meadow-endpoints 4.0.18 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/meadow-endpoints.js +2477 -544
- package/dist/meadow-endpoints.js.map +1 -1
- package/dist/meadow-endpoints.min.js +32 -27
- package/dist/meadow-endpoints.min.js.map +1 -1
- package/package.json +5 -5
- package/source/Meadow-Endpoints.js +8 -0
- package/source/endpoints/update/Meadow-Endpoint-Update.js +17 -1
- package/test/MeadowEndpoints_basic_tests.js +552 -0
|
@@ -1,88 +1,93 @@
|
|
|
1
|
-
"use strict";!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MeadowEndpoints=e()}}(function(){return function e(t,r,n){function o(i,u){if(!r[i]){if(!t[i]){var s="function"==typeof require&&require;if(!u&&s)return s(i,!0);if(a)return a(i,!0);var l=new Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){return o(t[i][1][e]||e)},c,c.exports,e,t,r,n)}return r[i].exports}for(var a="function"==typeof require&&require,i=0;i<n.length;i++)o(n[i]);return o}({1:[function(e,t,r){
|
|
1
|
+
"use strict";!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).MeadowEndpoints=e()}}(function(){var define,module,exports;return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){return i(t[o][1][e]||e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){(function(t){(function(){var n=e("jsonparse"),i=e("through"),a=t.from&&t.from!==Uint8Array.from;function o(e,t){return"string"==typeof e?t==e:e&&"function"==typeof e.exec?e.exec(t):"boolean"==typeof e||"object"==typeof e?e:"function"==typeof e&&e(t)}r.parse=function(e,r){var s,u,f=new n,c=i(function(e){"string"==typeof e&&(e=a?t.from(e):new t(e)),f.write(e)},function(e){e&&c.write(e),s&&c.emit("header",s),u&&c.emit("footer",u),c.queue(null)});"string"==typeof e&&(e=e.split(".").map(function(e){return"$*"===e?{emitKey:!0}:"*"===e||(""===e?{recurse:!0}:e)}));return e&&e.length||(e=null),f.onValue=function(t){if(this.root||(c.root=t),e){for(var n=0,i=0,a=!1,u=!1;n<e.length;){var f,d=e[n];if(i++,d&&!d.recurse){if(!(f=i===this.stack.length?this:this.stack[i]))return;if(!o(d,f.key))return void l(f.key,t);a=!!d.emitKey,u=!!d.emitPath,n++}else{n++;var h=e[n];if(!h)return;for(;;){if(!(f=i===this.stack.length?this:this.stack[i]))return;if(o(h,f.key)){n++,Object.isFrozen(this.stack[i])||(this.stack[i].value=null);break}l(f.key,t),i++}}}if(s&&(c.emit("header",s),s=!1),i===this.stack.length){0;var p=this.stack.slice(1).map(function(e){return e.key}).concat([this.key]),y=t;for(var b in null!=y&&null!=(y=r?r(y,p):y)&&((a||u)&&(y={value:y},a&&(y.key=this.key),u&&(y.path=p)),c.queue(y)),this.value&&delete this.value[this.key],this.stack)Object.isFrozen(this.stack[b])||(this.stack[b].value=null)}}},f._onToken=f.onToken,f.onToken=function(t,r){f._onToken(t,r),0===this.stack.length&&c.root&&(e||c.queue(c.root),c.root=null)},f.onError=function(e){e.message.indexOf("at position")>-1&&(e.message="Invalid JSON ("+e.message+")"),c.emit("error",e)},c;function l(e,t){!1!==s&&((s=s||{})[e]=t),!1!==u&&!1===s&&((u=u||{})[e]=t)}},r.stringify=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="[\n",t="\n,\n",r="\n]\n");var a,o=!0,s=!1;return a=i(function(r){s=!0;try{var i=JSON.stringify(r,null,n)}catch(e){return a.emit("error",e)}o?(o=!1,a.queue(e+i)):a.queue(t+i)},function(t){s||a.queue(e),a.queue(r),a.queue(null)})},r.stringifyObject=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="{\n",t="\n,\n",r="\n}\n");var a=!0,o=!1;return i(function(r){o=!0;var i=JSON.stringify(r[0])+":"+JSON.stringify(r[1],null,n);a?(a=!1,this.queue(e+i)):this.queue(t+i)},function(t){o||this.queue(e),this.queue(r),this.queue(null)})}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83,jsonparse:199,through:343}],2:[function(e,t,r){var n=r;n.bignum=e("bn.js"),n.define=e("./asn1/api").define,n.base=e("./asn1/base"),n.constants=e("./asn1/constants"),n.decoders=e("./asn1/decoders"),n.encoders=e("./asn1/encoders")},{"./asn1/api":3,"./asn1/base":5,"./asn1/constants":9,"./asn1/decoders":11,"./asn1/encoders":14,"bn.js":16}],3:[function(e,t,r){var n=e("../asn1"),i=e("inherits");function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}r.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(t){var r;try{r=e("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){r=function(e){this._initNamed(e)}}return i(r,t),r.prototype._initNamed=function(e){t.call(this,e)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(n.decoders[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n.encoders[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},{"../asn1":2,inherits:189,vm:354}],4:[function(e,t,r){var n=e("inherits"),i=e("../base").Reporter,a=e("buffer").Buffer;function o(e,t){i.call(this,t),a.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof s||(e=new s(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=a.byteLength(e);else{if(!a.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(o,i),r.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},o.prototype.restore=function(e){var t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new o(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},r.EncoderBuffer=s,s.prototype.join=function(e,t){return e||(e=new a(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):a.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base":5,buffer:83,inherits:189}],5:[function(e,t,r){var n=r;n.Reporter=e("./reporter").Reporter,n.DecoderBuffer=e("./buffer").DecoderBuffer,n.EncoderBuffer=e("./buffer").EncoderBuffer,n.Node=e("./node")},{"./buffer":4,"./node":6,"./reporter":7}],6:[function(e,t,r){var n=e("../base").Reporter,i=e("../base").EncoderBuffer,a=e("../base").DecoderBuffer,o=e("minimalistic-assert"),s=["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"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function f(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.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 e=this._baseState,t={};c.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},f.prototype._wrap=function(){var e=this._baseState;u.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},f.prototype._init=function(e){var t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),o.equal(t.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(o(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var n=e[r];t[n]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){f.prototype[e]=function(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),s.forEach(function(e){f.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(r),this}}),f.prototype.use=function(e){o(e);var t=this._baseState;return o(null===t.use),t.use=e,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(e){var t=this._baseState;return o(null===t.default),t.default=e,t.optional=!0,this},f.prototype.explicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},f.prototype.implicit=function(e){var t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},f.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},f.prototype.key=function(e){var t=this._baseState;return o(null===t.key),t.key=e,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(e){var t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},f.prototype.contains=function(e){var t=this._baseState;return o(null===t.use),t.contains=e,this},f.prototype._decode=function(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var n,i=r.default,o=!0,s=null;if(null!==r.key&&(s=e.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(e,u,r.any),e.isError(o))return o}else{var f=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(f)}}if(r.obj&&o&&(n=e.enterObject()),o){if(null!==r.explicit){var c=this._decodeTag(e,r.explicit);if(e.isError(c))return c;e=c}var l=e.offset;if(null===r.use&&null===r.choice){if(r.any)f=e.save();var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?i=e.raw(f):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),l,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var h=new a(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(h,t)}}return r.obj&&o&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==o?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(e,t,r){var n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},f.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),o(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(e,t){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(a){var o=e.save(),s=r.choice[a];try{var u=s._decode(e,t);if(e.isError(u))return!1;n={type:a,value:u},i=!0}catch(t){return e.restore(o),!1}return!0},this),i?n:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},f.prototype._encode=function(e,t,r){var n=this._baseState;if(null===n.default||n.default!==e){var i=this._encodeValue(e,t,r);if(void 0!==i&&!this._skipDefault(i,t,r))return i}},f.prototype._encodeValue=function(e,t,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);var a=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var o=null,s=!1;if(i.any)a=this._createEncoderBuffer(e);else if(i.choice)a=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)o=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i},this).filter(function(e){return e}),o=this._createEncoderBuffer(o);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},u))}else null!==i.use?a=this._getUse(i.use,r)._encode(e,t):(o=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){var f=null!==i.implicit?i.implicit:i.tag,c=null===i.implicit?"universal":"context";null===f?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(a=this._encodeComposite(f,s,c,o))}return null!==i.explicit&&(a=this._encodeComposite(i.explicit,!1,"context",a)),a},f.prototype._encodeChoice=function(e,t){var r=this._baseState,n=r.choice[e.type];return n||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},f.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},{"../base":5,"minimalistic-assert":239}],7:[function(e,t,r){var n=e("inherits");function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function a(e,t){this.path=e,this.rethrow(t)}r.Reporter=i,i.prototype.isError=function(e){return e instanceof a},i.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){var n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof a;if(t=n?e:new a(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(a,Error),a.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,a),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:189}],8:[function(e,t,r){var n=e("../constants");r.tagClass={0:"universal",1:"application",2:"context",3:"private"},r.tagClassByName=n._reverse(r.tagClass),r.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"},r.tagByName=n._reverse(r.tag)},{"../constants":9}],9:[function(e,t,r){var n=r;n._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r}),t},n.der=e("./der")},{"./der":8}],10:[function(e,t,r){var n=e("inherits"),i=e("../../asn1"),a=i.base,o=i.bignum,s=i.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){a.Node.call(this,"der",e)}function c(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=s.tagClass[r>>6],i=!(32&r);if(31&~r)r&=31;else{var a=r;for(r=0;!(128&~a);){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(!(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var a=0;a<i;a++){n<<=8;var o=e.readUInt8(r);if(e.isError(o))return o;n|=o}return n}t.exports=u,u.prototype.decode=function(e,t){return e instanceof a.DecoderBuffer||(e=new a.DecoderBuffer(e,t)),this.tree._decode(e,t)},n(f,a.Node),f.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;var n=e.save(),i=c(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},f.prototype._decodeTag=function(e,t,r){var n=c(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=l(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');var a=e.save(),o=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(o)?o:(i=e.offset-a.offset,e.restore(a),e.skip(i,'Failed to match body of: "'+t+'"'))},f.prototype._skipUntilEnd=function(e,t){for(;;){var r=c(e,t);if(e.isError(r))return r;var n,i=l(e,r.primitive,t);if(e.isError(i))return i;if(n=r.primitive||null!==i?e.skip(i):this._skipUntilEnd(e,t),e.isError(n))return n;if("end"===r.tagStr)break}},f.prototype._decodeList=function(e,t,r,n){for(var i=[];!e.isEmpty();){var a=this._peekTag(e,"end");if(e.isError(a))return a;var o=r.decode(e,"der",n);if(e.isError(o)&&a)break;i.push(o)}return i},f.prototype._decodeStr=function(e,t){if("bitstr"===t){var r=e.readUInt8();return e.isError(r)?r:{unused:r,data:e.raw()}}if("bmpstr"===t){var n=e.raw();if(n.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");for(var i="",a=0;a<n.length/2;a++)i+=String.fromCharCode(n.readUInt16BE(2*a));return i}if("numstr"===t){var o=e.raw().toString("ascii");return this._isNumstr(o)?o:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){var s=e.raw().toString("ascii");return this._isPrintstr(s)?s:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},f.prototype._decodeObjid=function(e,t,r){for(var n,i=[],a=0;!e.isEmpty();){var o=e.readUInt8();a<<=7,a|=127&o,128&o||(i.push(a),a=0)}128&o&&i.push(a);var s=i[0]/40|0,u=i[0]%40;if(n=r?i:[s,u].concat(i.slice(1)),t){var f=t[n.join(" ")];void 0===f&&(f=t[n.join(".")]),void 0!==f&&(n=f)}return n},f.prototype._decodeTime=function(e,t){var r=e.raw().toString();if("gentime"===t)var n=0|r.slice(0,4),i=0|r.slice(4,6),a=0|r.slice(6,8),o=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),a=0|r.slice(4,6),o=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,a,o,s,u,0)},f.prototype._decodeNull=function(e){return null},f.prototype._decodeBool=function(e){var t=e.readUInt8();return e.isError(t)?t:0!==t},f.prototype._decodeInt=function(e,t){var r=e.raw(),n=new o(r);return t&&(n=t[n.toString(10)]||n),n},f.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../../asn1":2,inherits:189}],11:[function(e,t,r){var n=r;n.der=e("./der"),n.pem=e("./pem")},{"./der":10,"./pem":12}],12:[function(e,t,r){var n=e("inherits"),i=e("buffer").Buffer,a=e("./der");function o(e){a.call(this,e),this.enc="pem"}n(o,a),t.exports=o,o.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),o=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,f=0;f<r.length;f++){var c=r[f].match(o);if(null!==c&&c[2]===n){if(-1!==s){if("END"!==c[1])break;u=f;break}if("BEGIN"!==c[1])break;s=f}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);var l=r.slice(s+1,u).join("");l.replace(/[^a-z0-9\+\/=]+/gi,"");var d=new i(l,"base64");return a.prototype.decode.call(this,d,t)}},{"./der":10,buffer:83,inherits:189}],13:[function(e,t,r){var n=e("inherits"),i=e("buffer").Buffer,a=e("../../asn1"),o=a.base,s=a.constants.der;function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){o.Node.call(this,"der",e)}function c(e){return e<10?"0"+e:e}t.exports=u,u.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(f,o.Node),f.prototype._encodeComposite=function(e,t,r,n){var a,o=function(e,t,r,n){var i;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}if(i>=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6,i}(e,t,r,this.reporter);if(n.length<128)return(a=new i(2))[0]=o,a[1]=n.length,this._createEncoderBuffer([a,n]);for(var u=1,f=n.length;f>=256;f>>=8)u++;(a=new i(2+u))[0]=o,a[1]=128|u;f=1+u;for(var c=n.length;c>0;f--,c>>=8)a[f]=255&c;return this._createEncoderBuffer([a,n])},f.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n<e.length;n++)r.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):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(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},f.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var a=0;for(n=0;n<e.length;n++){var o=e[n];for(a++;o>=128;o>>=7)a++}var s=new i(a),u=s.length-1;for(n=e.length-1;n>=0;n--){o=e[n];for(s[u--]=127&o;(o>>=7)>0;)s[u--]=128|127&o}return this._createEncoderBuffer(s)},f.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var a=new i(n);return e.copy(a),0===e.length&&(a[0]=0),this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var o=e;o>=256;o>>=8)n++;for(o=(a=new Array(n)).length-1;o>=0;o--)a[o]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(new i(a))},f.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},f.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},f.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var a=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),a.length!==i.defaultBuffer.length)return!1;for(n=0;n<a.length;n++)if(a[n]!==i.defaultBuffer[n])return!1;return!0}},{"../../asn1":2,buffer:83,inherits:189}],14:[function(e,t,r){var n=r;n.der=e("./der"),n.pem=e("./pem")},{"./der":13,"./pem":15}],15:[function(e,t,r){var n=e("inherits"),i=e("./der");function a(e){i.call(this,e),this.enc="pem"}n(a,i),t.exports=a,a.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],a=0;a<r.length;a+=64)n.push(r.slice(a,a+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},{"./der":13,inherits:189}],16:[function(e,t,r){!function(t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof t?t.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function f(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c<s;c+=n)u=f(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var l=1;for(u=f(e,c,e.length,t),c=0;c<o;c++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.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 h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var c=u>>>26,l=67108863&u,d=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=d;h++){var p=f-h|0;c+=(o=(i=0|e.words[p])*(a=0|t.words[h])+l)/67108864|0,l=67108863&o}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?c[6-u.length]+u+r:u+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:c[f-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,f=new e(a),c=this.clone();if(u){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),f[s]=o;for(;s<a;s++)f[s]=0}else{for(s=0;s<a-i;s++)f[s]=0;for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),f[a-s-1]=o}return f},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,f=0,c=0|o[0],l=8191&c,d=c>>>13,h=0|o[1],p=8191&h,y=h>>>13,b=0|o[2],m=8191&b,g=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,S=0|o[4],E=8191&S,M=S>>>13,A=0|o[5],D=8191&A,k=A>>>13,O=0|o[6],x=8191&O,R=O>>>13,C=0|o[7],j=8191&C,q=C>>>13,I=0|o[8],T=8191&I,L=I>>>13,U=0|o[9],P=8191&U,B=U>>>13,N=0|s[0],F=8191&N,Q=N>>>13,$=0|s[1],z=8191&$,H=$>>>13,J=0|s[2],W=8191&J,V=J>>>13,G=0|s[3],K=8191&G,X=G>>>13,Z=0|s[4],Y=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],le=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(f+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,Q))+Math.imul(d,F)|0))<<13)|0;f=((a=Math.imul(d,Q))+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,Q))+Math.imul(y,F)|0,a=Math.imul(y,Q);var me=(f+(n=n+Math.imul(l,z)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(d,z)|0))<<13)|0;f=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,Q))+Math.imul(g,F)|0,a=Math.imul(g,Q),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,a=a+Math.imul(y,H)|0;var ge=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(d,W)|0))<<13)|0;f=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,Q))+Math.imul(_,F)|0,a=Math.imul(_,Q),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(g,z)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,V)|0;var ve=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,K)|0))<<13)|0;f=((a=a+Math.imul(d,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,Q))+Math.imul(M,F)|0,a=Math.imul(M,Q),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,V)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,X)|0;var we=(f+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,Y)|0))<<13)|0;f=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,Q))+Math.imul(k,F)|0,a=Math.imul(k,Q),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(M,z)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,ee)|0;var _e=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,Q))+Math.imul(R,F)|0,a=Math.imul(R,Q),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(k,z)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,V)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(g,Y)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Se=(f+(n=n+Math.imul(l,ae)|0)|0)+((8191&(i=(i=i+Math.imul(l,oe)|0)+Math.imul(d,ae)|0))<<13)|0;f=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,Q))+Math.imul(q,F)|0,a=Math.imul(q,Q),n=n+Math.imul(x,z)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(R,z)|0,a=a+Math.imul(R,H)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,V)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0;var Ee=(f+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((a=a+Math.imul(d,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,Q))+Math.imul(L,F)|0,a=Math.imul(L,Q),n=n+Math.imul(j,z)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(q,z)|0,a=a+Math.imul(q,H)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,V)|0,n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,fe)|0;var Me=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,Q))+Math.imul(B,F)|0,a=Math.imul(B,Q),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(L,z)|0,a=a+Math.imul(L,H)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(q,W)|0,a=a+Math.imul(q,V)|0,n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(k,Y)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,fe)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,le)|0,a=a+Math.imul(y,de)|0;var Ae=(f+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;f=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(B,z)|0,a=Math.imul(B,H),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(L,W)|0,a=a+Math.imul(L,V)|0,n=n+Math.imul(j,K)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(q,K)|0,a=a+Math.imul(q,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,fe)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,de)|0;var De=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;f=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(P,W),i=(i=Math.imul(P,V))+Math.imul(B,W)|0,a=Math.imul(B,V),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(q,Y)|0,a=a+Math.imul(q,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(g,pe)|0))<<13)|0;f=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,X))+Math.imul(B,K)|0,a=Math.imul(B,X),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(q,re)|0,a=a+Math.imul(q,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,fe)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,de)|0;var Oe=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;f=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(P,Y),i=(i=Math.imul(P,ee))+Math.imul(B,Y)|0,a=Math.imul(B,ee),n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,a=a+Math.imul(L,ne)|0,n=n+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(q,ae)|0,a=a+Math.imul(q,oe)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(R,ue)|0,a=a+Math.imul(R,fe)|0,n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(k,le)|0,a=a+Math.imul(k,de)|0;var xe=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(M,pe)|0))<<13)|0;f=((a=a+Math.imul(M,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(P,re),i=(i=Math.imul(P,ne))+Math.imul(B,re)|0,a=Math.imul(B,ne),n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(q,ue)|0,a=a+Math.imul(q,fe)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,de)|0;var Re=(f+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(k,pe)|0))<<13)|0;f=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(P,ae),i=(i=Math.imul(P,oe))+Math.imul(B,ae)|0,a=Math.imul(B,oe),n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,fe)|0,n=n+Math.imul(j,le)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(q,le)|0,a=a+Math.imul(q,de)|0;var Ce=(f+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(R,pe)|0))<<13)|0;f=((a=a+Math.imul(R,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(P,ue),i=(i=Math.imul(P,fe))+Math.imul(B,ue)|0,a=Math.imul(B,fe),n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,le)|0,a=a+Math.imul(L,de)|0;var je=(f+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,ye)|0)+Math.imul(q,pe)|0))<<13)|0;f=((a=a+Math.imul(q,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(P,le),i=(i=Math.imul(P,de))+Math.imul(B,le)|0,a=Math.imul(B,de);var qe=(f+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(L,pe)|0))<<13)|0;f=((a=a+Math.imul(L,ye)|0)+(i>>>13)|0)+(qe>>>26)|0,qe&=67108863;var Ie=(f+(n=Math.imul(P,pe))|0)+((8191&(i=(i=Math.imul(P,ye))+Math.imul(B,pe)|0))<<13)|0;return f=((a=Math.imul(B,ye))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=be,u[1]=me,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Ee,u[8]=Me,u[9]=Ae,u[10]=De,u[11]=ke,u[12]=Oe,u[13]=xe,u[14]=Re,u[15]=Ce,u[16]=je,u[17]=qe,u[18]=Ie,0!==f&&(u[19]=f,r.length++),r};function y(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=h),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),f=Math.max(0,a-e.length+1);f<=u;f++){var c=a-f,l=(0|e.words[c])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(o=(o=o+(l/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):y(this,e,t),r},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},b.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var l=u,d=f,h=0;h<o;h++){var p=r[c+h],y=n[c+h],b=r[c+h+o],m=n[c+h+o],g=l*b-d*m;m=l*m+d*b,b=g,r[c+h]=p+b,n[c+h]=y+m,r[c+h+o]=p-b,n[c+h+o]=y-m,h!==s&&(g=u*l-f*d,d=u*d+f*l,l=g)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(!(-8192&a))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,a,s,u,n,i),this.transform(f,a,c,l,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*l[h];u[h]=s[h]*l[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),y(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<r;this.words[t]=u|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=r;if(i-=o,i=Math.max(0,i),u){for(var f=0;f<o;f++)u.words[f]=this.words[f];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var l=0|this.words[f];this.words[f]=c<<26-a|l>>>a,c=l&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return 0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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 s,u=n.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(l)),i.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;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(u)):(r.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:r.iushln(f)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0===(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var l=0,d=1;0===(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new E(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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 e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<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(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},i(v,g),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,g),i(_,g),i(S,g),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return m[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=o;0!==h.cmp(s);){for(var y=h,b=0;0!==y.cmp(s);b++)y=y.redSqr();n(b<p);var m=this.pow(l,new a(1).iushln(p-b-1));d=d.redMul(m),l=m.redSqr(),h=h.redMul(l),p=b}return d},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var l=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new M(e)},i(M,E),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:38}],17:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,a.isAsync)(e))return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const i=r.pop();return s(e.apply(this,r),i)};return(0,n.default)(function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return s(n,r);r(null,n)})};var n=o(e("./internal/initialParams.js")),i=o(e("./internal/setImmediate.js")),a=e("./internal/wrapAsync.js");function o(e){return e&&e.__esModule?e:{default:e}}function s(e,t){return e.then(e=>{u(t,null,e)},e=>{u(t,e&&(e instanceof Error||e.message)?e:new Error(e))})}function u(e,t,r){try{e(t,r)}catch(e){(0,i.default)(e=>{throw e},e)}}t.exports=r.default},{"./internal/initialParams.js":25,"./internal/setImmediate.js":30,"./internal/wrapAsync.js":32}],18:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=s(e("./internal/eachOfLimit.js")),i=s(e("./internal/withoutIndex.js")),a=s(e("./internal/wrapAsync.js")),o=s(e("./internal/awaitify.js"));function s(e){return e&&e.__esModule?e:{default:e}}r.default=(0,o.default)(function(e,t,r,o){return(0,n.default)(t)(e,(0,i.default)((0,a.default)(r)),o)},4),t.exports=r.default},{"./internal/awaitify.js":21,"./internal/eachOfLimit.js":23,"./internal/withoutIndex.js":31,"./internal/wrapAsync.js":32}],19:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("./eachLimit.js")),i=a(e("./internal/awaitify.js"));function a(e){return e&&e.__esModule?e:{default:e}}r.default=(0,i.default)(function(e,t,r){return(0,n.default)(e,1,t,r)},3),t.exports=r.default},{"./eachLimit.js":18,"./internal/awaitify.js":21}],20:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r,n){let i=!1,o=!1,s=!1,u=0,f=0;function c(){u>=t||s||i||(s=!0,e.next().then(e=>{let{value:t,done:a}=e;if(!o&&!i){if(s=!1,a)return i=!0,void(u<=0&&n(null));u++,r(t,f,l),f++,c()}}).catch(d))}function l(e,t){if(u-=1,!o)return e?d(e):!1===e?(i=!0,void(o=!0)):t===a.default||i&&u<=0?(i=!0,n(null)):void c()}function d(e){o||(s=!1,i=!0,n(e))}c()};var n,i=e("./breakLoop.js"),a=(n=i)&&n.__esModule?n:{default:n};t.exports=r.default},{"./breakLoop.js":22}],21:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){t||(t=e.length);if(!t)throw new Error("arity is undefined");return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return"function"==typeof n[t-1]?e.apply(this,n):new Promise((r,i)=>{n[t-1]=function(e){if(e)return i(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];r(n.length>1?n:n[0])},e.apply(this,n)})}},t.exports=r.default},{}],22:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});r.default={},t.exports=r.default},{}],23:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=f(e("./once.js")),i=f(e("./iterator.js")),a=f(e("./onlyOnce.js")),o=e("./wrapAsync.js"),s=f(e("./asyncEachOfLimit.js")),u=f(e("./breakLoop.js"));function f(e){return e&&e.__esModule?e:{default:e}}r.default=e=>(t,r,f)=>{if(f=(0,n.default)(f),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return f(null);if((0,o.isAsyncGenerator)(t))return(0,s.default)(t,e,r,f);if((0,o.isAsyncIterable)(t))return(0,s.default)(t[Symbol.asyncIterator](),e,r,f);var c=(0,i.default)(t),l=!1,d=!1,h=0,p=!1;function y(e,t){if(!d)if(h-=1,e)l=!0,f(e);else if(!1===e)l=!0,d=!0;else{if(t===u.default||l&&h<=0)return l=!0,f(null);p||b()}}function b(){for(p=!0;h<e&&!l;){var t=c();if(null===t)return l=!0,void(h<=0&&f(null));h+=1,r(t.value,t.key,(0,a.default)(y))}p=!1}b()},t.exports=r.default},{"./asyncEachOfLimit.js":20,"./breakLoop.js":22,"./iterator.js":27,"./once.js":28,"./onlyOnce.js":29,"./wrapAsync.js":32}],24:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},t.exports=r.default},{}],25:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=r.pop();return e.call(this,r,i)}},t.exports=r.default},{}],26:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0},t.exports=r.default},{}],27:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=(0,i.default)(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):(r=e,a=r?Object.keys(r):[],o=-1,s=a.length,function e(){var t=a[++o];return"__proto__"===t?e():o<s?{value:r[t],key:t}:null});var r,a,o,s};var n=a(e("./isArrayLike.js")),i=a(e("./getIterator.js"));function a(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./getIterator.js":24,"./isArrayLike.js":26}],28:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){function t(){if(null!==e){var t=e;e=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}return Object.assign(t,e),t},t.exports=r.default},{}],29:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}},t.exports=r.default},{}],30:[function(e,t,r){(function(e,t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=s,r.wrap=u;var n,i=r.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,a=r.hasSetImmediate="function"==typeof t&&t,o=r.hasNextTick="object"==typeof e&&"function"==typeof e.nextTick;function s(e){setTimeout(e,0)}function u(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e(()=>t(...n))}}n=i?queueMicrotask:a?t:o?e.nextTick:s,r.default=u(n)}).call(this)}).call(this,e("_process"),e("timers").setImmediate)},{_process:256,timers:344}],31:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(t,r,n)=>e(t,n)},t.exports=r.default},{}],32:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=r.isAsyncGenerator=r.isAsync=void 0;var n,i=e("../asyncify.js"),a=(n=i)&&n.__esModule?n:{default:n};function o(e){return"AsyncFunction"===e[Symbol.toStringTag]}r.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return o(e)?(0,a.default)(e):e},r.isAsync=o,r.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},r.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},{"../asyncify.js":17}],33:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=s(e("./internal/once.js")),i=s(e("./internal/onlyOnce.js")),a=s(e("./internal/wrapAsync.js")),o=s(e("./internal/awaitify.js"));function s(e){return e&&e.__esModule?e:{default:e}}r.default=(0,o.default)(function(e,t){if(t=(0,n.default)(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function o(t){(0,a.default)(e[r++])(...t,(0,i.default)(s))}function s(n){if(!1!==n){for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(n||r===e.length)return t(n,...a);o(a)}}o([])}),t.exports=r.default},{"./internal/awaitify.js":21,"./internal/once.js":28,"./internal/onlyOnce.js":29,"./internal/wrapAsync.js":32}],34:[function(e,t,r){(function(r){(function(){var n=e("possible-typed-array-names"),i="undefined"==typeof globalThis?r:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"possible-typed-array-names":254}],35:[function(e,t,r){r.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=u(e),o=n[0],s=n[1],f=new a(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,l=s>0?o-4:o;for(r=0;r<l;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],f[c++]=t>>16&255,f[c++]=t>>8&255,f[c++]=255&t;2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,f[c++]=255&t);1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,f[c++]=t>>8&255,f[c++]=255&t);return f},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=16383,s=0,u=r-i;s<u;s+=o)a.push(c(e,s,s+o>u?u:s+o));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=o[s],i[o.charCodeAt(s)]=s;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(f(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],36:[function(e,t,r){!function(t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof t?t.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function f(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),u=t;u<s;u++){var f=e.charCodeAt(u)-48;a*=i,o=f>=49?f-49+10:f>=17?f-17+10:f,n(f>=0&&o<i,"Invalid character"),a+=o}return a}function c(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c<s;c+=n)u=f(e,c,c+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var l=1;for(u=f(e,c,e.length,t),c=0;c<o;c++)l*=t;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype._move=function(e){c(e,this)},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){a.prototype.inspect=l}else a.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"],h=[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],p=[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];a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?d[6-u.length]+u+r:u+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var f=h[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var y=l.modrn(c).toString(e);r=(l=l.idivn(c)).isZero()?y+r:d[f-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function y(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var c=u>>>26,l=67108863&u,d=Math.min(f,t.length-1),h=Math.max(0,f-e.length+1);h<=d;h++){var p=f-h|0;c+=(o=(i=0|e.words[p])*(a=0|t.words[h])+l)/67108864|0,l=67108863&o}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}a.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},a.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===a?(r<e.length&&(e[r++]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},a.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===a?(r>=0&&(e[r--]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},a.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},a.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},a.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,f=0,c=0|o[0],l=8191&c,d=c>>>13,h=0|o[1],p=8191&h,y=h>>>13,b=0|o[2],m=8191&b,g=b>>>13,v=0|o[3],w=8191&v,_=v>>>13,S=0|o[4],E=8191&S,M=S>>>13,A=0|o[5],D=8191&A,k=A>>>13,O=0|o[6],x=8191&O,R=O>>>13,C=0|o[7],j=8191&C,q=C>>>13,I=0|o[8],T=8191&I,L=I>>>13,U=0|o[9],P=8191&U,B=U>>>13,N=0|s[0],F=8191&N,Q=N>>>13,$=0|s[1],z=8191&$,H=$>>>13,J=0|s[2],W=8191&J,V=J>>>13,G=0|s[3],K=8191&G,X=G>>>13,Z=0|s[4],Y=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],le=8191&ce,de=ce>>>13,he=0|s[9],pe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(f+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,Q))+Math.imul(d,F)|0))<<13)|0;f=((a=Math.imul(d,Q))+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,Q))+Math.imul(y,F)|0,a=Math.imul(y,Q);var me=(f+(n=n+Math.imul(l,z)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(d,z)|0))<<13)|0;f=((a=a+Math.imul(d,H)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,F),i=(i=Math.imul(m,Q))+Math.imul(g,F)|0,a=Math.imul(g,Q),n=n+Math.imul(p,z)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(y,z)|0,a=a+Math.imul(y,H)|0;var ge=(f+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,V)|0)+Math.imul(d,W)|0))<<13)|0;f=((a=a+Math.imul(d,V)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,Q))+Math.imul(_,F)|0,a=Math.imul(_,Q),n=n+Math.imul(m,z)|0,i=(i=i+Math.imul(m,H)|0)+Math.imul(g,z)|0,a=a+Math.imul(g,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,V)|0;var ve=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,K)|0))<<13)|0;f=((a=a+Math.imul(d,X)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,Q))+Math.imul(M,F)|0,a=Math.imul(M,Q),n=n+Math.imul(w,z)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,z)|0,a=a+Math.imul(_,H)|0,n=n+Math.imul(m,W)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,V)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,X)|0;var we=(f+(n=n+Math.imul(l,Y)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,Y)|0))<<13)|0;f=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,Q))+Math.imul(k,F)|0,a=Math.imul(k,Q),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(M,z)|0,a=a+Math.imul(M,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,V)|0,n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Y)|0,a=a+Math.imul(y,ee)|0;var _e=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,Q))+Math.imul(R,F)|0,a=Math.imul(R,Q),n=n+Math.imul(D,z)|0,i=(i=i+Math.imul(D,H)|0)+Math.imul(k,z)|0,a=a+Math.imul(k,H)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(M,W)|0,a=a+Math.imul(M,V)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(g,Y)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(y,re)|0,a=a+Math.imul(y,ne)|0;var Se=(f+(n=n+Math.imul(l,ae)|0)|0)+((8191&(i=(i=i+Math.imul(l,oe)|0)+Math.imul(d,ae)|0))<<13)|0;f=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,Q))+Math.imul(q,F)|0,a=Math.imul(q,Q),n=n+Math.imul(x,z)|0,i=(i=i+Math.imul(x,H)|0)+Math.imul(R,z)|0,a=a+Math.imul(R,H)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,V)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,V)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,X)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(y,ae)|0,a=a+Math.imul(y,oe)|0;var Ee=(f+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((a=a+Math.imul(d,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,Q))+Math.imul(L,F)|0,a=Math.imul(L,Q),n=n+Math.imul(j,z)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(q,z)|0,a=a+Math.imul(q,H)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,V)|0,n=n+Math.imul(D,K)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(k,K)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(y,ue)|0,a=a+Math.imul(y,fe)|0;var Me=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,Q))+Math.imul(B,F)|0,a=Math.imul(B,Q),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(L,z)|0,a=a+Math.imul(L,H)|0,n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(q,W)|0,a=a+Math.imul(q,V)|0,n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(R,K)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(k,Y)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,fe)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,fe)|0,n=n+Math.imul(p,le)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(y,le)|0,a=a+Math.imul(y,de)|0;var Ae=(f+(n=n+Math.imul(l,pe)|0)|0)+((8191&(i=(i=i+Math.imul(l,ye)|0)+Math.imul(d,pe)|0))<<13)|0;f=((a=a+Math.imul(d,ye)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,z),i=(i=Math.imul(P,H))+Math.imul(B,z)|0,a=Math.imul(B,H),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(L,W)|0,a=a+Math.imul(L,V)|0,n=n+Math.imul(j,K)|0,i=(i=i+Math.imul(j,X)|0)+Math.imul(q,K)|0,a=a+Math.imul(q,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(R,Y)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(E,ae)|0,i=(i=i+Math.imul(E,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,fe)|0,n=n+Math.imul(m,le)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,de)|0;var De=(f+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ye)|0)+Math.imul(y,pe)|0))<<13)|0;f=((a=a+Math.imul(y,ye)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(P,W),i=(i=Math.imul(P,V))+Math.imul(B,W)|0,a=Math.imul(B,V),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,X)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(q,Y)|0,a=a+Math.imul(q,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(D,ae)|0,i=(i=i+Math.imul(D,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,fe)|0)+Math.imul(M,ue)|0,a=a+Math.imul(M,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,de)|0;var ke=(f+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ye)|0)+Math.imul(g,pe)|0))<<13)|0;f=((a=a+Math.imul(g,ye)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,X))+Math.imul(B,K)|0,a=Math.imul(B,X),n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(L,Y)|0,a=a+Math.imul(L,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(q,re)|0,a=a+Math.imul(q,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,fe)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,fe)|0,n=n+Math.imul(E,le)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,de)|0;var Oe=(f+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ye)|0)+Math.imul(_,pe)|0))<<13)|0;f=((a=a+Math.imul(_,ye)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(P,Y),i=(i=Math.imul(P,ee))+Math.imul(B,Y)|0,a=Math.imul(B,ee),n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(L,re)|0,a=a+Math.imul(L,ne)|0,n=n+Math.imul(j,ae)|0,i=(i=i+Math.imul(j,oe)|0)+Math.imul(q,ae)|0,a=a+Math.imul(q,oe)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(R,ue)|0,a=a+Math.imul(R,fe)|0,n=n+Math.imul(D,le)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(k,le)|0,a=a+Math.imul(k,de)|0;var xe=(f+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ye)|0)+Math.imul(M,pe)|0))<<13)|0;f=((a=a+Math.imul(M,ye)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(P,re),i=(i=Math.imul(P,ne))+Math.imul(B,re)|0,a=Math.imul(B,ne),n=n+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(L,ae)|0,a=a+Math.imul(L,oe)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(q,ue)|0,a=a+Math.imul(q,fe)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(R,le)|0,a=a+Math.imul(R,de)|0;var Re=(f+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ye)|0)+Math.imul(k,pe)|0))<<13)|0;f=((a=a+Math.imul(k,ye)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(P,ae),i=(i=Math.imul(P,oe))+Math.imul(B,ae)|0,a=Math.imul(B,oe),n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(L,ue)|0,a=a+Math.imul(L,fe)|0,n=n+Math.imul(j,le)|0,i=(i=i+Math.imul(j,de)|0)+Math.imul(q,le)|0,a=a+Math.imul(q,de)|0;var Ce=(f+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ye)|0)+Math.imul(R,pe)|0))<<13)|0;f=((a=a+Math.imul(R,ye)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(P,ue),i=(i=Math.imul(P,fe))+Math.imul(B,ue)|0,a=Math.imul(B,fe),n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(L,le)|0,a=a+Math.imul(L,de)|0;var je=(f+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,ye)|0)+Math.imul(q,pe)|0))<<13)|0;f=((a=a+Math.imul(q,ye)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(P,le),i=(i=Math.imul(P,de))+Math.imul(B,le)|0,a=Math.imul(B,de);var qe=(f+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ye)|0)+Math.imul(L,pe)|0))<<13)|0;f=((a=a+Math.imul(L,ye)|0)+(i>>>13)|0)+(qe>>>26)|0,qe&=67108863;var Ie=(f+(n=Math.imul(P,pe))|0)+((8191&(i=(i=Math.imul(P,ye))+Math.imul(B,pe)|0))<<13)|0;return f=((a=Math.imul(B,ye))+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,u[0]=be,u[1]=me,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Ee,u[8]=Me,u[9]=Ae,u[10]=De,u[11]=ke,u[12]=Oe,u[13]=xe,u[14]=Re,u[15]=Ce,u[16]=je,u[17]=qe,u[18]=Ie,0!==f&&(u[19]=f,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),f=Math.max(0,a-e.length+1);f<=u;f++){var c=a-f,l=(0|e.words[c])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(o=(o=o+(l/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r._strip()}function g(e,t,r){return m(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(b=y),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):r<63?y(this,e,t):r<1024?m(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},v.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},v.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},v.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,u=Math.cos(2*Math.PI/s),f=Math.sin(2*Math.PI/s),c=0;c<i;c+=s)for(var l=u,d=f,h=0;h<o;h++){var p=r[c+h],y=n[c+h],b=r[c+h+o],m=n[c+h+o],g=l*b-d*m;m=l*m+d*b,b=g,r[c+h]=p+b,n[c+h]=y+m,r[c+h+o]=p-b,n[c+h+o]=y-m,h!==s&&(g=u*l-f*d,d=u*d+f*l,l=g)}},v.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},v.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},v.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},v.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(!(-8192&a))},v.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},v.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),u=new Array(n),f=new Array(n),c=new Array(n),l=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,f,n),this.transform(o,a,s,u,n,i),this.transform(f,a,c,l,n,i);for(var h=0;h<n;h++){var p=s[h]*c[h]-u[h]*l[h];u[h]=s[h]*l[h]+u[h]*c[h],s[h]=p}return this.conjugate(s,u,n),this.transform(s,u,d,a,n,i),this.conjugate(d,a,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),g(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<r;this.words[t]=u|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,u=r;if(i-=o,i=Math.max(0,i),u){for(var f=0;f<o;f++)u.words[f]=this.words[f];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var l=0|this.words[f];this.words[f]=c<<26-a|l>>>a,c=l&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return 0===this.length&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,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 s,u=n.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var c=n.clone()._ishlnsubmul(i,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},a.prototype.modn=function(e){return this.modrn(e)},a.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),u=new a(1),f=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++f;for(var c=r.clone(),l=t.clone();!t.isZero();){for(var d=0,h=1;0===(t.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(l)),i.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;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(u)):(r.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:r.iushln(f)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,c=1;0===(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var l=0,d=1;0===(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return!(1&this.words[0])},a.prototype.isOdd=function(){return!(1&~this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new D(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function S(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function D(e){if("string"==typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){D.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(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)}_.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<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},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(S,_),S.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},S.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(E,_),i(M,_),i(A,_),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new S;else if("p224"===e)t=new E;else if("p192"===e)t=new M;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},D.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},D.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},D.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(c(e,e.umod(this.m)._forceRed(this)),e)},D.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},D.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},D.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},D.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},D.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},D.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},D.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},D.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},D.prototype.isqr=function(e){return this.imul(e,e.clone())},D.prototype.sqr=function(e){return this.mul(e,e)},D.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,i),d=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=o;0!==h.cmp(s);){for(var y=h,b=0;0!==y.cmp(s);b++)y=y.redSqr();n(b<p);var m=this.pow(l,new a(1).iushln(p-b-1));d=d.redMul(m),l=m.redSqr(),h=h.redMul(l),p=b}return d},D.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},D.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var l=f>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}u=26}return i},D.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},D.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new k(e)},i(k,D),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),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(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:38}],37:[function(e,t,r){var n;function i(e){this.rand=e}if(t.exports=function(e){return n||(n=new i(null)),n.generate(e)},t.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var a=e("crypto");if("function"!=typeof a.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return a.randomBytes(e)}}catch(e){}},{crypto:38}],38:[function(e,t,r){},{}],39:[function(e,t,r){var n=e("safe-buffer").Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function a(e){for(;0<e.length;e++)e[0]=0}function o(e,t,r,n,i){for(var a,o,s,u,f=r[0],c=r[1],l=r[2],d=r[3],h=e[0]^t[0],p=e[1]^t[1],y=e[2]^t[2],b=e[3]^t[3],m=4,g=1;g<i;g++)a=f[h>>>24]^c[p>>>16&255]^l[y>>>8&255]^d[255&b]^t[m++],o=f[p>>>24]^c[y>>>16&255]^l[b>>>8&255]^d[255&h]^t[m++],s=f[y>>>24]^c[b>>>16&255]^l[h>>>8&255]^d[255&p]^t[m++],u=f[b>>>24]^c[h>>>16&255]^l[p>>>8&255]^d[255&y]^t[m++],h=a,p=o,y=s,b=u;return a=(n[h>>>24]<<24|n[p>>>16&255]<<16|n[y>>>8&255]<<8|n[255&b])^t[m++],o=(n[p>>>24]<<24|n[y>>>16&255]<<16|n[b>>>8&255]<<8|n[255&h])^t[m++],s=(n[y>>>24]<<24|n[b>>>16&255]<<16|n[h>>>8&255]<<8|n[255&p])^t[m++],u=(n[b>>>24]<<24|n[h>>>16&255]<<16|n[p>>>8&255]<<8|n[255&y])^t[m++],[a>>>=0,o>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],a=[[],[],[],[]],o=0,s=0,u=0;u<256;++u){var f=s^s<<1^s<<2^s<<3^s<<4;f=f>>>8^255&f^99,r[o]=f,n[f]=o;var c=e[o],l=e[c],d=e[l],h=257*e[f]^16843008*f;i[0][o]=h<<24|h>>>8,i[1][o]=h<<16|h>>>16,i[2][o]=h<<8|h>>>24,i[3][o]=h,h=16843009*d^65537*l^257*c^16843008*o,a[0][f]=h<<24|h>>>8,a[1][f]=h<<16|h>>>16,a[2][f]=h<<8|h>>>24,a[3][f]=h,0===o?o=s=1:(o=c^e[e[e[d^c]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:a}}();function f(e){this._key=i(e),this._reset()}f.blockSize=16,f.keySize=32,f.prototype.blockSize=f.blockSize,f.prototype.keySize=f.keySize,f.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],a=0;a<t;a++)i[a]=e[a];for(a=t;a<n;a++){var o=i[a-1];a%t===0?(o=o<<8|o>>>24,o=u.SBOX[o>>>24]<<24|u.SBOX[o>>>16&255]<<16|u.SBOX[o>>>8&255]<<8|u.SBOX[255&o],o^=s[a/t|0]<<24):t>6&&a%t===4&&(o=u.SBOX[o>>>24]<<24|u.SBOX[o>>>16&255]<<16|u.SBOX[o>>>8&255]<<8|u.SBOX[255&o]),i[a]=i[a-t]^o}for(var f=[],c=0;c<n;c++){var l=n-c,d=i[l-(c%4?0:4)];f[c]=c<4||l<=4?d:u.INV_SUB_MIX[0][u.SBOX[d>>>24]]^u.INV_SUB_MIX[1][u.SBOX[d>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[d>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&d]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=f},f.prototype.encryptBlockRaw=function(e){return o(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},f.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},f.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=o(e,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),a=n.allocUnsafe(16);return a.writeUInt32BE(r[0],0),a.writeUInt32BE(r[3],4),a.writeUInt32BE(r[2],8),a.writeUInt32BE(r[1],12),a},f.prototype.scrub=function(){a(this._keySchedule),a(this._invKeySchedule),a(this._key)},t.exports.AES=f},{"safe-buffer":291}],40:[function(e,t,r){var n=e("./aes"),i=e("safe-buffer").Buffer,a=e("cipher-base"),o=e("inherits"),s=e("./ghash"),u=e("buffer-xor"),f=e("./incr32");function c(e,t,r,o){a.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var c=this._cipher.encryptBlock(u);this._ghash=new s(c),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new s(r),a=t.length,o=a%16;n.update(t),o&&(o=16-o,n.update(i.alloc(o,0))),n.update(i.alloc(8,0));var u=8*a,c=i.alloc(8);c.writeUIntBE(u,0,8),n.update(c),e._finID=n.state;var l=i.from(e._finID);return f(l),l}(this,r,c),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(c,a),c.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},c.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},c.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},c.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},c.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=c},{"./aes":39,"./ghash":44,"./incr32":45,"buffer-xor":82,"cipher-base":93,inherits:189,"safe-buffer":291}],41:[function(e,t,r){var n=e("./encrypter"),i=e("./decrypter"),a=e("./modes/list.json");r.createCipher=r.Cipher=n.createCipher,r.createCipheriv=r.Cipheriv=n.createCipheriv,r.createDecipher=r.Decipher=i.createDecipher,r.createDecipheriv=r.Decipheriv=i.createDecipheriv,r.listCiphers=r.getCiphers=function(){return Object.keys(a)}},{"./decrypter":42,"./encrypter":43,"./modes/list.json":53}],42:[function(e,t,r){var n=e("./authCipher"),i=e("safe-buffer").Buffer,a=e("./modes"),o=e("./streamCipher"),s=e("cipher-base"),u=e("./aes"),f=e("evp_bytestokey");function c(e,t,r){s.call(this),this._cache=new l,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function l(){this.cache=i.allocUnsafe(0)}function d(e,t,r){var s=a[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new o(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new c(s.module,t,r)}e("inherits")(c,s),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},l.prototype.add=function(e){this.cache=i.concat([this.cache,e])},l.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},l.prototype.flush=function(){if(this.cache.length)return this.cache},r.createDecipher=function(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=f(t,!1,r.key,r.iv);return d(e,n.key,n.iv)},r.createDecipheriv=d},{"./aes":39,"./authCipher":40,"./modes":52,"./streamCipher":55,"cipher-base":93,evp_bytestokey:142,inherits:189,"safe-buffer":291}],43:[function(e,t,r){var n=e("./modes"),i=e("./authCipher"),a=e("safe-buffer").Buffer,o=e("./streamCipher"),s=e("cipher-base"),u=e("./aes"),f=e("evp_bytestokey");function c(e,t,r){s.call(this),this._cache=new d,this._cipher=new u.AES(t),this._prev=a.from(r),this._mode=e,this._autopadding=!0}e("inherits")(c,s),c.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return a.concat(n)};var l=a.alloc(16,16);function d(){this.cache=a.allocUnsafe(0)}function h(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=a.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=a.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new o(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new c(s.module,t,r)}c.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(l))throw this._cipher.scrub(),new Error("data not multiple of block length")},c.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=a.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=a.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return a.concat([this.cache,t])},r.createCipheriv=h,r.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=f(t,!1,r.key,r.iv);return h(e,i.key,i.iv)}},{"./aes":39,"./authCipher":40,"./modes":52,"./streamCipher":55,"cipher-base":93,evp_bytestokey:142,inherits:189,"safe-buffer":291}],44:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.alloc(16,0);function a(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},o.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],o=-1;++o<128;){for(!!(this.state[~~(o/8)]&1<<7-o%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=!!(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=a(i)},o.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(a([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":291}],45:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],46:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":82}],47:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("buffer-xor");function a(e,t,r){var a=t.length,o=i(t,e._cache);return e._cache=e._cache.slice(a),e._prev=n.concat([e._prev,r?t:o]),o}r.encrypt=function(e,t,r){for(var i,o=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){o=n.concat([o,a(e,t,r)]);break}i=e._cache.length,o=n.concat([o,a(e,t.slice(0,i),r)]),t=t.slice(i)}return o}},{"buffer-xor":82,"safe-buffer":291}],48:[function(e,t,r){var n=e("safe-buffer").Buffer;function i(e,t,r){for(var n,i,o=-1,s=0;++o<8;)n=t&1<<7-o?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>o%8,e._prev=a(e._prev,r?n:i);return s}function a(e,t){var r=e.length,i=-1,a=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)a[i]=e[i]<<1|e[i+1]>>7;return a}r.encrypt=function(e,t,r){for(var a=t.length,o=n.allocUnsafe(a),s=-1;++s<a;)o[s]=i(e,t[s],r);return o}},{"safe-buffer":291}],49:[function(e,t,r){var n=e("safe-buffer").Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}r.encrypt=function(e,t,r){for(var a=t.length,o=n.allocUnsafe(a),s=-1;++s<a;)o[s]=i(e,t[s],r);return o}},{"safe-buffer":291}],50:[function(e,t,r){var n=e("buffer-xor"),i=e("safe-buffer").Buffer,a=e("../incr32");function o(e){var t=e._cipher.encryptBlockRaw(e._prev);return a(e._prev),t}r.encrypt=function(e,t){var r=Math.ceil(t.length/16),a=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=o(e),f=a+16*s;e._cache.writeUInt32BE(u[0],f+0),e._cache.writeUInt32BE(u[1],f+4),e._cache.writeUInt32BE(u[2],f+8),e._cache.writeUInt32BE(u[3],f+12)}var c=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,c)}},{"../incr32":45,"buffer-xor":82,"safe-buffer":291}],51:[function(e,t,r){r.encrypt=function(e,t){return e._cipher.encryptBlock(t)},r.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],52:[function(e,t,r){var n={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},i=e("./list.json");for(var a in i)i[a].module=n[i[a].mode];t.exports=i},{"./cbc":46,"./cfb":47,"./cfb1":48,"./cfb8":49,"./ctr":50,"./ecb":51,"./list.json":53,"./ofb":54}],53:[function(e,t,r){t.exports={"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"}}},{}],54:[function(e,t,r){(function(t){(function(){var n=e("buffer-xor");function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}r.encrypt=function(e,r){for(;e._cache.length<r.length;)e._cache=t.concat([e._cache,i(e)]);var a=e._cache.slice(0,r.length);return e._cache=e._cache.slice(r.length),n(r,a)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83,"buffer-xor":82}],55:[function(e,t,r){var n=e("./aes"),i=e("safe-buffer").Buffer,a=e("cipher-base");function o(e,t,r,o){a.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=o,this._mode=e}e("inherits")(o,a),o.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},o.prototype._final=function(){this._cipher.scrub()},t.exports=o},{"./aes":39,"cipher-base":93,inherits:189,"safe-buffer":291}],56:[function(e,t,r){var n=e("browserify-des"),i=e("browserify-aes/browser"),a=e("browserify-aes/modes"),o=e("browserify-des/modes"),s=e("evp_bytestokey");function u(e,t,r){if(e=e.toLowerCase(),a[e])return i.createCipheriv(e,t,r);if(o[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function f(e,t,r){if(e=e.toLowerCase(),a[e])return i.createDecipheriv(e,t,r);if(o[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}r.createCipher=r.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");r=8*o[e].key,n=o[e].iv}var i=s(t,!1,r,n);return u(e,i.key,i.iv)},r.createCipheriv=r.Cipheriv=u,r.createDecipher=r.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),a[e])r=a[e].key,n=a[e].iv;else{if(!o[e])throw new TypeError("invalid suite type");r=8*o[e].key,n=o[e].iv}var i=s(t,!1,r,n);return f(e,i.key,i.iv)},r.createDecipheriv=r.Decipheriv=f,r.listCiphers=r.getCiphers=function(){return Object.keys(o).concat(i.getCiphers())}},{"browserify-aes/browser":41,"browserify-aes/modes":52,"browserify-des":57,"browserify-des/modes":58,evp_bytestokey:142}],57:[function(e,t,r){var n=e("cipher-base"),i=e("des.js"),a=e("inherits"),o=e("safe-buffer").Buffer,s={"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(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var a=e.key;o.isBuffer(a)||(a=o.from(a)),"des-ede"!==r&&"des-ede-cbc"!==r||(a=o.concat([a,a.slice(0,8)]));var u=e.iv;o.isBuffer(u)||(u=o.from(u)),this._des=i.create({key:a,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],t.exports=u,a(u,n),u.prototype._update=function(e){return o.from(this._des.update(e))},u.prototype._final=function(){return o.from(this._des.final())}},{"cipher-base":93,"des.js":103,inherits:189,"safe-buffer":291}],58:[function(e,t,r){r["des-ecb"]={key:8,iv:0},r["des-cbc"]=r.des={key:8,iv:8},r["des-ede3-cbc"]=r.des3={key:24,iv:8},r["des-ede3"]={key:24,iv:0},r["des-ede-cbc"]={key:16,iv:8},r["des-ede"]={key:16,iv:0}},{}],59:[function(e,t,r){var n=e("bn.js"),i=e("randombytes"),a=e("safe-buffer").Buffer;function o(e){var t,r=e.modulus.byteLength();do{t=new n(i(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var r=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),i=t.modulus.byteLength(),s=new n(e).mul(r.blinder).umod(t.modulus),u=s.toRed(n.mont(t.prime1)),f=s.toRed(n.mont(t.prime2)),c=t.coefficient,l=t.prime1,d=t.prime2,h=u.redPow(t.exponent1).fromRed(),p=f.redPow(t.exponent2).fromRed(),y=h.isub(p).imul(c).umod(l).imul(d);return p.iadd(y).imul(r.unblinder).umod(t.modulus).toArrayLike(a,"be",i)}s.getr=o,t.exports=s},{"bn.js":36,randombytes:273,"safe-buffer":291}],60:[function(e,t,r){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":61}],61:[function(e,t,r){t.exports={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"}}},{}],62:[function(e,t,r){t.exports={"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"}},{}],63:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("create-hash"),a=e("readable-stream"),o=e("inherits"),s=e("./sign"),u=e("./verify"),f=e("./algorithms.json");function c(e){a.Writable.call(this);var t=f[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function l(e){a.Writable.call(this);var t=f[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new c(e)}function h(e){return new l(e)}Object.keys(f).forEach(function(e){f[e].id=n.from(f[e].id,"hex"),f[e.toLowerCase()]=f[e]}),o(c,a.Writable),c.prototype._write=function(e,t,r){this._hash.update(e),r()},c.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},c.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},o(l,a.Writable),l.prototype._write=function(e,t,r){this._hash.update(e),r()},l.prototype.update=function(e,t){return this._hash.update("string"==typeof e?n.from(e,t):e),this},l.prototype.verify=function(e,t,r){var i="string"==typeof t?n.from(t,r):t;this.end();var a=this._hash.digest();return u(i,a,e,this._signType,this._tag)},t.exports={Sign:d,Verify:h,createSign:d,createVerify:h}},{"./algorithms.json":61,"./sign":64,"./verify":65,"create-hash":97,inherits:189,"readable-stream":76,"safe-buffer":291}],64:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("create-hmac"),a=e("browserify-rsa"),o=e("elliptic").ec,s=e("bn.js"),u=e("parse-asn1"),f=e("./curves.json");function c(e,t,r,a){if((e=n.from(e.toArray())).length<t.byteLength()){var o=n.alloc(t.byteLength()-e.length);e=n.concat([o,e])}var s=r.length,u=function(e,t){e=l(e,t),e=e.mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),f=n.alloc(s);f.fill(1);var c=n.alloc(s);return c=i(a,c).update(f).update(n.from([0])).update(e).update(u).digest(),f=i(a,c).update(f).digest(),{k:c=i(a,c).update(f).update(n.from([1])).update(e).update(u).digest(),v:f=i(a,c).update(f).digest()}}function l(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function d(e,t,r){var a,o;do{for(a=n.alloc(0);8*a.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),a=n.concat([a,t.v]);o=l(a,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==o.cmp(e));return o}function h(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}t.exports=function(e,t,r,i,p){var y=u(t);if(y.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=f[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new o(r).keyFromPrivate(t.privateKey),a=i.sign(e);return n.from(a.toDER())}(e,y)}if("dsa"===y.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,a=t.params.priv_key,o=t.params.p,u=t.params.q,f=t.params.g,p=new s(0),y=l(e,u).mod(u),b=!1,m=c(a,u,e,r);for(;!1===b;)p=h(f,i=d(u,m,r),o,u),0===(b=i.invm(u).imul(y.add(a.mul(p))).mod(u)).cmpn(0)&&(b=!1,p=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=e.length+t.length+4,i=[48,r,2,e.length];return i=i.concat(e,[2,t.length],t),n.from(i)}(p,b)}(e,y,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");if(void 0!==t.padding&&1!==t.padding)throw new Error("illegal or unsupported padding mode");e=n.concat([p,e]);for(var b=y.modulus.byteLength(),m=[0,1];e.length+m.length+1<b;)m.push(255);m.push(0);for(var g=-1;++g<e.length;)m.push(e[g]);return a(m,y)},t.exports.getKey=c,t.exports.makeKey=d},{"./curves.json":62,"bn.js":36,"browserify-rsa":59,"create-hmac":99,elliptic:115,"parse-asn1":247,"safe-buffer":291}],65:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("bn.js"),a=e("elliptic").ec,o=e("parse-asn1"),s=e("./curves.json");function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=0)throw new Error("invalid sig")}t.exports=function(e,t,r,f,c){var l=o(r);if("ec"===l.type){if("ecdsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new a(n),o=r.data.subjectPrivateKey.data;return i.verify(t,e,o)}(e,t,l)}if("dsa"===l.type){if("dsa"!==f)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,a=r.data.q,s=r.data.g,f=r.data.pub_key,c=o.signature.decode(e,"der"),l=c.s,d=c.r;u(l,a),u(d,a);var h=i.mont(n),p=l.invm(a),y=s.toRed(h).redPow(new i(t).mul(p).mod(a)).fromRed().mul(f.toRed(h).redPow(d.mul(p).mod(a)).fromRed()).mod(n).mod(a);return 0===y.cmp(d)}(e,t,l)}if("rsa"!==f&&"ecdsa/rsa"!==f)throw new Error("wrong public key type");t=n.concat([c,t]);for(var d=l.modulus.byteLength(),h=[1],p=0;t.length+h.length+2<d;)h.push(255),p+=1;h.push(0);for(var y=-1;++y<t.length;)h.push(t[y]);h=n.from(h);var b=i.mont(l.modulus);e=(e=new i(e).toRed(b)).redPow(new i(l.publicExponent)),e=n.from(e.fromRed().toArray());var m=p<8?1:0;for(d=Math.min(e.length,h.length),e.length!==h.length&&(m=1),y=-1;++y<d;)m|=e[y]^h[y];return 0===m}},{"./curves.json":62,"bn.js":36,elliptic:115,"parse-asn1":247,"safe-buffer":291}],66:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],67:[function(e,t,r){var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var a=Object.create(e("core-util-is"));a.inherits=e("inherits");var o=e("./_stream_readable"),s=e("./_stream_writable");a.inherits(l,o);for(var u=i(s.prototype),f=0;f<u.length;f++){var c=u[f];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},{"./_stream_readable":69,"./_stream_writable":71,"core-util-is":94,inherits:189,"process-nextick-args":255}],68:[function(e,t,r){t.exports=a;var n=e("./_stream_transform"),i=Object.create(e("core-util-is"));function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(a,n),a.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":70,"core-util-is":94,inherits:189}],69:[function(e,t,r){(function(r,n){(function(){var i=e("process-nextick-args");t.exports=v;var a,o=e("isarray");v.ReadableState=g;e("events").EventEmitter;var s=function(e,t){return e.listeners(t).length},u=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,y=e("./internal/streams/BufferList"),b=e("./internal/streams/destroy");l.inherits(v,u);var m=["error","close","destroy","pause","resume"];function g(t,r){t=t||{};var n=r instanceof(a=a||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,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=e("string_decoder/").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(a=a||e("./_stream_duplex"),!(this instanceof v))return new v(t);this._readableState=new g(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(e,t,r,n,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,M(e)}(e,o)):(i||(a=function(e,t){var r;n=t,f.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=function(e){return f.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?_(e,o,t,!1):D(e,o)):_(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),D(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(t){return p||(p=e("string_decoder/").StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var S=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),R(e)}function D(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){h("readable nexttick read 0"),e.read(0)}function x(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function j(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(q,t,e))}function q(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):M(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:v;function f(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",b),e.removeListener("unpipe",f),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",y),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",f);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",l);var d=!1;var p=!1;function y(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==I(a.pipes,e))&&!d&&(h("false write response, pause",a.awaitDrain),a.awaitDrain++,p=!0),n.pause())}function b(t){h("onerror",t),v(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),v()}function g(){h("onfinish"),e.removeListener("close",m),v()}function v(){h("unpipe"),n.unpipe(e)}return n.on("data",y),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&M(this):i.nextTick(O,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(x,e,t))}(this,e)),this},v.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},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<m.length;a++)e.on(m[a],this.emit.bind(this,m[a]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=C}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":67,"./internal/streams/BufferList":72,"./internal/streams/destroy":73,"./internal/streams/stream":74,_process:256,"core-util-is":94,events:141,inherits:189,isarray:66,"process-nextick-args":255,"safe-buffer":75,"string_decoder/":77,util:38}],70:[function(e,t,r){t.exports=o;var n=e("./_stream_duplex"),i=Object.create(e("core-util-is"));function a(e,t){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!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);n.call(this,e),this._transformState={afterTransform:a.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},o.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},{"./_stream_duplex":67,"core-util-is":94,inherits:189}],71:[function(e,t,r){(function(r,n,i){(function(){var a=e("process-nextick-args");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}t.exports=g;var s,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:a.nextTick;g.WritableState=m;var f=Object.create(e("core-util-is"));f.inherits=e("inherits");var c={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,h=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,y=e("./internal/streams/destroy");function b(){}function m(t,r){s=s||e("./_stream_duplex"),t=t||{};var n=r instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(M,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),M(e,t))}(e,r,n,t,i);else{var o=S(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,o,i):w(e,r,o,i)}}(r,e)},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 o(this)}function g(t){if(s=s||e("./_stream_duplex"),!(p.call(g,this)||this instanceof s))return new g(t);this._writableState=new m(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)),l.call(this)}function v(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),M(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(v(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),M(e,t)})}function M(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}f.inherits(g,l),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,a);return u}(this,i,s,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},g.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,M(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":67,"./internal/streams/destroy":73,"./internal/streams/stream":74,_process:256,"core-util-is":94,inherits:189,"process-nextick-args":255,"safe-buffer":75,timers:344,"util-deprecate":350}],72:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("util");function a(e,t,r){e.copy(t,r)}t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)a(r.data,t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":75,util:38}],73:[function(e,t,r){var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(i,this,e)):n.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted||(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t&&t(e)}),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)}}},{"process-nextick-args":255}],74:[function(e,t,r){t.exports=e("events").EventEmitter},{events:141}],75:[function(e,t,r){var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:83}],76:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":67,"./lib/_stream_passthrough.js":68,"./lib/_stream_readable.js":69,"./lib/_stream_transform.js":70,"./lib/_stream_writable.js":71}],77:[function(e,t,r){var n=e("safe-buffer").Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.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 a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=l,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function f(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);if(i>=0)return i>0&&(e.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(e.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if(i=o(t[n]),i>=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":78}],78:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{buffer:83,dup:75}],79:[function(e,t,r){arguments[4][38][0].apply(r,arguments)},{dup:38}],80:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{buffer:83,dup:75}],81:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,"safe-buffer":80}],82:[function(e,t,r){(function(e){(function(){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),a=0;a<n;++a)i[a]=t[a]^r[a];return i}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83}],83:[function(e,t,r){(function(t){(function(){var t=e("base64-js"),n=e("ieee754");r.Buffer=o,r.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=a(r),i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=o.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);var i=function(e){if(o.isBuffer(e)){var t=0|l(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||F(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|l(e))}function c(e){for(var t=e.length<0?0:0|l(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return P(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function h(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return M(this,t,r);case"ascii":return D(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;a<s;a++)if(f(e,a)===f(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var l=!0,d=0;d<u;d++)if(f(e,a+d)!==f(t,d)){l=!1;break}if(l)return a}return-1}function m(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(F(s))return o;e[r+o]=s}return o}function g(e,t,r,n){return B(U(t,e.length-r),e,r,n)}function v(e,t,r,n){return B(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return v(e,t,r,n)}function _(e,t,r,n){return B(P(t),e,r,n)}function S(e,t,r,n){return B(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function M(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,u,f=e[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&f)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&f)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),o.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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,o.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},o.allocUnsafe=function(e){return f(e)},o.allocUnsafeSlow=function(e){return f(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).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}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(N(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},o.byteLength=d,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?M(this,0,e):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},o.prototype.compare=function(e,t,r,n,i){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),u=Math.min(a,s),f=this.slice(n,i),c=e.slice(t,r),l=0;l<u;++l)if(f[l]!==c[l]){a=f[l],s=c[l];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return g(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=L(e[a]);return i}function x(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function R(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,i,a){return t=+t,r>>>=0,a||j(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,a){return t=+t,r>>>=0,a||j(e,0,r,8),n.write(e,t,r,i,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=o.prototype,n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||R(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),n.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),n.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||C(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);C(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=i-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=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&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var s=o.isBuffer(e)?e:o.from(e,n),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=s[a%u]}return this};var T=/[^+/0-9A-Za-z-_]/g;function L(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function P(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(T,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function B(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":35,buffer:83,ieee754:188}],84:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],85:[function(e,t,r){var n=e("function-bind"),i=e("./functionApply"),a=e("./functionCall"),o=e("./reflectApply");t.exports=o||n.call(a,i)},{"./functionApply":87,"./functionCall":88,"./reflectApply":90,"function-bind":158}],86:[function(e,t,r){var n=e("function-bind"),i=e("./functionApply"),a=e("./actualApply");t.exports=function(){return a(n,i,arguments)}},{"./actualApply":85,"./functionApply":87,"function-bind":158}],87:[function(e,t,r){t.exports=Function.prototype.apply},{}],88:[function(e,t,r){t.exports=Function.prototype.call},{}],89:[function(e,t,r){var n=e("function-bind"),i=e("es-errors/type"),a=e("./functionCall"),o=e("./actualApply");t.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return o(n,a,e)}},{"./actualApply":85,"./functionCall":88,"es-errors/type":138,"function-bind":158}],90:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],91:[function(e,t,r){var n=e("set-function-length"),i=e("es-define-property"),a=e("call-bind-apply-helpers"),o=e("call-bind-apply-helpers/applyBind");t.exports=function(e){var t=a(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(t.exports,"apply",{value:o}):t.exports.apply=o},{"call-bind-apply-helpers":89,"call-bind-apply-helpers/applyBind":86,"es-define-property":132,"set-function-length":293}],92:[function(e,t,r){var n=e("get-intrinsic"),i=e("call-bind-apply-helpers"),a=i([n("%String.prototype.indexOf%")]);t.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?i([r]):r}},{"call-bind-apply-helpers":89,"get-intrinsic":162}],93:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,a=e("string_decoder").StringDecoder,o=e("inherits"),s=e("to-buffer");function u(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}o(u,i),u.prototype.update=function(e,t,r){var n=s(e,t),i=this._update(n);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},u.prototype.setAutoPadding=function(){},u.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},u.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},u.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},u.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},u.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},u.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},u.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new a(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},t.exports=u},{inherits:189,"safe-buffer":291,stream:308,string_decoder:81,"to-buffer":345}],94:[function(e,t,r){function n(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===n(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===n(e)},r.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("buffer").Buffer.isBuffer},{buffer:83}],95:[function(e,t,r){(function(r){(function(){var n=e("elliptic"),i=e("bn.js");t.exports=function(e){return new o(e)};var a={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 o(e){this.curveType=a[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(e,t,n){Array.isArray(e)||(e=e.toArray());var i=new r(e);if(n&&i.length<n){var a=new r(n-i.length);a.fill(0),i=r.concat([a,i])}return t?i.toString(t):i}a.p224=a.secp224r1,a.p256=a.secp256r1=a.prime256v1,a.p192=a.secp192r1=a.prime192v1,a.p384=a.secp384r1,a.p521=a.secp521r1,o.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},o.prototype.computeSecret=function(e,t,n){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},o.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),s(r,e)},o.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},o.prototype.setPublicKey=function(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this.keys._importPublic(e),this},o.prototype.setPrivateKey=function(e,t){t=t||"utf8",r.isBuffer(e)||(e=new r(e,t));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":96,buffer:83,elliptic:115}],96:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{buffer:38,dup:16}],97:[function(e,t,r){var n=e("inherits"),i=e("md5.js"),a=e("ripemd160"),o=e("sha.js"),s=e("cipher-base");function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new a:new u(o(e))}},{"cipher-base":93,inherits:189,"md5.js":209,ripemd160:275,"sha.js":295}],98:[function(e,t,r){var n=e("md5.js");t.exports=function(e){return(new n).update(e).digest()}},{"md5.js":209}],99:[function(e,t,r){var n=e("inherits"),i=e("./legacy"),a=e("cipher-base"),o=e("safe-buffer").Buffer,s=e("create-hash/md5"),u=e("ripemd160"),f=e("sha.js"),c=o.alloc(128);function l(e,t){a.call(this,"digest"),"string"==typeof t&&(t=o.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new u:f(e)).update(t).digest():t.length<r&&(t=o.concat([t,c],r));for(var n=this._ipad=o.allocUnsafe(r),i=this._opad=o.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:f(e),this._hash.update(n)}n(l,a),l.prototype._update=function(e){this._hash.update(e)},l.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:f(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new l("rmd160",t):"md5"===e?new i(s,t):new l(e,t)}},{"./legacy":100,"cipher-base":93,"create-hash/md5":98,inherits:189,ripemd160:275,"safe-buffer":291,"sha.js":295}],100:[function(e,t,r){var n=e("inherits"),i=e("safe-buffer").Buffer,a=e("cipher-base"),o=i.alloc(128),s=64;function u(e,t){a.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>s?t=e(t):t.length<s&&(t=i.concat([t,o],s));for(var r=this._ipad=i.allocUnsafe(s),n=this._opad=i.allocUnsafe(s),u=0;u<s;u++)r[u]=54^t[u],n[u]=92^t[u];this._hash=[r]}n(u,a),u.prototype._update=function(e){this._hash.push(e)},u.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},t.exports=u},{"cipher-base":93,inherits:189,"safe-buffer":291}],101:[function(e,t,r){r.randomBytes=r.rng=r.pseudoRandomBytes=r.prng=e("randombytes"),r.createHash=r.Hash=e("create-hash"),r.createHmac=r.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),i=Object.keys(n),a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);r.getHashes=function(){return a};var o=e("pbkdf2");r.pbkdf2=o.pbkdf2,r.pbkdf2Sync=o.pbkdf2Sync;var s=e("browserify-cipher");r.Cipher=s.Cipher,r.createCipher=s.createCipher,r.Cipheriv=s.Cipheriv,r.createCipheriv=s.createCipheriv,r.Decipher=s.Decipher,r.createDecipher=s.createDecipher,r.Decipheriv=s.Decipheriv,r.createDecipheriv=s.createDecipheriv,r.getCiphers=s.getCiphers,r.listCiphers=s.listCiphers;var u=e("diffie-hellman");r.DiffieHellmanGroup=u.DiffieHellmanGroup,r.createDiffieHellmanGroup=u.createDiffieHellmanGroup,r.getDiffieHellman=u.getDiffieHellman,r.createDiffieHellman=u.createDiffieHellman,r.DiffieHellman=u.DiffieHellman;var f=e("browserify-sign");r.createSign=f.createSign,r.Sign=f.Sign,r.createVerify=f.createVerify,r.Verify=f.Verify,r.createECDH=e("create-ecdh");var c=e("public-encrypt");r.publicEncrypt=c.publicEncrypt,r.privateEncrypt=c.privateEncrypt,r.publicDecrypt=c.publicDecrypt,r.privateDecrypt=c.privateDecrypt;var l=e("randomfill");r.randomFill=l.randomFill,r.randomFillSync=l.randomFillSync,r.createCredentials=function(){throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify")},r.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}},{"browserify-cipher":56,"browserify-sign":63,"browserify-sign/algos":60,"create-ecdh":95,"create-hash":97,"create-hmac":99,"diffie-hellman":109,pbkdf2:248,"public-encrypt":257,randombytes:273,randomfill:274}],102:[function(e,t,r){var n=e("es-define-property"),i=e("es-errors/syntax"),a=e("es-errors/type"),o=e("gopd");t.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],l=!!o&&o(e,t);if(n)n(e,t,{configurable:null===f&&l?l.configurable:!f,enumerable:null===s&&l?l.enumerable:!s,value:r,writable:null===u&&l?l.writable:!u});else{if(!c&&(s||u||f))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},{"es-define-property":132,"es-errors/syntax":137,"es-errors/type":138,gopd:167}],103:[function(e,t,r){r.utils=e("./des/utils"),r.Cipher=e("./des/cipher"),r.DES=e("./des/des"),r.CBC=e("./des/cbc"),r.EDE=e("./des/ede")},{"./des/cbc":104,"./des/cipher":105,"./des/des":106,"./des/ede":107,"./des/utils":108}],104:[function(e,t,r){var n=e("minimalistic-assert"),i=e("inherits"),a={};function o(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}r.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(a),n=0;n<r.length;n++){var o=r[n];t.prototype[o]=a[o]}return t.create=function(e){return new t(e)},t},a._cbcInit=function(){var e=new o(this.options.iv);this._cbcState=e},a._update=function(e,t,r,n){var i=this._cbcState,a=this.constructor.super_.prototype,o=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)o[s]^=e[t+s];a._update.call(this,o,0,r,n);for(s=0;s<this.blockSize;s++)o[s]=r[n+s]}else{a._update.call(this,e,t,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=o[s];for(s=0;s<this.blockSize;s++)o[s]=e[t+s]}}},{inherits:189,"minimalistic-assert":239}],105:[function(e,t,r){var n=e("minimalistic-assert");function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=(this.bufferOff+e.length)/this.blockSize|0,i=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var a=e.length-(e.length-t)%this.blockSize;t<a;t+=this.blockSize)this._update(e,t,i,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":239}],106:[function(e,t,r){var n=e("minimalistic-assert"),i=e("inherits"),a=e("./utils"),o=e("./cipher");function s(){this.tmp=new Array(2),this.keys=null}function u(e){o.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}i(u,o),t.exports=u,u.create=function(e){return new u(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=a.readUInt32BE(t,0),i=a.readUInt32BE(t,4);a.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var o=0;o<e.keys.length;o+=2){var s=f[o>>>1];r=a.r28shl(r,s),i=a.r28shl(i,s),a.pc2(r,i,e.keys,o)}},u.prototype._update=function(e,t,r,n){var i=this._desState,o=a.readUInt32BE(e,t),s=a.readUInt32BE(e,t+4);a.ip(o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,o,s,i.tmp,0):this._decrypt(i,o,s,i.tmp,0),o=i.tmp[0],s=i.tmp[1],a.writeUInt32BE(r,o,n),a.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var o=t,s=r,u=0;u<e.keys.length;u+=2){var f=e.keys[u],c=e.keys[u+1];a.expand(s,e.tmp,0),f^=e.tmp[0],c^=e.tmp[1];var l=a.substitute(f,c),d=s;s=(o^a.permute(l))>>>0,o=d}a.rip(s,o,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var o=r,s=t,u=e.keys.length-2;u>=0;u-=2){var f=e.keys[u],c=e.keys[u+1];a.expand(o,e.tmp,0),f^=e.tmp[0],c^=e.tmp[1];var l=a.substitute(f,c),d=o;o=(s^a.permute(l))>>>0,s=d}a.rip(o,s,n,i)}},{"./cipher":105,"./utils":108,inherits:189,"minimalistic-assert":239}],107:[function(e,t,r){var n=e("minimalistic-assert"),i=e("inherits"),a=e("./cipher"),o=e("./des");function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),a=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:i}),o.create({type:"encrypt",key:a})]:[o.create({type:"decrypt",key:a}),o.create({type:"encrypt",key:i}),o.create({type:"decrypt",key:r})]}function u(e){a.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(u,a),t.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=o.prototype._pad,u.prototype._unpad=o.prototype._unpad},{"./cipher":105,"./des":106,inherits:189,"minimalistic-assert":239}],108:[function(e,t,r){r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,n){for(var i=0,a=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+o&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+o&1}for(o=6;o>=0;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[n+0]=i>>>0,r[n+1]=a>>>0},r.rip=function(e,t,r,n){for(var i=0,a=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+o&1,i<<=1,i|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;s>=0;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},r.pc1=function(e,t,r,n){for(var i=0,a=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+o&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+o&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},r.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};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];r.pc2=function(e,t,r,i){for(var a=0,o=0,s=n.length>>>1,u=0;u<s;u++)a<<=1,a|=e>>>n[u]&1;for(u=s;u<n.length;u++)o<<=1,o|=t>>>n[u]&1;r[i+0]=a>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var a=23;a>=15;a-=4)n<<=6,n|=e>>>a&63;for(a=11;a>=3;a-=4)i|=e>>>a&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[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];r.substitute=function(e,t){for(var r=0,n=0;n<4;n++){r<<=4,r|=i[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)]}return r>>>0};var a=[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];r.permute=function(e){for(var t=0,r=0;r<a.length;r++)t<<=1,t|=e>>>a[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],a=0;a<t;a+=r)i.push(n.slice(a,a+r));return i.join(" ")}},{}],109:[function(e,t,r){(function(t){(function(){var n=e("./lib/generatePrime"),i=e("./lib/primes.json"),a=e("./lib/dh");var o={binary:!0,hex:!0,base64:!0};r.DiffieHellmanGroup=r.createDiffieHellmanGroup=r.getDiffieHellman=function(e){var r=new t(i[e].prime,"hex"),n=new t(i[e].gen,"hex");return new a(r,n)},r.createDiffieHellman=r.DiffieHellman=function e(r,i,s,u){return t.isBuffer(i)||void 0===o[i]?e(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new t([2]),t.isBuffer(s)||(s=new t(s,u)),"number"==typeof r?new a(n(r,s),s,!0):(t.isBuffer(r)||(r=new t(r,i)),new a(r,s,!0)))}}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/dh":110,"./lib/generatePrime":111,"./lib/primes.json":112,buffer:83}],110:[function(e,t,r){(function(r){(function(){var n=e("bn.js"),i=new(e("miller-rabin")),a=new n(24),o=new n(11),s=new n(10),u=new n(3),f=new n(7),c=e("./generatePrime"),l=e("randombytes");function d(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._pub=new n(e),this}function h(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this._priv=new n(e),this}t.exports=y;var p={};function y(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=d,this.setPrivateKey=h):this._primeCode=8}function b(e,t){var n=new r(e.toArray());return t?n.toString(t):n}Object.defineProperty(y.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var l,d=0;if(e.isEven()||!c.simpleSieve||!c.fermatTest(e)||!i.test(e))return d+=1,d+="02"===r||"05"===r?8:4,p[n]=d,d;switch(i.test(e.shrn(1))||(d+=2),r){case"02":e.mod(a).cmp(o)&&(d+=8);break;case"05":(l=e.mod(s)).cmp(u)&&l.cmp(f)&&(d+=8);break;default:d+=4}return p[n]=d,d}(this.__prime,this.__gen)),this._primeCode}}),y.prototype.generateKeys=function(){return this._priv||(this._priv=new n(l(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},y.prototype.computeSecret=function(e){var t=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new r(t.toArray()),a=this.getPrime();if(i.length<a.length){var o=new r(a.length-i.length);o.fill(0),i=r.concat([o,i])}return i},y.prototype.getPublicKey=function(e){return b(this._pub,e)},y.prototype.getPrivateKey=function(e){return b(this._priv,e)},y.prototype.getPrime=function(e){return b(this.__prime,e)},y.prototype.getGenerator=function(e){return b(this._gen,e)},y.prototype.setGenerator=function(e,t){return t=t||"utf8",r.isBuffer(e)||(e=new r(e,t)),this.__gen=e,this._gen=new n(e),this}}).call(this)}).call(this,e("buffer").Buffer)},{"./generatePrime":111,"bn.js":113,buffer:83,"miller-rabin":237,randombytes:273}],111:[function(e,t,r){var n=e("randombytes");t.exports=g,g.simpleSieve=b,g.fermatTest=m;var i=e("bn.js"),a=new i(24),o=new(e("miller-rabin")),s=new i(1),u=new i(2),f=new i(5),c=(new i(16),new i(8),new i(10)),l=new i(3),d=(new i(7),new i(11)),h=new i(4),p=(new i(12),null);function y(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!==0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}function b(e){for(var t=y(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function m(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function g(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(f))for(;r.mod(c).cmp(l);)r.iadd(h)}else for(;r.mod(a).cmp(d);)r.iadd(h);if(b(p=r.shrn(1))&&b(r)&&m(p)&&m(r)&&o.test(p)&&o.test(r))return r}}},{"bn.js":113,"miller-rabin":237,randombytes:273}],112:[function(e,t,r){t.exports={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"}}},{}],113:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{buffer:38,dup:16}],114:[function(e,t,r){var n,i=e("call-bind-apply-helpers"),a=e("gopd");try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!n&&a&&a(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;t.exports=o&&"function"==typeof o.get?i([o.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},{"call-bind-apply-helpers":89,gopd:167}],115:[function(e,t,r){var n=r;n.version=e("../package.json").version,n.utils=e("./elliptic/utils"),n.rand=e("brorand"),n.curve=e("./elliptic/curve"),n.curves=e("./elliptic/curves"),n.ec=e("./elliptic/ec"),n.eddsa=e("./elliptic/eddsa")},{"../package.json":131,"./elliptic/curve":118,"./elliptic/curves":121,"./elliptic/ec":122,"./elliptic/eddsa":125,"./elliptic/utils":129,brorand:37}],116:[function(e,t,r){var n=e("bn.js"),i=e("../utils"),a=i.getNAF,o=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.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=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.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 f(e,t){this.curve=e,this.type=t,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(e,t){s(e.precomputed);var r=e._getDoubles(),n=a(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,u,f=[];for(o=0;o<n.length;o+=r.step){u=0;for(var c=o+r.step-1;c>=o;c--)u=(u<<1)+n[c];f.push(u)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<f.length;o++)(u=f[o])===h?d=d.mixedAdd(r.points[o]):u===-h&&(d=d.mixedAdd(r.points[o].neg()));l=l.add(d)}return l.toP()},u.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=a(t,r,this._bitLength),u=this.jpoint(null,null,null),f=o.length-1;f>=0;f--){for(var c=0;f>=0&&0===o[f];f--)c++;if(f>=0&&c++,u=u.dblp(c),f<0)break;var l=o[f];s(0!==l),u="affine"===e.type?l>0?u.mixedAdd(i[l-1>>1]):u.mixedAdd(i[-l-1>>1].neg()):l>0?u.add(i[l-1>>1]):u.add(i[-l-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,f,c=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(s=0;s<n;s++){var p=(f=t[s])._getNAFPoints(e);c[s]=p.wnd,l[s]=p.points}for(s=n-1;s>=1;s-=2){var y=s-1,b=s;if(1===c[y]&&1===c[b]){var m=[t[y],null,null,t[b]];0===t[y].y.cmp(t[b].y)?(m[1]=t[y].add(t[b]),m[2]=t[y].toJ().mixedAdd(t[b].neg())):0===t[y].y.cmp(t[b].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[b]),m[2]=t[y].add(t[b].neg())):(m[1]=t[y].toJ().mixedAdd(t[b]),m[2]=t[y].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[y],r[b]);for(h=Math.max(v[0].length,h),d[y]=new Array(h),d[b]=new Array(h),u=0;u<h;u++){var w=0|v[0][u],_=0|v[1][u];d[y][u]=g[3*(w+1)+(_+1)],d[b][u]=0,l[y]=m}}else d[y]=a(r[y],c[y],this._bitLength),d[b]=a(r[b],c[b],this._bitLength),h=Math.max(d[y].length,h),h=Math.max(d[b].length,h)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(s=h;s>=0;s--){for(var M=0;s>=0;){var A=!0;for(u=0;u<n;u++)E[u]=0|d[u][s],0!==E[u]&&(A=!1);if(!A)break;M++,s--}if(s>=0&&M++,S=S.dblp(M),s<0)break;for(u=0;u<n;u++){var D=E[u];0!==D&&(D>0?f=l[u][D-1>>1]:D<0&&(f=l[u][-D-1>>1].neg()),S="affine"===f.type?S.mixedAdd(f):S.add(f))}}for(s=0;s<n;s++)l[s]=null;return i?S:S.toP()},u.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},f.prototype.encodeCompressed=function(e){return this.encode(e,!0)},f.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},f.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},f.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},f.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}},f.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},{"../utils":129,"bn.js":130}],117:[function(e,t,r){var n=e("../utils"),i=e("bn.js"),a=e("inherits"),o=e("./base"),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function f(e,t,r,n,a){o.BasePoint.call(this,e,"projective"),null===t&&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(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=a&&new i(a,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()))))}a(u,o),t.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(a.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),a=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(a.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},a(f,o.BasePoint),u.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new f(this,e,t,r,n)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.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)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=n.redAdd(t),o=a.redSub(r),s=n.redSub(t),u=i.redMul(o),f=a.redMul(s),c=i.redMul(s),l=o.redMul(a);return this.curve.point(u,f,l,c)},f.prototype._projDbl=function(){var e,t,r,n,i,a,o=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=o.redSub(s).redSub(u).redMul(f.redSub(this.curve.two)),t=f.redMul(n.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(i=this.z.redSqr(),a=f.redSub(i).redISub(i),e=o.redSub(s).redISub(u).redMul(a),t=f.redMul(n.redSub(u)),r=f.redMul(a))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),a=n.redSub(i).redSub(i),e=this.curve._mulC(o.redISub(n)).redMul(a),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(a);return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),o=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),f=a.redMul(o),c=s.redMul(u),l=a.redMul(u),d=o.redMul(s);return this.curve.point(f,c,d,l)},f.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),a=this.x.redMul(e.x),o=this.y.redMul(e.y),s=this.curve.d.redMul(a).redMul(o),u=i.redSub(s),f=i.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(o),l=n.redMul(u).redMul(c);return this.curve.twisted?(t=n.redMul(f).redMul(o.redSub(this.curve._mulA(a))),r=u.redMul(f)):(t=n.redMul(f).redMul(o.redSub(a)),r=this.curve._mulC(u).redMul(f)),this.curve.point(l,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../utils":129,"./base":116,"bn.js":130,inherits:189}],118:[function(e,t,r){var n=r;n.base=e("./base"),n.short=e("./short"),n.mont=e("./mont"),n.edwards=e("./edwards")},{"./base":116,"./edwards":117,"./mont":119,"./short":120}],119:[function(e,t,r){var n=e("bn.js"),i=e("inherits"),a=e("./base"),o=e("../utils");function s(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.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(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,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(s,a),t.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,a.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.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 e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.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(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),o=i.redMul(n),s=t.z.redMul(a.redAdd(o).redSqr()),u=t.x.redMul(a.redISub(o).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var a=i.length-1;a>=0;a--)0===i[a]?(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(e){return 0===this.getX().cmp(e.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()}},{"../utils":129,"./base":116,"bn.js":130,inherits:189}],120:[function(e,t,r){var n=e("../utils"),i=e("bn.js"),a=e("inherits"),o=e("./base"),s=n.assert;function u(e){o.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.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(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(e,t,r,n){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,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 c(e,t,r,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,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}a(u,o),t.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var a=this._getEndoRoots(this.n);0===this.g.mul(a[0]).x.cmp(this.g.x.redMul(t))?r=a[0]:(r=a[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,a,o,s,u,f,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new i(1),y=new i(0),b=new i(0),m=new i(1),g=0;0!==d.cmpn(0);){var v=h.div(d);f=h.sub(v.mul(d)),c=b.sub(v.mul(p));var w=m.sub(v.mul(y));if(!n&&f.cmp(l)<0)t=u.neg(),r=p,n=f.neg(),a=c;else if(n&&2===++g)break;u=f,h=d,d=f,b=p,p=c,m=y,y=w}o=f.neg(),s=c;var _=n.sqr().add(a.sqr());return o.sqr().add(s.sqr()).cmp(_)>=0&&(o=t,s=r),n.negative&&(n=n.neg(),a=a.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:a},{a:o,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),u=i.mul(r.b),f=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:u.add(f).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a<e.length;a++){var o=this._endoSplit(t[a]),s=e[a],u=s._getBeta();o.k1.negative&&(o.k1.ineg(),s=s.neg(!0)),o.k2.negative&&(o.k2.ineg(),u=u.neg(!0)),n[2*a]=s,n[2*a+1]=u,i[2*a]=o.k1,i[2*a+1]=o.k2}for(var f=this._wnafMulAdd(1,n,i,2*a,r),c=0;c<2*a;c++)n[c]=null,i[c]=null;return f},a(f,o.BasePoint),u.prototype.point=function(e,t,r){return new f(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return f.fromJSON(this,e,t)},f.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},f.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]},f.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var a=t[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(i))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(i))}},n},f.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)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.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 t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},a(c,o.BasePoint),u.prototype.jpoint=function(e,t,r){return new c(this,e,t,r)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),c=f.redMul(s),l=n.redMul(f),d=u.redSqr().redIAdd(c).redISub(l).redISub(l),h=u.redMul(l.redISub(d)).redISub(a.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(d,h,p)},c.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),f=u.redMul(o),c=r.redMul(u),l=s.redSqr().redIAdd(f).redISub(c).redISub(c),d=s.redMul(c.redISub(l)).redISub(i.redMul(f)),h=this.z.redMul(o);return this.curve.jpoint(l,d,h)},c.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,a=this.x,o=this.y,s=this.z,u=s.redSqr().redSqr(),f=o.redAdd(o);for(t=0;t<e;t++){var c=a.redSqr(),l=f.redSqr(),d=l.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(n.redMul(u)),p=a.redMul(l),y=h.redSqr().redISub(p.redAdd(p)),b=p.redISub(y),m=h.redMul(b);m=m.redIAdd(m).redISub(d);var g=f.redMul(s);t+1<e&&(u=u.redMul(d)),a=y,s=g,f=m}return this.curve.jpoint(a,f.redMul(i),s)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(o).redISub(o),f=a.redIAdd(a);f=(f=f.redIAdd(f)).redIAdd(f),e=u,t=s.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.x.redSqr(),l=this.y.redSqr(),d=l.redSqr(),h=this.x.redAdd(l).redSqr().redISub(c).redISub(d);h=h.redIAdd(h);var p=c.redAdd(c).redIAdd(c),y=p.redSqr(),b=d.redIAdd(d);b=(b=b.redIAdd(b)).redIAdd(b),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(b),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},c.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(o).redISub(o);e=u;var f=a.redIAdd(a);f=(f=f.redIAdd(f)).redIAdd(f),t=s.redMul(o.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var c=this.z.redSqr(),l=this.y.redSqr(),d=this.x.redMul(l),h=this.x.redSub(c).redMul(this.x.redAdd(c));h=h.redAdd(h).redIAdd(h);var p=d.redIAdd(d),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(l).redISub(c);var b=l.redSqr();b=(b=(b=b.redIAdd(b)).redIAdd(b)).redIAdd(b),t=h.redMul(p.redISub(e)).redISub(b)}return this.curve.jpoint(e,t,r)},c.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),a=t.redSqr(),o=r.redSqr(),s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i)),u=t.redAdd(t),f=(u=u.redIAdd(u)).redMul(o),c=s.redSqr().redISub(f.redAdd(f)),l=f.redISub(c),d=o.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=s.redMul(l).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(c,h,p)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),a=i.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(a)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(u),c=t.redMul(f);c=(c=c.redIAdd(c)).redIAdd(c);var l=this.x.redMul(s).redISub(c);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.y.redMul(f.redMul(u.redISub(f)).redISub(o.redMul(s)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var h=this.z.redAdd(o).redSqr().redISub(r).redISub(s);return this.curve.jpoint(l,d,h)},c.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},c.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},c.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){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}},c.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)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":129,"./base":116,"bn.js":130,inherits:189}],121:[function(e,t,r){var n,i=r,a=e("hash.js"),o=e("./curve"),s=e("./utils").assert;function u(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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:a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:a.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"]}),f("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:a.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.sha256,gRed:!1,g:["9"]}),f("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:a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}f("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:a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":118,"./precomputed/secp256k1":128,"./utils":129,"hash.js":173}],122:[function(e,t,r){var n=e("bn.js"),i=e("hmac-drbg"),a=e("../utils"),o=e("../curves"),s=e("brorand"),u=a.assert,f=e("./key"),c=e("./signature");function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=l,l.prototype.keyPair=function(e){return new f(this,e)},l.prototype.keyFromPrivate=function(e,t){return f.fromPrivate(this,e,t)},l.prototype.keyFromPublic=function(e,t){return f.fromPublic(this,e,t)},l.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),a=this.n.sub(new n(2));;){var o=new n(t.generate(r));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},l.prototype._truncateToN=function(e,t,r){var i;if(n.isBN(e)||"number"==typeof e)i=(e=new n(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new n(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new n(a,16)}"number"!=typeof r&&(r=8*i);var o=r-this.n.bitLength();return o>0&&(e=e.ushrn(o)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},l.prototype.sign=function(e,t,r,a){if("object"==typeof r&&(a=r,r=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){u("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),u(e.length>>>0===e.length);for(var o=0;o<e.length;o++)u((255&e[o])===e[o])}t=this.keyFromPrivate(t,r),e=this._truncateToN(e,!1,a.msgBitLength),u(!e.isNeg(),"Can not sign a negative message");var s=this.n.byteLength(),f=t.getPrivate().toArray("be",s),l=e.toArray("be",s);u(new n(l).eq(e),"Can not sign message");for(var d=new i({hash:this.hash,entropy:f,nonce:l,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new n(1)),p=0;;p++){var y=a.k?a.k(p):new n(d.generate(this.n.byteLength()));if(!((y=this._truncateToN(y,!0)).cmpn(1)<=0||y.cmp(h)>=0)){var b=this.g.mul(y);if(!b.isInfinity()){var m=b.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var v=y.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(b.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return a.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new c({r:g,s:v,recoveryParam:w})}}}}}},l.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var a=(t=new c(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),f=u.mul(e).umod(this.n),l=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),l)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(f,r.getPublic(),l)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},l.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new c(t,i);var a=this.n,o=new n(e),s=t.r,f=t.s,l=1&r,d=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");s=d?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var h=t.r.invm(a),p=a.sub(o).mul(h).umod(a),y=f.mul(h).umod(a);return this.g.mulAdd(p,s,y)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new c(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":121,"../utils":129,"./key":123,"./signature":124,"bn.js":130,brorand:37,"hmac-drbg":186}],123:[function(e,t,r){var n=e("bn.js"),i=e("../utils").assert;function a(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=a,a.fromPublic=function(e,t,r){return t instanceof a?t:new a(e,{pub:t,pubEnc:r})},a.fromPrivate=function(e,t,r){return t instanceof a?t:new a(e,{priv:t,privEnc:r})},a.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.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"}},a.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},a.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},a.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},a.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},a.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},a.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},a.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},a.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":129,"bn.js":130}],124:[function(e,t,r){var n=e("bn.js"),i=e("../utils"),a=i.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(a(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;if(0===e[t.place])return!1;for(var i=0,a=0,o=t.place;a<n;a++,o++)i<<=8,i|=e[o],i>>>=0;return!(i<=127)&&(t.place=o,i)}function f(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function c(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}t.exports=o,o.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;if(a+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(128&e[r.place])return!1;var f=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var c=u(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;if(128&e[r.place])return!1;var l=e.slice(r.place,c+r.place);if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}return this.r=new n(f),this.s=new n(l),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=f(t),r=f(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];c(n,t.length),(n=n.concat(t)).push(2),c(n,r.length);var a=n.concat(r),o=[48];return c(o,a.length),o=o.concat(a),i.encode(o,e)}},{"../utils":129,"bn.js":130}],125:[function(e,t,r){var n=e("hash.js"),i=e("../curves"),a=e("../utils"),o=a.assert,s=a.parseBytes,u=e("./key"),f=e("./signature");function c(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof c))return new c(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}t.exports=c,c.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),a=this.encodePoint(i),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),u=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:a})},c.prototype.verify=function(e,t,r){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(a)},c.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},c.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},c.prototype.makeSignature=function(e){return e instanceof f?e:new f(this,e)},c.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},c.prototype.decodePoint=function(e){var t=(e=a.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),i=a.intFromLE(r);return this.curve.pointFromY(i,n)},c.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(e){return a.intFromLE(e)},c.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../curves":121,"../utils":129,"./key":126,"./signature":127,"hash.js":173}],126:[function(e,t,r){var n=e("../utils"),i=n.assert,a=n.parseBytes,o=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=a(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=a(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},o(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),o(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},t.exports=s},{"../utils":129}],127:[function(e,t,r){var n=e("bn.js"),i=e("../utils"),a=i.assert,o=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(a(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=u},{"../utils":129,"bn.js":130}],128:[function(e,t,r){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"]]}}},{}],129:[function(e,t,r){var n=r,i=e("bn.js"),a=e("minimalistic-assert"),o=e("minimalistic-crypto-utils");n.assert=a,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n,i=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<i.length;n+=1)i[n]=0;var a=1<<t+1,o=e.clone();for(n=0;n<i.length;n++){var s,u=o.andln(a-1);o.isOdd()?(s=u>(a>>1)-1?(a>>1)-u:u,o.isubn(s)):s=0,i[n]=s,o.iushrn(1)}return i},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,f=t.andln(3)+a&3;3===u&&(u=-1),3===f&&(f=-1),o=1&u?3!==(n=e.andln(7)+i&7)&&5!==n||2!==f?u:-u:0,r[0].push(o),s=1&f?3!==(n=t.andln(7)+a&7)&&5!==n||2!==u?f:-f:0,r[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},{"bn.js":130,"minimalistic-assert":239,"minimalistic-crypto-utils":240}],130:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{buffer:38,dup:16}],131:[function(e,t,r){t.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",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"},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"}}},{}],132:[function(e,t,r){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}t.exports=n},{}],133:[function(e,t,r){t.exports=EvalError},{}],134:[function(e,t,r){t.exports=Error},{}],135:[function(e,t,r){t.exports=RangeError},{}],136:[function(e,t,r){t.exports=ReferenceError},{}],137:[function(e,t,r){t.exports=SyntaxError},{}],138:[function(e,t,r){t.exports=TypeError},{}],139:[function(e,t,r){t.exports=URIError},{}],140:[function(e,t,r){t.exports=Object},{}],141:[function(e,t,r){var n,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&m(e,"error",t,r)}(e,i,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function f(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,a,o,s;if(f(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"==typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}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 h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(a){n.once&&e.removeEventListener(t,i),r(a)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var f=u.length,c=b(u,f);for(r=0;r<f;++r)a(c[r],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return f(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return f(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,a,o;if(f(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,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[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},s.prototype.listenerCount=y,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],142:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("md5.js");t.exports=function(e,t,r,a){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=r/8,s=n.alloc(o),u=n.alloc(a||0),f=n.alloc(0);o>0||a>0;){var c=new i;c.update(f),c.update(e),t&&c.update(t),f=c.digest();var l=0;if(o>0){var d=s.length-o;l=Math.min(o,f.length),f.copy(s,d,0,l),o-=l}if(l<f.length&&a>0){var h=u.length-a,p=Math.min(a,f.length-l);f.copy(u,h,l,l+p),a-=p}}return f.fill(0),{key:s,iv:u}}},{"md5.js":209,"safe-buffer":291}],143:[function(e,t,r){var n=e("is-callable"),i=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o,s;arguments.length>=3&&(o=r),s=e,"[object Array]"===i.call(s)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,o):function(e,t,r){for(var n in e)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o)}},{"is-callable":191}],144:[function(e,t,r){
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* FoxHound Query Generation Library
|
|
5
4
|
* @license MIT
|
|
6
5
|
* @author Steven Velozo <steven@velozo.com>
|
|
7
6
|
*/
|
|
8
|
-
const n=e("./controller/Meadow-Endpoints-Controller-Base.js"),o=e("meadow");class a{constructor(t,r){if(this._Meadow=t,this.DAL=this._Meadow,this._Controller=!1,this._ControllerOptions="object"==typeof r?r:{},"object"!=typeof t)throw new Error("Meadow endpoints requires a valid Meadow DAL object as the first parameter of the constructor.");this._ControllerOptions.hasOwnProperty("ControllerInstance")?this._Controller=this._ControllerOptions.ControllerInstance:this._ControllerOptions.hasOwnProperty("ControllerClass")?this._Controller=new this._ControllerOptions.ControllerClass(this):this._Controller=new n(this),this.EndpointVersion=this._Controller.settings.MeadowEndpointVersion||"1.0",this.EndpointName=this.DAL.scope,this.EndpointPrefix=`/${this.EndpointVersion}/${this.EndpointName}`,this._EnabledBehaviorSets={Create:!0,Read:!0,Reads:!0,Update:!0,Delete:!0,Count:!0,Schema:!0,Validate:!0,New:!0},this._Endpoints={Create:e("./endpoints/create/Meadow-Endpoint-Create.js"),Creates:e("./endpoints/create/Meadow-Endpoint-BulkCreate.js"),Read:e("./endpoints/read/Meadow-Endpoint-Read.js"),ReadMax:e("./endpoints/read/Meadow-Endpoint-ReadMax.js"),Reads:e("./endpoints/read/Meadow-Endpoint-Reads.js"),ReadsBy:e("./endpoints/read/Meadow-Endpoint-ReadsBy.js"),ReadSelectList:e("./endpoints/read/Meadow-Endpoint-ReadSelectList.js"),ReadLiteList:e("./endpoints/read/Meadow-Endpoint-ReadLiteList.js"),ReadDistinctList:e("./endpoints/read/Meadow-Endpoint-ReadDistinctList.js"),Update:e("./endpoints/update/Meadow-Endpoint-Update.js"),Updates:e("./endpoints/update/Meadow-Endpoint-BulkUpdate.js"),Upsert:e("./endpoints/upsert/Meadow-Endpoint-Upsert.js"),Upserts:e("./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js"),UpsertsDetailed:e("./endpoints/upsert/Meadow-Endpoint-BulkUpsertDetailed.js"),Delete:e("./endpoints/delete/Meadow-Endpoint-Delete.js"),Undelete:e("./endpoints/delete/Meadow-Endpoint-Undelete.js"),Count:e("./endpoints/count/Meadow-Endpoint-Count.js"),CountBy:e("./endpoints/count/Meadow-Endpoint-CountBy.js"),Schema:e("./endpoints/schema/Meadow-Endpoint-Schema.js"),Validate:e("./endpoints/schema/Meadow-Endpoint-Validate.js"),New:e("./endpoints/schema/Meadow-Endpoint-New.js")}}get controller(){return this._Controller}set controller(e){this._Controller=e}setBehaviorEndpoint(e,t){return"function"==typeof t&&(this._Endpoints[e]=t),this}connectRoute(e,t,r,n,o){let a=`${this.EndpointPrefix}${r}`,i="string"==typeof o?o:"an unnamed custom behavior";this._Controller.log.trace(`...meadow-endpoints mapping a ${t} endpoint for scope ${this.DAL.scope} on route [${a}] which runs ${i}.`);try{e[t](a,n.bind(this._Controller))}catch(e){this._Controller.log.error(`...error mapping ${o} to method ${t} for scope ${this.DAL.scope} to route [${a}]: ${e}`,e.stack)}return!0}connectRoutes(e){this._Controller.log.trace(`Creating automatic meadow endpoints at prefix [${this.EndpointPrefix}] for scope ${this.DAL.scope}...`),this._EnabledBehaviorSets.Schema&&this.connectRoute(e,"get","/Schema",this._Endpoints.Schema,"the internal behavior _Endpoints.Schema"),this._EnabledBehaviorSets.New&&this.connectRoute(e,"get","/Schema/New",this._Endpoints.New,"the internal behavior _Endpoints.New"),this._EnabledBehaviorSets.Validate&&this.connectRoute(e,"postWithBodyParser","/Schema/Validate",this._Endpoints.Validate,"the internal behavior _Endpoints.Validate"),this._EnabledBehaviorSets.Create&&(this.connectRoute(e,"postWithBodyParser","",this._Endpoints.Create,"the internal behavior _Endpoints.Create"),this.connectRoute(e,"postWithBodyParser","s",this._Endpoints.Creates,"the internal behavior _Endpoints.Creates")),this._EnabledBehaviorSets.Read&&(this.connectRoute(e,"get","/Max/:ColumnName",this._Endpoints.ReadMax,"the internal behavior _Endpoints.ReadMax"),this.connectRoute(e,"get","/:IDRecord",this._Endpoints.Read,"the internal behavior _Endpoints.Read")),this._EnabledBehaviorSets.Reads&&(this.connectRoute(e,"get","s",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/By/:ByField/:ByValue",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/By/:ByField/:ByValue/:Begin/:Cap",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/FilteredTo/:Filter",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","Select",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","s/Lite",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Distinct/:Columns",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads")),this._EnabledBehaviorSets.Update&&(this.connectRoute(e,"putWithBodyParser","",this._Endpoints.Update,"the internal behavior _Endpoints.Update"),this.connectRoute(e,"putWithBodyParser","s",this._Endpoints.Updates,"the internal behavior _Endpoints.Updates"),this.connectRoute(e,"putWithBodyParser","/Upsert",this._Endpoints.Upsert,"the internal behavior _Endpoints.Upsert"),this.connectRoute(e,"putWithBodyParser","/Upserts",this._Endpoints.Upserts,"the internal behavior _Endpoints.Upserts"),this.connectRoute(e,"putWithBodyParser","/Upserts/Detailed",this._Endpoints.UpsertsDetailed,"the internal behavior _Endpoints.UpsertsDetailed")),this._EnabledBehaviorSets.Delete&&(this.connectRoute(e,"del","",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"del","/:IDRecord",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"get","/Undelete/:IDRecord",this._Endpoints.Undelete,"the internal behavior _Endpoints.Undelete")),this._EnabledBehaviorSets.Count&&(this.connectRoute(e,"get","s/Count",this._Endpoints.Count,"the internal behavior _Endpoints.Count"),this.connectRoute(e,"get","s/Count/By/:ByField/:ByValue",this._Endpoints.CountBy,"the internal behavior _Endpoints.CountBy"),this.connectRoute(e,"get","s/Count/FilteredTo/:Filter",this._Endpoints.Count,"the internal behavior _Endpoints.Count"))}}t.exports=a,t.exports.new=function(e,t){return new a(e,t)},t.exports.Meadow=o,t.exports.BaseController=n},{"./controller/Meadow-Endpoints-Controller-Base.js":2,"./endpoints/count/Meadow-Endpoint-Count.js":9,"./endpoints/count/Meadow-Endpoint-CountBy.js":10,"./endpoints/create/Meadow-Endpoint-BulkCreate.js":11,"./endpoints/create/Meadow-Endpoint-Create.js":12,"./endpoints/delete/Meadow-Endpoint-Delete.js":14,"./endpoints/delete/Meadow-Endpoint-Undelete.js":15,"./endpoints/read/Meadow-Endpoint-Read.js":16,"./endpoints/read/Meadow-Endpoint-ReadDistinctList.js":17,"./endpoints/read/Meadow-Endpoint-ReadLiteList.js":18,"./endpoints/read/Meadow-Endpoint-ReadMax.js":19,"./endpoints/read/Meadow-Endpoint-ReadSelectList.js":20,"./endpoints/read/Meadow-Endpoint-Reads.js":21,"./endpoints/read/Meadow-Endpoint-ReadsBy.js":22,"./endpoints/schema/Meadow-Endpoint-New.js":25,"./endpoints/schema/Meadow-Endpoint-Schema.js":26,"./endpoints/schema/Meadow-Endpoint-Validate.js":27,"./endpoints/update/Meadow-Endpoint-BulkUpdate.js":28,"./endpoints/update/Meadow-Endpoint-Update.js":29,"./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js":31,"./endpoints/upsert/Meadow-Endpoint-BulkUpsertDetailed.js":32,"./endpoints/upsert/Meadow-Endpoint-Upsert.js":33,meadow:137}],2:[function(e,t,r){e("async/waterfall");const n=e("./components/Meadow-Endpoints-Controller-Log.js"),o=e("./components/Meadow-Endpoints-Controller-Error.js"),a=e("./components/Meadow-Endpoints-Controller-BehaviorInjection.js"),i=e("./utility/Meadow-Endpoints-Filter-Parser.js"),u=e("./utility/Meadow-Endpoints-Session-Marshaler.js"),s=e("./utility/Meadow-Endpoints-Stream-RecordArray.js");t.exports=class{constructor(e){this.DAL=e.DAL,this.ControllerOptions=e._ControllerOptions,this._Settings=null,this._LogController=null,this._BehaviorInjectionController=null,this._ErrorController=null,this.waterfall=this.DAL.fable.Utility.waterfall,this.eachLimit=this.DAL.fable.Utility.eachLimit,this.extend=this.DAL.fable.Utility.extend,this.initializeDefaultUnsetControllers(this),this._FilterParser=new i(this),this._SessionMarshaler=new u(this),this._StreamRecordArray=new s(this)}initializeDefaultUnsetControllers(e){this._Settings||(this._Settings=e.DAL.fable.settings),this._Settings.hasOwnProperty("MeadowEndpointsDefaultSessionObject")||(this._Settings.MeadowEndpointsDefaultSessionObject={CustomerID:0,SessionID:"0x0000",DeviceID:"Unset",UserID:0,UserRole:"None",UserRoleIndex:0,LoggedIn:!1}),this._LogController||(this._LogController=new n(e)),this._BehaviorInjectionController||(this._BehaviorInjectionController=new a(e)),this._ErrorController||(this._ErrorController=new o(e))}initializeRequestState(e,t){let r={};return r.Verb="string"==typeof t?t:"Unnamed_Custom_Behavior",r.SessionData=this.getSessionData(e),r}cloneAsyncSafeRequestState(e,t){let r={ParentRequestState:e,SessionData:e.SessionData};return r.Verb="string"==typeof t?t:e.Verb,r}_BeginDataRequestFunction(e,t,r){return r()}beginMeadowRequest(e,t,r){this._BeginDataRequestFunction(e,t,r)}_EndDataRequestFunction(e,t,r){return r()}endMeadowRequest(e,t,r){this._EndDataRequestFunction(e,t,r)}get settings(){return this._Settings}set settings(e){this._Settings=e}get log(){return this._LogController}set log(e){this._LogController=e}get BehaviorInjection(){return this._BehaviorInjectionController}set BehaviorInjection(e){this._BehaviorInjectionController=e}get ErrorHandler(){return this._ErrorController}set ErrorHandler(e){this._ErrorController=e}parseFilter(e,t){return this._FilterParser.parseFilter(e,t)}doStreamRecordArray(e,t,r){return this._StreamRecordArray.streamRecordArray(e,t,r)}getSessionData(e){return this._SessionMarshaler.getSessionData(e)}},t.exports.BaseErrorController=o,t.exports.BaseBehaviorInjectionController=a,t.exports.BaseFilterParser=i,t.exports.BaseSessionMarshaler=u,t.exports.BaseStreamRecordArray=s},{"./components/Meadow-Endpoints-Controller-BehaviorInjection.js":3,"./components/Meadow-Endpoints-Controller-Error.js":4,"./components/Meadow-Endpoints-Controller-Log.js":5,"./utility/Meadow-Endpoints-Filter-Parser.js":6,"./utility/Meadow-Endpoints-Session-Marshaler.js":7,"./utility/Meadow-Endpoints-Stream-RecordArray.js":8,"async/waterfall":52}],3:[function(e,t,r){const n=e("underscore");t.exports=class{constructor(e){this._Controller=e,this.template=n.template,this._BehaviorFunctions={},this._Templates={},this._TemplateFunctions={}}setBehavior(e,t){this._BehaviorFunctions[e]=t}runBehavior(e,t,r,n,o){if(this._BehaviorFunctions.hasOwnProperty(e))try{return this._BehaviorFunctions[e].call(t,r,n,o)}catch(e){return o(e)}return o()}getTemplate(e){return!!this._Templates.hasOwnProperty(e)&&this._Templates[e]}setTemplate(e,t){this._Templates[e]=t,this._TemplateFunctions[e]=this.template(t)}getTemplateFunction(e){return!!this._TemplateFunctions.hasOwnProperty(e)&&this._TemplateFunctions[e]}processTemplate(e,t,r){var n=this.getTemplateFunction(e),o=void 0===t?{}:t;return!1===n&&(this.setTemplate(e,void 0===r?"":r),n=this.getTemplateFunction(e)),n(o)}}},{underscore:216}],4:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getError(e,t,r){const n=new Error(e);return n.StatusCode="number"==typeof t?t:400,n.SuppressSoftwareTrace=void 0===r||r,n}handleErrorIfSet(e,t,r,n,o){return n?this.sendError(e,t,r,n,o):o()}sendError(e,t,r,n,o){if(this._Controller.log.logRequestError(e,t,n),!this._Controller.ControllerOptions.SendErrorStatusCodes){let e=n.hasOwnProperty("StatusCode")?n.StatusCode:500;r.status(e)}let a={Error:n.message,StatusCode:n.StatusCode};a=this._Controller.ErrorHandler.prepareRequestContextOutputObject(a,e,t,n),r.send(a),o(n)}prepareRequestContextOutputObject(e,t,r,n){if(n&&(e.Error=n.message,e.Code=n.code,e.StatusCode=n.StatusCode,n.SuppressSoftwareTrace||(e.Stack=n.stack),r.hasOwnProperty("Record")&&(e.Record=r.Record),r.hasOwnProperty("Query")&&"object"==typeof r.Query&&r.Query.query&&("string"==typeof r.Query.query.body&&(e.Query=r.Query.query.body),"object"==typeof r.Query.query.parameters))){e.QueryParameters=r.Query.query.parameters,e.RebuiltQueryString="string"==typeof e.Query?e.Query:"";let t=Object.keys(e.QueryParameters);for(let r=0;r<t.length;r++)if("number"==typeof t[r])e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),`'${e.QueryParameters[t[r]]}'`);else e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),e.QueryParameters[t[r]])}return e}}},{}],5:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}prepareLogData(e,t,r){return t.hasOwnProperty("Record")&&(t.Record.hasOwnProperty(this._Controller.DAL.defaultIdentifier)&&(r[this._Controller.DAL.defaultIdentifier]=t.Record[this._Controller.DAL.defaultIdentifier]),t.Record.hasOwnProperty(this._Controller.DAL.defaultGUIdentifier)&&(r[this._Controller.DAL.defaultGUIdentifier]=t.Record[this._Controller.DAL.defaultGUIdentifier])),t.hasOwnProperty("UpdatedRecords")&&(r.UpdatedRecordCount=t.UpdatedRecords.length),t.hasOwnProperty("CreatedRecords")&&(r.UpdatedRecordCount=t.CreatedRecords.length),t.hasOwnProperty("UpsertedRecords")&&(r.UpdatedRecordCount=t.UpsertedRecords.length),r}requestCompletedSuccessfully(e,t,r){let n={SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb};this._Controller.log.info(r,this.prepareLogData(e,t,n))}logRequestError(e,t,r){let n={SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb};n=this._Controller.ErrorHandler.prepareRequestContextOutputObject(n,e,t,r),this._Controller.log.error(r.message,this.prepareLogData(e,t,n))}trace(e,t){this._Controller.DAL.log.trace(e,t)}debug(e,t){this._Controller.DAL.log.debug(e,t)}info(e,t){this._Controller.DAL.log.info(e,t)}warn(e,t){this._Controller.DAL.log.warn(e,t)}error(e,t){this._Controller.DAL.log.error(e,t)}fatal(e,t){this._Controller.DAL.log.fatal(e,t)}}},{}],6:[function(e,t,r){
|
|
7
|
+
const n=e("./Parameters.js");t.exports=function t(r,i){if("object"!=typeof r||!("fable"in r))return{new:t};var a=r,o=void 0===i?{}:i,s=!1,u=e("./Foxhound-Dialects.js"),f=a.getUUID(),c=0,l=!1,d=function(){return(s=a.Utility.extend({},n,o)).query={disableAutoIdentity:!1,disableAutoDateStamp:!1,disableAutoUserStamp:!1,disableDeleteTracking:!1,body:!1,schema:!1,IDUser:0,UUID:a.getUUID(),records:!1,parameters:{}},s.result={executed:!1,value:!1,error:void 0},this};d();var h=function(e,t,r,n){if("string"!=typeof e)return a.log.warn("Tried to add an invalid query join table",{queryUUID:f,parameters:s}),this;if(void 0===t||void 0===r)return a.log.warn("Tried to add an invalid query join field",{queryUUID:f,parameters:s}),this;if(0!=t.indexOf(e))return a.log.warn("Tried to add an invalid query join field, join must come FROM the join table!",{queryUUID:f,parameters:s,invalidField:t}),this;if(r.indexOf(".")<=0)return a.log.warn("Tried to add an invalid query join field, join must go TO a field on another table ([table].[field])!",{queryUUID:f,parameters:s,invalidField:r}),this;var i={Type:void 0===n?"INNER JOIN":n,Table:e,From:t,To:r};return Array.isArray(s.join)?s.join.push(i):s.join=[i],c>2&&a.log.info("Added a join",{queryUUID:f,parameters:s}),this},p=function(e){return"string"!=typeof e?(a.log.warn("Dialect set to English - invalid name",{queryUUID:f,parameters:s,invalidDialect:e}),p("English")):(u.hasOwnProperty(e)?(l=u[e](a),c>2&&a.log.info("Dialog set to: "+e,{queryUUID:f,parameters:s})):(a.log.error('Dialect not set - unknown dialect "'+e+"'",{queryUUID:f,parameters:s,invalidDialect:e}),p("English")),this)},y=function(){!1===l&&p("English")},b={resetParameters:d,mergeParameters:function(e){return s=a.Utility.extend({},s,e),this},setLogLevel:function(e){var t=0;return"number"==typeof e&&e%1==0&&(t=e),c=t,this},setScope:function(e){var t=!1;return"string"==typeof e?t=e:!1!==e&&a.log.error("Scope set failed. You must pass in a string or array.",{queryUUID:f,parameters:s,invalidScope:e}),s.scope=t,c>2&&a.log.info("Scope set: "+t,{queryUUID:f,parameters:s}),this},setDistinct:function(e){return s.distinct=!!e,c>2&&a.log.info("Distinct set: "+s.distinct,{queryUUID:f,parameters:s}),this},setIDUser:function(e){var t=0;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("User set failed; non-positive or non-numeric argument.",{queryUUID:f,parameters:s,invalidIDUser:e}),s.userID=t,s.query.IDUser=t,c>2&&a.log.info("IDUser set to: "+t,{queryUUID:f,parameters:s}),this},setDataElements:function(e){var t=!1;return Array.isArray(e)&&(t=e),"string"==typeof e&&(t=[e]),s.dataElements=t,c>2&&a.log.info("Data Elements set",{queryUUID:f,parameters:s}),this},setBegin:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("Begin set failed; non-positive or non-numeric argument.",{queryUUID:f,parameters:s,invalidBeginAmount:e}),s.begin=t,c>2&&a.log.info("Begin set: "+e,{queryUUID:f,parameters:s}),this},setCap:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("Cap set failed; non-positive or non-numeric argument.",{queryUUID:f,parameters:s,invalidCapAmount:e}),s.cap=t,c>2&&a.log.info("Cap set to: "+t,{queryUUID:f,parameters:s}),this},setFilter:function(e){var t=!1;return Array.isArray(e)?t=e:"object"==typeof e&&(t=[e]),s.filter=t,c>2&&a.log.info("Filter set",{queryUUID:f,parameters:s}),this},addFilter:function(e,t,r,n,i){if("string"!=typeof e)return a.log.warn("Tried to add an invalid query filter column",{queryUUID:f,parameters:s}),this;if(void 0===t)return a.log.warn("Tried to add an invalid query filter value",{queryUUID:f,parameters:s,invalidColumn:e}),this;var o=void 0===i?e:i,u={Column:e,Operator:void 0===r?"=":r,Value:t,Connector:void 0===n?"AND":n,Parameter:o=o.replace(".","_")};return Array.isArray(s.filter)?s.filter.push(u):s.filter=[u],c>2&&a.log.info("Added a filter",{queryUUID:f,parameters:s,newFilter:u}),this},setSort:function(e){var t=!1;return Array.isArray(e)?t=e:"string"==typeof e?t=[{Column:e,Direction:"Ascending"}]:"object"==typeof e&&(t=[e]),s.sort=t,c>2&&a.log.info("Sort set",{queryUUID:f,parameters:s}),this},addSort:function(e){var t=!1;return"string"==typeof e&&(t={Column:e,Direction:"Ascending"}),"object"==typeof e&&(t=e),s.sort||(s.sort=[]),s.sort.push(t),c>2&&a.log.info("Sort set",{queryUUID:f,parameters:s}),this},setJoin:function(e){return s.join=[],Array.isArray(e)?e.forEach(function(e){h(e.Table,e.From,e.To,e.Type)}):"object"==typeof e&&h(e.Table,e.From,e.To,e.Type),this},addJoin:h,addRecord:function(e){return"object"!=typeof e?(a.log.warn("Tried to add an invalid record to the query -- records must be an object",{queryUUID:f,parameters:s}),this):(Array.isArray(s.query.records)?s.query.records.push(e):s.query.records=[e],c>2&&a.log.info("Added a record to the query",{queryUUID:f,parameters:s,newRecord:e}),this)},setDisableAutoIdentity:function(e){return s.query.disableAutoIdentity=e,this},setDisableAutoDateStamp:function(e){return s.query.disableAutoDateStamp=e,this},setDisableAutoUserStamp:function(e){return s.query.disableAutoUserStamp=e,this},setDisableDeleteTracking:function(e){return s.query.disableDeleteTracking=e,this},setDialect:p,buildCreateQuery:function(){return y(),s.query.body=l.Create(s),this},buildReadQuery:function(){return y(),s.query.body=l.Read(s),this},buildUpdateQuery:function(){return y(),s.query.body=l.Update(s),this},buildDeleteQuery:function(){return y(),s.query.body=l.Delete(s),this},buildUndeleteQuery:function(){return y(),s.query.body=l.Undelete(s),this},buildCountQuery:function(){return y(),s.query.body=l.Count(s),this},clone:function(){var e=t(a,n).setScope(s.scope).setBegin(s.begin).setCap(s.cap);return e.query.schema=s.query.schema,s.dataElements&&(e.parameters.dataElements=s.dataElements.slice()),s.sort&&(e.parameters.sort=s.sort.slice()),s.filter&&(e.parameters.filter=s.filter.slice()),e},new:t};return Object.defineProperty(b,"query",{get:function(){return s.query},set:function(e){s.query=e},enumerable:!0}),Object.defineProperty(b,"indexHints",{get:function(){return s.indexHints},set:function(e){s.indexHints=e},enumerable:!0}),Object.defineProperty(b,"result",{get:function(){return s.result},set:function(e){s.result=e},enumerable:!0}),Object.defineProperty(b,"parameters",{get:function(){return s},set:function(e){s=e},enumerable:!0}),Object.defineProperty(b,"dialect",{get:function(){return l},enumerable:!0}),Object.defineProperty(b,"uuid",{get:function(){return f},enumerable:!0}),Object.defineProperty(b,"logLevel",{get:function(){return c},enumerable:!0}),b}()},{"./Foxhound-Dialects.js":145,"./Parameters.js":146}],145:[function(e,t,r){t.exports=(()=>{let t={};return t.English=e("./dialects/English/FoxHound-Dialect-English.js"),t.SQLite=e("./dialects/SQLite/FoxHound-Dialect-SQLite.js"),t.ALASQL=e("./dialects/ALASQL/FoxHound-Dialect-ALASQL.js"),t.MeadowEndpoints=e("./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js"),t.MySQL=e("./dialects/MySQL/FoxHound-Dialect-MySQL.js"),t.MSSQL=e("./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js"),t.PostgreSQL=e("./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js"),t.MongoDB=e("./dialects/MongoDB/FoxHound-Dialect-MongoDB.js"),t.DGraph=e("./dialects/DGraph/FoxHound-Dialect-DGraph.js"),t.Solr=e("./dialects/Solr/FoxHound-Dialect-Solr.js"),t.default=t.English,t})()},{"./dialects/ALASQL/FoxHound-Dialect-ALASQL.js":147,"./dialects/DGraph/FoxHound-Dialect-DGraph.js":148,"./dialects/English/FoxHound-Dialect-English.js":149,"./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js":150,"./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js":151,"./dialects/MongoDB/FoxHound-Dialect-MongoDB.js":152,"./dialects/MySQL/FoxHound-Dialect-MySQL.js":153,"./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js":154,"./dialects/SQLite/FoxHound-Dialect-SQLite.js":155,"./dialects/Solr/FoxHound-Dialect-Solr.js":156}],146:[function(e,t,r){t.exports={scope:!1,dataElements:!1,begin:!1,cap:!1,filter:!1,sort:!1,join:!1,queryOverride:!1,query:!1,indexHints:!1,userID:0,result:!1}},{}],147:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){return" "+e.scope},n=(e,t)=>{if(e.indexOf(".")<0)return"`"+e+"`";var r=t.scope;return e.indexOf(r+".")>-1?"`"+e.replace(r+".","")+"`":"`"+e+"`"},i=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){if(!t)return" *";const r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length<1)return"";const n=r.find(e=>"AutoIdentity"===e.Type);return n?` ${n.Column}`:""}for(var i=" ",a=0;a<r.length;a++)a>0&&(i+=", "),i+=n(r[a],e);return i},a=function(e){var t=Array.isArray(e.filter)?e.filter:[],i=r(e).trim();if(!e.query.disableDeleteTracking)for(var a=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<a.length;o++){var s=a[o];if("Deleted"===s.Type){var u=!1;if(t.length>0)for(var f=0;f<t.length;f++)if(t[f].Column===s.Column){u=!0;break}u||t.push({Column:i+"."+s.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",l=!1;for(o=0;o<t.length;o++){var d;"NONE"!=t[o].Connector&&")"!=t[o].Operator&&" WHERE"!=c&&0==l&&(c+=" "+t[o].Connector),l=!1,"("===t[o].Operator?(c+=" (",l=!0):")"===t[o].Operator?c+=" )":"IN"===t[o].Operator?(d=t[o].Parameter+"_w"+o,c+=" "+n(t[o].Column,e)+" "+t[o].Operator+" ( :"+d+" )",e.query.parameters[d]=t[o].Value):"IS NOT NULL"===t[o].Operator?c+=" "+n(t[o].Column,e)+" "+t[o].Operator:(d=t[o].Parameter+"_w"+o,c+=" "+n(t[o].Column,e)+" "+t[o].Operator+" :"+d,e.query.parameters[d]=t[o].Value)}return c},o={Create:function(e){var t=r(e),i=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],i="";for(var a in t[0]){for(var o={Column:a,Type:"Default"},s=0;s<r.length;s++)if(a==r[s].Column){o=r[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)switch(o.Type){case"JSON":""!=i&&(i+=","),i+=" "+a;break;case"JSONProxy":""!=i&&(i+=","),i+=" "+o.StorageColumn;break;default:""!=i&&(i+=","),i+=" "+n(a,e)}}return i}(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],n="",i=0;for(var a in t[0]){for(var o={Column:a,Type:"Default"},s=0;s<r.length;s++)if(a==r[s].Column){o=r[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type){i>0&&(n+=",");var u,f=function(){var r=a+"_"+i;n+=" :"+r,e.query.parameters[r]=t[0][a]};switch(o.Type){case"AutoIdentity":e.query.disableAutoIdentity?f():n+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?f():(n+=" :"+(u=a+"_"+i),e.query.parameters[u]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?f():n+=" NOW()";break;case"UpdateIDUser":case"CreateIDUser":case"DeleteIDUser":e.query.disableAutoUserStamp?f():(n+=" :"+(u=a+"_"+i),e.query.parameters[u]=e.query.IDUser);break;case"JSON":var c=a+"_"+i;n+=" :"+c,e.query.parameters[c]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;case"JSONProxy":var l=a+"_"+i;n+=" :"+l,e.query.parameters[l]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;default:f()}i++}}return""!==n&&n}(e);return!!a&&"INSERT INTO"+t+" ("+i+") VALUES ("+a+");"},Read:function(e){var o=i(e),s=r(e),u=a(e),f=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",i=0;i<t.length;i++)i>0&&(r+=","),r+=" "+n(t[i].Column,e),"Descending"==t[i].Direction&&(r+=" DESC");return r}(e),c=function(e){if(!e.cap)return"";var t=" LIMIT";return t+=" "+e.cap,!1!==e.begin&&(t+=" FETCH "+e.begin),t}(e);const l=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:o,TableName:s,Where:u,OrderBy:f,Limit:c,Distinct:l,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${l}${o} FROM${s}${u}${f}${c};`},Update:function(e){var t=r(e),i=a(e),o=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in t[0]){for(var s={Column:o,Type:"Default"},u=0;u<r.length;u++)if(o==r[u].Column){s=r[u];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==s.Type){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(i+=","),s.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var f=o+"_"+a;i+=" "+n(o,e)+" = :"+f,e.query.parameters[f]=t[0][o]}else i+=" "+n(o,e)+" = NOW()";break;case"UpdateIDUser":f=o+"_"+a,i+=" "+n(o,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;case"JSON":var c=o+"_"+a;i+=" "+o+" = :"+c,e.query.parameters[c]="string"==typeof t[0][o]?t[0][o]:JSON.stringify(t[0][o]||{});break;case"JSONProxy":var l=s.StorageColumn+"_"+a;i+=" "+s.StorageColumn+" = :"+l,e.query.parameters[l]="string"==typeof t[0][o]?t[0][o]:JSON.stringify(t[0][o]||{});break;default:var d=o+"_"+a;i+=" "+n(o,e)+" = :"+d,e.query.parameters[d]=t[0][o]}a++}}return""!==i&&i}(e);return!!o&&"UPDATE"+t+" SET"+o+i+";"},Delete:function(e){var t=r(e),i=a(e),o=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,i=!1,a="",o={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((o=t[s]).Type){case"Deleted":u=" "+n(o.Column,e)+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":u=" "+n(o.Column,e)+" = NOW()";break;case"DeleteIDUser":var f=o.Column+"_"+r;u=" "+n(o.Column,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=u,r++}return!(!i||""===a)&&a}(e);return o?"UPDATE"+t+" SET"+o+i+";":"DELETE FROM"+t+i+";"},Undelete:function(e){var t=r(e);let i=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var o=a(e),s=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,i=!1,a="",o={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((o=t[s]).Type){case"Deleted":u=" "+n(o.Column,e)+" = 0",i=!0;break;case"UpdateDate":u=" "+n(o.Column,e)+" = NOW()";break;case"UpdateIDUser":var f=o.Column+"_"+r;u=" "+n(o.Column,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=u,r++}return!(!i||""===a)&&a}(e);return e.query.disableDeleteTracking=i,s?"UPDATE"+t+" SET"+s+o+";":"SELECT NULL;"},Count:function(e){var n=r(e),o=a(e);const s=e.distinct?i(e,!0):"*";e.distinct&&s.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const u=e.distinct&&s.length>0?"DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:[],TableName:n,Where:o,OrderBy:"",Limit:"",Distinct:u,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${u}${s||"*"}) AS RowCount FROM${n}${o};`}};return Object.defineProperty(o,"name",{get:function(){return"ALASQL"},enumerable:!0}),o}},{}],148:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},i=function(e){if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(i(e[r]));return"["+t.join(", ")+"]"}return"number"==typeof e?String(e):"boolean"==typeof e?e?"true":"false":'"'+String(e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},a=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":default:return"eq("+t+", "+i(n)+")";case"!=":return"NOT eq("+t+", "+i(n)+")";case">":return"gt("+t+", "+i(n)+")";case">=":return"ge("+t+", "+i(n)+")";case"<":return"lt("+t+", "+i(n)+")";case"<=":return"le("+t+", "+i(n)+")";case"LIKE":return"regexp("+t+", /"+String(n).replace(/%/g,".*").replace(/_/g,".")+"/i)";case"IN":var a=Array.isArray(n)?n:[n];return"eq("+t+", "+i(a)+")";case"NOT IN":var o=Array.isArray(n)?n:[n];return"NOT eq("+t+", "+i(o)+")";case"IS NULL":return"NOT has("+t+")";case"IS NOT NULL":return"has("+t+")"}},o=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],i=0;i<n.length;i++)if("Deleted"===n[i].Type){for(var o=!1,s=0;s<t.length;s++)if(r(t[s].Column)===n[i].Column){o=!0;break}o||t.push({Column:n[i].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return"";var u=[[]];for(i=0;i<t.length;i++){var f=t[i];if("("===f.Operator)u.push([]);else if(")"===f.Operator){for(var c=u.pop(),l=!1,d=0;d<c.length;d++)if("OR"===c[d].connector){l=!0;break}for(var h="",p=0;p<c.length;p++)p>0&&(h+=l?" OR ":" AND "),h+=c[p].text;u[u.length-1].push({text:"("+h+")",connector:f.Connector||"AND"})}else u[u.length-1].push({text:a(f),connector:f.Connector||"AND"})}var y=u[0];if(0===y.length)return"";for(var b="",m=0;m<y.length;m++)m>0&&(b+=" "+y[m].connector+" "),b+=y[m].text;return" @filter("+b+")"},s=function(e,t,r){var n=["func: type("+e+")"];return t&&n.push(t),r&&n.push(r),n.join(", ")},u={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)switch(o.Type){case"AutoIdentity":e.query.disableAutoIdentity?i[a]=t[0][a]:i[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?i[a]=t[0][a]:i[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?i[a]=t[0][a]:i[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?i[a]=t[0][a]:i[a]=e.query.IDUser;break;case"Deleted":i[a]=0;break;default:i[a]=t[0][a]}}return 0!==Object.keys(i).length&&i}(e);if(!t)return!1;t["dgraph.type"]=e.scope;for(var r=!1,i=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<i.length;a++)if("AutoIdentity"===i[a].Type&&!e.query.disableAutoIdentity){r=e.scope+"."+i[a].Column;break}var o={type:e.scope,operation:"mutate",mutationType:"set",document:t};return r&&(o.counterScope=r),e.query.parameters.dgraphOperation=o,JSON.stringify(o)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("DGraph dialect does not support JOINs; join parameter will be ignored.");var n=o(e),i=function(e){var t=["uid"],n=e.dataElements;if(Array.isArray(n)&&n.length>0)for(var i=0;i<n.length;i++){var a=n[i];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&t.indexOf(a)<0&&t.push(a)}else for(var o=Array.isArray(e.query.schema)?e.query.schema:[],s=0;s<o.length;s++){var u=o[s].Column;t.indexOf(u)<0&&t.push(u)}return 1===t.length&&t.push("dgraph.type"),t.join(" ")}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var n=[],i=0;i<t.length;i++){var a=r(t[i].Column),o="Descending"===t[i].Direction?"orderdesc":"orderasc";n.push(o+": "+a)}return n.join(", ")}(e),u=function(e){var t=[];return e.cap&&t.push("first: "+e.cap),!1!==e.begin&&e.begin>0&&t.push("offset: "+e.begin),t.join(", ")}(e),f="{ results("+s(e.scope,u,a)+")"+n+" { "+i+" } }",c={type:e.scope,operation:"query",query:f,queryName:"results"};return e.distinct&&(c.distinct=!0),e.query.parameters.dgraphOperation=c,JSON.stringify(c)},Update:function(e){var t=o(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==o.Type){switch(o.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o.Type){case"UpdateDate":e.query.disableAutoDateStamp?i[a]=t[0][a]:i[a]="$$NOW";break;case"UpdateIDUser":i[a]=e.query.IDUser;break;default:i[a]=t[0][a]}}}return 0!==Object.keys(i).length&&i}(e);if(!r)return!1;var i="{ updateTargets("+s(e.scope,"","")+")"+t+" { uid } }",a={type:e.scope,operation:"upsert",queryForUIDs:i,queryName:"updateTargets",update:r};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]=1,r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]="$$NOW";break;case"DeleteIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=o(e),n="{ deleteTargets("+s(e.scope,"","")+")"+r+" { uid } }";if(t){var i={type:e.scope,operation:"upsert",queryForUIDs:n,queryName:"deleteTargets",update:t};return e.query.parameters.dgraphOperation=i,JSON.stringify(i)}var a={type:e.scope,operation:"delete",queryForUIDs:n,queryName:"deleteTargets"};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]=0,r=!0;break;case"UpdateDate":n[a.Column]="$$NOW";break;case"UpdateIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=o(e);if(e.query.disableDeleteTracking=r,t){var i="{ undeleteTargets("+s(e.scope,"","")+")"+n+" { uid } }",a={type:e.scope,operation:"upsert",queryForUIDs:i,queryName:"undeleteTargets",update:t};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)}var u={type:e.scope,operation:"noop"};return e.query.parameters.dgraphOperation=u,JSON.stringify(u)},Count:function(e){var t=o(e),n="{ results("+s(e.scope,"","")+")"+t+" { total: count(uid) } }",i={type:e.scope,operation:"query",query:n,queryName:"results",isCount:!0};if(e.distinct){i.distinct=!0;var a=e.dataElements;if(Array.isArray(a)&&a.length>0){for(var u=[],f=0;f<a.length;f++){var c=Array.isArray(a[f])?a[f][0]:a[f];"*"!==(c=r(c))&&u.push(c)}u.length>0&&(i.distinctFields=u)}else for(var l=Array.isArray(e.query.schema)?e.query.schema:[],d=0;d<l.length;d++)if("AutoIdentity"===l[d].Type){i.distinctFields=[l[d].Column];break}}return e.query.parameters.dgraphOperation=i,JSON.stringify(i)}};return Object.defineProperty(u,"name",{get:function(){return"DGraph"},enumerable:!0}),u}},{}],149:[function(e,t,r){t.exports=function(){var e={Create:function(e){return"Here is a "+e.scope+"."},Read:function(e){var t=e.scope;return`Please give me all your ${e.distinct?"unique ":""}${t} records. Thanks.`},Update:function(e){return"I am changing your "+e.scope+"."},Delete:function(e){return"I am deleting your "+e.scope+"."},Undelete:function(e){return"I am undeleting your "+e.scope+"."},Count:function(e){var t=e.scope;return`Count your ${e.distinct?"unique ":""}${t}.`}};return Object.defineProperty(e,"name",{get:function(){return"English"},enumerable:!0}),e}},{}],150:[function(e,t,r){t.exports=function(){var e=function(e){return e.scope},t=function(t){var r=Array.isArray(t.filter)?t.filter:[],i=(e(t),"");let a=(e,t)=>{i.length>0&&(i+="~"),i+=`${e}~${t[0]}~${t[1]}~${t[2]}`},o=e=>{let t="EQ";switch(e.toUpperCase()){case"!=":t="NE";break;case">":t="GT";break;case">=":t="GE";break;case"<=":t="LE";break;case"<":t="LT";break;case"LIKE":t="LK";break;case"IN":t="INN";break;case"NOT IN":t="NI"}return t};t.query.disableDeleteTracking&&a("FBV",["Deleted","GE","0"]);for(var s=0;s<r.length;s++)if("("===r[s].Operator)a("FOP",["0","(","0"]);else if(")"===r[s].Operator)a("FCP",["0",")","0"]);else if("IN"===r[s].Operator||"NOT IN"===r[s].Operator){let e="FBV";"OR"==r[s].Connector&&(e="FBVOR"),a(e,[r[s].Column,o(r[s].Operator),r[s].Value.map(encodeURIComponent).join(",")])}else if("IS NULL"===r[s].Operator)a("FBV",[r[s].Column,"IN","0"]);else if("IS NOT NULL"===r[s].Operator)a("FBV",[r[s].Column,"NN","0"]);else{let e="FBV";"OR"==r[s].Connector&&(e="FBVOR"),a(e,[r[s].Column,o(r[s].Operator),encodeURIComponent(r[s].Value)])}let u=n(t);return u&&(i&&(i+="~"),i+=u),i};function r(e){let t=e.query.disableAutoDateStamp,r=e.query.disableDeleteTracking,n=e.query.disableAutoIdentity,i=e.query.disableAutoUserStamp,a="",o=(e,t)=>{e&&(a.length>0&&(a+=","),a+=t)};return o(t,"DisableAutoDateStamp"),o(r,"DisableDeleteTracking"),o(n,"DisableAutoIdentity"),o(i,"DisableAutoUserStamp"),a}var n=function(e){var t=e.sort,r=null;if(!Array.isArray(t)||t.length<1)return r;r="";for(var n=0;n<t.length;n++)n>0&&(r+="~"),r+=`FSF~${t[n].Column}~`,"Descending"==t[n].Direction?r+="DESC~0":r+="ASC~0";return r},i={Create:function(t){var n=e(t),i=r(t);if(n){let e=n;return i&&(e=`${e}/WithFlags/${i}`),e}return!1},Read:function(r){var n=e(r),i=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++)n>0&&(r+=","),r+=t[n];return r}(r),a=t(r),o=function(e){return e.cap?`${!1!==e.begin?e.begin:0}/${e.cap}`:""}(r),s=`${n}`;return r.filter&&1==r.filter.length&&r.filter[0].Column===function(e){return`ID${e.scope}`}(r)&&"="===r.filter[0].Operator&&""==o&&""==i&&!r.sort?s=`${s}/${r.filter[0].Value}`:(s=`${s}s`,i&&(s=`${s}/LiteExtended/${i}`),a&&(s=`${s}/FilteredTo/${a}`),o&&(s=`${s}/${o}`)),s},Update:function(t){var n=e(t),i=r(t);if(n){let e=n;return i&&(e=`${e}/WithFlags/${i}`),e}return!1},Delete:function(t){var r=e(t),n=function(e){var t=Array.isArray(e.filter)?e.filter:[],r=!1;if(t.length<1)return r;for(var n=0;n<t.length;n++)for(var i=Array.isArray(e.query.schema)?e.query.schema:[],a=(t[n].Column,0);a<i.length;a++)if(t[n].Column==i[a].Column&&"AutoIdentity"==i[a].Type){r=t[n].Value;break}return r}(t);return!!n&&`${r}/${n}`},Count:function(r){var n=e(r),i=t(r);return i?`${n}s/Count/FilteredTo/${i}`:`${n}s/Count`}};return Object.defineProperty(i,"name",{get:function(){return"MeadowEndpoints"},enumerable:!0}),i}},{}],151:[function(e,t,r){t.exports=function(e){const t="GETUTCDATE()";let r=e;var n=function(e){return e.query.hasOwnProperty("parameterTypes")||(e.query.parameterTypes={})," ["+e.scope+"]"},i=function(e,t,n){e.query.hasOwnProperty("parameterTypes")||(e.query.parameterTypes={});let i="VarChar";if("object"==typeof n)i=n.Type;else if("string"==typeof n){var a=Array.isArray(e.query.schema)?e.query.schema:[];for(let e=0;e<a.length;e++)if(a[e].Column==n){i=a[e].Type;break}}else r.log.warn(`Meadow MSSQL query attempted to add a parameter type but no valid column schema entry object or column name was passed; parameter name ${t}.`);if(null==i||null==i)return!1;switch(i){case"AutoIdentity":case"CreateIDUser":case"UpdateIDUser":case"DeleteIDUser":case"Integer":e.query.parameterTypes[t]="Int";break;case"Deleted":case"Boolean":e.query.parameterTypes[t]="TinyInt";break;case"Decimal":e.query.parameterTypes[t]="Decimal";break;case"String":case"AutoGUID":e.query.parameterTypes[t]="VarChar";break;case"CreateDate":case"UpdateDate":case"DeleteDate":case"DateTime":e.query.parameterTypes[t]="DateTime";break;default:return e.query.parameterTypes[t]=i,!1}return!0},a=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const i=Array.isArray(e.query.schema)?e.query.schema:[];if(i.length<1)return"";const a=i.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const s=`${a.Column}`;return` ${o(s)}`}for(var i=" ",a=0;a<r.length;a++)a>0&&(i+=", "),Array.isArray(r[a])?(i+=o(r[a][0]),r[a].length>1&&r[a][1]&&(i+=" AS "+o(r[a][1]))):i+=o(r[a]);return i},o=function(e){return"*"!=e&&e.indexOf("[")<0&&e.indexOf(".")<0?"["+e+"]":e},s=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var i=r[n],a=0;a<t.length;a++){if(t[a].Column===i&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:i,path:"$."+r.slice(n+1).join(".")}}return null},u=function(e){var t=Array.isArray(e.filter)?e.filter:[];n(e);if(!e.query.disableDeleteTracking)for(var r=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<r.length;a++){var o=r[a];if("Deleted"===o.Type){var u=!1;if(t.length>0)for(var f=0;f<t.length;f++)if(t[f].Column===o.Column){u=!0;break}u||t.push({Column:o.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",l=!1;for(a=0;a<t.length;a++){var d;if("NONE"!=t[a].Connector&&")"!=t[a].Operator&&" WHERE"!=c&&0==l&&(c+=" "+t[a].Connector),l=!1,"("===t[a].Operator)c+=" (",l=!0;else if(")"===t[a].Operator)c+=" )";else if("IN"===t[a].Operator||"NOT IN"===t[a].Operator)d=t[a].Parameter+"_w"+a,c+=" ["+t[a].Column+"] "+t[a].Operator+" ( @"+d+" )",e.query.parameters[d]=t[a].Value,i(e,d,t[a].Parameter);else if("IS NULL"===t[a].Operator)c+=" ["+t[a].Column+"] "+t[a].Operator;else if("IS NOT NULL"===t[a].Operator)c+=" ["+t[a].Column+"] "+t[a].Operator;else{d=t[a].Parameter+"_w"+a;r=Array.isArray(e.query.schema)?e.query.schema:[];var h=s(t[a].Column,r);c+=h?" JSON_VALUE(["+h.column+"], '"+h.path+"') "+t[a].Operator+" :"+d:" ["+t[a].Column+"] "+t[a].Operator+" @"+d,e.query.parameters[d]=t[a].Value,i(e,d,t[a].Parameter)}}return c},f=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1){if(e.cap){var r=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0;r<t.length;r++)if("AutoIdentity"===t[r].Type)return t[r].Column;return null}(e);return r?" ORDER BY ["+r+"]":" ORDER BY (SELECT 1)"}return""}for(var n=" ORDER BY",i=0;i<t.length;i++)i>0&&(n+=","),n+=" ["+t[i].Column+"]","Descending"==t[i].Direction&&(n+=" DESC");return n},c=function(e){return!Array.isArray(e.indexHints)||e.indexHints.length<1?"":` WITH(INDEX(${e.indexHints.join(",")}))`},l=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var i=t[n];i.Type&&i.Table&&i.From&&i.To&&(r+=` ${i.Type} [${i.Table}] ON ${i.From} = ${i.To}`)}return r},d={Create:function(e){var r=n(e),a=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var i in t[0]){for(var a={Column:i,Type:"Default"},o=0;o<r.length;o++)if(i==r[o].Column){a=r[o];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"AutoIdentity":e.query.disableAutoIdentity&&(""!=n&&(n+=","),n+=" ["+i+"]");continue;case"JSON":default:""!=n&&(n+=","),n+=" ["+i+"]";break;case"JSONProxy":""!=n&&(n+=","),n+=" ["+a.StorageColumn+"]"}}return n}(e),o=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],a="",o=0;for(var s in r[0]){for(var u={Column:s,Type:"Default"},f=0;f<n.length;f++)if(s==n[f].Column){u=n[f];break}if(e.query.disableDeleteTracking||"DeleteDate"!==u.Type&&"DeleteIDUser"!==u.Type){o>0&&""!=a&&(a+=",");var c,l=function(){var t=s+"_"+o;a+=" @"+t,e.query.parameters[t]=r[0][s],i(e,t,u)};switch(u.Type){case"AutoIdentity":e.query.disableAutoIdentity&&l();break;case"AutoGUID":e.query.disableAutoIdentity||r[0][s]&&r[0][s].length>=5&&"0x0000000000000000"!==r[0][s]?l():(a+=" @"+(c=s+"_"+o),e.query.parameters[c]=e.query.UUID,i(e,c,u));break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?l():a+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?l():(a+=" @"+(c=s+"_"+o),e.query.parameters[c]=e.query.IDUser,i(e,c,u));break;case"JSON":var d=s+"_"+o;a+=" @"+d,e.query.parameters[d]="string"==typeof r[0][s]?r[0][s]:JSON.stringify(r[0][s]||{}),i(e,d,{Type:"String"});break;case"JSONProxy":var h=s+"_"+o;a+=" @"+h,e.query.parameters[h]="string"==typeof r[0][s]?r[0][s]:JSON.stringify(r[0][s]||{}),i(e,h,{Type:"String"});break;default:l()}o++}}return""!==a&&a}(e);return!!o&&"INSERT INTO"+r+" ("+a+") VALUES ("+o+");"},Read:function(e){var t=a(e),i=n(e),s=u(e),d=l(e),h=f(e),p=function(e){if(!e.cap)return"";if(e.legacyPagination)return"";var t=" OFFSET ";return!1!==e.begin?t+=e.begin:t+="0",t+` ROWS FETCH NEXT ${e.cap} ROWS ONLY`}(e),y=c(e);const b=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:i,Where:s,Join:d,OrderBy:h,Limit:p,IndexHints:y,Distinct:b,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}if(e.legacyPagination&&e.cap){var m=!1!==e.begin?e.begin:0,g=m+e.cap,v=h.replace(/^ /,""),w=function(e){var t=e.dataElements;if(Array.isArray(t)&&t.length>0)return a(e);var r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length>0){for(var n=" ",i=0;i<r.length;i++)i>0&&(n+=", "),n+=o(r[i].Column);return n}return" *"}(e);return`SELECT${b}${w} FROM (SELECT${t}, ROW_NUMBER() OVER (${v}) AS [_RowNum] FROM${i}${y}${d}${s}) AS [_Paged] WHERE [_RowNum] > ${m} AND [_RowNum] <= ${g};`}return`SELECT${b}${t} FROM${i}${y}${d}${s}${h}${p};`},Update:function(e){var r=n(e),a=u(e),o=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],a="",o=0;for(var s in r[0]){for(var u={Column:s,Type:"Default"},f=0;f<n.length;f++)if(s==n[f].Column){u=n[f];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==u.Type){switch(u.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o>0&&(a+=","),u.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var c="MANUAL_UpdateDate";a+=" ["+s+"] = @MANUAL_UpdateDate",e.query.parameters[c]=r[0][s],i(e,c,u)}else a+=" ["+s+"] = "+t;break;case"UpdateIDUser":a+=" ["+s+"] = @"+(c=s+"_"+o),e.query.parameters[c]=e.query.IDUser,i(e,c,s);break;case"JSON":var l=s+"_"+o;a+=" ["+s+"] = @"+l,e.query.parameters[l]="string"==typeof r[0][s]?r[0][s]:JSON.stringify(r[0][s]||{}),i(e,l,{Type:"String"});break;case"JSONProxy":var d=u.StorageColumn+"_"+o;a+=" ["+u.StorageColumn+"] = @"+d,e.query.parameters[d]="string"==typeof r[0][s]?r[0][s]:JSON.stringify(r[0][s]||{}),i(e,d,{Type:"String"});break;default:var h=s+"_"+o;a+=" ["+s+"] = @"+h,e.query.parameters[h]=r[0][s],i(e,h,u)}o++}}return""!==a&&a}(e);return!!o&&"UPDATE"+r+" SET"+o+a+";"},Delete:function(e){var r=n(e),a=u(e),o=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,a=!1,o="",s={Type:"Default"},u=0;u<r.length;u++){var f=null;switch((s=r[u]).Type){case"Deleted":f=" ["+s.Column+"] = 1",a=!0;break;case"DeleteDate":case"UpdateDate":f=" ["+s.Column+"] = "+t;break;case"DeleteIDUser":var c=s.Column+"_"+n;f=" ["+s.Column+"] = @"+c,e.query.parameters[c]=e.query.IDUser,i(e,c,s);break;default:continue}n>0&&(o+=","),o+=f,n++}return!(!a||""===o)&&o}(e);return o?"UPDATE"+r+" SET"+o+a+";":"DELETE FROM"+r+a+";"},Undelete:function(e){var r=n(e);let a=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var o=u(e),s=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,a=!1,o="",s={Type:"Default"},u=0;u<r.length;u++){var f=null;switch((s=r[u]).Type){case"Deleted":f=" ["+s.Column+"] = 0",a=!0;break;case"UpdateDate":f=" ["+s.Column+"] = "+t;break;case"UpdateIDUser":var c=s.Column+"_"+n;f=" ["+s.Column+"] = @"+c,e.query.parameters[c]=e.query.IDUser,i(e,c,s);break;default:continue}n>0&&(o+=","),o+=f,n++}return!(!a||""===o)&&o}(e);return e.query.disableDeleteTracking=a,s?"UPDATE"+r+" SET"+s+o+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?a(e,!0):"*",i=n(e),o=l(e),s=u(e),f=c(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const d=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:i,Where:s,OrderBy:"",IndexHints:f,Limit:"",Distinct:d,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${d}${t||"*"}) AS Row_Count FROM${i}${f}${o}${s};`}};return Object.defineProperty(d,"name",{get:function(){return"MSSQL"},enumerable:!0}),d}},{}],152:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},i=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":var i={};return i[t]=n,i;case"!=":var a={};return a[t]={$ne:n},a;case">":var o={};return o[t]={$gt:n},o;case">=":var s={};return s[t]={$gte:n},s;case"<":var u={};return u[t]={$lt:n},u;case"<=":var f={};return f[t]={$lte:n},f;case"LIKE":var c=String(n).replace(/%/g,".*").replace(/_/g,"."),l={};return l[t]={$regex:c,$options:"i"},l;case"IN":var d={};return d[t]={$in:Array.isArray(n)?n:[n]},d;case"NOT IN":var h={};return h[t]={$nin:Array.isArray(n)?n:[n]},h;case"IS NULL":var p={};return p[t]=null,p;case"IS NOT NULL":var y={};return y[t]={$ne:null},y;default:var b={};return b[t]=n,b}},a=function(e){if(!e||0===e.length)return{};if(1===e.length){var t=e[0];return delete t._connector,t}for(var r={},n=!1,i=0;i<e.length;i++){for(var a=Object.keys(e[i]),o=0;o<a.length;o++){var s=a[o];if("_connector"!==s){if("$"===s.charAt(0)){n=!0;break}if(r[s]){n=!0;break}r[s]=!0}}if(n)break}if(n){for(var u=[],f=0;f<e.length;f++){var c=e[f];delete c._connector,u.push(c)}return{$and:u}}for(var l={},d=0;d<e.length;d++)for(var h=e[d],p=Object.keys(h),y=0;y<p.length;y++)"_connector"!==p[y]&&(l[p[y]]=h[p[y]]);return l},o=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<n.length;o++)if("Deleted"===n[o].Type){for(var s=!1,u=0;u<t.length;u++)if(r(t[u].Column)===n[o].Column){s=!0;break}s||t.push({Column:n[o].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return{};var f=[[]];for(o=0;o<t.length;o++){var c=t[o];if("("===c.Operator)f.push([]);else if(")"===c.Operator){for(var l,d=f.pop(),h=!1,p=0;p<d.length;p++)if("OR"===d[p]._connector){h=!0;break}if(h){for(var y=[],b=0;b<d.length;b++)delete d[b]._connector,y.push(d[b]);l={$or:y}}else l=a(d);l._connector=c.Connector||"AND",f[f.length-1].push(l)}else{var m=i(c);m._connector=c.Connector||"AND",f[f.length-1].push(m)}}var g=f[0];return a(g)},s={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)switch(o.Type){case"AutoIdentity":e.query.disableAutoIdentity?i[a]=t[0][a]:i[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?i[a]=t[0][a]:i[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?i[a]=t[0][a]:i[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?i[a]=t[0][a]:i[a]=e.query.IDUser;break;case"Deleted":i[a]=0;break;default:i[a]=t[0][a]}}return 0!==Object.keys(i).length&&i}(e);if(!t)return!1;var r={collection:e.scope,operation:"insertOne",document:t};return e.query.parameters.mongoOperation=r,JSON.stringify(r)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("MongoDB dialect does not support JOINs; join parameter will be ignored.");var n=o(e),i=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return{};for(var n={},i=0;i<t.length;i++){var a=t[i];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&(n[a]=1)}return n}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return{};for(var n={},i=0;i<t.length;i++)n[r(t[i].Column)]="Descending"===t[i].Direction?-1:1;return n}(e),s={collection:e.scope,operation:"find",filter:n};return Object.keys(i).length>0&&(s.projection=i),Object.keys(a).length>0&&(s.sort=a),e.cap&&(s.limit=e.cap),!1!==e.begin&&e.begin>0&&(s.skip=e.begin),e.distinct&&(s.distinct=!0),e.query.parameters.mongoOperation=s,JSON.stringify(s)},Update:function(e){var t=o(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==o.Type){switch(o.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o.Type){case"UpdateDate":e.query.disableAutoDateStamp?i[a]=t[0][a]:i[a]="$$NOW";break;case"UpdateIDUser":i[a]=e.query.IDUser;break;default:i[a]=t[0][a]}}}return 0!==Object.keys(i).length&&i}(e);if(!r)return!1;var i={collection:e.scope,operation:"updateMany",filter:t,update:{$set:r}};return e.query.parameters.mongoOperation=i,JSON.stringify(i)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]=1,r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]="$$NOW";break;case"DeleteIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=o(e);if(t){var n={collection:e.scope,operation:"updateMany",filter:r,update:{$set:t}};return e.query.parameters.mongoOperation=n,JSON.stringify(n)}var i={collection:e.scope,operation:"deleteMany",filter:r};return e.query.parameters.mongoOperation=i,JSON.stringify(i)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]=0,r=!0;break;case"UpdateDate":n[a.Column]="$$NOW";break;case"UpdateIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=o(e);if(e.query.disableDeleteTracking=r,t){var i={collection:e.scope,operation:"updateMany",filter:n,update:{$set:t}};return e.query.parameters.mongoOperation=i,JSON.stringify(i)}var a={collection:e.scope,operation:"noop"};return e.query.parameters.mongoOperation=a,JSON.stringify(a)},Count:function(e){var t=o(e),n={collection:e.scope,operation:"countDocuments",filter:t};if(e.distinct){n.distinct=!0;var i=e.dataElements;if(Array.isArray(i)&&i.length>0){for(var a=[],s=0;s<i.length;s++){var u=Array.isArray(i[s])?i[s][0]:i[s];"*"!==(u=r(u))&&a.push(u)}a.length>0&&(n.distinctFields=a)}else for(var f=Array.isArray(e.query.schema)?e.query.schema:[],c=0;c<f.length;c++)if("AutoIdentity"===f[c].Type){n.distinctFields=[f[c].Column];break}}return e.query.parameters.mongoOperation=n,JSON.stringify(n)}};return Object.defineProperty(s,"name",{get:function(){return"MongoDB"},enumerable:!0}),s}},{}],153:[function(e,t,r){t.exports=function(e){const t="NOW(3)";let r=e;var n=function(e){return e.scope&&e.scope.indexOf("`")>=0?" "+e.scope:" `"+e.scope+"`"},i=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const i=Array.isArray(e.query.schema)?e.query.schema:[];if(i.length<1)return"";const a=i.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const o=`${r}.${a.Column}`;return` ${s(o)}`}for(var i=" ",a=0;a<r.length;a++)a>0&&(i+=", "),Array.isArray(r[a])?(i+=s(r[a][0]),r[a].length>1&&r[a][1]&&(i+=" AS "+s(r[a][1]))):i+=s(r[a]);return i};const a=/^[` ]+|[` ]+$/g,o=e=>e.replace(a,"");var s=function(e){let t=e.split(".");if(t.length>1){const e=o(t[1]);return"*"===e?"`"+o(t[0])+"`.*":"`"+o(t[0])+"`.`"+e+"`"}return"*"===o(t[0])?"*":"`"+o(t[0])+"`"},u=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var i=r[n],a=0;a<t.length;a++){if(t[a].Column===i&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:i,path:"$."+r.slice(n+1).join(".")}}return null},f=function(e){var t=Array.isArray(e.filter)?e.filter:[],r=n(e);if(!e.query.disableDeleteTracking)for(var i=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<i.length;a++){var o=i[a];if("Deleted"===o.Type){var s=!1;if(t.length>0)for(var f=0;f<t.length;f++)if(t[f].Column===o.Column){s=!0;break}s||t.push({Column:r+"."+o.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",l=!1;for(a=0;a<t.length;a++){var d;if("NONE"!=t[a].Connector&&")"!=t[a].Operator&&" WHERE"!=c&&0==l&&(c+=" "+t[a].Connector),l=!1,"("===t[a].Operator)c+=" (",l=!0;else if(")"===t[a].Operator)c+=" )";else if("IN"===t[a].Operator||"NOT IN"===t[a].Operator)d=t[a].Parameter+"_w"+a,c+=" "+t[a].Column+" "+t[a].Operator+" ( :"+d+" )",e.query.parameters[d]=t[a].Value;else if("IS NULL"===t[a].Operator)c+=" "+t[a].Column+" "+t[a].Operator;else if("IS NOT NULL"===t[a].Operator)c+=" "+t[a].Column+" "+t[a].Operator;else{d=t[a].Parameter+"_w"+a;i=Array.isArray(e.query.schema)?e.query.schema:[];var h=u(t[a].Column,i);c+=h?" JSON_EXTRACT(`"+h.column+"`, '"+h.path+"') "+t[a].Operator+" :"+d:" "+t[a].Column+" "+t[a].Operator+" :"+d,e.query.parameters[d]=t[a].Value}}return c},c=function(e){return!Array.isArray(e.indexHints)||e.indexHints.length<1?"":` USE INDEX (${e.indexHints.join(",")})`},l=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var i=t[n];i.Type&&i.Table&&i.From&&i.To&&(r+=` ${i.Type} ${i.Table} ON ${i.From} = ${i.To}`)}return r},d={Create:function(e){var r=n(e),i=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var i in t[0]){for(var a={Column:i,Type:"Default"},o=0;o<r.length;o++)if(i==r[o].Column){a=r[o];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"JSON":default:""!=n&&(n+=","),n+=" "+i;break;case"JSONProxy":""!=n&&(n+=","),n+=" "+a.StorageColumn}}return n}(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in r[0]){for(var s={Column:o,Type:"Default"},u=0;u<n.length;u++)if(o==n[u].Column){s=n[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==s.Type&&"DeleteIDUser"!==s.Type){a>0&&(i+=",");var f,c=function(){var t=o+"_"+a;i+=" :"+t,e.query.parameters[t]=r[0][o]};switch(s.Type){case"AutoIdentity":e.query.disableAutoIdentity?c():i+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||r[0][o]&&r[0][o].length>=5&&"0x0000000000000000"!==r[0][o]?c():(i+=" :"+(f=o+"_"+a),e.query.parameters[f]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?c():i+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?c():(i+=" :"+(f=o+"_"+a),e.query.parameters[f]=e.query.IDUser);break;case"JSON":var l=o+"_"+a;i+=" :"+l,e.query.parameters[l]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;case"JSONProxy":var d=o+"_"+a;i+=" :"+d,e.query.parameters[d]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;default:c()}a++}}return""!==i&&i}(e);return!!a&&"INSERT INTO"+r+" ("+i+") VALUES ("+a+");"},Read:function(e){var t=i(e),a=n(e),o=f(e),s=l(e),u=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",n=0;n<t.length;n++)n>0&&(r+=","),r+=" "+t[n].Column,"Descending"==t[n].Direction&&(r+=" DESC");return r}(e),d=function(e){if(!e.cap)return"";var t=" LIMIT";return!1!==e.begin&&(t+=" "+e.begin+","),t+" "+e.cap}(e),h=c(e);const p=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:a,Where:o,Join:s,OrderBy:u,Limit:d,IndexHints:h,Distinct:p,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${p}${t} FROM${a}${h}${s}${o}${u}${d};`},Update:function(e){var r=n(e),i=f(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in r[0]){for(var s={Column:o,Type:"Default"},u=0;u<n.length;u++)if(o==n[u].Column){s=n[u];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==s.Type){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(i+=","),s.Type){case"UpdateDate":e.query.disableAutoDateStamp?(i+=" "+o+" = :"+(f=o+"_"+a),e.query.parameters[f]=r[0][o]):i+=" "+o+" = "+t;break;case"UpdateIDUser":var f;i+=" "+o+" = :"+(f=o+"_"+a),e.query.parameters[f]=e.query.IDUser;break;case"JSON":var c=o+"_"+a;i+=" "+o+" = :"+c,e.query.parameters[c]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;case"JSONProxy":var l=s.StorageColumn+"_"+a;i+=" "+s.StorageColumn+" = :"+l,e.query.parameters[l]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;default:var d=o+"_"+a;i+=" "+o+" = :"+d,e.query.parameters[d]=r[0][o]}a++}}return""!==i&&i}(e);return!!a&&"UPDATE"+r+" SET"+a+i+";"},Delete:function(e){var r=n(e),i=f(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,a="",o={Type:"Default"},s=0;s<r.length;s++){var u=null;switch((o=r[s]).Type){case"Deleted":u=" "+o.Column+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":u=" "+o.Column+" = "+t;break;case"DeleteIDUser":var f=o.Column+"_"+n;u=" "+o.Column+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=u,n++}return!(!i||""===a)&&a}(e);return a?"UPDATE"+r+" SET"+a+i+";":"DELETE FROM"+r+i+";"},Undelete:function(e){var r=n(e);let i=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=f(e),o=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,a="",o={Type:"Default"},s=0;s<r.length;s++){var u=null;switch((o=r[s]).Type){case"Deleted":u=" "+o.Column+" = 0",i=!0;break;case"UpdateDate":u=" "+o.Column+" = "+t;break;case"UpdateIDUser":var f=o.Column+"_"+n;u=" "+o.Column+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=u,n++}return!(!i||""===a)&&a}(e);return e.query.disableDeleteTracking=i,o?"UPDATE"+r+" SET"+o+a+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?i(e,!0):"*",a=n(e),o=l(e),s=f(e),u=c(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const d=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:a,Where:s,OrderBy:"",Limit:"",IndexHints:u,Distinct:d,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${d}${t||"*"}) AS RowCount FROM${a}${u}${o}${s};`}};return Object.defineProperty(d,"name",{get:function(){return"MySQL"},enumerable:!0}),d}},{}],154:[function(e,t,r){t.exports=function(e){const t="NOW()";let r=e;var n=function(e){return e.scope&&e.scope.indexOf('"')>=0?" "+e.scope:' "'+e.scope+'"'},i=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const i=Array.isArray(e.query.schema)?e.query.schema:[];if(i.length<1)return"";const a=i.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const o=`${r}.${a.Column}`;return` ${s(o)}`}for(var i=" ",a=0;a<r.length;a++)a>0&&(i+=", "),Array.isArray(r[a])?(i+=s(r[a][0]),r[a].length>1&&r[a][1]&&(i+=" AS "+s(r[a][1]))):i+=s(r[a]);return i};const a=/^[" ]+|[" ]+$/g,o=e=>e.replace(a,"");var s=function(e){let t=e.split(".");if(t.length>1){const e=o(t[1]);return"*"===e?'"'+o(t[0])+'".*':'"'+o(t[0])+'"."'+e+'"'}return"*"===o(t[0])?"*":'"'+o(t[0])+'"'},u=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var i=r[n],a=0;a<t.length;a++){if(t[a].Column===i&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:i,path:"$."+r.slice(n+1).join(".")}}return null},f=function(e){var t=Array.isArray(e.filter)?e.filter:[];n(e);if(!e.query.disableDeleteTracking)for(var r=Array.isArray(e.query.schema)?e.query.schema:[],i=0;i<r.length;i++){var a=r[i];if("Deleted"===a.Type){var o=!1;if(t.length>0)for(var f=0;f<t.length;f++)if(t[f].Column===a.Column){o=!0;break}o||t.push({Column:s(e.scope+"."+a.Column),Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",l=!1;for(i=0;i<t.length;i++){var d;if("NONE"!=t[i].Connector&&")"!=t[i].Operator&&" WHERE"!=c&&0==l&&(c+=" "+t[i].Connector),l=!1,"("===t[i].Operator)c+=" (",l=!0;else if(")"===t[i].Operator)c+=" )";else if("IN"===t[i].Operator||"NOT IN"===t[i].Operator)d=t[i].Parameter+"_w"+i,c+=" "+s(t[i].Column)+" "+t[i].Operator+" ( :"+d+" )",e.query.parameters[d]=t[i].Value;else if("IS NULL"===t[i].Operator)c+=" "+s(t[i].Column)+" "+t[i].Operator;else if("IS NOT NULL"===t[i].Operator)c+=" "+s(t[i].Column)+" "+t[i].Operator;else{d=t[i].Parameter+"_w"+i;r=Array.isArray(e.query.schema)?e.query.schema:[];var h=u(t[i].Column,r);if(h){var p=h.path.replace("$.","").split(".");1===p.length?c+=' "'+h.column+"\"->>'"+p[0]+"' "+t[i].Operator+" :"+d:c+=' "'+h.column+"\"#>>'{"+p.join(",")+"}' "+t[i].Operator+" :"+d}else c+=" "+s(t[i].Column)+" "+t[i].Operator+" :"+d;e.query.parameters[d]=t[i].Value}}return c},c=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var i=t[n];i.Type&&i.Table&&i.From&&i.To&&(r+=` ${i.Type} ${i.Table} ON ${i.From} = ${i.To}`)}return r},l={Create:function(e){var r=n(e),i=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var i in t[0]){for(var a={Column:i,Type:"Default"},o=0;o<r.length;o++)if(i==r[o].Column){a=r[o];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"JSON":default:""!=n&&(n+=","),n+=" "+s(i);break;case"JSONProxy":""!=n&&(n+=","),n+=" "+s(a.StorageColumn)}}return n}(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in r[0]){for(var s={Column:o,Type:"Default"},u=0;u<n.length;u++)if(o==n[u].Column){s=n[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==s.Type&&"DeleteIDUser"!==s.Type){a>0&&(i+=",");var f,c=function(){var t=o+"_"+a;i+=" :"+t,e.query.parameters[t]=r[0][o]};switch(s.Type){case"AutoIdentity":e.query.disableAutoIdentity?c():i+=" DEFAULT";break;case"AutoGUID":e.query.disableAutoIdentity||r[0][o]&&r[0][o].length>=5&&"0x0000000000000000"!==r[0][o]?c():(i+=" :"+(f=o+"_"+a),e.query.parameters[f]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?c():i+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?c():(i+=" :"+(f=o+"_"+a),e.query.parameters[f]=e.query.IDUser);break;case"JSON":var l=o+"_"+a;i+=" :"+l,e.query.parameters[l]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;case"JSONProxy":var d=o+"_"+a;i+=" :"+d,e.query.parameters[d]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;default:c()}a++}}return""!==i&&i}(e);return!!a&&"INSERT INTO"+r+" ("+i+") VALUES ("+a+") RETURNING *;"},Read:function(e){var t=i(e),a=n(e),o=f(e),u=c(e),l=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",n=0;n<t.length;n++)n>0&&(r+=","),r+=" "+s(t[n].Column),"Descending"==t[n].Direction&&(r+=" DESC");return r}(e),d=function(e){if(!e.cap)return"";var t=" LIMIT "+e.cap;return!1!==e.begin&&(t+=" OFFSET "+e.begin),t}(e);const h=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:a,Where:o,Join:u,OrderBy:l,Limit:d,Distinct:h,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${h}${t} FROM${a}${u}${o}${l}${d};`},Update:function(e){var r=n(e),i=f(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in r[0]){for(var u={Column:o,Type:"Default"},f=0;f<n.length;f++)if(o==n[f].Column){u=n[f];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==u.Type){switch(u.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(i+=","),u.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var c=o+"_"+a;i+=" "+s(o)+" = :"+c,e.query.parameters[c]=r[0][o]}else i+=" "+s(o)+" = "+t;break;case"UpdateIDUser":c=o+"_"+a,i+=" "+s(o)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;case"JSON":var l=o+"_"+a;i+=" "+s(o)+" = :"+l,e.query.parameters[l]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;case"JSONProxy":var d=u.StorageColumn+"_"+a;i+=" "+s(u.StorageColumn)+" = :"+d,e.query.parameters[d]="string"==typeof r[0][o]?r[0][o]:JSON.stringify(r[0][o]||{});break;default:var h=o+"_"+a;i+=" "+s(o)+" = :"+h,e.query.parameters[h]=r[0][o]}a++}}return""!==i&&i}(e);return!!a&&"UPDATE"+r+" SET"+a+i+";"},Delete:function(e){var r=n(e),i=f(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,a="",o={Type:"Default"},u=0;u<r.length;u++){var f=null;switch((o=r[u]).Type){case"Deleted":f=" "+s(o.Column)+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":f=" "+s(o.Column)+" = "+t;break;case"DeleteIDUser":var c=o.Column+"_"+n;f=" "+s(o.Column)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=f,n++}return!(!i||""===a)&&a}(e);return a?"UPDATE"+r+" SET"+a+i+";":"DELETE FROM"+r+i+";"},Undelete:function(e){var r=n(e);let i=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=f(e),o=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,i=!1,a="",o={Type:"Default"},u=0;u<r.length;u++){var f=null;switch((o=r[u]).Type){case"Deleted":f=" "+s(o.Column)+" = 0",i=!0;break;case"UpdateDate":f=" "+s(o.Column)+" = "+t;break;case"UpdateIDUser":var c=o.Column+"_"+n;f=" "+s(o.Column)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=f,n++}return!(!i||""===a)&&a}(e);return e.query.disableDeleteTracking=i,o?"UPDATE"+r+" SET"+o+a+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?i(e,!0):"*",a=n(e),o=c(e),s=f(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const u=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:a,Where:s,OrderBy:"",Limit:"",Distinct:u,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${u}${t||"*"}) AS RowCount FROM${a}${o}${s};`}};return Object.defineProperty(l,"name",{get:function(){return"PostgreSQL"},enumerable:!0}),l}},{}],155:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){return" "+e.scope},n=(e,t)=>{if(e.indexOf(".")<0)return"`"+e+"`";var r=t.scope;return e.indexOf(r+".")>-1?"`"+e.replace(r+".","")+"`":"`"+e+"`"},i=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){if(!t)return" *";const r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length<1)return"";const n=r.find(e=>"AutoIdentity"===e.Type);return n?` ${n.Column}`:""}for(var i=" ",a=0;a<r.length;a++)a>0&&(i+=", "),i+=n(r[a],e);return i},a=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var i=r[n],a=0;a<t.length;a++){if(t[a].Column===i&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:i,path:"$."+r.slice(n+1).join(".")}}return null},o=function(e){var t=Array.isArray(e.filter)?e.filter:[],i=r(e).trim();if(!e.query.disableDeleteTracking)for(var o=Array.isArray(e.query.schema)?e.query.schema:[],s=0;s<o.length;s++){var u=o[s];if("Deleted"===u.Type){var f=!1;if(t.length>0)for(var c=0;c<t.length;c++)if(t[c].Column===u.Column){f=!0;break}f||t.push({Column:i+"."+u.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var l=" WHERE",d=!1;for(s=0;s<t.length;s++){var h;if("NONE"!=t[s].Connector&&")"!=t[s].Operator&&" WHERE"!=l&&0==d&&(l+=" "+t[s].Connector),d=!1,"("===t[s].Operator)l+=" (",d=!0;else if(")"===t[s].Operator)l+=" )";else if("IN"===t[s].Operator||"NOT IN"===t[s].Operator){h=t[s].Parameter+"_w"+s;var p=t[s].Value;if(Array.isArray(p)){for(var y=[],b=0;b<p.length;b++){var m=h+"_"+b;y.push(":"+m),e.query.parameters[m]=p[b]}l+=" "+n(t[s].Column,e)+" "+t[s].Operator+" ( "+y.join(", ")+" )"}else l+=" "+n(t[s].Column,e)+" "+t[s].Operator+" ( :"+h+" )",e.query.parameters[h]=p}else if("IS NOT NULL"===t[s].Operator)l+=" "+n(t[s].Column,e)+" "+t[s].Operator;else{h=t[s].Parameter+"_w"+s;o=Array.isArray(e.query.schema)?e.query.schema:[];var g=a(t[s].Column,o);l+=g?" json_extract(`"+g.column+"`, '"+g.path+"') "+t[s].Operator+" :"+h:" "+n(t[s].Column,e)+" "+t[s].Operator+" :"+h,e.query.parameters[h]=t[s].Value}}return l},s={Create:function(e){var t=r(e),i=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],i="";for(var a in t[0]){for(var o={Column:a,Type:"Default"},s=0;s<r.length;s++)if(a==r[s].Column){o=r[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)switch(o.Type){case"JSON":""!=i&&(i+=","),i+=" "+a;break;case"JSONProxy":""!=i&&(i+=","),i+=" "+o.StorageColumn;break;default:""!=i&&(i+=","),i+=" "+n(a,e)}}return i}(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],n="",i=0;for(var a in t[0]){for(var o={Column:a,Type:"Default"},s=0;s<r.length;s++)if(a==r[s].Column){o=r[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type){i>0&&(n+=",");var u,f=function(){var r=a+"_"+i;n+=" :"+r,e.query.parameters[r]=t[0][a]};switch(o.Type){case"AutoIdentity":e.query.disableAutoIdentity?f():n+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?f():(n+=" :"+(u=a+"_"+i),e.query.parameters[u]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?f():n+=" NOW()";break;case"UpdateIDUser":case"CreateIDUser":case"DeleteIDUser":e.query.disableAutoUserStamp?f():(n+=" :"+(u=a+"_"+i),e.query.parameters[u]=e.query.IDUser);break;case"JSON":var c=a+"_"+i;n+=" :"+c,e.query.parameters[c]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;case"JSONProxy":var l=a+"_"+i;n+=" :"+l,e.query.parameters[l]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;default:f()}i++}}return""!==n&&n}(e);return!!a&&"INSERT INTO"+t+" ("+i+") VALUES ("+a+");"},Read:function(e){var a=i(e),s=r(e),u=o(e),f=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",i=0;i<t.length;i++)i>0&&(r+=","),r+=" "+n(t[i].Column,e),"Descending"==t[i].Direction&&(r+=" DESC");return r}(e),c=function(e){if(!e.cap)return"";var t=" LIMIT";return t+=" "+e.cap,!1!==e.begin&&(t+=" OFFSET "+e.begin),t}(e);const l=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:a,TableName:s,Where:u,OrderBy:f,Limit:c,Distinct:l,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${l}${a} FROM${s}${u}${f}${c};`},Update:function(e){var t=r(e),i=o(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i="",a=0;for(var o in t[0]){for(var s={Column:o,Type:"Default"},u=0;u<r.length;u++)if(o==r[u].Column){s=r[u];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==s.Type){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(i+=","),s.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var f=o+"_"+a;i+=" "+n(o,e)+" = :"+f,e.query.parameters[f]=t[0][o]}else i+=" "+n(o,e)+" = NOW()";break;case"UpdateIDUser":f=o+"_"+a,i+=" "+n(o,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;case"JSON":var c=o+"_"+a;i+=" "+o+" = :"+c,e.query.parameters[c]="string"==typeof t[0][o]?t[0][o]:JSON.stringify(t[0][o]||{});break;case"JSONProxy":var l=s.StorageColumn+"_"+a;i+=" "+s.StorageColumn+" = :"+l,e.query.parameters[l]="string"==typeof t[0][o]?t[0][o]:JSON.stringify(t[0][o]||{});break;default:var d=o+"_"+a;i+=" "+n(o,e)+" = :"+d,e.query.parameters[d]=t[0][o]}a++}}return""!==i&&i}(e);return!!a&&"UPDATE"+t+" SET"+a+i+";"},Delete:function(e){var t=r(e),i=o(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,i=!1,a="",o={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((o=t[s]).Type){case"Deleted":u=" "+n(o.Column,e)+" = 1",i=!0;break;case"DeleteDate":case"UpdateDate":u=" "+n(o.Column,e)+" = NOW()";break;case"DeleteIDUser":var f=o.Column+"_"+r;u=" "+n(o.Column,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=u,r++}return!(!i||""===a)&&a}(e);return a?"UPDATE"+t+" SET"+a+i+";":"DELETE FROM"+t+i+";"},Undelete:function(e){var t=r(e);let i=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=o(e),s=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,i=!1,a="",o={Type:"Default"},s=0;s<t.length;s++){var u=null;switch((o=t[s]).Type){case"Deleted":u=" "+n(o.Column,e)+" = 0",i=!0;break;case"UpdateDate":u=" "+n(o.Column,e)+" = NOW()";break;case"UpdateIDUser":var f=o.Column+"_"+r;u=" "+n(o.Column,e)+" = :"+f,e.query.parameters[f]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=u,r++}return!(!i||""===a)&&a}(e);return e.query.disableDeleteTracking=i,s?"UPDATE"+t+" SET"+s+a+";":"SELECT NULL;"},Count:function(e){var n=r(e),a=o(e);const s=e.distinct?i(e,!0):"*";e.distinct&&s.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const u=e.distinct&&s.length>0?"DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:[],TableName:n,Where:a,OrderBy:"",Limit:"",Distinct:u,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${u}${s||"*"}) AS RowCount FROM${n}${a};`}};return Object.defineProperty(s,"name",{get:function(){return"SQLite"},enumerable:!0}),s}},{}],156:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},i=function(e){return"number"==typeof e?String(e):"boolean"==typeof e?e?"1":"0":'"'+function(e){return"string"!=typeof e?e:e.replace(/([+\-&|!(){}\[\]^"~*?:\\/])/g,"\\$1")}(String(e))+'"'},a=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":default:return t+":"+i(n);case"!=":return"(*:* NOT "+t+":"+i(n)+")";case">":return t+":{"+i(n)+" TO *}";case">=":return t+":["+i(n)+" TO *]";case"<":return t+":{* TO "+i(n)+"}";case"<=":return t+":[* TO "+i(n)+"]";case"LIKE":return t+":"+String(n).replace(/%/g,"*").replace(/_/g,"?");case"IN":for(var a=Array.isArray(n)?n:[n],o=[],s=0;s<a.length;s++)o.push(i(a[s]));return t+":("+o.join(" OR ")+")";case"NOT IN":for(var u=Array.isArray(n)?n:[n],f=[],c=0;c<u.length;c++)f.push(i(u[c]));return"(*:* NOT "+t+":("+f.join(" OR ")+"))";case"IS NULL":return"(*:* NOT "+t+":[* TO *])";case"IS NOT NULL":return t+":[* TO *]"}},o=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],i=0;i<n.length;i++)if("Deleted"===n[i].Type){for(var o=!1,s=0;s<t.length;s++)if(r(t[s].Column)===n[i].Column){o=!0;break}o||t.push({Column:n[i].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return"";var u=[[]];for(i=0;i<t.length;i++){var f=t[i];if("("===f.Operator)u.push([]);else if(")"===f.Operator){for(var c=u.pop(),l=!1,d=0;d<c.length;d++)if("OR"===c[d].connector){l=!0;break}for(var h="",p=0;p<c.length;p++)p>0&&(h+=l?" OR ":" AND "),h+=c[p].text;u[u.length-1].push({text:"("+h+")",connector:f.Connector||"AND"})}else u[u.length-1].push({text:a(f),connector:f.Connector||"AND"})}var y=u[0];if(0===y.length)return"";for(var b="",m=0;m<y.length;m++)m>0&&(b+=" "+y[m].connector+" "),b+=y[m].text;return b},s={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==o.Type&&"DeleteIDUser"!==o.Type)switch(o.Type){case"AutoIdentity":e.query.disableAutoIdentity?i[a]=t[0][a]:i[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?i[a]=t[0][a]:i[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?i[a]=t[0][a]:i[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?i[a]=t[0][a]:i[a]=e.query.IDUser;break;case"Deleted":i[a]=0;break;default:i[a]=t[0][a]}}return 0!==Object.keys(i).length&&i}(e);if(!t)return!1;for(var r=!1,i=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<i.length;a++)if("AutoIdentity"===i[a].Type&&!e.query.disableAutoIdentity){r=e.scope+"."+i[a].Column;break}var o={collection:e.scope,operation:"add",document:t};return r&&(o.counterScope=r),e.query.parameters.solrOperation=o,JSON.stringify(o)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("Solr dialect does not support JOINs; join parameter will be ignored.");var n=o(e),i=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return"*";for(var n=[],i=0;i<t.length;i++){var a=t[i];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&n.indexOf(a)<0&&n.push(a)}return 0===n.length?"*":n.join(",")}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var n=[],i=0;i<t.length;i++){var a=r(t[i].Column),o="Descending"===t[i].Direction?"desc":"asc";n.push(a+" "+o)}return n.join(", ")}(e),s={collection:e.scope,operation:"search",query:"*:*"};return n&&(s.filterQuery=n),"*"!==i&&(s.fields=i),a&&(s.sort=a),e.cap&&(s.rows=e.cap),!1!==e.begin&&e.begin>0&&(s.start=e.begin),e.distinct&&(s.distinct=!0),e.query.parameters.solrOperation=s,JSON.stringify(s)},Update:function(e){var t=o(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],i={};for(var a in t[0]){var o=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==o.Type){switch(o.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(o.Type){case"UpdateDate":e.query.disableAutoDateStamp?i[a]={set:t[0][a]}:i[a]={set:"$$NOW"};break;case"UpdateIDUser":i[a]={set:e.query.IDUser};break;default:i[a]={set:t[0][a]}}}}return 0!==Object.keys(i).length&&i}(e);if(!r)return!1;var i={collection:e.scope,operation:"atomicUpdate",filterQuery:t||"*:*",update:r};return e.query.parameters.solrOperation=i,JSON.stringify(i)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]={set:1},r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]={set:"$$NOW"};break;case"DeleteIDUser":n[a.Column]={set:e.query.IDUser};break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=o(e);if(t){var n={collection:e.scope,operation:"atomicUpdate",filterQuery:r||"*:*",update:t};return e.query.parameters.solrOperation=n,JSON.stringify(n)}var i={collection:e.scope,operation:"deleteByQuery",filterQuery:r||"*:*"};return e.query.parameters.solrOperation=i,JSON.stringify(i)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},i=0;i<t.length;i++){var a=t[i];switch(a.Type){case"Deleted":n[a.Column]={set:0},r=!0;break;case"UpdateDate":n[a.Column]={set:"$$NOW"};break;case"UpdateIDUser":n[a.Column]={set:e.query.IDUser};break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=o(e);if(e.query.disableDeleteTracking=r,t){var i={collection:e.scope,operation:"atomicUpdate",filterQuery:n||"*:*",update:t};return e.query.parameters.solrOperation=i,JSON.stringify(i)}var a={collection:e.scope,operation:"noop"};return e.query.parameters.solrOperation=a,JSON.stringify(a)},Count:function(e){var t=o(e),n={collection:e.scope,operation:"search",query:"*:*",rows:0,isCount:!0};if(t&&(n.filterQuery=t),e.distinct){n.distinct=!0;var i=e.dataElements;if(Array.isArray(i)&&i.length>0){for(var a=[],s=0;s<i.length;s++){var u=Array.isArray(i[s])?i[s][0]:i[s];"*"!==(u=r(u))&&a.push(u)}a.length>0&&(n.distinctFields=a)}else for(var f=Array.isArray(e.query.schema)?e.query.schema:[],c=0;c<f.length;c++)if("AutoIdentity"===f[c].Type){n.distinctFields=[f[c].Column];break}}return e.query.parameters.solrOperation=n,JSON.stringify(n)}};return Object.defineProperty(s,"name",{get:function(){return"Solr"},enumerable:!0}),s}},{}],157:[function(e,t,r){var n=Object.prototype.toString,i=Math.max,a=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};t.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==n.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,o=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments,1),s=i(0,t.length-o.length),u=[],f=0;f<s;f++)u[f]="$"+f;if(r=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var n=t.apply(this,a(o,arguments));return Object(n)===n?n:this}return t.apply(e,a(o,arguments))}),t.prototype){var c=function(){};c.prototype=t.prototype,r.prototype=new c,c.prototype=null}return r}},{}],158:[function(e,t,r){var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":157}],159:[function(e,t,r){for(var n=e("util"),i=e("is-property"),a=/[\{\[]/,o=/[\}\]]/,s=["do","if","in","for","let","new","try","var","case","else","enum","eval","null","this","true","void","with","await","break","catch","class","const","false","super","throw","while","yield","delete","export","import","public","return","static","switch","typeof","default","extends","finally","package","private","continue","debugger","function","arguments","interface","protected","implements","instanceof","NaN","undefined"],u={},f=0;f<s.length;f++)u[s[f]]=!0;var c={s:function(e){return""+e},d:function(e){return""+Number(e)},o:function(e){return JSON.stringify(e)}},l=function(){var e=[],t=0,r={},s=function(r){for(var n="";n.length<2*t;)n+=" ";e.push(n+r)},f=function(e){return o.test(e.trim()[0])&&a.test(e[e.length-1])?(t--,s(e),void t++):a.test(e[e.length-1])?(s(e),void t++):o.test(e.trim()[0])?(t--,void s(e)):void s(e)},l=function(e){if(!e)return l;if(1===arguments.length&&e.indexOf("\n")>-1)for(var t=e.trim().split("\n"),r=0;r<t.length;r++)f(t[r].trim());else f(n.format.apply(n,arguments));return l};return l.scope={},l.formats=c,l.sym=function(e){return e&&function(e){return i(e)&&!u.hasOwnProperty(e)}(e)||(e="tmp"),r[e]||(r[e]=0),e+(r[e]++||"")},l.property=function(e,t){return 1===arguments.length&&(t=e,e=""),i(t+="")?e?e+"."+t:t:e?e+"["+JSON.stringify(t)+"]":JSON.stringify(t)},l.toString=function(){return e.join("\n")},l.toFunction=function(e){e||(e={});var t="return ("+l.toString()+")";Object.keys(l.scope).forEach(function(t){e[t]||(e[t]=l.scope[t])});var r=Object.keys(e).map(function(e){return e}),n=r.map(function(t){return e[t]});return Function.apply(null,r.concat(t)).apply(null,n)},arguments.length&&l.apply(null,arguments),l};l.formats=c,t.exports=l},{"is-property":196,util:353}],160:[function(e,t,r){var n=e("is-property"),i=function(e,t){return n(t)?e+"."+t:e+"["+JSON.stringify(t)+"]"};i.valid=n,i.property=function(e){return n(e)?e:JSON.stringify(e)},t.exports=i},{"is-property":196}],161:[function(e,t,r){var n;t.exports=function(){if(void 0===n)try{n=Function("return function* () {}")().constructor}catch(e){n=!1}return n}},{}],162:[function(e,t,r){var n,i=e("es-object-atoms"),a=e("es-errors"),o=e("es-errors/eval"),s=e("es-errors/range"),u=e("es-errors/ref"),f=e("es-errors/syntax"),c=e("es-errors/type"),l=e("es-errors/uri"),d=e("math-intrinsics/abs"),h=e("math-intrinsics/floor"),p=e("math-intrinsics/max"),y=e("math-intrinsics/min"),b=e("math-intrinsics/pow"),m=e("math-intrinsics/round"),g=e("math-intrinsics/sign"),v=Function,w=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},_=e("gopd"),S=e("es-define-property"),E=function(){throw new c},M=_?function(){try{return E}catch(e){try{return _(arguments,"callee").get}catch(e){return E}}}():E,A=e("has-symbols")(),D=e("get-proto"),k=e("get-proto/Object.getPrototypeOf"),O=e("get-proto/Reflect.getPrototypeOf"),x=e("call-bind-apply-helpers/functionApply"),R=e("call-bind-apply-helpers/functionCall"),C={},j="undefined"!=typeof Uint8Array&&D?D(Uint8Array):n,q={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":A&&D?D([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":C,"%AsyncGenerator%":C,"%AsyncGeneratorFunction%":C,"%AsyncIteratorPrototype%":C,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":C,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&D?D(D([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&D?D((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":_,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&D?D((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&D?D(""[Symbol.iterator]()):n,"%Symbol%":A?Symbol:n,"%SyntaxError%":f,"%ThrowTypeError%":M,"%TypedArray%":j,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":R,"%Function.prototype.apply%":x,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":k,"%Math.abs%":d,"%Math.floor%":h,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":b,"%Math.round%":m,"%Math.sign%":g,"%Reflect.getPrototypeOf%":O};if(D)try{null.error}catch(e){var I=D(D(e));q["%Error.prototype%"]=I}var T=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&D&&(r=D(i.prototype))}return q[t]=r,r},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},U=e("function-bind"),P=e("hasown"),B=U.call(R,Array.prototype.concat),N=U.call(x,Array.prototype.splice),F=U.call(R,String.prototype.replace),Q=U.call(R,String.prototype.slice),$=U.call(R,RegExp.prototype.exec),z=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,J=function(e,t){var r,n=e;if(P(L,n)&&(n="%"+(r=L[n])[0]+"%"),P(q,n)){var i=q[n];if(i===C&&(i=T(n)),void 0===i&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new f("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===$(/^%?[^%]*%?$/,e))throw new f("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=Q(e,0,1),r=Q(e,-1);if("%"===t&&"%"!==r)throw new f("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new f("invalid intrinsic syntax, expected opening `%`");var n=[];return F(e,z,function(e,t,r,i){n[n.length]=r?F(i,H,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=J("%"+n+"%",t),a=i.name,o=i.value,s=!1,u=i.alias;u&&(n=u[0],N(r,B([0,1],u)));for(var l=1,d=!0;l<r.length;l+=1){var h=r[l],p=Q(h,0,1),y=Q(h,-1);if(('"'===p||"'"===p||"`"===p||'"'===y||"'"===y||"`"===y)&&p!==y)throw new f("property names with quotes must have matching quotes");if("constructor"!==h&&d||(s=!0),P(q,a="%"+(n+="."+h)+"%"))o=q[a];else if(null!=o){if(!(h in o)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(_&&l+1>=r.length){var b=_(o,h);o=(d=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:o[h]}else d=P(o,h),o=o[h];d&&!s&&(q[a]=o)}}return o}},{"call-bind-apply-helpers/functionApply":87,"call-bind-apply-helpers/functionCall":88,"es-define-property":132,"es-errors":134,"es-errors/eval":133,"es-errors/range":135,"es-errors/ref":136,"es-errors/syntax":137,"es-errors/type":138,"es-errors/uri":139,"es-object-atoms":140,"function-bind":158,"get-proto":165,"get-proto/Object.getPrototypeOf":163,"get-proto/Reflect.getPrototypeOf":164,gopd:167,"has-symbols":169,hasown:185,"math-intrinsics/abs":201,"math-intrinsics/floor":202,"math-intrinsics/max":204,"math-intrinsics/min":205,"math-intrinsics/pow":206,"math-intrinsics/round":207,"math-intrinsics/sign":208}],163:[function(e,t,r){var n=e("es-object-atoms");t.exports=n.getPrototypeOf||null},{"es-object-atoms":140}],164:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],165:[function(e,t,r){var n=e("./Reflect.getPrototypeOf"),i=e("./Object.getPrototypeOf"),a=e("dunder-proto/get");t.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:a?function(e){return a(e)}:null},{"./Object.getPrototypeOf":163,"./Reflect.getPrototypeOf":164,"dunder-proto/get":114}],166:[function(e,t,r){t.exports=Object.getOwnPropertyDescriptor},{}],167:[function(e,t,r){var n=e("./gOPD");if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"./gOPD":166}],168:[function(e,t,r){var n=e("es-define-property"),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},t.exports=i},{"es-define-property":132}],169:[function(e,t,r){var n="undefined"!=typeof Symbol&&Symbol,i=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&i())))}},{"./shams":170}],170:[function(e,t,r){t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},{}],171:[function(e,t,r){var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":170}],172:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform;function a(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(a,i),a.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},a.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};var o="undefined"!=typeof Uint8Array,s="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);a.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");e=function(e,t){if(e instanceof n)return e;if("string"==typeof e)return n.from(e,t);if(s&&ArrayBuffer.isView(e)){if(0===e.byteLength)return n.alloc(0);var r=n.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}if(o&&e instanceof Uint8Array)return n.from(e);if(n.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return n.from(e);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(e,t);for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var u=0,f=8*e.length;f>0;++u)this._length[u]+=f,(f=this._length[u]/4294967296|0)>0&&(this._length[u]-=4294967296*f);return this},a.prototype._update=function(){throw new Error("_update is not implemented")},a.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},a.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=a},{inherits:189,"safe-buffer":291,stream:308}],173:[function(e,t,r){var n=r;n.utils=e("./hash/utils"),n.common=e("./hash/common"),n.sha=e("./hash/sha"),n.ripemd=e("./hash/ripemd"),n.hmac=e("./hash/hmac"),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},{"./hash/common":174,"./hash/hmac":175,"./hash/ripemd":176,"./hash/sha":177,"./hash/utils":184}],174:[function(e,t,r){var n=e("./utils"),i=e("minimalistic-assert");function a(){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}r.BlockHash=a,a.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},a.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},a.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,a=8;a<this.padLength;a++)n[i++]=0;return n}},{"./utils":184,"minimalistic-assert":239}],175:[function(e,t,r){var n=e("./utils"),i=e("minimalistic-assert");function a(e,t,r){if(!(this instanceof a))return new a(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}t.exports=a,a.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},a.prototype.update=function(e,t){return this.inner.update(e,t),this},a.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":184,"minimalistic-assert":239}],176:[function(e,t,r){var n=e("./utils"),i=e("./common"),a=n.rotl32,o=n.sum32,s=n.sum32_3,u=n.sum32_4,f=i.BlockHash;function c(){if(!(this instanceof c))return new c;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function l(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(c,f),r.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],c=this.h[4],g=r,v=n,w=i,_=f,S=c,E=0;E<80;E++){var M=o(a(u(r,l(E,n,i,f),e[p[E]+t],d(E)),b[E]),c);r=c,c=f,f=a(i,10),i=n,n=M,M=o(a(u(g,l(79-E,v,w,_),e[y[E]+t],h(E)),m[E]),S),g=S,S=_,_=a(w,10),w=v,v=M}M=s(this.h[1],i,_),this.h[1]=s(this.h[2],f,S),this.h[2]=s(this.h[3],c,g),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=M},c.prototype._digest=function(e){return"hex"===e?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],b=[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],m=[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]},{"./common":174,"./utils":184}],177:[function(e,t,r){r.sha1=e("./sha/1"),r.sha224=e("./sha/224"),r.sha256=e("./sha/256"),r.sha384=e("./sha/384"),r.sha512=e("./sha/512")},{"./sha/1":178,"./sha/224":179,"./sha/256":180,"./sha/384":181,"./sha/512":182}],178:[function(e,t,r){var n=e("../utils"),i=e("../common"),a=e("./common"),o=n.rotl32,s=n.sum32,u=n.sum32_5,f=a.ft_1,c=i.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,c),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],a=this.h[1],c=this.h[2],d=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=u(o(i,5),f(p,a,c,d),h,r[n],l[p]);h=d,d=c,c=o(a,30),a=i,i=y}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],c),this.h[3]=s(this.h[3],d),this.h[4]=s(this.h[4],h)},d.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":174,"../utils":184,"./common":183}],179:[function(e,t,r){var n=e("../utils"),i=e("./256");function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=512,a.outSize=224,a.hmacStrength=192,a.padLength=64,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":184,"./256":180}],180:[function(e,t,r){var n=e("../utils"),i=e("../common"),a=e("./common"),o=e("minimalistic-assert"),s=n.sum32,u=n.sum32_4,f=n.sum32_5,c=a.ch32,l=a.maj32,d=a.s0_256,h=a.s1_256,p=a.g0_256,y=a.g1_256,b=i.BlockHash,m=[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 g(){if(!(this instanceof g))return new g;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,b),t.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+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],a=this.h[1],b=this.h[2],m=this.h[3],g=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var S=f(_,h(g),c(g,v,w),this.k[n],r[n]),E=s(d(i),l(i,a,b));_=w,w=v,v=g,g=s(m,S),m=b,b=a,a=i,i=s(S,E)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],a),this.h[2]=s(this.h[2],b),this.h[3]=s(this.h[3],m),this.h[4]=s(this.h[4],g),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},g.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":174,"../utils":184,"./common":183,"minimalistic-assert":239}],181:[function(e,t,r){var n=e("../utils"),i=e("./512");function a(){if(!(this instanceof a))return new a;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(a,i),t.exports=a,a.blockSize=1024,a.outSize=384,a.hmacStrength=192,a.padLength=128,a.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":184,"./512":182}],182:[function(e,t,r){var n=e("../utils"),i=e("../common"),a=e("minimalistic-assert"),o=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,f=n.shr64_lo,c=n.sum64,l=n.sum64_hi,d=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,b=n.sum64_5_lo,m=i.BlockHash,g=[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 v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function w(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function _(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function S(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function M(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function D(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=o(e,t,1)^o(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,1)^s(e,t,8)^f(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=o(e,t,19)^o(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function C(e,t){var r=s(e,t,19)^s(t,e,29)^f(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,m),t.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=R(r[n-4],r[n-3]),a=C(r[n-4],r[n-3]),o=r[n-14],s=r[n-13],u=O(r[n-30],r[n-29]),f=x(r[n-30],r[n-29]),c=r[n-32],l=r[n-31];r[n]=h(i,a,o,s,u,f,c,l),r[n+1]=p(i,a,o,s,u,f,c,l)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],u=this.h[4],f=this.h[5],h=this.h[6],p=this.h[7],m=this.h[8],g=this.h[9],v=this.h[10],O=this.h[11],x=this.h[12],R=this.h[13],C=this.h[14],j=this.h[15];a(this.k.length===r.length);for(var q=0;q<r.length;q+=2){var I=C,T=j,L=D(m,g),U=k(m,g),P=w(m,g,v,O,x),B=_(m,g,v,O,x,R),N=this.k[q],F=this.k[q+1],Q=r[q],$=r[q+1],z=y(I,T,L,U,P,B,N,F,Q,$),H=b(I,T,L,U,P,B,N,F,Q,$);I=M(n,i),T=A(n,i),L=S(n,i,o,s,u),U=E(n,i,o,s,u,f);var J=l(I,T,L,U),W=d(I,T,L,U);C=x,j=R,x=v,R=O,v=m,O=g,m=l(h,p,z,H),g=d(p,p,z,H),h=u,p=f,u=o,f=s,o=n,s=i,n=l(z,H,J,W),i=d(z,H,J,W)}c(this.h,0,n,i),c(this.h,2,o,s),c(this.h,4,u,f),c(this.h,6,h,p),c(this.h,8,m,g),c(this.h,10,v,O),c(this.h,12,x,R),c(this.h,14,C,j)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":174,"../utils":184,"minimalistic-assert":239}],183:[function(e,t,r){var n=e("../utils").rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}r.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?o(t,r,n):2===e?a(t,r,n):void 0},r.ch32=i,r.maj32=a,r.p32=o,r.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},r.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},r.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},r.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":184}],184:[function(e,t,r){var n=e("minimalistic-assert"),i=e("inherits");function a(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},r.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},r.htonl=o,r.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=o(i)),r+=u(i.toString(16))}return r},r.zero2=s,r.zero8=u,r.join32=function(e,t,r,i){var a=r-t;n(a%4==0);for(var o=new Array(a/4),s=0,u=t;s<o.length;s++,u+=4){var f;f="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],o[s]=f>>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];"big"===t?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<<t|e>>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},r.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},r.sum64=function(e,t,r,n){var i=e[t],a=n+e[t+1]>>>0,o=(a<n?1:0)+r+i;e[t]=o>>>0,e[t+1]=a},r.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},r.sum64_lo=function(e,t,r,n){return t+n>>>0},r.sum64_4_hi=function(e,t,r,n,i,a,o,s){var u=0,f=t;return u+=(f=f+n>>>0)<t?1:0,u+=(f=f+a>>>0)<a?1:0,e+r+i+o+(u+=(f=f+s>>>0)<s?1:0)>>>0},r.sum64_4_lo=function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},r.sum64_5_hi=function(e,t,r,n,i,a,o,s,u,f){var c=0,l=t;return c+=(l=l+n>>>0)<t?1:0,c+=(l=l+a>>>0)<a?1:0,c+=(l=l+s>>>0)<s?1:0,e+r+i+o+u+(c+=(l=l+f>>>0)<f?1:0)>>>0},r.sum64_5_lo=function(e,t,r,n,i,a,o,s,u,f){return t+n+a+s+f>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:189,"minimalistic-assert":239}],185:[function(e,t,r){var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,a=e("function-bind");t.exports=a.call(n,i)},{"function-bind":158}],186:[function(e,t,r){var n=e("hash.js"),i=e("minimalistic-crypto-utils"),a=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}t.exports=o,o.prototype._init=function(e,t,r){var n=e.concat(t).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},o.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var o=a.slice(0,e);return this._update(r),this._reseed++,i.encode(o,t)}},{"hash.js":173,"minimalistic-assert":239,"minimalistic-crypto-utils":240}],187:[function(e,t,r){var n=e("http"),i=e("url"),a=t.exports;for(var o in n)n.hasOwnProperty(o)&&(a[o]=n[o]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}a.request=function(e,t){return e=s(e),n.request.call(this,e,t)},a.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},{http:323,url:349}],188:[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+l],l+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+l],l+=d,c-=8);if(0===a)a=1-f;else{if(a===u)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=f}return(h?-1:1)*o*Math.pow(2,a-n)},r.write=function(e,t,r,n,i,a){var o,s,u,f=8*a-i-1,c=(1<<f)-1,l=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*u-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[r+h]=255&o,h+=p,o/=256,f-=8);e[r+h-p]|=128*y}},{}],189:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],190:[function(e,t,r){var n=e("has-tostringtag/shams")(),i=e("call-bound")("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},o=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},s=function(){return a(arguments)}();a.isLegacyArguments=o,t.exports=s?a:o},{"call-bound":92,"has-tostringtag/shams":171}],191:[function(e,t,r){var n,i,a=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw i}}),i={},o(function(){throw 42},null,n)}catch(e){e!==i&&(o=null)}else o=null;var s=/^\s*class\b/,u=function(e){try{var t=a.call(e);return s.test(t)}catch(e){return!1}},f=function(e){try{return!u(e)&&(a.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,l="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var p=document.all;c.call(p)===c.call(document.all)&&(h=function(e){if((d||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=o?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,n)}catch(e){if(e!==i)return!1}return!u(e)&&f(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(l)return f(e);if(u(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&f(e)}},{}],192:[function(e,t,r){var n=e("call-bound"),i=e("safe-regex-test")(/^\s*(?:function)?\*/),a=e("has-tostringtag/shams")(),o=e("get-proto"),s=n("Object.prototype.toString"),u=n("Function.prototype.toString"),f=e("generator-function");t.exports=function(e){if("function"!=typeof e)return!1;if(i(u(e)))return!0;if(!a)return"[object GeneratorFunction]"===s(e);if(!o)return!1;var t=f();return t&&o(e)===t.prototype}},{"call-bound":92,"generator-function":161,"get-proto":165,"has-tostringtag/shams":171,"safe-regex-test":292}],193:[function(e,t,r){var n=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,i=/\/\d{1,3}(?=%|$)/,a=/\//,o=/%.*$/,s=/([^0-9a-f:/%])/i,u=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/i;function f(e){if(!n.test(e))return!1;var t=e.split(".");if(4!==t.length)return!1;if("0"===t[0][0]&&t[0].length>1)return!1;if("0"===t[1][0]&&t[1].length>1)return!1;if("0"===t[2][0]&&t[2].length>1)return!1;if("0"===t[3][0]&&t[3].length>1)return!1;var r=Number(t[0]),i=Number(t[1]),a=Number(t[2]),o=Number(t[3]);return r>=0&&r<256&&i>=0&&i<256&&a>=0&&a<256&&o>=0&&o<256}function c(e){var t=e.replace(i,""),r=e.length!==t.length;if(r)return!1;if(!r&&a.test(e))return!1;var n=t.replace(o,""),c=n.lastIndexOf(":");if(-1===c)return!1;var l=f(n.substring(c+1))?n.substring(0,c+1)+"1234:5678":n;if(s.test(l))return!1;if(u.test(l))return!1;var d=l.split("::");if(d.length>2)return!1;if(2===d.length){var h=""===d[0]?[]:d[0].split(":"),p=""===d[1]?[]:d[1].split(":");if(8-(h.length+p.length)<=0)return!1}else if(8!==l.split(":").length)return!1;return!0}function l(e){return f(e)||c(e)}t.exports=function(e){if(e||(e={}),4===e.version)return f;if(6===e.version)return c;if(null==e.version)return l;throw new Error("Unknown version: "+e.version)},t.exports.__all_regexes__=[n,i,a,o,s,u]},{}],194:[function(e,t,r){var n=e("is-my-ip-valid"),i=/\s/,a=/^[a-zA-Z0-9.-]+$/,o=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/,s=/^\+[0-9][0-9 ]{5,27}[0-9]$/,u=/ {2}/,f=/ /g;r["date-time"]=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(?:\.\d+|)([zZ]|[+-]\d{2}:\d{2})$/,r.date=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/,r.time=/^\d{2}:\d{2}:\d{2}$/,r.email=function(e){return-1!==e.indexOf("@")&&!i.test(e)},r["ip-address"]=r.ipv4=n({version:4}),r.ipv6=n({version:6}),r.uri=/^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/,r.color=/(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/,r.hostname=function(e){if(!a.test(e))return!1;for(var t=e.split("."),r=0;r<t.length;r++)if(!o.test(t[r]))return!1;return!0},r.alpha=/^[a-zA-Z]+$/,r.alphanumeric=/^[a-zA-Z0-9]+$/,r.style=/.:\s*[^;]/g,r.phone=function(e){if(!s.test(e))return!1;if(u.test(e))return!1;var t=e.substring(1).replace(f,"").length;return t>=7&&t<=15},r["utc-millisec"]=/^[0-9]{1,15}\.?[0-9]{0,15}$/},{"is-my-ip-valid":193}],195:[function(e,t,r){var n=e("generate-object-property"),i=e("generate-function"),a=e("jsonpointer"),o=e("xtend"),s=e("./formats"),u={any:function(){return"true"},null:function(e){return e+" === null"},boolean:function(e){return"typeof "+e+' === "boolean"'},array:function(e){return"Array.isArray("+e+")"},object:function(e){return"typeof "+e+' === "object" && '+e+" && !Array.isArray("+e+")"},number:function(e){return"typeof "+e+' === "number" && isFinite('+e+")"},integer:function(e){return"typeof "+e+' === "number" && (Math.floor('+e+") === "+e+" || "+e+" > 9007199254740992 || "+e+" < -9007199254740992)"},string:function(e){return"typeof "+e+' === "string"'}},f=function(e,t){t=Math.min(-1===t?e.length:t,e.length);for(var r=[],n=0;n<t;n++)r.push("object"==typeof e[n]?JSON.stringify(e[n]):e[n]);for(n=1;n<r.length;n++)if(r.indexOf(r[n])!==n)return!1;return!0},c=function(e,t){var r,n=(0|t)!==t?Math.pow(10,t.toString().split(".").pop().length):1;n>1?r=((0|e)!==e?Math.pow(10,e.toString().split(".").pop().length):1)>n||Math.round(n*e)%(n*t):r=e%t;return!r},l=function(e,t,r){return r>-1&&t.length>r||e.test(t)},d=function(e,t,r,h,p){var y=p?o(s,p.formats):s,b={unique:f,formats:y,isMultipleOf:c,testLimitedRegex:l},m=!!p&&!!p.verbose,g=!(!p||void 0===p.greedy)&&p.greedy,v={},w=[],_=function(e){var t=e+(v[e]=(v[e]||0)+1);return w.push(t),t},S=function(e){var t=JSON.stringify(e);try{for(var r=/\[([^\[\]"]+)\]/;r.test(t);)t=t.replace(r,n);return t}catch(t){return JSON.stringify(e)}function n(e,t){if(-1===w.indexOf(t))throw new Error("Unreplaceable");return'." + '+t+' + "'}},E={},M=function(e){if(E[e])return E[e];var t=_("pattern");return b[t]=new RegExp(e),E[e]=t,t},A=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],D=function(){var e=A.shift();return A.push(e+e[0]),w.push(e),e},k=function(e,i,o,f,c){var l=i.properties,h=i.type,v=!1;Array.isArray(i.items)&&(l={},i.items.forEach(function(e,t){l[t]=e}),h="array",v=!0);var w=0,E=function(t,r,n){O("errors++"),!0===o&&(O("if (validate.errors === null) validate.errors = []"),m?O("validate.errors.push({field:%s,message:%s,value:%s,type:%s,schemaPath:%s})",S(r||e),JSON.stringify(t),n||e,JSON.stringify(h),JSON.stringify(c)):O("validate.errors.push({field:%s,message:%s})",S(r||e),JSON.stringify(t)))};!0===i.required?(w++,O("if (%s === undefined) {",e),E("is required"),O("} else {")):(w++,O("if (%s !== undefined) {",e));var A=[].concat(h).map(function(t){if(t&&!u.hasOwnProperty(t))throw new Error("Unknown type: "+t);return u[t||"any"](e)}).join(" || ")||"true";if("true"!==A&&(w++,O("if (!(%s)) {",A),E("is the wrong type"),O("} else {")),v)if(!1===i.additionalItems)O("if (%s.length > %d) {",e,i.items.length),E("has additional items"),O("}");else if(i.additionalItems){var x=D();O("for (var %s = %d; %s < %s.length; %s++) {",x,i.items.length,x,e,x),k(e+"["+x+"]",i.additionalItems,o,f,c.concat("additionalItems")),O("}")}if(i.format&&y[i.format]){"string"!==h&&s[i.format]&&O("if (%s) {",u.string(e));var R=_("format");b[R]=y[i.format],"function"==typeof b[R]?O("if (!%s(%s)) {",R,e):O("if (!testLimitedRegex(%s, %s, %d)) {",R,e,void 0===i.maxLength?-1:i.maxLength),E("must be "+i.format+" format"),O("}"),"string"!==h&&s[i.format]&&O("}")}if(Array.isArray(i.required)){R=_("missing");O("var %s = 0",R);O("if ((%s)) {","object"!==h?u.object(e):"true"),i.required.map(function(t){var r=n(e,t);O("if (%s === undefined) {",r),E("is required",r),O("%s++",R),O("}")}),O("}"),g||(O("if (%s === 0) {",R),w++)}if(i.uniqueItems&&("array"!==h&&O("if (%s) {",u.array(e)),O("if (!(unique(%s, %d))) {",e,i.maxItems||-1),E("must be unique"),O("}"),"array"!==h&&O("}")),i.enum){var C=i.enum.some(function(e){return"object"==typeof e})?function(t){return"JSON.stringify("+e+") !== JSON.stringify("+JSON.stringify(t)+")"}:function(t){return e+" !== "+JSON.stringify(t)};O("if (%s) {",i.enum.map(C).join(" && ")||"false"),E("must be an enum value"),O("}")}if(i.dependencies&&("object"!==h&&O("if (%s) {",u.object(e)),Object.keys(i.dependencies).forEach(function(t){var r=i.dependencies[t];"string"==typeof r&&(r=[r]);Array.isArray(r)&&(O("if (%s !== undefined && !(%s)) {",n(e,t),r.map(function(t){return n(e,t)+" !== undefined"}).join(" && ")||"true"),E("dependencies not set"),O("}")),"object"==typeof r&&(O("if (%s !== undefined) {",n(e,t)),k(e,r,o,f,c.concat(["dependencies",t])),O("}"))}),"object"!==h&&O("}")),i.additionalProperties||!1===i.additionalProperties){"object"!==h&&O("if (%s) {",u.object(e));x=D();var j=_("keys"),q=Object.keys(l||{}).map(function(e){return j+"["+x+"] !== "+JSON.stringify(e)}).concat(Object.keys(i.patternProperties||{}).map(function(e){return"!"+M(e)+".test("+j+"["+x+"])"})).join(" && ")||"true";O("var %s = Object.keys(%s)",j,e)("for (var %s = 0; %s < %s.length; %s++) {",x,x,j,x)("if (%s) {",q),!1===i.additionalProperties?(f&&O("delete %s",e+"["+j+"["+x+"]]"),E("has additional properties",null,JSON.stringify(e+".")+" + "+j+"["+x+"]")):k(e+"["+j+"["+x+"]]",i.additionalProperties,o,f,c.concat(["additionalProperties"])),O("}")("}"),"object"!==h&&O("}")}if(i.$ref){var I=function(e,t,r){var n=function(e){return e&&e.id===r?e:"object"==typeof e&&e?Object.keys(e).reduce(function(t,r){return t||n(e[r])},null):null},i=n(e);if(i)return i;r=(r=r.replace(/^#/,"")).replace(/\/$/,"");try{return a.get(e,decodeURI(r))}catch(e){var o,s=r.indexOf("#");if(0!==s)if(-1===s)o=t[r];else{o=t[r.slice(0,s)];var u=r.slice(s).replace(/^#/,"");try{return a.get(o,u)}catch(e){}}else o=t[r];return o||null}}(r,p&&p.schemas||{},i.$ref);if(I){var T=t[i.$ref];T||(t[i.$ref]=function(e){return T(e)},T=d(I,t,r,!1,p));R=_("ref");b[R]=T,O("if (!(%s(%s))) {",R,e),E("referenced schema does not match"),O("}")}}if(i.not){var L=_("prev");O("var %s = errors",L),k(e,i.not,!1,f,c.concat("not")),O("if (%s === errors) {",L),E("negative schema matches"),O("} else {")("errors = %s",L)("}")}if(i.items&&!v){"array"!==h&&O("if (%s) {",u.array(e));x=D();O("for (var %s = 0; %s < %s.length; %s++) {",x,x,e,x),k(e+"["+x+"]",i.items,o,f,c.concat("items")),O("}"),"array"!==h&&O("}")}if(i.patternProperties){"object"!==h&&O("if (%s) {",u.object(e));j=_("keys"),x=D();O("var %s = Object.keys(%s)",j,e)("for (var %s = 0; %s < %s.length; %s++) {",x,x,j,x),Object.keys(i.patternProperties).forEach(function(t){var r=M(t);O("if (%s.test(%s)) {",r,j+"["+x+"]"),k(e+"["+j+"["+x+"]]",i.patternProperties[t],o,f,c.concat(["patternProperties",t])),O("}")}),O("}"),"object"!==h&&O("}")}if(i.pattern){var U=M(i.pattern);"string"!==h&&O("if (%s) {",u.string(e)),O("if (!(testLimitedRegex(%s, %s, %d))) {",U,e,void 0===i.maxLength?-1:i.maxLength),E("pattern mismatch"),O("}"),"string"!==h&&O("}")}if(i.allOf&&i.allOf.forEach(function(t,r){k(e,t,o,f,c.concat(["allOf",r]))}),i.anyOf&&i.anyOf.length){L=_("prev");i.anyOf.forEach(function(t,r){0===r?O("var %s = errors",L):O("if (errors !== %s) {",L)("errors = %s",L),k(e,t,!1,!1,c)}),i.anyOf.forEach(function(e,t){t&&O("}")}),O("if (%s !== errors) {",L),E("no schemas match"),O("}")}if(i.oneOf&&i.oneOf.length){L=_("prev");var P=_("passes");O("var %s = errors",L)("var %s = 0",P),i.oneOf.forEach(function(t,r){k(e,t,!1,!1,c),O("if (%s === errors) {",L)("%s++",P)("} else {")("errors = %s",L)("}")}),O("if (%s !== 1) {",P),E("no (or more than one) schemas match"),O("}")}for(void 0!==i.multipleOf&&("number"!==h&&"integer"!==h&&O("if (%s) {",u.number(e)),O("if (!isMultipleOf(%s, %d)) {",e,i.multipleOf),E("has a remainder"),O("}"),"number"!==h&&"integer"!==h&&O("}")),void 0!==i.maxProperties&&("object"!==h&&O("if (%s) {",u.object(e)),O("if (Object.keys(%s).length > %d) {",e,i.maxProperties),E("has more properties than allowed"),O("}"),"object"!==h&&O("}")),void 0!==i.minProperties&&("object"!==h&&O("if (%s) {",u.object(e)),O("if (Object.keys(%s).length < %d) {",e,i.minProperties),E("has less properties than allowed"),O("}"),"object"!==h&&O("}")),void 0!==i.maxItems&&("array"!==h&&O("if (%s) {",u.array(e)),O("if (%s.length > %d) {",e,i.maxItems),E("has more items than allowed"),O("}"),"array"!==h&&O("}")),void 0!==i.minItems&&("array"!==h&&O("if (%s) {",u.array(e)),O("if (%s.length < %d) {",e,i.minItems),E("has less items than allowed"),O("}"),"array"!==h&&O("}")),void 0!==i.maxLength&&("string"!==h&&O("if (%s) {",u.string(e)),O("if (%s.length > %d) {",e,i.maxLength),E("has longer length than allowed"),O("}"),"string"!==h&&O("}")),void 0!==i.minLength&&("string"!==h&&O("if (%s) {",u.string(e)),O("if (%s.length < %d) {",e,i.minLength),E("has less length than allowed"),O("}"),"string"!==h&&O("}")),void 0!==i.minimum&&("number"!==h&&"integer"!==h&&O("if (%s) {",u.number(e)),O("if (%s %s %d) {",e,i.exclusiveMinimum?"<=":"<",i.minimum),E("is less than minimum"),O("}"),"number"!==h&&"integer"!==h&&O("}")),void 0!==i.maximum&&("number"!==h&&"integer"!==h&&O("if (%s) {",u.number(e)),O("if (%s %s %d) {",e,i.exclusiveMaximum?">=":">",i.maximum),E("is more than maximum"),O("}"),"number"!==h&&"integer"!==h&&O("}")),l&&Object.keys(l).forEach(function(t){Array.isArray(h)&&-1!==h.indexOf("null")&&O("if (%s !== null) {",e),k(n(e,t),l[t],o,f,c.concat(v?t:["properties",t])),Array.isArray(h)&&-1!==h.indexOf("null")&&O("}")});w--;)O("}")},O=i("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return k("data",e,h,p&&p.filter,[]),O("return errors === 0")("}"),(O=O.toFunction(b)).errors=null,Object.defineProperty&&Object.defineProperty(O,"error",{get:function(){return O.errors?O.errors.map(function(e){return e.field+" "+e.message}).join("\n"):""}}),O.toJSON=function(){return e},O};t.exports=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),d(e,{},e,!0,t)},t.exports.filter=function(e,r){var n=t.exports(e,o(r,{filter:!0}));return function(e){return n(e),e}}},{"./formats":194,"generate-function":159,"generate-object-property":160,jsonpointer:200,xtend:357}],196:[function(e,t,r){t.exports=function(e){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}},{}],197:[function(e,t,r){var n,i=e("call-bound"),a=e("has-tostringtag/shams")(),o=e("hasown"),s=e("gopd");if(a){var u=i("RegExp.prototype.exec"),f={},c=function(){throw f},l={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(l[Symbol.toPrimitive]=c),n=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&o(t,"value")))return!1;try{u(e,l)}catch(e){return e===f}}}else{var d=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===d(e)}}t.exports=n},{"call-bound":92,gopd:167,"has-tostringtag/shams":171,hasown:185}],198:[function(e,t,r){var n=e("which-typed-array");t.exports=function(e){return!!n(e)}},{"which-typed-array":355}],199:[function(e,t,r){(function(e){(function(){var r={},n=r.LEFT_BRACE=1,i=r.RIGHT_BRACE=2,a=r.LEFT_BRACKET=3,o=r.RIGHT_BRACKET=4,s=r.COLON=5,u=r.COMMA=6,f=r.TRUE=7,c=r.FALSE=8,l=r.NULL=9,d=r.STRING=10,h=r.NUMBER=11,p=r.START=17,y=r.STOP=18,b=r.TRUE1=33,m=r.TRUE2=34,g=r.TRUE3=35,v=r.FALSE1=49,w=r.FALSE2=50,_=r.FALSE3=51,S=r.FALSE4=52,E=r.NULL1=65,M=r.NULL2=66,A=r.NULL3=67,D=r.NUMBER1=81,k=r.NUMBER3=83,O=r.STRING1=97,x=r.STRING2=98,R=r.STRING3=99,C=r.STRING4=100,j=r.STRING5=101,q=r.STRING6=102,I=r.VALUE=113,T=r.KEY=114,L=r.OBJECT=129,U=r.ARRAY=130,P="\\".charCodeAt(0),B="/".charCodeAt(0),N="\b".charCodeAt(0),F="\f".charCodeAt(0),Q="\n".charCodeAt(0),$="\r".charCodeAt(0),z="\t".charCodeAt(0),H=65536;function J(){this.tState=p,this.value=void 0,this.string=void 0,this.stringBuffer=e.alloc?e.alloc(H):new e(H),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=I,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new e(2),3:new e(3),4:new e(4)},this.offset=-1}J.toknam=function(e){for(var t=Object.keys(r),n=0,i=t.length;n<i;n++){var a=t[n];if(r[a]===e)return a}return e&&"0x"+e.toString(16)};var W=J.prototype;W.onError=function(e){throw e},W.charError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(e[t]))+" at position "+t+" in state "+J.toknam(this.tState)))},W.appendStringChar=function(e){this.stringBufferOffset>=H&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},W.appendStringBuf=function(e,t,r){var n=e.length;"number"==typeof t&&(n="number"==typeof r?r<0?e.length-t+r:r-t:e.length-t),n<0&&(n=0),this.stringBufferOffset+n>H&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=n},W.write=function(t){var r;"string"==typeof t&&(t=new e(t));for(var y=0,I=t.length;y<I;y++)if(this.tState===p){if(r=t[y],this.offset++,123===r)this.onToken(n,"{");else if(125===r)this.onToken(i,"}");else if(91===r)this.onToken(a,"[");else if(93===r)this.onToken(o,"]");else if(58===r)this.onToken(s,":");else if(44===r)this.onToken(u,",");else if(116===r)this.tState=b;else if(102===r)this.tState=v;else if(110===r)this.tState=E;else if(34===r)this.string="",this.stringBufferOffset=0,this.tState=O;else if(45===r)this.string="-",this.tState=D;else if(r>=48&&r<64)this.string=String.fromCharCode(r),this.tState=k;else if(32!==r&&9!==r&&10!==r&&13!==r)return this.charError(t,y)}else if(this.tState===O)if(r=t[y],this.bytes_remaining>0){for(var T=0;T<this.bytes_remaining;T++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+T]=t[T];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,y=y+T-1}else if(0===this.bytes_remaining&&r>=128){if(r<=193||r>244)return this.onError(new Error("Invalid UTF-8 character at position "+y+" in state "+J.toknam(this.tState)));if(r>=194&&r<=223&&(this.bytes_in_sequence=2),r>=224&&r<=239&&(this.bytes_in_sequence=3),r>=240&&r<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+y>t.length){for(var L=0;L<=t.length-1-y;L++)this.temp_buffs[this.bytes_in_sequence][L]=t[y+L];this.bytes_remaining=y+this.bytes_in_sequence-t.length,y=t.length-1}else this.appendStringBuf(t,y,y+this.bytes_in_sequence),y=y+this.bytes_in_sequence-1}else if(34===r)this.tState=p,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(d,this.string),this.offset+=e.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===r)this.tState=x;else{if(!(r>=32))return this.charError(t,y);this.appendStringChar(r)}else if(this.tState===x)if(34===(r=t[y]))this.appendStringChar(r),this.tState=O;else if(92===r)this.appendStringChar(P),this.tState=O;else if(47===r)this.appendStringChar(B),this.tState=O;else if(98===r)this.appendStringChar(N),this.tState=O;else if(102===r)this.appendStringChar(F),this.tState=O;else if(110===r)this.appendStringChar(Q),this.tState=O;else if(114===r)this.appendStringChar($),this.tState=O;else if(116===r)this.appendStringChar(z),this.tState=O;else{if(117!==r)return this.charError(t,y);this.unicode="",this.tState=R}else if(this.tState===R||this.tState===C||this.tState===j||this.tState===q){if(!((r=t[y])>=48&&r<64||r>64&&r<=70||r>96&&r<=102))return this.charError(t,y);if(this.unicode+=String.fromCharCode(r),this.tState++===q){var U=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&U>=56320&&U<57344?(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate,U))),this.highSurrogate=void 0):void 0===this.highSurrogate&&U>=55296&&U<56320?this.highSurrogate=U:(void 0!==this.highSurrogate&&(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new e(String.fromCharCode(U)))),this.tState=O}}else if(this.tState===D||this.tState===k)switch(r=t[y]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(r),this.tState=k;break;default:this.tState=p;var H=Number(this.string);if(isNaN(H))return this.charError(t,y);this.string.match(/[0-9]+/)==this.string&&H.toString()!=this.string?this.onToken(d,this.string):this.onToken(h,H),this.offset+=this.string.length-1,this.string=void 0,y--}else if(this.tState===b){if(114!==t[y])return this.charError(t,y);this.tState=m}else if(this.tState===m){if(117!==t[y])return this.charError(t,y);this.tState=g}else if(this.tState===g){if(101!==t[y])return this.charError(t,y);this.tState=p,this.onToken(f,!0),this.offset+=3}else if(this.tState===v){if(97!==t[y])return this.charError(t,y);this.tState=w}else if(this.tState===w){if(108!==t[y])return this.charError(t,y);this.tState=_}else if(this.tState===_){if(115!==t[y])return this.charError(t,y);this.tState=S}else if(this.tState===S){if(101!==t[y])return this.charError(t,y);this.tState=p,this.onToken(c,!1),this.offset+=4}else if(this.tState===E){if(117!==t[y])return this.charError(t,y);this.tState=M}else if(this.tState===M){if(108!==t[y])return this.charError(t,y);this.tState=A}else if(this.tState===A){if(108!==t[y])return this.charError(t,y);this.tState=p,this.onToken(l,null),this.offset+=3}},W.onToken=function(e,t){},W.parseError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+J.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+J.toknam(this.state)))},W.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},W.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=I)},W.emit=function(e){this.mode&&(this.state=u),this.onValue(e)},W.onValue=function(e){},W.onToken=function(e,t){if(this.state===I)if(e===d||e===h||e===f||e===c||e===l)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===n)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=T,this.mode=L;else if(e===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=U,this.state=I;else if(e===i){if(this.mode!==L)return this.parseError(e,t);this.pop()}else{if(e!==o)return this.parseError(e,t);if(this.mode!==U)return this.parseError(e,t);this.pop()}else if(this.state===T)if(e===d)this.key=t,this.state=s;else{if(e!==i)return this.parseError(e,t);this.pop()}else if(this.state===s){if(e!==s)return this.parseError(e,t);this.state=I}else{if(this.state!==u)return this.parseError(e,t);if(e===u)this.mode===U?(this.key++,this.state=I):this.mode===L&&(this.state=T);else{if(!(e===o&&this.mode===U||e===i&&this.mode===L))return this.parseError(e,t);this.pop()}}},J.C=r,t.exports=J}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83}],200:[function(e,t,r){var n=/~/,i=/~[01]/g;function a(e){switch(e){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+e)}function o(e){return n.test(e)?e.replace(i,a):e}function s(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e;throw new Error("Invalid JSON pointer.")}if(Array.isArray(e)){for(const t of e)if("string"!=typeof t&&"number"!=typeof t)throw new Error("Invalid JSON pointer. Must be of type string or number.");return e}throw new Error("Invalid JSON pointer.")}function u(e,t){if("object"!=typeof e)throw new Error("Invalid input object.");var r=(t=s(t)).length;if(1===r)return e;for(var n=1;n<r;){if(e=e[o(t[n++])],r===n)return e;if("object"!=typeof e||null===e)return}}function f(e,t,r){if("object"!=typeof e)throw new Error("Invalid input object.");if(0===(t=s(t)).length)throw new Error("Invalid JSON pointer for set.");return function(e,t,r){for(var n,i,a=1,s=t.length;a<s;){if("constructor"===t[a]||"prototype"===t[a]||"__proto__"===t[a])return e;if(n=o(t[a++]),i=s>a,void 0===e[n]&&(Array.isArray(e)&&"-"===n&&(n=e.length),i&&(""!==t[a]&&t[a]<1/0||"-"===t[a]?e[n]=[]:e[n]={})),!i)break;e=e[n]}var u=e[n];return void 0===r?delete e[n]:e[n]=r,u}(e,t,r)}r.get=u,r.set=f,r.compile=function(e){var t=s(e);return{get:function(e){return u(e,t)},set:function(e,r){return f(e,t,r)}}}},{}],201:[function(e,t,r){t.exports=Math.abs},{}],202:[function(e,t,r){t.exports=Math.floor},{}],203:[function(e,t,r){t.exports=Number.isNaN||function(e){return e!=e}},{}],204:[function(e,t,r){t.exports=Math.max},{}],205:[function(e,t,r){t.exports=Math.min},{}],206:[function(e,t,r){t.exports=Math.pow},{}],207:[function(e,t,r){t.exports=Math.round},{}],208:[function(e,t,r){var n=e("./isNaN");t.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},{"./isNaN":203}],209:[function(e,t,r){var n=e("inherits"),i=e("hash-base"),a=e("safe-buffer").Buffer,o=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function f(e,t,r,n,i,a,o){return u(e+(t&r|~t&n)+i+a|0,o)+t|0}function c(e,t,r,n,i,a,o){return u(e+(t&n|r&~n)+i+a|0,o)+t|0}function l(e,t,r,n,i,a,o){return u(e+(t^r^n)+i+a|0,o)+t|0}function d(e,t,r,n,i,a,o){return u(e+(r^(t|~n))+i+a|0,o)+t|0}n(s,i),s.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,a=this._d;r=f(r,n,i,a,e[0],3614090360,7),a=f(a,r,n,i,e[1],3905402710,12),i=f(i,a,r,n,e[2],606105819,17),n=f(n,i,a,r,e[3],3250441966,22),r=f(r,n,i,a,e[4],4118548399,7),a=f(a,r,n,i,e[5],1200080426,12),i=f(i,a,r,n,e[6],2821735955,17),n=f(n,i,a,r,e[7],4249261313,22),r=f(r,n,i,a,e[8],1770035416,7),a=f(a,r,n,i,e[9],2336552879,12),i=f(i,a,r,n,e[10],4294925233,17),n=f(n,i,a,r,e[11],2304563134,22),r=f(r,n,i,a,e[12],1804603682,7),a=f(a,r,n,i,e[13],4254626195,12),i=f(i,a,r,n,e[14],2792965006,17),r=c(r,n=f(n,i,a,r,e[15],1236535329,22),i,a,e[1],4129170786,5),a=c(a,r,n,i,e[6],3225465664,9),i=c(i,a,r,n,e[11],643717713,14),n=c(n,i,a,r,e[0],3921069994,20),r=c(r,n,i,a,e[5],3593408605,5),a=c(a,r,n,i,e[10],38016083,9),i=c(i,a,r,n,e[15],3634488961,14),n=c(n,i,a,r,e[4],3889429448,20),r=c(r,n,i,a,e[9],568446438,5),a=c(a,r,n,i,e[14],3275163606,9),i=c(i,a,r,n,e[3],4107603335,14),n=c(n,i,a,r,e[8],1163531501,20),r=c(r,n,i,a,e[13],2850285829,5),a=c(a,r,n,i,e[2],4243563512,9),i=c(i,a,r,n,e[7],1735328473,14),r=l(r,n=c(n,i,a,r,e[12],2368359562,20),i,a,e[5],4294588738,4),a=l(a,r,n,i,e[8],2272392833,11),i=l(i,a,r,n,e[11],1839030562,16),n=l(n,i,a,r,e[14],4259657740,23),r=l(r,n,i,a,e[1],2763975236,4),a=l(a,r,n,i,e[4],1272893353,11),i=l(i,a,r,n,e[7],4139469664,16),n=l(n,i,a,r,e[10],3200236656,23),r=l(r,n,i,a,e[13],681279174,4),a=l(a,r,n,i,e[0],3936430074,11),i=l(i,a,r,n,e[3],3572445317,16),n=l(n,i,a,r,e[6],76029189,23),r=l(r,n,i,a,e[9],3654602809,4),a=l(a,r,n,i,e[12],3873151461,11),i=l(i,a,r,n,e[15],530742520,16),r=d(r,n=l(n,i,a,r,e[2],3299628645,23),i,a,e[0],4096336452,6),a=d(a,r,n,i,e[7],1126891415,10),i=d(i,a,r,n,e[14],2878612391,15),n=d(n,i,a,r,e[5],4237533241,21),r=d(r,n,i,a,e[12],1700485571,6),a=d(a,r,n,i,e[3],2399980690,10),i=d(i,a,r,n,e[10],4293915773,15),n=d(n,i,a,r,e[1],2240044497,21),r=d(r,n,i,a,e[8],1873313359,6),a=d(a,r,n,i,e[15],4264355552,10),i=d(i,a,r,n,e[6],2734768916,15),n=d(n,i,a,r,e[13],1309151649,21),r=d(r,n,i,a,e[4],4149444226,6),a=d(a,r,n,i,e[11],3174756917,10),i=d(i,a,r,n,e[2],718787259,15),n=d(n,i,a,r,e[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+a|0},s.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 e=a.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=s},{"hash-base":172,inherits:189,"safe-buffer":291}],210:[function(e,t,r){
|
|
9
8
|
/**
|
|
10
|
-
* Meadow Endpoint Utility
|
|
9
|
+
* Meadow Endpoint Utility Function - Parse a Filter String and put it into a Query.
|
|
11
10
|
*
|
|
12
11
|
* @license MIT
|
|
13
12
|
*
|
|
14
13
|
* @author Steven Velozo <steven@velozo.com>
|
|
15
14
|
* @module Meadow
|
|
16
15
|
*/
|
|
17
|
-
const{parse:n}=e("meadow-filter");t.exports=class{constructor(e){this._Controller=e}parseFilter(e,t){return n(e,t)}}},{"meadow-filter":132}],7:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getSessionData(e){let t,r=Object.assign({},this._Controller.settings.MeadowEndpointsDefaultSessionObject);switch(this._Controller.settings.MeadowEndpointsSessionDataSource||"Request"){default:this._Controller.log.warn(`Unknown session source configured: ${this._Controller.settings.MeadowEndpointsSessionDataSource} - defaulting to Request for backward compatibility`);case"Request":r=this._Controller.extend(r,e.UserSession);break;case"None":break;case"Header":try{if(t=e.headers["x-trusted-session"],!t)break;const n=JSON.parse(t);r=this._Controller.extend(r,n)}catch(e){this._Controller.log.error(`Meadow Endpoints attempted to process a Header Session String with value [${t}] and failed -- likely culprit is bad JSON.`)}}return e.UserSession=r,r}}},{}],8:[function(e,t,r){const n=e("async/eachSeries"),o=e("JSONStream");t.exports=class{constructor(e){this._Controller=e}chunk(e,t,r){let n=[...e],o="number"==typeof t?t:0,a=void 0!==r?r:[];if(o<=0)return a;for(;n.length;)a.push(n.splice(0,o));return a}streamRecordArray(e,t,r){if(!e.writeHead||!Array.isArray(t)||t.length<2500)return e.send(t),r();e.writeHead(200,{"content-type":"application/json"});const a=o.stringify();a.pipe(e),n(this.chunk(t,1e3),(e,t)=>{e.forEach(a.write),setTimeout(t,0)},e=>{a.end(),r(e)})}}},{JSONStream:35,"async/eachSeries":38}],9:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Count");this.waterfall([t=>(n.Query=this.DAL.query,"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Count-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,(t,r,o)=>(n.Result={Count:o},e(t)))},r=>(t.send(n.Result),this.log.requestCompletedSuccessfully(e,n,`Delivered recordset count of ${n.Result.Count} for ${this.DAL.scope}.`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],10:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"CountBy");this.waterfall([t=>(n.Query=this.DAL.query,n.Query.addFilter(e.params.ByField,e.params.ByValue,"=","AND","RequestByField"),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("CountBy-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,(t,r,o)=>(n.Result={Count:o},e(t)))},r=>(this.log.requestCompletedSuccessfully(e,n,"Delivered recordset count of "+n.Result.Count+"."),t.send(n.Result),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],11:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"CreateBulk"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)};o.CreatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(e.RecordsToBulkCreate=e.body,t()):t(this.ErrorHandler.getError("Bulk record create failure - a valid array of records to create is required.",500)),a("CreateBulk-PreRequest"),a("CreateBulk-PreOperation"),r=>{this.eachLimit(e.RecordsToBulkCreate,1,(r,a)=>{n.call(this,r,e,o,t,a)},r)},a("CreateBulk-PostOperation"),e=>this.doStreamRecordArray(t,o.CreatedRecords,e),t=>(this.log.requestCompletedSuccessfully(e,o,`Bulk created ${o.CreatedRecords.length} records`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Operation-Create.js":13}],12:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"Create");this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record create failure - a valid record is required.",500)):t(),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)})("Create-PreRequest"),r=>{n.call(this,e.body,e,o,t,r)},e=>o.RecordCreateError?e(o.RecordCreateErrorObject):o.CreatedRecords.length<1?e(this.ErrorHandler.getError("Unknown record create failure - no created records returned.",500)):(o.Record=o.CreatedRecords[0],e()),e=>(t.send(o.Record),e()),t=>(this.log.requestCompletedSuccessfully(e,o,`Created a ${this.DAL.scope} record ID ${o.Record[this.DAL.defaultIdentifier]}`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Operation-Create.js":13}],13:[function(e,t,r){t.exports=function(e,t,r,n,o){let a=this.cloneAsyncSafeRequestState(r,"doCreate");Array.isArray(a.ParentRequestState.CreatedRecords)||(a.ParentRequestState.CreatedRecords=[]),this.waterfall([t=>(a.RecordToCreate=e,!a.RecordToCreate.hasOwnProperty("IDCustomer")&&this.DAL.jsonSchema&&this.DAL.jsonSchema.properties&&this.DAL.jsonSchema.properties.hasOwnProperty("IDCustomer")&&(a.RecordToCreate.IDCustomer=a.SessionData.CustomerID||0),t()),e=>{this.BehaviorInjection.runBehavior("Create-PreOperation",this,t,a,e)},e=>(a.Query=this.DAL.query,a.Query.setIDUser(a.SessionData.UserID),a.Query.addRecord(a.RecordToCreate),e()),e=>{this.BehaviorInjection.runBehavior("Create-QueryConfiguration",this,t,a,e)},e=>{this.DAL.doCreate(a.Query,(t,r,n,o)=>t?e(t):o?(a.Record=o,e()):e(this.ErrorHandler.getError("Error in DAL Create: No record returned from persistence engine.",500)))},e=>this.BehaviorInjection.runBehavior("Create-PostOperation",this,t,a,e),e=>(a.ParentRequestState.CreatedRecords.push(a.Record),this.log.requestCompletedSuccessfully(t,a,`Created a record with ${this.DAL.defaultIdentifier} = ${a.Record[this.DAL.defaultIdentifier]}`),e())],e=>(e&&(a.RecordToCreate.Error=e,a.ParentRequestState.RecordCreateError=!0,a.ParentRequestState.RecordCreateErrorObject=e,a.ParentRequestState.CreatedRecords.push(a.RecordToCreate)),o()))}},{}],14:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Delete");n.IDRecord=0,n.RecordCount={Count:0},this.waterfall([t=>("string"==typeof e.params.IDRecord?n.IDRecord=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(n.IDRecord=e.body[this.DAL.defaultIdentifier]),n.IDRecord<1?t(this.ErrorHandler.getError("Record delete failure - a valid record ID is required in the passed-in record.",500)):t()),e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,n.IDRecord),n.Query.setIDUser(n.SessionData.UserID),e()),t=>this.BehaviorInjection.runBehavior("Delete-QueryConfiguration",this,e,n,t),e=>{this.DAL.doRead(n.Query,(t,r,o)=>o?(n.Record=o,n.OriginalRecord=o,e()):e(this.ErrorHandler.getError("Record not found.",404)))},t=>this.BehaviorInjection.runBehavior("Delete-PreOperation",this,e,n,t),e=>{this.DAL.doDelete(n.Query,(t,r,o)=>(n.RecordCount.Count=o,e(t)))},t=>this.BehaviorInjection.runBehavior("Delete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,`Deleted ${n.RecordCount.Count} ${this.DAL.scope} records with ID ${n.IDRecord}`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],15:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Undelete");var o=0;if("string"==typeof e.params.IDRecord?o=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(o=e.body[this.DAL.defaultIdentifier]),o<1)return r(this.ErrorHandler.getError("Record undelete failure - a valid record ID is required.",500));n.RecordCount={Count:0},this.waterfall([e=>{var t=this.DAL.schema,r=!1;for(let e=0;e<t.length;e++)"Deleted"==t[e].Type&&(r=!0);return r?e():e(this.ErrorHandler.getError("No undelete bit on record.",500))},e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,o),n.Query.addFilter("Deleted",1),n.Query.setIDUser(n.SessionData.UserID),e()),e=>{this.DAL.doRead(n.Query,(t,r,o)=>o?(n.Record=o,n.OriginalRecord=o,e()):e(this.ErrorHandler.getError("Record not found.",404)))},t=>this.BehaviorInjection.runBehavior("Undelete-PreOperation",this,e,n,t),e=>{this.DAL.doUndelete(n.Query,(t,r,o)=>(n.RecordCount={Count:o},e(t)))},t=>this.BehaviorInjection.runBehavior("Undelete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,"Undeleted "+n.RecordCount.Count+" records with ID "+o+"."),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],16:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Read"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([e=>(n.Query=this.DAL.query,e()),o("Read-PreOperation"),t=>{if(!e.params.IDRecord&&e.params.GUIDRecord)n.RecordSearchCriteria=`${this.DAL.defaultGUIdentifier} = ${e.params.GUIDRecord}`,n.Query.addFilter(this.DAL.defaultGUIdentifier,e.params.GUIDRecord,"=","AND","RequestDefaultIdentifier");else{if(!e.params.IDRecord)return t(this.ErrorHandler.getError("No ID Provided",400));n.RecordSearchCriteria=`${this.DAL.defaultIdentifier} = ${e.params.IDRecord}`,n.Query.addFilter(this.DAL.defaultIdentifier,e.params.IDRecord,"=","AND","RequestDefaultIdentifier")}return t()},o("Read-QueryConfiguration"),e=>{try{this.DAL.doRead(n.Query,(t,r,o)=>o?(n.Record=o,e()):e(this.ErrorHandler.getError("Record not Found",404)))}catch(t){return e(t)}},o("Read-PostOperation"),r=>(t.send(n.Record),this.log.requestCompletedSuccessfully(e,n,`Read Record Where ${n.RecordSearchCriteria}`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],17:[function(e,t,r){const n=e("./Meadow-Marshal-DistinctList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadDistinct"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)};o.DistinctColumns,this.waterfall([t=>{o.Query=this.DAL.query.setDistinct(!0);let r=!1,n=!1;if("string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,o.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,o.Query):e.params.Filter&&o.Query.setFilter(e.params.Filter),"string"==typeof e.params.Columns){if(o.DistinctColumns=e.params.Columns.split(","),!o.DistinctColumns)return t({Code:400,Message:"Columns to distinct on must be provided."});o.Query.setDataElements(o.DistinctColumns)}return t()},a("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.Records=t,r()),a("ReadDistinct-PostOperation"),t=>(o.ResultRecords=n.call(this,o.Records,e,o.DistinctColumns),t()),e=>this.doStreamRecordArray(t,o.ResultRecords,e),t=>(this.log.requestCompletedSuccessfully(e,o,`Read a recordset distinct lite list with ${o.ResultRecords.length} results.`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Marshal-DistinctList.js":23}],18:[function(e,t,r){const n=e("./Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadsLite"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)};this.waterfall([t=>{o.Query=this.DAL.query;var r=!1,n=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,o.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,o.Query):e.params.Filter&&o.Query.setFilter(e.params.Filter),t()},a("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.RawRecords=t,o.Records=t,r()),a("ReadsLite-PostOperation"),t=>(o.Records=n.call(this,o.RawRecords,e,"string"==typeof e.params.ExtraColumns?e.params.ExtraColumns.split(","):[]),t()),e=>this.doStreamRecordArray(t,o.Records,r),t=>(this.log.requestCompletedSuccessfully(e,o,`Read a recordset lite list with ${o.Records.length} results`),t())],(n,a)=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Marshal-LiteList.js":24}],19:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadMax");this.waterfall([e=>(n.Query=this.DAL.query,e()),t=>(n.ColumnName=e.params.ColumnName,n.Query.setSort({Column:n.ColumnName,Direction:"Descending"}),n.Query.setCap(1),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("ReadMax-QueryConfiguration"),e=>{this.DAL.doRead(n.Query,e)},(e,t,r)=>t?(n.Record=t,r()):r(this.ErrorHandler.getError("Record not Found",404)),t=>{this.BehaviorInjection.runBehavior("ReadMax-PostOperation",this,e,n,t)},r=>{this.log.requestCompletedSuccessfully(e,n,`Read max record of ${this.DAL.scope} on ${n.ColumnName}`),t.send(n.Record)}],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],20:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,o=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(o=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(o),"string"==typeof e.params.Filter&&this.parseFilter(e.params.Filter,n.Query),t()},o("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),n.Records=t,r()),o("ReadSelectList-PostOperation"),e=>{n.SelectList=[];for(var t=0;t<n.Records.length;t++)n.SelectList.push({Hash:n.Records[t][this.DAL.defaultIdentifier],Value:this.BehaviorInjection.processTemplate("SelectList",{Record:n.Records[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")});return e()},e=>this.doStreamRecordArray(t,n.SelectList,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a recordset lite list with ${n.SelectList.length} results.`),t())],(o,a)=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],21:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Reads"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,o=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(o=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(o),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()},o("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>t?(n.Records=t,r()):r(this.ErrorHandler.getError("No records found.",404)),o("Reads-PostOperation"),e=>{this.doStreamRecordArray(t,n.Records,e)},t=>(this.log.requestCompletedSuccessfully(e,n,"Read a list of records."),t())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],22:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,o=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(o=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(o),t()},t=>{function r(e,t){t.constructor===Array?n.Query.addFilter(e,t,"IN","AND","RequestByField"):n.Query.addFilter(e,t,"=","AND","RequestByField")}var o=e.params.Filters;return o&&o.constructor===Array?o.forEach(function(e){r(e.ByField,e.ByValue)}):r(e.params.ByField,e.params.ByValue),t()},o("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,(t,r,o)=>o?(n.Records=o,e()):e(this.ErrorHandler.getError("No records found.",404)))},o("Reads-PostOperation"),e=>this.doStreamRecordArray(t,n.Records,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a list of records by ${e.params.ByField} = ${e.params.ByValue}`),t())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],23:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],o=void 0!==r?r:[],a=(!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,e[0].hasOwnProperty("UpdateDate"),Object.keys(e[0]),0);for(;a<o.length;)e[0].hasOwnProperty(o[0])?a++:o.splice(a,1);for(let t=0;t<e.length;t++){let r={};o.forEach(n=>{r[n]=e[t][n]}),n.push(r)}return n}},{}],24:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],o=void 0!==r?r:[],a=!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,i=!!e[0].hasOwnProperty("UpdateDate");Object.keys(e[0]).forEach(e=>{0!==e.indexOf("ID")&&0!==e.indexOf("GUID")&&"CreatingIDUser"!=e||o.push(e)});let u=0;for(;u<o.length;)e[0].hasOwnProperty(o[0])?u++:o.splice(u,1);for(let t=0;t<e.length;t++){let r={Value:this.BehaviorInjection.processTemplate("SelectList",{Record:e[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")};r[this.DAL.defaultIdentifier]=e[t][this.DAL.defaultIdentifier],a&&(r[a]=e[t][a]),i&&(r.UpdateDate=e[t].UpdateDate),o.forEach(n=>{r[n]=e[t][n]}),n.push(r)}return n}},{}],25:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"New"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([o("New-PreOperation"),e=>(n.EmptyEntityRecord||(n.EmptyEntityRecord=this.extend({},this.DAL.schemaFull.defaultObject)),e()),o("New-PostOperation"),r=>(t.send(n.EmptyEntityRecord),this.log.requestCompletedSuccessfully(e,n,`Delivered New ${this.DAL.scope} Record`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],26:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Schema"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([o("Schema-PreOperation"),t=>(e.JSONSchema||(n.JSONSchema=this.extend({},this.DAL.jsonSchema)),t()),o("Schema-PostOperation"),r=>(t.send(n.JSONSchema),this.log.requestCompletedSuccessfully(e,n,`Delivered JSONSchema for ${this.DAL.scope}`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],27:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Validate"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([o("Validate-PreOperation"),t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record validate failure - a valid JSON object is required.",500)):(n.Record=e.body,t()),e=>(n.RecordValidation=this.DAL.schemaFull.validateObject(n.Record),e()),o("Validate-PostOperation"),r=>(t.send(n.RecordValidation),this.log.requestCompletedSuccessfully(e,n,`Validated Record for ${this.DAL.scope} - ${JSON.stringify(n.RecordValidation)}`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],28:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"UpdateBulk"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)};o.UpdatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(o.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record update failure - a valid record is required.",500)),a("UpdateBulk-PreOperation"),r=>{this.eachLimit(o.BulkRecords,1,(r,a)=>{n.call(this,r,e,o,t,a)},r)},a("UpdateBulk-PostOperation"),e=>this.doStreamRecordArray(t,o.UpdatedRecords,e),t=>(this.log.requestCompletedSuccessfully(e,o,`Bulk updated ${o.UpdatedRecords.length} records`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Operation-Update.js":30}],29:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"Update");this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record update failure - a valid record is required.",400)):e.body[this.DAL.defaultIdentifier]<1?t(this.ErrorHandler.getError("Record update failure - a valid record ID is required in the passed-in record.",400)):(o.Record=e.body,t()),r=>{n.call(this,e.body,e,o,t,r)},e=>o.RecordUpdateError?e(o.RecordUpdateErrorObject):o.UpdatedRecords.length<1?e(this.ErrorHandler.getError("Unknown record update failure - no updated records returned.",500)):(o.Record=o.UpdatedRecords[0],e()),e=>(t.send(o.Record),e())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Operation-Update.js":30}],30:[function(e,t,r){t.exports=function(e,t,r,n,o,a){let i=this.cloneAsyncSafeRequestState(r,"doUpdate"),u=e=>r=>{this.BehaviorInjection.runBehavior(e,this,t,i,r)};if(e[this.DAL.defaultIdentifier]<1&&void 0===a)return o("Record update failure - a valid record ID is required in the passed-in record.");Array.isArray(i.ParentRequestState.UpdatedRecords)||(i.ParentRequestState.UpdatedRecords=[]),this.waterfall([t=>{if(i.RecordToModify=e,void 0!==a)return i.OriginalRecord=a,t();i.Query=this.DAL.query,i.Query.addFilter(this.DAL.defaultIdentifier,i.RecordToModify[this.DAL.defaultIdentifier]),this.DAL.doRead(i.Query,(e,r,n)=>e?t(e):n?(i.Record=n,i.OriginalRecord=n,t()):t(this.ErrorHandler.getError("Record not Found",404)))},e=>(i.Query=this.DAL.query,e()),u("Update-PreOperation"),e=>(i.Query.setIDUser(i.SessionData.UserID),i.Query.addRecord(i.RecordToModify),e()),u("Update-QueryConfiguration"),e=>{this.DAL.doUpdate(i.Query,(t,r,n,o)=>t?e("string"==typeof t?this.ErrorHandler.getError(t,500):t):o?(i.Record=o,e()):e(this.ErrorHandler.getError("Error in DAL Update: No record returned from persistence engine.",500)))},e=>this.BehaviorInjection.runBehavior("Update-PostOperation",this,t,i,e),e=>(i.ParentRequestState.UpdatedRecords.push(i.Record),this.log.requestCompletedSuccessfully(t,i,`Updated record with ID ${i.Record[this.DAL.defaultIdentifier]}`),e())],e=>(e&&(i.Record?i.Record.Error=e:i.Record={Error:e},i.ParentRequestState.RecordUpdateError=!0,i.ParentRequestState.RecordUpdateErrorObject=e,i.ParentRequestState.UpdatedRecords.push(i.Record)),o()))}},{}],31:[function(e,t,r){const n=e("./Meadow-Operation-Upsert.js"),o=e("../read/Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let a=this.initializeRequestState(e,"UpsertBulk"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,a,r)};a.CreatedRecords=[],a.UpdatedRecords=[],a.UpsertedRecords=[],a.ErrorRecords=[],this.waterfall([t=>Array.isArray(e.body)?(a.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record bulk upsert failure - a valid array of records is required.",500)),i("UpsertBulk-PreOperation"),r=>{this.eachLimit(a.BulkRecords,1,(r,o)=>{n.call(this,r,e,a,t,o)},r)},i("UpsertBulk-PostOperation"),r=>{let n=a.BulkRecords&&a.BulkRecords.length||0,i=a.ErrorRecords&&a.ErrorRecords.length||0,u=a.UpsertedRecords&&a.UpsertedRecords.length||0;try{t.header("X-Meadow-Upsert-Total",String(n)),t.header("X-Meadow-Upsert-Succeeded",String(u)),t.header("X-Meadow-Upsert-Errored",String(i))}catch(e){}return this.doStreamRecordArray(t,o.call(this,a.UpsertedRecords,e),r)},t=>{let r=a.UpsertedRecords&&a.UpsertedRecords.length||0,n=a.ErrorRecords&&a.ErrorRecords.length||0,o=n>0?`Bulk upsert complete -- ${r} records succeeded, ${n} errored`:`Bulk upsert complete -- ${r} records processed`;return this.log.requestCompletedSuccessfully(e,a,o),t()}],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":24,"./Meadow-Operation-Upsert.js":34}],32:[function(e,t,r){const n=e("./Meadow-Operation-Upsert.js"),o=e("../read/Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let a=this.initializeRequestState(e,"UpsertBulkDetailed"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,a,r)};a.CreatedRecords=[],a.UpdatedRecords=[],a.UpsertedRecords=[],a.ErrorRecords=[],this.waterfall([t=>Array.isArray(e.body)?(a.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record bulk upsert (detailed) failure - a valid array of records is required.",500)),i("UpsertBulk-PreOperation"),r=>{this.eachLimit(a.BulkRecords,1,(r,o)=>{n.call(this,r,e,a,t,o)},r)},i("UpsertBulk-PostOperation"),r=>{let n=a.BulkRecords&&a.BulkRecords.length||0,i=a.ErrorRecords&&a.ErrorRecords.length||0,u=a.UpsertedRecords&&a.UpsertedRecords.length||0;try{t.header("X-Meadow-Upsert-Total",String(n)),t.header("X-Meadow-Upsert-Succeeded",String(u)),t.header("X-Meadow-Upsert-Errored",String(i))}catch(e){}let s={Counts:{Total:n,Succeeded:u,Errored:i},UpsertedRecords:o.call(this,a.UpsertedRecords,e),ErrorRecords:a.ErrorRecords||[]};return t.send(s),r()},t=>{let r=a.UpsertedRecords&&a.UpsertedRecords.length||0,n=a.ErrorRecords&&a.ErrorRecords.length||0,o=n>0?`Bulk upsert (detailed) complete -- ${r} records succeeded, ${n} errored`:`Bulk upsert (detailed) complete -- ${r} records processed`;return this.log.requestCompletedSuccessfully(e,a,o),t()}],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":24,"./Meadow-Operation-Upsert.js":34}],33:[function(e,t,r){var n=e("./Meadow-Operation-Upsert.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"Upsert");o.CreatedRecords=[],o.UpdatedRecords=[],o.UpsertedRecords=[],o.ErrorRecords=[],this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record upsert failure - a valid record is required.",500)):(o.RecordToUpsert=e.body,t()),r=>{n.call(this,o.RecordToUpsert,e,o,t,r)},e=>o.RecordUpsertError?e(o.RecordUpsertErrorMessage):o.UpsertedRecords.length<1?e(this.ErrorHandler.getError("Record upsert unknown failure - no record back from Upsert operation.",500)):(o.Record=o.UpsertedRecords[0],t.send(o.Record),e())],n=>this.ErrorHandler.handleErrorIfSet(e,o,t,n,r))}},{"./Meadow-Operation-Upsert.js":34}],34:[function(e,t,r){const n=e("../create/Meadow-Operation-Create.js"),o=e("../update/Meadow-Operation-Update.js");t.exports=function(e,t,r,a,i){let u=this.cloneAsyncSafeRequestState(r,"Upsert");this.waterfall([t=>(u.Query=this.DAL.query,u.Record=e,u.UpsertCreateOnly=!0,void 0!==u.Record[this.DAL.defaultGUIdentifier]&&u.Record[this.DAL.defaultGUIdentifier].length>0&&(u.Query.addFilter(this.DAL.defaultGUIdentifier,u.Record[this.DAL.defaultGUIdentifier]),u.UpsertCreateOnly=!1),void 0!==u.Record[this.DAL.defaultIdentifier]&&u.Record[this.DAL.defaultIdentifier]>0&&(u.Query.addFilter(this.DAL.defaultIdentifier,u.Record[this.DAL.defaultIdentifier]),u.UpsertCreateOnly=!1),t()),e=>{u.UpsertCreateOnly?(u.Operation="Create",n.call(this,u.Record,t,u,a,e)):this.DAL.doRead(u.Query,(r,i,s)=>{if(r)return e("string"==typeof r?this.ErrorHandler.getError(r,500):r);if(s){if(u.Record.hasOwnProperty(this.DAL.defaultIdentifier)&&u.Record[this.DAL.defaultIdentifier]||(u.Record[this.DAL.defaultIdentifier]=s[this.DAL.defaultIdentifier]),u.Record[this.DAL.defaultIdentifier]!=s[this.DAL.defaultIdentifier])return e(this.ErrorHandler.getError("Record IDs do not match",500));u.Operation="Update",o.call(this,u.Record,t,u,a,e,s)}else u.Operation="Create",n.call(this,u.Record,t,u,a,e)})},e=>{if("Update"==u.Operation){if(u.RecordUpdateError)return e(u.RecordUpdateErrorObject);if(u.UpdatedRecords.length<1)return e(this.ErrorHandler.getError("Unknown record update failure - no updated records returned.",500));u.Record=u.UpdatedRecords[0]}else{if("Create"!=u.Operation)return e(this.ErrorHandler.getError("Unkknown record upsert failure = no records returned from doUpsert.",500));if(u.RecordCreateError)return e(u.RecordCreateErrorObject);if(u.CreatedRecords.length<1)return e(this.ErrorHandler.getError("Unknown record create failure - no created records returned.",500));u.Record=u.CreatedRecords[0]}return u.ParentRequestState.UpsertedRecords.push(u.Record),e()}],e=>{if(e&&(u.Record.Error=e,u.ParentRequestState&&Array.isArray(u.ParentRequestState.ErrorRecords))){let t=e&&(e.message||e.Error)?e.message||e.Error:String(e);u.ParentRequestState.ErrorRecords.push({Record:u.Record,Operation:u.Operation||"Unknown",Error:t})}return i()})}},{"../create/Meadow-Operation-Create.js":13,"../update/Meadow-Operation-Update.js":30}],35:[function(e,t,r){(function(t){(function(){var n=e("jsonparse"),o=e("through"),a=t.from&&t.from!==Uint8Array.from;function i(e,t){return"string"==typeof e?t==e:e&&"function"==typeof e.exec?e.exec(t):"boolean"==typeof e||"object"==typeof e?e:"function"==typeof e&&e(t)}r.parse=function(e,r){var u,s,l=new n,c=o(function(e){"string"==typeof e&&(e=a?t.from(e):new t(e)),l.write(e)},function(e){e&&c.write(e),u&&c.emit("header",u),s&&c.emit("footer",s),c.queue(null)});"string"==typeof e&&(e=e.split(".").map(function(e){return"$*"===e?{emitKey:!0}:"*"===e||(""===e?{recurse:!0}:e)}));return e&&e.length||(e=null),l.onValue=function(t){if(this.root||(c.root=t),e){for(var n=0,o=0,a=!1,s=!1;n<e.length;){var l,d=e[n];if(o++,d&&!d.recurse){if(!(l=o===this.stack.length?this:this.stack[o]))return;if(!i(d,l.key))return void f(l.key,t);a=!!d.emitKey,s=!!d.emitPath,n++}else{n++;var p=e[n];if(!p)return;for(;;){if(!(l=o===this.stack.length?this:this.stack[o]))return;if(i(p,l.key)){n++,Object.isFrozen(this.stack[o])||(this.stack[o].value=null);break}f(l.key,t),o++}}}if(u&&(c.emit("header",u),u=!1),o===this.stack.length){0;var h=this.stack.slice(1).map(function(e){return e.key}).concat([this.key]),y=t;for(var g in null!=y&&null!=(y=r?r(y,h):y)&&((a||s)&&(y={value:y},a&&(y.key=this.key),s&&(y.path=h)),c.queue(y)),this.value&&delete this.value[this.key],this.stack)Object.isFrozen(this.stack[g])||(this.stack[g].value=null)}}},l._onToken=l.onToken,l.onToken=function(t,r){l._onToken(t,r),0===this.stack.length&&c.root&&(e||c.queue(c.root),c.root=null)},l.onError=function(e){e.message.indexOf("at position")>-1&&(e.message="Invalid JSON ("+e.message+")"),c.emit("error",e)},c;function f(e,t){!1!==u&&((u=u||{})[e]=t),!1!==s&&!1===u&&((s=s||{})[e]=t)}},r.stringify=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="[\n",t="\n,\n",r="\n]\n");var a,i=!0,u=!1;return a=o(function(r){u=!0;try{var o=JSON.stringify(r,null,n)}catch(e){return a.emit("error",e)}i?(i=!1,a.queue(e+o)):a.queue(t+o)},function(t){u||a.queue(e),a.queue(r),a.queue(null)})},r.stringifyObject=function(e,t,r,n){n=n||0,!1===e?(e="",t="\n",r=""):null==e&&(e="{\n",t="\n,\n",r="\n}\n");var a=!0,i=!1;return o(function(r){i=!0;var o=JSON.stringify(r[0])+":"+JSON.stringify(r[1],null,n);a?(a=!1,this.queue(e+o)):this.queue(t+o)},function(t){i||this.queue(e),this.queue(r),this.queue(null)})}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:57,jsonparse:121,through:214}],36:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,a.isAsync)(e))return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const o=r.pop();return u(e.apply(this,r),o)};return(0,n.default)(function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return u(n,r);r(null,n)})};var n=i(e("./internal/initialParams.js")),o=i(e("./internal/setImmediate.js")),a=e("./internal/wrapAsync.js");function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){return e.then(e=>{s(t,null,e)},e=>{s(t,e&&(e instanceof Error||e.message)?e:new Error(e))})}function s(e,t,r){try{e(t,r)}catch(e){(0,o.default)(e=>{throw e},e)}}t.exports=r.default},{"./internal/initialParams.js":44,"./internal/setImmediate.js":49,"./internal/wrapAsync.js":51}],37:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=u(e("./internal/eachOfLimit.js")),o=u(e("./internal/withoutIndex.js")),a=u(e("./internal/wrapAsync.js")),i=u(e("./internal/awaitify.js"));function u(e){return e&&e.__esModule?e:{default:e}}r.default=(0,i.default)(function(e,t,r,i){return(0,n.default)(t)(e,(0,o.default)((0,a.default)(r)),i)},4),t.exports=r.default},{"./internal/awaitify.js":40,"./internal/eachOfLimit.js":42,"./internal/withoutIndex.js":50,"./internal/wrapAsync.js":51}],38:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=a(e("./eachLimit.js")),o=a(e("./internal/awaitify.js"));function a(e){return e&&e.__esModule?e:{default:e}}r.default=(0,o.default)(function(e,t,r){return(0,n.default)(e,1,t,r)},3),t.exports=r.default},{"./eachLimit.js":37,"./internal/awaitify.js":40}],39:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t,r,n){let o=!1,i=!1,u=!1,s=0,l=0;function c(){s>=t||u||o||(u=!0,e.next().then(e=>{let{value:t,done:a}=e;if(!i&&!o){if(u=!1,a)return o=!0,void(s<=0&&n(null));s++,r(t,l,f),l++,c()}}).catch(d))}function f(e,t){if(s-=1,!i)return e?d(e):!1===e?(o=!0,void(i=!0)):t===a.default||o&&s<=0?(o=!0,n(null)):void c()}function d(e){i||(u=!1,o=!0,n(e))}c()};var n,o=e("./breakLoop.js"),a=(n=o)&&n.__esModule?n:{default:n};t.exports=r.default},{"./breakLoop.js":41}],40:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e,t){t||(t=e.length);if(!t)throw new Error("arity is undefined");return function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return"function"==typeof n[t-1]?e.apply(this,n):new Promise((r,o)=>{n[t-1]=function(e){if(e)return o(e);for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];r(n.length>1?n:n[0])},e.apply(this,n)})}},t.exports=r.default},{}],41:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});r.default={},t.exports=r.default},{}],42:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=l(e("./once.js")),o=l(e("./iterator.js")),a=l(e("./onlyOnce.js")),i=e("./wrapAsync.js"),u=l(e("./asyncEachOfLimit.js")),s=l(e("./breakLoop.js"));function l(e){return e&&e.__esModule?e:{default:e}}r.default=e=>(t,r,l)=>{if(l=(0,n.default)(l),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return l(null);if((0,i.isAsyncGenerator)(t))return(0,u.default)(t,e,r,l);if((0,i.isAsyncIterable)(t))return(0,u.default)(t[Symbol.asyncIterator](),e,r,l);var c=(0,o.default)(t),f=!1,d=!1,p=0,h=!1;function y(e,t){if(!d)if(p-=1,e)f=!0,l(e);else if(!1===e)f=!0,d=!0;else{if(t===s.default||f&&p<=0)return f=!0,l(null);h||g()}}function g(){for(h=!0;p<e&&!f;){var t=c();if(null===t)return f=!0,void(p<=0&&l(null));p+=1,r(t.value,t.key,(0,a.default)(y))}h=!1}g()},t.exports=r.default},{"./asyncEachOfLimit.js":39,"./breakLoop.js":41,"./iterator.js":46,"./once.js":47,"./onlyOnce.js":48,"./wrapAsync.js":51}],43:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()},t.exports=r.default},{}],44:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var o=r.pop();return e.call(this,r,o)}},t.exports=r.default},{}],45:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0},t.exports=r.default},{}],46:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){if((0,n.default)(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t=(0,o.default)(e);return t?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(t):(r=e,a=r?Object.keys(r):[],i=-1,u=a.length,function e(){var t=a[++i];return"__proto__"===t?e():i<u?{value:r[t],key:t}:null});var r,a,i,u};var n=a(e("./isArrayLike.js")),o=a(e("./getIterator.js"));function a(e){return e&&e.__esModule?e:{default:e}}t.exports=r.default},{"./getIterator.js":43,"./isArrayLike.js":45}],47:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){function t(){if(null!==e){var t=e;e=null;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];t.apply(this,n)}}return Object.assign(t,e),t},t.exports=r.default},{}],48:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return function(){if(null===e)throw new Error("Callback was already called.");var t=e;e=null;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];t.apply(this,n)}},t.exports=r.default},{}],49:[function(e,t,r){(function(e,t){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.fallback=u,r.wrap=s;var n,o=r.hasQueueMicrotask="function"==typeof queueMicrotask&&queueMicrotask,a=r.hasSetImmediate="function"==typeof t&&t,i=r.hasNextTick="object"==typeof e&&"function"==typeof e.nextTick;function u(e){setTimeout(e,0)}function s(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return e(()=>t(...n))}}n=o?queueMicrotask:a?t:i?e.nextTick:u,r.default=s(n)}).call(this)}).call(this,e("_process"),e("timers").setImmediate)},{_process:160,timers:215}],50:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return(t,r,n)=>e(t,n)},t.exports=r.default},{}],51:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterable=r.isAsyncGenerator=r.isAsync=void 0;var n,o=e("../asyncify.js"),a=(n=o)&&n.__esModule?n:{default:n};function i(e){return"AsyncFunction"===e[Symbol.toStringTag]}r.default=function(e){if("function"!=typeof e)throw new Error("expected a function");return i(e)?(0,a.default)(e):e},r.isAsync=i,r.isAsyncGenerator=function(e){return"AsyncGenerator"===e[Symbol.toStringTag]},r.isAsyncIterable=function(e){return"function"==typeof e[Symbol.asyncIterator]}},{"../asyncify.js":36}],52:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});var n=u(e("./internal/once.js")),o=u(e("./internal/onlyOnce.js")),a=u(e("./internal/wrapAsync.js")),i=u(e("./internal/awaitify.js"));function u(e){return e&&e.__esModule?e:{default:e}}r.default=(0,i.default)(function(e,t){if(t=(0,n.default)(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function i(t){(0,a.default)(e[r++])(...t,(0,o.default)(u))}function u(n){if(!1!==n){for(var o=arguments.length,a=new Array(o>1?o-1:0),u=1;u<o;u++)a[u-1]=arguments[u];if(n||r===e.length)return t(n,...a);i(a)}}i([])}),t.exports=r.default},{"./internal/awaitify.js":40,"./internal/once.js":47,"./internal/onlyOnce.js":48,"./internal/wrapAsync.js":51}],53:[function(e,t,r){(function(r){(function(){var n=e("possible-typed-array-names"),o="undefined"==typeof globalThis?r:globalThis;t.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"possible-typed-array-names":159}],54:[function(e,t,r){r.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=s(e),i=n[0],u=n[1],l=new a(function(e,t,r){return 3*(t+r)/4-r}(0,i,u)),c=0,f=u>0?i-4:i;for(r=0;r<f;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],l[c++]=t>>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===u&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===u&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},r.fromByteArray=function(e){for(var t,r=e.length,o=r%3,a=[],i=16383,u=0,s=r-o;u<s;u+=i)a.push(c(e,u,u+i>s?s:u+i));1===o?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],o=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)n[u]=i[u],o[i.charCodeAt(u)]=u;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,o=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(l(n));return o.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],55:[function(e,t,r){},{}],56:[function(e,t,r){arguments[4][55][0].apply(r,arguments)},{dup:55}],57:[function(e,t,r){(function(t){(function(){var t=e("base64-js"),n=e("ieee754");r.Buffer=i,r.SlowBuffer=function(e){+e!=e&&(e=0);return i.alloc(+e)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=a(r),o=n.write(e,t);o!==r&&(n=n.slice(0,o));return n}(e,t);if(ArrayBuffer.isView(e))return c(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(B(e,ArrayBuffer)||e&&B(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return n.__proto__=i.prototype,n}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return i.from(n,t,r);var o=function(e){if(i.isBuffer(e)){var t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||F(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),a(e<0?0:0|f(e))}function c(e){for(var t=e.length<0?0:0|f(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function d(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||B(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return M(e).length;default:if(o)return n?-1:N(e).length;t=(""+t).toLowerCase(),o=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){var a,i=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;i=2,u/=2,s/=2,r/=2}function l(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(o){var c=-1;for(a=r;a<u;a++)if(l(e,a)===l(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===s)return c*i}else-1!==c&&(a-=a-c),c=-1}else for(r+s>u&&(r=u-s),a=r;a>=0;a--){for(var f=!0,d=0;d<s;d++)if(l(e,a+d)!==l(t,d)){f=!1;break}if(f)return a}return-1}function b(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var a=t.length;n>a/2&&(n=a/2);for(var i=0;i<n;++i){var u=parseInt(t.substr(2*i,2),16);if(F(u))return i;e[r+i]=u}return i}function m(e,t,r,n){return P(N(t,e.length-r),e,r,n)}function v(e,t,r,n){return P(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function w(e,t,r,n){return v(e,t,r,n)}function S(e,t,r,n){return P(M(t),e,r,n)}function D(e,t,r,n){return P(function(e,t){for(var r,n,o,a=[],i=0;i<e.length&&!((t-=2)<0);++i)n=(r=e.charCodeAt(i))>>8,o=r%256,a.push(o),a.push(n);return a}(t,e.length-r),e,r,n)}function E(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var a,i,u,s,l=e[o],c=null,f=l>239?4:l>223?3:l>191?2:1;if(o+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[o+1]))&&(s=(31&l)<<6|63&a)>127&&(c=s);break;case 3:a=e[o+1],i=e[o+2],128==(192&a)&&128==(192&i)&&(s=(15&l)<<12|(63&a)<<6|63&i)>2047&&(s<55296||s>57343)&&(c=s);break;case 4:a=e[o+1],i=e[o+2],u=e[o+3],128==(192&a)&&128==(192&i)&&128==(192&u)&&(s=(15&l)<<18|(63&a)<<12|(63&i)<<6|63&u)>65535&&s<1114112&&(c=s)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=f}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}r.kMaxLength=o,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){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}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(e,t,r){return u(e,t,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,r){return function(e,t,r){return s(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},i.allocUnsafe=function(e){return l(e)},i.allocUnsafeSlow=function(e){return l(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),B(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(e){switch(String(e).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(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=i.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var a=e[r];if(B(a,Uint8Array)&&(a=i.from(a)),!i.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,o),o+=a.length}return n},i.byteLength=d,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)h(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):p.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},i.prototype.compare=function(e,t,r,n,o){if(B(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(t>>>=0),s=Math.min(a,u),l=this.slice(n,o),c=e.slice(t,r),f=0;f<s;++f)if(l[f]!==c[f]){a=l[f],u=c[f];break}return a<u?-1:u<a?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return y(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return y(this,e,t,r,!1)},i.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":return v(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;function _(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function C(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",a=t;a<r;++a)o+=k(e[a]);return o}function q(e,t,r){for(var n=e.slice(t,r),o="",a=0;a<n.length;a+=2)o+=String.fromCharCode(n[a]+256*n[a+1]);return o}function T(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,o,a){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function x(e,t,r,n,o,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,o,a){return t=+t,r>>>=0,a||x(e,0,r,4),n.write(e,t,r,o,23,4),r+4}function I(e,t,r,o,a){return t=+t,r>>>=0,a||x(e,0,r,8),n.write(e,t,r,o,52,8),r+8}i.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=i.prototype,n},i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n},i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},i.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=this[e],o=1,a=0;++a<t&&(o*=256);)n+=this[e+a]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||T(e,t,this.length);for(var n=t,o=1,a=this[e+--n];n>0&&(o*=256);)a+=this[e+--n]*o;return a>=(o*=128)&&(a-=Math.pow(2,8*t)),a},i.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||j(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,a=0;for(this[t]=255&e;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r},i.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||j(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r},i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);j(this,e,t,r,o-1,-o)}var a=0,i=1,u=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===u&&0!==this[t+a-1]&&(u=1),this[t+a]=(e/i|0)-u&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);j(this,e,t,r,o-1,-o)}var a=r-1,i=1,u=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===u&&0!==this[t+a+1]&&(u=1),this[t+a]=(e/i|0)-u&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<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),e.length-t<n-r&&(n=e.length-t+r);var o=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=o-1;a>=0;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return o},i.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=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===e.length){var o=e.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var u=i.isBuffer(e)?e:i.from(e,n),s=u.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=u[a%s]}return this};var U=/[^+/0-9A-Za-z-_]/g;function k(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,t){var r;t=t||1/0;for(var n=e.length,o=null,a=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(i+1===n){(t-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function M(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function P(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function B(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":54,buffer:57,ieee754:110}],58:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],59:[function(e,t,r){var n=e("function-bind"),o=e("./functionApply"),a=e("./functionCall"),i=e("./reflectApply");t.exports=i||n.call(a,o)},{"./functionApply":61,"./functionCall":62,"./reflectApply":64,"function-bind":94}],60:[function(e,t,r){var n=e("function-bind"),o=e("./functionApply"),a=e("./actualApply");t.exports=function(){return a(n,o,arguments)}},{"./actualApply":59,"./functionApply":61,"function-bind":94}],61:[function(e,t,r){t.exports=Function.prototype.apply},{}],62:[function(e,t,r){t.exports=Function.prototype.call},{}],63:[function(e,t,r){var n=e("function-bind"),o=e("es-errors/type"),a=e("./functionCall"),i=e("./actualApply");t.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new o("a function is required");return i(n,a,e)}},{"./actualApply":59,"./functionCall":62,"es-errors/type":75,"function-bind":94}],64:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],65:[function(e,t,r){var n=e("set-function-length"),o=e("es-define-property"),a=e("call-bind-apply-helpers"),i=e("call-bind-apply-helpers/applyBind");t.exports=function(e){var t=a(arguments),r=1+e.length-(arguments.length-1);return n(t,r>0?r:0,!0)},o?o(t.exports,"apply",{value:i}):t.exports.apply=i},{"call-bind-apply-helpers":63,"call-bind-apply-helpers/applyBind":60,"es-define-property":69,"set-function-length":172}],66:[function(e,t,r){var n=e("get-intrinsic"),o=e("call-bind-apply-helpers"),a=o([n("%String.prototype.indexOf%")]);t.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&a(e,".prototype.")>-1?o([r]):r}},{"call-bind-apply-helpers":63,"get-intrinsic":98}],67:[function(e,t,r){var n=e("es-define-property"),o=e("es-errors/syntax"),a=e("es-errors/type"),i=e("gopd");t.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var u=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!i&&i(e,t);if(n)n(e,t,{configurable:null===l&&f?f.configurable:!l,enumerable:null===u&&f?f.enumerable:!u,value:r,writable:null===s&&f?f.writable:!s});else{if(!c&&(u||s||l))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},{"es-define-property":69,"es-errors/syntax":74,"es-errors/type":75,gopd:103}],68:[function(e,t,r){var n,o=e("call-bind-apply-helpers"),a=e("gopd");try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var i=!!n&&a&&a(Object.prototype,"__proto__"),u=Object,s=u.getPrototypeOf;t.exports=i&&"function"==typeof i.get?o([i.get]):"function"==typeof s&&function(e){return s(null==e?e:u(e))}},{"call-bind-apply-helpers":63,gopd:103}],69:[function(e,t,r){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}t.exports=n},{}],70:[function(e,t,r){t.exports=EvalError},{}],71:[function(e,t,r){t.exports=Error},{}],72:[function(e,t,r){t.exports=RangeError},{}],73:[function(e,t,r){t.exports=ReferenceError},{}],74:[function(e,t,r){t.exports=SyntaxError},{}],75:[function(e,t,r){t.exports=TypeError},{}],76:[function(e,t,r){t.exports=URIError},{}],77:[function(e,t,r){t.exports=Object},{}],78:[function(e,t,r){var n,o="object"==typeof Reflect?Reflect:null,a=o&&"function"==typeof o.apply?o.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}t.exports=u,t.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,a),n(r)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}b(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&b(e,"error",t,r)}(e,o,{once:!0})})},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var o,a,i,u;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),i=a[t]),void 0===i)i=a[t]=r,++e._eventsCount;else if("function"==typeof i?i=a[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),(o=c(e))>0&&i.length>o&&!i.warned){i.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=i.length,u=s,console&&console.warn&&console.warn(u)}return e}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(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=d.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):g(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function g(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function b(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(a){n.once&&e.removeEventListener(t,o),r(a)})}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),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(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var i;if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var u=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw u.context=i,u}var s=o[e];if(void 0===s)return!1;if("function"==typeof s)a(s,this,t);else{var l=s.length,c=g(s,l);for(r=0;r<l;++r)a(c[r],this,t)}return!0},u.prototype.addListener=function(e,t){return f(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return f(this,e,t,!0)},u.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,n,o,a,i;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){i=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,i||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,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[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(o=a[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],79:[function(e,t,r){var n=e("is-callable"),o=Object.prototype.toString,a=Object.prototype.hasOwnProperty;t.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var i,u;arguments.length>=3&&(i=r),u=e,"[object Array]"===o.call(u)?function(e,t,r){for(var n=0,o=e.length;n<o;n++)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,i):"string"==typeof e?function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,i):function(e,t,r){for(var n in e)a.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,i)}},{"is-callable":113}],80:[function(e,t,r){
|
|
16
|
+
const n=e=>{let t="=";switch(e){case"EQ":t="=";break;case"NE":t="!=";break;case"GT":t=">";break;case"GE":t=">=";break;case"LT":t="<";break;case"LE":t="<=";break;case"LK":t="LIKE";break;case"NLK":t="NOT LIKE";break;case"IN":t="IS NULL";break;case"NN":t="IS NOT NULL";break;case"INN":t="IN";break;case"NIN":t="NOT IN";break;case"FOP":case"FOPOR":t="(";break;case"FCP":t=")"}return t},i=e=>{const t=e.Field.indexOf("$");let r,n;if(-1!==t)r=e.Field.substring(0,t),n=e.Field.substring(t+1);else{const t=e.Field.indexOf(".");if(t<1){const t=`Invalid format for Field[${e.Field}]`;throw new Error(t)}r=e.Field.substring(0,t),n=e.Field.substring(t)}let[i,a]=[r,n].map(e=>e.replace(/'/g,"\\'").replace(/"/g,'\\"'));return{fieldColumn:i,jsonPath:a}},a=(e,t,r,n,i,a)=>{a.addFilter("","","(",i),a.addFilter(`JSON_VALID(${e})`,1,"=","AND","validJson");let o=`CAST(JSON_UNQUOTE(JSON_EXTRACT(${e}, '$${t}')) AS CHAR)`,s=r;if(Array.isArray(r)){r.find(e=>isNaN(Number(e)))||(s=r.map(e=>Number(e)))}else isNaN(Number(r))||(s=Number(r));return a.addFilter(o,s,n,"AND","jsonExtracted"),a.addFilter("","",")"),a},o=(e,t)=>{if(!e.Instruction)return!1;switch(e.Instruction){case"FBV":t.addFilter(e.Field,e.Value,n(e.Operator),"AND");break;case"FBVOR":t.addFilter(e.Field,e.Value,n(e.Operator),"OR");break;case"FBL":t.addFilter(e.Field,e.Value.split(","),n(e.Operator),"AND");break;case"FBLOR":t.addFilter(e.Field,e.Value.split(","),n(e.Operator),"OR");break;case"FBD":t.addFilter(`DATE(${e.Field})`,e.Value.split(","),n(e.Operator),"AND",e.Field);break;case"FBDOR":t.addFilter(`DATE(${e.Field})`,e.Value.split(","),n(e.Operator),"OR",e.Field);break;case"FSF":const r="DESC"===e.Operator?"Descending":"Ascending";t.addSort({Column:e.Field,Direction:r});break;case"FBJV":{const{fieldColumn:r,jsonPath:o}=i(e);a(r,o,e.Value,n(e.Operator),"AND",t);break}case"FBJVOR":{const{fieldColumn:r,jsonPath:o}=i(e);a(r,o,e.Value,n(e.Operator),"OR",t);break}case"FBJL":{const{fieldColumn:r,jsonPath:o}=i(e);a(r,o,e.Value.split(","),n(e.Operator),"AND",t);break}case"FBJLOR":{const{fieldColumn:r,jsonPath:o}=i(e);a(r,o,e.Value.split(","),n(e.Operator),"OR",t);break}case"FBJD":{const{fieldColumn:r,jsonPath:a}=i(e);t.addFilter("","","("),t.addFilter(`JSON_VALID(${r})`,1,"=","AND","validJson"),t.addFilter(`DATE(JSON_UNQUOTE(JSON_EXTRACT(${r}, '$${a}')))`,e.Value.split(","),n(e.Operator),"AND",r),t.addFilter("","",")");break}case"FSJF":{const{fieldColumn:r,jsonPath:n}=i(e),a="DESC"===e.Operator?"Descending":"Ascending",o=(e=>{let t="CHAR";switch(e){case"SINT":t="SIGNED";break;case"UINT":t="UNSIGNED";break;case"DD":t="DECIMAL(10,5)";break;case"DATE":t="DATE"}return t})(e.Value);t.addFilter(`JSON_VALID(${r})`,1,"=","AND","validJson"),t.addSort({Column:`CAST(${r} ->> '$${n}' AS ${o})`,Direction:a});break}case"FOP":t.addFilter("","","(");break;case"FOPOR":t.addFilter("","","(","OR");break;case"FCP":t.addFilter("","",")");break;case"FDST":t.setDistinct&&t.setDistinct(!0);break;default:return!1}return e.Instruction=!1,!0};t.exports=(e,t)=>{if("string"!=typeof e)return!1;const r=e.split("~");if(r.length<4)return!0;let n={Instruction:null};for(let e=0;e<r.length;e++)switch(e%4){case 0:o(n,t),n={Instruction:r[e],Field:"",Operator:"",Value:""};break;case 1:n.Field=r[e];break;case 2:n.Operator=r[e];break;case 3:n.Value=r[e]}return o(n,t),!0}},{}],211:[function(e,t,r){t.exports={parse:e("./Meadow-Filter-Parse.js")}},{"./Meadow-Filter-Parse.js":210}],212:[function(e,t,r){t.exports=function(t,r){var n=!1;try{n=e(r)}catch(e){return t.fable.log.error("Error loading Fable package",{Package:r}),!1}var i=t.new(t.fable);return"string"==typeof n.Scope&&i.setScope(n.Scope),"string"==typeof n.Domain&&i.setDomain(n.Domain),"string"==typeof n.DefaultIdentifier&&i.setDefaultIdentifier(n.DefaultIdentifier),Array.isArray(n.Schema)&&i.setSchema(n.Schema),"object"==typeof n.JsonSchema&&i.setJsonSchema(n.JsonSchema),"object"==typeof n.DefaultObject&&i.setDefault(n.DefaultObject),"object"==typeof n.Authorization&&i.setAuthorizer(n.Authorization),i}},{}],213:[function(e,t,r){t.exports=function(e,t){var r="object"==typeof t?t:{};t.hasOwnProperty("Scope")||e.fable.log.error("Error loading Fable package -- scope not defined.",{Package:t});var n=e.new(e.fable);return"string"==typeof r.Scope&&n.setScope(r.Scope),"string"==typeof r.Domain&&n.setDomain(r.Domain),"string"==typeof r.DefaultIdentifier&&n.setDefaultIdentifier(r.DefaultIdentifier),Array.isArray(r.Schema)&&n.setSchema(r.Schema),"object"==typeof r.JsonSchema&&n.setJsonSchema(r.JsonSchema),"object"==typeof r.DefaultObject&&n.setDefault(r.DefaultObject),"object"==typeof r.Authorization&&n.setAuthorizer(r.Authorization),n}},{}],214:[function(e,t,r){
|
|
18
17
|
/**
|
|
19
|
-
* FoxHound Query Generation Library
|
|
20
18
|
* @license MIT
|
|
21
|
-
* @author
|
|
19
|
+
* @author <steven@velozo.com>
|
|
22
20
|
*/
|
|
23
|
-
const n=e("./Parameters.js");t.exports=function t(r,o){if("object"!=typeof r||!("fable"in r))return{new:t};var a=r,i=void 0===o?{}:o,u=!1,s=e("./Foxhound-Dialects.js"),l=a.getUUID(),c=0,f=!1,d=function(){return(u=a.Utility.extend({},n,i)).query={disableAutoIdentity:!1,disableAutoDateStamp:!1,disableAutoUserStamp:!1,disableDeleteTracking:!1,body:!1,schema:!1,IDUser:0,UUID:a.getUUID(),records:!1,parameters:{}},u.result={executed:!1,value:!1,error:void 0},this};d();var p=function(e,t,r,n){if("string"!=typeof e)return a.log.warn("Tried to add an invalid query join table",{queryUUID:l,parameters:u}),this;if(void 0===t||void 0===r)return a.log.warn("Tried to add an invalid query join field",{queryUUID:l,parameters:u}),this;if(0!=t.indexOf(e))return a.log.warn("Tried to add an invalid query join field, join must come FROM the join table!",{queryUUID:l,parameters:u,invalidField:t}),this;if(r.indexOf(".")<=0)return a.log.warn("Tried to add an invalid query join field, join must go TO a field on another table ([table].[field])!",{queryUUID:l,parameters:u,invalidField:r}),this;var o={Type:void 0===n?"INNER JOIN":n,Table:e,From:t,To:r};return Array.isArray(u.join)?u.join.push(o):u.join=[o],c>2&&a.log.info("Added a join",{queryUUID:l,parameters:u}),this},h=function(e){return"string"!=typeof e?(a.log.warn("Dialect set to English - invalid name",{queryUUID:l,parameters:u,invalidDialect:e}),h("English")):(s.hasOwnProperty(e)?(f=s[e](a),c>2&&a.log.info("Dialog set to: "+e,{queryUUID:l,parameters:u})):(a.log.error('Dialect not set - unknown dialect "'+e+"'",{queryUUID:l,parameters:u,invalidDialect:e}),h("English")),this)},y=function(){!1===f&&h("English")},g={resetParameters:d,mergeParameters:function(e){return u=a.Utility.extend({},u,e),this},setLogLevel:function(e){var t=0;return"number"==typeof e&&e%1==0&&(t=e),c=t,this},setScope:function(e){var t=!1;return"string"==typeof e?t=e:!1!==e&&a.log.error("Scope set failed. You must pass in a string or array.",{queryUUID:l,parameters:u,invalidScope:e}),u.scope=t,c>2&&a.log.info("Scope set: "+t,{queryUUID:l,parameters:u}),this},setDistinct:function(e){return u.distinct=!!e,c>2&&a.log.info("Distinct set: "+u.distinct,{queryUUID:l,parameters:u}),this},setIDUser:function(e){var t=0;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("User set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:u,invalidIDUser:e}),u.userID=t,u.query.IDUser=t,c>2&&a.log.info("IDUser set to: "+t,{queryUUID:l,parameters:u}),this},setDataElements:function(e){var t=!1;return Array.isArray(e)&&(t=e),"string"==typeof e&&(t=[e]),u.dataElements=t,c>2&&a.log.info("Data Elements set",{queryUUID:l,parameters:u}),this},setBegin:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("Begin set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:u,invalidBeginAmount:e}),u.begin=t,c>2&&a.log.info("Begin set: "+e,{queryUUID:l,parameters:u}),this},setCap:function(e){var t=!1;return"number"==typeof e&&e%1==0&&e>=0?t=e:!1!==e&&a.log.error("Cap set failed; non-positive or non-numeric argument.",{queryUUID:l,parameters:u,invalidCapAmount:e}),u.cap=t,c>2&&a.log.info("Cap set to: "+t,{queryUUID:l,parameters:u}),this},setFilter:function(e){var t=!1;return Array.isArray(e)?t=e:"object"==typeof e&&(t=[e]),u.filter=t,c>2&&a.log.info("Filter set",{queryUUID:l,parameters:u}),this},addFilter:function(e,t,r,n,o){if("string"!=typeof e)return a.log.warn("Tried to add an invalid query filter column",{queryUUID:l,parameters:u}),this;if(void 0===t)return a.log.warn("Tried to add an invalid query filter value",{queryUUID:l,parameters:u,invalidColumn:e}),this;var i=void 0===o?e:o,s={Column:e,Operator:void 0===r?"=":r,Value:t,Connector:void 0===n?"AND":n,Parameter:i=i.replace(".","_")};return Array.isArray(u.filter)?u.filter.push(s):u.filter=[s],c>2&&a.log.info("Added a filter",{queryUUID:l,parameters:u,newFilter:s}),this},setSort:function(e){var t=!1;return Array.isArray(e)?t=e:"string"==typeof e?t=[{Column:e,Direction:"Ascending"}]:"object"==typeof e&&(t=[e]),u.sort=t,c>2&&a.log.info("Sort set",{queryUUID:l,parameters:u}),this},addSort:function(e){var t=!1;return"string"==typeof e&&(t={Column:e,Direction:"Ascending"}),"object"==typeof e&&(t=e),u.sort||(u.sort=[]),u.sort.push(t),c>2&&a.log.info("Sort set",{queryUUID:l,parameters:u}),this},setJoin:function(e){return u.join=[],Array.isArray(e)?e.forEach(function(e){p(e.Table,e.From,e.To,e.Type)}):"object"==typeof e&&p(e.Table,e.From,e.To,e.Type),this},addJoin:p,addRecord:function(e){return"object"!=typeof e?(a.log.warn("Tried to add an invalid record to the query -- records must be an object",{queryUUID:l,parameters:u}),this):(Array.isArray(u.query.records)?u.query.records.push(e):u.query.records=[e],c>2&&a.log.info("Added a record to the query",{queryUUID:l,parameters:u,newRecord:e}),this)},setDisableAutoIdentity:function(e){return u.query.disableAutoIdentity=e,this},setDisableAutoDateStamp:function(e){return u.query.disableAutoDateStamp=e,this},setDisableAutoUserStamp:function(e){return u.query.disableAutoUserStamp=e,this},setDisableDeleteTracking:function(e){return u.query.disableDeleteTracking=e,this},setDialect:h,buildCreateQuery:function(){return y(),u.query.body=f.Create(u),this},buildReadQuery:function(){return y(),u.query.body=f.Read(u),this},buildUpdateQuery:function(){return y(),u.query.body=f.Update(u),this},buildDeleteQuery:function(){return y(),u.query.body=f.Delete(u),this},buildUndeleteQuery:function(){return y(),u.query.body=f.Undelete(u),this},buildCountQuery:function(){return y(),u.query.body=f.Count(u),this},clone:function(){var e=t(a,n).setScope(u.scope).setBegin(u.begin).setCap(u.cap);return e.query.schema=u.query.schema,u.dataElements&&(e.parameters.dataElements=u.dataElements.slice()),u.sort&&(e.parameters.sort=u.sort.slice()),u.filter&&(e.parameters.filter=u.filter.slice()),e},new:t};return Object.defineProperty(g,"query",{get:function(){return u.query},set:function(e){u.query=e},enumerable:!0}),Object.defineProperty(g,"indexHints",{get:function(){return u.indexHints},set:function(e){u.indexHints=e},enumerable:!0}),Object.defineProperty(g,"result",{get:function(){return u.result},set:function(e){u.result=e},enumerable:!0}),Object.defineProperty(g,"parameters",{get:function(){return u},set:function(e){u=e},enumerable:!0}),Object.defineProperty(g,"dialect",{get:function(){return f},enumerable:!0}),Object.defineProperty(g,"uuid",{get:function(){return l},enumerable:!0}),Object.defineProperty(g,"logLevel",{get:function(){return c},enumerable:!0}),g}()},{"./Foxhound-Dialects.js":81,"./Parameters.js":82}],81:[function(e,t,r){t.exports=(()=>{let t={};return t.English=e("./dialects/English/FoxHound-Dialect-English.js"),t.SQLite=e("./dialects/SQLite/FoxHound-Dialect-SQLite.js"),t.ALASQL=e("./dialects/ALASQL/FoxHound-Dialect-ALASQL.js"),t.MeadowEndpoints=e("./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js"),t.MySQL=e("./dialects/MySQL/FoxHound-Dialect-MySQL.js"),t.MSSQL=e("./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js"),t.PostgreSQL=e("./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js"),t.MongoDB=e("./dialects/MongoDB/FoxHound-Dialect-MongoDB.js"),t.DGraph=e("./dialects/DGraph/FoxHound-Dialect-DGraph.js"),t.Solr=e("./dialects/Solr/FoxHound-Dialect-Solr.js"),t.default=t.English,t})()},{"./dialects/ALASQL/FoxHound-Dialect-ALASQL.js":83,"./dialects/DGraph/FoxHound-Dialect-DGraph.js":84,"./dialects/English/FoxHound-Dialect-English.js":85,"./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js":86,"./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js":87,"./dialects/MongoDB/FoxHound-Dialect-MongoDB.js":88,"./dialects/MySQL/FoxHound-Dialect-MySQL.js":89,"./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js":90,"./dialects/SQLite/FoxHound-Dialect-SQLite.js":91,"./dialects/Solr/FoxHound-Dialect-Solr.js":92}],82:[function(e,t,r){t.exports={scope:!1,dataElements:!1,begin:!1,cap:!1,filter:!1,sort:!1,join:!1,queryOverride:!1,query:!1,indexHints:!1,userID:0,result:!1}},{}],83:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){return" "+e.scope},n=(e,t)=>{if(e.indexOf(".")<0)return"`"+e+"`";var r=t.scope;return e.indexOf(r+".")>-1?"`"+e.replace(r+".","")+"`":"`"+e+"`"},o=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){if(!t)return" *";const r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length<1)return"";const n=r.find(e=>"AutoIdentity"===e.Type);return n?` ${n.Column}`:""}for(var o=" ",a=0;a<r.length;a++)a>0&&(o+=", "),o+=n(r[a],e);return o},a=function(e){var t=Array.isArray(e.filter)?e.filter:[],o=r(e).trim();if(!e.query.disableDeleteTracking)for(var a=Array.isArray(e.query.schema)?e.query.schema:[],i=0;i<a.length;i++){var u=a[i];if("Deleted"===u.Type){var s=!1;if(t.length>0)for(var l=0;l<t.length;l++)if(t[l].Column===u.Column){s=!0;break}s||t.push({Column:o+"."+u.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",f=!1;for(i=0;i<t.length;i++){var d;"NONE"!=t[i].Connector&&")"!=t[i].Operator&&" WHERE"!=c&&0==f&&(c+=" "+t[i].Connector),f=!1,"("===t[i].Operator?(c+=" (",f=!0):")"===t[i].Operator?c+=" )":"IN"===t[i].Operator?(d=t[i].Parameter+"_w"+i,c+=" "+n(t[i].Column,e)+" "+t[i].Operator+" ( :"+d+" )",e.query.parameters[d]=t[i].Value):"IS NOT NULL"===t[i].Operator?c+=" "+n(t[i].Column,e)+" "+t[i].Operator:(d=t[i].Parameter+"_w"+i,c+=" "+n(t[i].Column,e)+" "+t[i].Operator+" :"+d,e.query.parameters[d]=t[i].Value)}return c},i={Create:function(e){var t=r(e),o=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],o="";for(var a in t[0]){for(var i={Column:a,Type:"Default"},u=0;u<r.length;u++)if(a==r[u].Column){i=r[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type)switch(i.Type){case"JSON":""!=o&&(o+=","),o+=" "+a;break;case"JSONProxy":""!=o&&(o+=","),o+=" "+i.StorageColumn;break;default:""!=o&&(o+=","),o+=" "+n(a,e)}}return o}(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],n="",o=0;for(var a in t[0]){for(var i={Column:a,Type:"Default"},u=0;u<r.length;u++)if(a==r[u].Column){i=r[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type){o>0&&(n+=",");var s,l=function(){var r=a+"_"+o;n+=" :"+r,e.query.parameters[r]=t[0][a]};switch(i.Type){case"AutoIdentity":e.query.disableAutoIdentity?l():n+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?l():(n+=" :"+(s=a+"_"+o),e.query.parameters[s]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?l():n+=" NOW()";break;case"UpdateIDUser":case"CreateIDUser":case"DeleteIDUser":e.query.disableAutoUserStamp?l():(n+=" :"+(s=a+"_"+o),e.query.parameters[s]=e.query.IDUser);break;case"JSON":var c=a+"_"+o;n+=" :"+c,e.query.parameters[c]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;case"JSONProxy":var f=a+"_"+o;n+=" :"+f,e.query.parameters[f]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;default:l()}o++}}return""!==n&&n}(e);return!!a&&"INSERT INTO"+t+" ("+o+") VALUES ("+a+");"},Read:function(e){var i=o(e),u=r(e),s=a(e),l=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",o=0;o<t.length;o++)o>0&&(r+=","),r+=" "+n(t[o].Column,e),"Descending"==t[o].Direction&&(r+=" DESC");return r}(e),c=function(e){if(!e.cap)return"";var t=" LIMIT";return t+=" "+e.cap,!1!==e.begin&&(t+=" FETCH "+e.begin),t}(e);const f=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:i,TableName:u,Where:s,OrderBy:l,Limit:c,Distinct:f,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${f}${i} FROM${u}${s}${l}${c};`},Update:function(e){var t=r(e),o=a(e),i=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in t[0]){for(var u={Column:i,Type:"Default"},s=0;s<r.length;s++)if(i==r[s].Column){u=r[s];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==u.Type){switch(u.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(o+=","),u.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var l=i+"_"+a;o+=" "+n(i,e)+" = :"+l,e.query.parameters[l]=t[0][i]}else o+=" "+n(i,e)+" = NOW()";break;case"UpdateIDUser":l=i+"_"+a,o+=" "+n(i,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;case"JSON":var c=i+"_"+a;o+=" "+i+" = :"+c,e.query.parameters[c]="string"==typeof t[0][i]?t[0][i]:JSON.stringify(t[0][i]||{});break;case"JSONProxy":var f=u.StorageColumn+"_"+a;o+=" "+u.StorageColumn+" = :"+f,e.query.parameters[f]="string"==typeof t[0][i]?t[0][i]:JSON.stringify(t[0][i]||{});break;default:var d=i+"_"+a;o+=" "+n(i,e)+" = :"+d,e.query.parameters[d]=t[0][i]}a++}}return""!==o&&o}(e);return!!i&&"UPDATE"+t+" SET"+i+o+";"},Delete:function(e){var t=r(e),o=a(e),i=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,o=!1,a="",i={Type:"Default"},u=0;u<t.length;u++){var s=null;switch((i=t[u]).Type){case"Deleted":s=" "+n(i.Column,e)+" = 1",o=!0;break;case"DeleteDate":case"UpdateDate":s=" "+n(i.Column,e)+" = NOW()";break;case"DeleteIDUser":var l=i.Column+"_"+r;s=" "+n(i.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=s,r++}return!(!o||""===a)&&a}(e);return i?"UPDATE"+t+" SET"+i+o+";":"DELETE FROM"+t+o+";"},Undelete:function(e){var t=r(e);let o=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var i=a(e),u=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,o=!1,a="",i={Type:"Default"},u=0;u<t.length;u++){var s=null;switch((i=t[u]).Type){case"Deleted":s=" "+n(i.Column,e)+" = 0",o=!0;break;case"UpdateDate":s=" "+n(i.Column,e)+" = NOW()";break;case"UpdateIDUser":var l=i.Column+"_"+r;s=" "+n(i.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=s,r++}return!(!o||""===a)&&a}(e);return e.query.disableDeleteTracking=o,u?"UPDATE"+t+" SET"+u+i+";":"SELECT NULL;"},Count:function(e){var n=r(e),i=a(e);const u=e.distinct?o(e,!0):"*";e.distinct&&u.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const s=e.distinct&&u.length>0?"DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:[],TableName:n,Where:i,OrderBy:"",Limit:"",Distinct:s,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${s}${u||"*"}) AS RowCount FROM${n}${i};`}};return Object.defineProperty(i,"name",{get:function(){return"ALASQL"},enumerable:!0}),i}},{}],84:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},o=function(e){if(Array.isArray(e)){for(var t=[],r=0;r<e.length;r++)t.push(o(e[r]));return"["+t.join(", ")+"]"}return"number"==typeof e?String(e):"boolean"==typeof e?e?"true":"false":'"'+String(e).replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'},a=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":default:return"eq("+t+", "+o(n)+")";case"!=":return"NOT eq("+t+", "+o(n)+")";case">":return"gt("+t+", "+o(n)+")";case">=":return"ge("+t+", "+o(n)+")";case"<":return"lt("+t+", "+o(n)+")";case"<=":return"le("+t+", "+o(n)+")";case"LIKE":return"regexp("+t+", /"+String(n).replace(/%/g,".*").replace(/_/g,".")+"/i)";case"IN":var a=Array.isArray(n)?n:[n];return"eq("+t+", "+o(a)+")";case"NOT IN":var i=Array.isArray(n)?n:[n];return"NOT eq("+t+", "+o(i)+")";case"IS NULL":return"NOT has("+t+")";case"IS NOT NULL":return"has("+t+")"}},i=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<n.length;o++)if("Deleted"===n[o].Type){for(var i=!1,u=0;u<t.length;u++)if(r(t[u].Column)===n[o].Column){i=!0;break}i||t.push({Column:n[o].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return"";var s=[[]];for(o=0;o<t.length;o++){var l=t[o];if("("===l.Operator)s.push([]);else if(")"===l.Operator){for(var c=s.pop(),f=!1,d=0;d<c.length;d++)if("OR"===c[d].connector){f=!0;break}for(var p="",h=0;h<c.length;h++)h>0&&(p+=f?" OR ":" AND "),p+=c[h].text;s[s.length-1].push({text:"("+p+")",connector:l.Connector||"AND"})}else s[s.length-1].push({text:a(l),connector:l.Connector||"AND"})}var y=s[0];if(0===y.length)return"";for(var g="",b=0;b<y.length;b++)b>0&&(g+=" "+y[b].connector+" "),g+=y[b].text;return" @filter("+g+")"},u=function(e,t,r){var n=["func: type("+e+")"];return t&&n.push(t),r&&n.push(r),n.join(", ")},s={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type)switch(i.Type){case"AutoIdentity":e.query.disableAutoIdentity?o[a]=t[0][a]:o[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?o[a]=t[0][a]:o[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?o[a]=t[0][a]:o[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?o[a]=t[0][a]:o[a]=e.query.IDUser;break;case"Deleted":o[a]=0;break;default:o[a]=t[0][a]}}return 0!==Object.keys(o).length&&o}(e);if(!t)return!1;t["dgraph.type"]=e.scope;for(var r=!1,o=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<o.length;a++)if("AutoIdentity"===o[a].Type&&!e.query.disableAutoIdentity){r=e.scope+"."+o[a].Column;break}var i={type:e.scope,operation:"mutate",mutationType:"set",document:t};return r&&(i.counterScope=r),e.query.parameters.dgraphOperation=i,JSON.stringify(i)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("DGraph dialect does not support JOINs; join parameter will be ignored.");var n=i(e),o=function(e){var t=["uid"],n=e.dataElements;if(Array.isArray(n)&&n.length>0)for(var o=0;o<n.length;o++){var a=n[o];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&t.indexOf(a)<0&&t.push(a)}else for(var i=Array.isArray(e.query.schema)?e.query.schema:[],u=0;u<i.length;u++){var s=i[u].Column;t.indexOf(s)<0&&t.push(s)}return 1===t.length&&t.push("dgraph.type"),t.join(" ")}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var n=[],o=0;o<t.length;o++){var a=r(t[o].Column),i="Descending"===t[o].Direction?"orderdesc":"orderasc";n.push(i+": "+a)}return n.join(", ")}(e),s=function(e){var t=[];return e.cap&&t.push("first: "+e.cap),!1!==e.begin&&e.begin>0&&t.push("offset: "+e.begin),t.join(", ")}(e),l="{ results("+u(e.scope,s,a)+")"+n+" { "+o+" } }",c={type:e.scope,operation:"query",query:l,queryName:"results"};return e.distinct&&(c.distinct=!0),e.query.parameters.dgraphOperation=c,JSON.stringify(c)},Update:function(e){var t=i(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==i.Type){switch(i.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(i.Type){case"UpdateDate":e.query.disableAutoDateStamp?o[a]=t[0][a]:o[a]="$$NOW";break;case"UpdateIDUser":o[a]=e.query.IDUser;break;default:o[a]=t[0][a]}}}return 0!==Object.keys(o).length&&o}(e);if(!r)return!1;var o="{ updateTargets("+u(e.scope,"","")+")"+t+" { uid } }",a={type:e.scope,operation:"upsert",queryForUIDs:o,queryName:"updateTargets",update:r};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]=1,r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]="$$NOW";break;case"DeleteIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=i(e),n="{ deleteTargets("+u(e.scope,"","")+")"+r+" { uid } }";if(t){var o={type:e.scope,operation:"upsert",queryForUIDs:n,queryName:"deleteTargets",update:t};return e.query.parameters.dgraphOperation=o,JSON.stringify(o)}var a={type:e.scope,operation:"delete",queryForUIDs:n,queryName:"deleteTargets"};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]=0,r=!0;break;case"UpdateDate":n[a.Column]="$$NOW";break;case"UpdateIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=i(e);if(e.query.disableDeleteTracking=r,t){var o="{ undeleteTargets("+u(e.scope,"","")+")"+n+" { uid } }",a={type:e.scope,operation:"upsert",queryForUIDs:o,queryName:"undeleteTargets",update:t};return e.query.parameters.dgraphOperation=a,JSON.stringify(a)}var s={type:e.scope,operation:"noop"};return e.query.parameters.dgraphOperation=s,JSON.stringify(s)},Count:function(e){var t=i(e),n="{ results("+u(e.scope,"","")+")"+t+" { total: count(uid) } }",o={type:e.scope,operation:"query",query:n,queryName:"results",isCount:!0};if(e.distinct){o.distinct=!0;var a=e.dataElements;if(Array.isArray(a)&&a.length>0){for(var s=[],l=0;l<a.length;l++){var c=Array.isArray(a[l])?a[l][0]:a[l];"*"!==(c=r(c))&&s.push(c)}s.length>0&&(o.distinctFields=s)}else for(var f=Array.isArray(e.query.schema)?e.query.schema:[],d=0;d<f.length;d++)if("AutoIdentity"===f[d].Type){o.distinctFields=[f[d].Column];break}}return e.query.parameters.dgraphOperation=o,JSON.stringify(o)}};return Object.defineProperty(s,"name",{get:function(){return"DGraph"},enumerable:!0}),s}},{}],85:[function(e,t,r){t.exports=function(){var e={Create:function(e){return"Here is a "+e.scope+"."},Read:function(e){var t=e.scope;return`Please give me all your ${e.distinct?"unique ":""}${t} records. Thanks.`},Update:function(e){return"I am changing your "+e.scope+"."},Delete:function(e){return"I am deleting your "+e.scope+"."},Undelete:function(e){return"I am undeleting your "+e.scope+"."},Count:function(e){var t=e.scope;return`Count your ${e.distinct?"unique ":""}${t}.`}};return Object.defineProperty(e,"name",{get:function(){return"English"},enumerable:!0}),e}},{}],86:[function(e,t,r){t.exports=function(){var e=function(e){return e.scope},t=function(t){var r=Array.isArray(t.filter)?t.filter:[],o=(e(t),"");let a=(e,t)=>{o.length>0&&(o+="~"),o+=`${e}~${t[0]}~${t[1]}~${t[2]}`},i=e=>{let t="EQ";switch(e.toUpperCase()){case"!=":t="NE";break;case">":t="GT";break;case">=":t="GE";break;case"<=":t="LE";break;case"<":t="LT";break;case"LIKE":t="LK";break;case"IN":t="INN";break;case"NOT IN":t="NI"}return t};t.query.disableDeleteTracking&&a("FBV",["Deleted","GE","0"]);for(var u=0;u<r.length;u++)if("("===r[u].Operator)a("FOP",["0","(","0"]);else if(")"===r[u].Operator)a("FCP",["0",")","0"]);else if("IN"===r[u].Operator||"NOT IN"===r[u].Operator){let e="FBV";"OR"==r[u].Connector&&(e="FBVOR"),a(e,[r[u].Column,i(r[u].Operator),r[u].Value.map(encodeURIComponent).join(",")])}else if("IS NULL"===r[u].Operator)a("FBV",[r[u].Column,"IN","0"]);else if("IS NOT NULL"===r[u].Operator)a("FBV",[r[u].Column,"NN","0"]);else{let e="FBV";"OR"==r[u].Connector&&(e="FBVOR"),a(e,[r[u].Column,i(r[u].Operator),encodeURIComponent(r[u].Value)])}let s=n(t);return s&&(o&&(o+="~"),o+=s),o};function r(e){let t=e.query.disableAutoDateStamp,r=e.query.disableDeleteTracking,n=e.query.disableAutoIdentity,o=e.query.disableAutoUserStamp,a="",i=(e,t)=>{e&&(a.length>0&&(a+=","),a+=t)};return i(t,"DisableAutoDateStamp"),i(r,"DisableDeleteTracking"),i(n,"DisableAutoIdentity"),i(o,"DisableAutoUserStamp"),a}var n=function(e){var t=e.sort,r=null;if(!Array.isArray(t)||t.length<1)return r;r="";for(var n=0;n<t.length;n++)n>0&&(r+="~"),r+=`FSF~${t[n].Column}~`,"Descending"==t[n].Direction?r+="DESC~0":r+="ASC~0";return r},o={Create:function(t){var n=e(t),o=r(t);if(n){let e=n;return o&&(e=`${e}/WithFlags/${o}`),e}return!1},Read:function(r){var n=e(r),o=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++)n>0&&(r+=","),r+=t[n];return r}(r),a=t(r),i=function(e){return e.cap?`${!1!==e.begin?e.begin:0}/${e.cap}`:""}(r),u=`${n}`;return r.filter&&1==r.filter.length&&r.filter[0].Column===function(e){return`ID${e.scope}`}(r)&&"="===r.filter[0].Operator&&""==i&&""==o&&!r.sort?u=`${u}/${r.filter[0].Value}`:(u=`${u}s`,o&&(u=`${u}/LiteExtended/${o}`),a&&(u=`${u}/FilteredTo/${a}`),i&&(u=`${u}/${i}`)),u},Update:function(t){var n=e(t),o=r(t);if(n){let e=n;return o&&(e=`${e}/WithFlags/${o}`),e}return!1},Delete:function(t){var r=e(t),n=function(e){var t=Array.isArray(e.filter)?e.filter:[],r=!1;if(t.length<1)return r;for(var n=0;n<t.length;n++)for(var o=Array.isArray(e.query.schema)?e.query.schema:[],a=(t[n].Column,0);a<o.length;a++)if(t[n].Column==o[a].Column&&"AutoIdentity"==o[a].Type){r=t[n].Value;break}return r}(t);return!!n&&`${r}/${n}`},Count:function(r){var n=e(r),o=t(r);return o?`${n}s/Count/FilteredTo/${o}`:`${n}s/Count`}};return Object.defineProperty(o,"name",{get:function(){return"MeadowEndpoints"},enumerable:!0}),o}},{}],87:[function(e,t,r){t.exports=function(e){const t="GETUTCDATE()";let r=e;var n=function(e){return e.query.hasOwnProperty("parameterTypes")||(e.query.parameterTypes={})," ["+e.scope+"]"},o=function(e,t,n){e.query.hasOwnProperty("parameterTypes")||(e.query.parameterTypes={});let o="VarChar";if("object"==typeof n)o=n.Type;else if("string"==typeof n){var a=Array.isArray(e.query.schema)?e.query.schema:[];for(let e=0;e<a.length;e++)if(a[e].Column==n){o=a[e].Type;break}}else r.log.warn(`Meadow MSSQL query attempted to add a parameter type but no valid column schema entry object or column name was passed; parameter name ${t}.`);if(null==o||null==o)return!1;switch(o){case"AutoIdentity":case"CreateIDUser":case"UpdateIDUser":case"DeleteIDUser":case"Integer":e.query.parameterTypes[t]="Int";break;case"Deleted":case"Boolean":e.query.parameterTypes[t]="TinyInt";break;case"Decimal":e.query.parameterTypes[t]="Decimal";break;case"String":case"AutoGUID":e.query.parameterTypes[t]="VarChar";break;case"CreateDate":case"UpdateDate":case"DeleteDate":case"DateTime":e.query.parameterTypes[t]="DateTime";break;default:return e.query.parameterTypes[t]=o,!1}return!0},a=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const o=Array.isArray(e.query.schema)?e.query.schema:[];if(o.length<1)return"";const a=o.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const u=`${a.Column}`;return` ${i(u)}`}for(var o=" ",a=0;a<r.length;a++)a>0&&(o+=", "),Array.isArray(r[a])?(o+=i(r[a][0]),r[a].length>1&&r[a][1]&&(o+=" AS "+i(r[a][1]))):o+=i(r[a]);return o},i=function(e){return"*"!=e&&e.indexOf("[")<0&&e.indexOf(".")<0?"["+e+"]":e},u=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var o=r[n],a=0;a<t.length;a++){if(t[a].Column===o&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:o,path:"$."+r.slice(n+1).join(".")}}return null},s=function(e){var t=Array.isArray(e.filter)?e.filter:[];n(e);if(!e.query.disableDeleteTracking)for(var r=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<r.length;a++){var i=r[a];if("Deleted"===i.Type){var s=!1;if(t.length>0)for(var l=0;l<t.length;l++)if(t[l].Column===i.Column){s=!0;break}s||t.push({Column:i.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",f=!1;for(a=0;a<t.length;a++){var d;if("NONE"!=t[a].Connector&&")"!=t[a].Operator&&" WHERE"!=c&&0==f&&(c+=" "+t[a].Connector),f=!1,"("===t[a].Operator)c+=" (",f=!0;else if(")"===t[a].Operator)c+=" )";else if("IN"===t[a].Operator||"NOT IN"===t[a].Operator)d=t[a].Parameter+"_w"+a,c+=" ["+t[a].Column+"] "+t[a].Operator+" ( @"+d+" )",e.query.parameters[d]=t[a].Value,o(e,d,t[a].Parameter);else if("IS NULL"===t[a].Operator)c+=" ["+t[a].Column+"] "+t[a].Operator;else if("IS NOT NULL"===t[a].Operator)c+=" ["+t[a].Column+"] "+t[a].Operator;else{d=t[a].Parameter+"_w"+a;r=Array.isArray(e.query.schema)?e.query.schema:[];var p=u(t[a].Column,r);c+=p?" JSON_VALUE(["+p.column+"], '"+p.path+"') "+t[a].Operator+" :"+d:" ["+t[a].Column+"] "+t[a].Operator+" @"+d,e.query.parameters[d]=t[a].Value,o(e,d,t[a].Parameter)}}return c},l=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1){if(e.cap){var r=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0;r<t.length;r++)if("AutoIdentity"===t[r].Type)return t[r].Column;return null}(e);return r?" ORDER BY ["+r+"]":" ORDER BY (SELECT 1)"}return""}for(var n=" ORDER BY",o=0;o<t.length;o++)o>0&&(n+=","),n+=" ["+t[o].Column+"]","Descending"==t[o].Direction&&(n+=" DESC");return n},c=function(e){return!Array.isArray(e.indexHints)||e.indexHints.length<1?"":` WITH(INDEX(${e.indexHints.join(",")}))`},f=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var o=t[n];o.Type&&o.Table&&o.From&&o.To&&(r+=` ${o.Type} [${o.Table}] ON ${o.From} = ${o.To}`)}return r},d={Create:function(e){var r=n(e),a=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var o in t[0]){for(var a={Column:o,Type:"Default"},i=0;i<r.length;i++)if(o==r[i].Column){a=r[i];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"AutoIdentity":e.query.disableAutoIdentity&&(""!=n&&(n+=","),n+=" ["+o+"]");continue;case"JSON":default:""!=n&&(n+=","),n+=" ["+o+"]";break;case"JSONProxy":""!=n&&(n+=","),n+=" ["+a.StorageColumn+"]"}}return n}(e),i=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],a="",i=0;for(var u in r[0]){for(var s={Column:u,Type:"Default"},l=0;l<n.length;l++)if(u==n[l].Column){s=n[l];break}if(e.query.disableDeleteTracking||"DeleteDate"!==s.Type&&"DeleteIDUser"!==s.Type){i>0&&""!=a&&(a+=",");var c,f=function(){var t=u+"_"+i;a+=" @"+t,e.query.parameters[t]=r[0][u],o(e,t,s)};switch(s.Type){case"AutoIdentity":e.query.disableAutoIdentity&&f();break;case"AutoGUID":e.query.disableAutoIdentity||r[0][u]&&r[0][u].length>=5&&"0x0000000000000000"!==r[0][u]?f():(a+=" @"+(c=u+"_"+i),e.query.parameters[c]=e.query.UUID,o(e,c,s));break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?f():a+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?f():(a+=" @"+(c=u+"_"+i),e.query.parameters[c]=e.query.IDUser,o(e,c,s));break;case"JSON":var d=u+"_"+i;a+=" @"+d,e.query.parameters[d]="string"==typeof r[0][u]?r[0][u]:JSON.stringify(r[0][u]||{}),o(e,d,{Type:"String"});break;case"JSONProxy":var p=u+"_"+i;a+=" @"+p,e.query.parameters[p]="string"==typeof r[0][u]?r[0][u]:JSON.stringify(r[0][u]||{}),o(e,p,{Type:"String"});break;default:f()}i++}}return""!==a&&a}(e);return!!i&&"INSERT INTO"+r+" ("+a+") VALUES ("+i+");"},Read:function(e){var t=a(e),o=n(e),u=s(e),d=f(e),p=l(e),h=function(e){if(!e.cap)return"";if(e.legacyPagination)return"";var t=" OFFSET ";return!1!==e.begin?t+=e.begin:t+="0",t+` ROWS FETCH NEXT ${e.cap} ROWS ONLY`}(e),y=c(e);const g=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:o,Where:u,Join:d,OrderBy:p,Limit:h,IndexHints:y,Distinct:g,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}if(e.legacyPagination&&e.cap){var b=!1!==e.begin?e.begin:0,m=b+e.cap,v=p.replace(/^ /,""),w=function(e){var t=e.dataElements;if(Array.isArray(t)&&t.length>0)return a(e);var r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length>0){for(var n=" ",o=0;o<r.length;o++)o>0&&(n+=", "),n+=i(r[o].Column);return n}return" *"}(e);return`SELECT${g}${w} FROM (SELECT${t}, ROW_NUMBER() OVER (${v}) AS [_RowNum] FROM${o}${y}${d}${u}) AS [_Paged] WHERE [_RowNum] > ${b} AND [_RowNum] <= ${m};`}return`SELECT${g}${t} FROM${o}${y}${d}${u}${p}${h};`},Update:function(e){var r=n(e),a=s(e),i=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],a="",i=0;for(var u in r[0]){for(var s={Column:u,Type:"Default"},l=0;l<n.length;l++)if(u==n[l].Column){s=n[l];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==s.Type){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(i>0&&(a+=","),s.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var c="MANUAL_UpdateDate";a+=" ["+u+"] = @MANUAL_UpdateDate",e.query.parameters[c]=r[0][u],o(e,c,s)}else a+=" ["+u+"] = "+t;break;case"UpdateIDUser":a+=" ["+u+"] = @"+(c=u+"_"+i),e.query.parameters[c]=e.query.IDUser,o(e,c,u);break;case"JSON":var f=u+"_"+i;a+=" ["+u+"] = @"+f,e.query.parameters[f]="string"==typeof r[0][u]?r[0][u]:JSON.stringify(r[0][u]||{}),o(e,f,{Type:"String"});break;case"JSONProxy":var d=s.StorageColumn+"_"+i;a+=" ["+s.StorageColumn+"] = @"+d,e.query.parameters[d]="string"==typeof r[0][u]?r[0][u]:JSON.stringify(r[0][u]||{}),o(e,d,{Type:"String"});break;default:var p=u+"_"+i;a+=" ["+u+"] = @"+p,e.query.parameters[p]=r[0][u],o(e,p,s)}i++}}return""!==a&&a}(e);return!!i&&"UPDATE"+r+" SET"+i+a+";"},Delete:function(e){var r=n(e),a=s(e),i=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,a=!1,i="",u={Type:"Default"},s=0;s<r.length;s++){var l=null;switch((u=r[s]).Type){case"Deleted":l=" ["+u.Column+"] = 1",a=!0;break;case"DeleteDate":case"UpdateDate":l=" ["+u.Column+"] = "+t;break;case"DeleteIDUser":var c=u.Column+"_"+n;l=" ["+u.Column+"] = @"+c,e.query.parameters[c]=e.query.IDUser,o(e,c,u);break;default:continue}n>0&&(i+=","),i+=l,n++}return!(!a||""===i)&&i}(e);return i?"UPDATE"+r+" SET"+i+a+";":"DELETE FROM"+r+a+";"},Undelete:function(e){var r=n(e);let a=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var i=s(e),u=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,a=!1,i="",u={Type:"Default"},s=0;s<r.length;s++){var l=null;switch((u=r[s]).Type){case"Deleted":l=" ["+u.Column+"] = 0",a=!0;break;case"UpdateDate":l=" ["+u.Column+"] = "+t;break;case"UpdateIDUser":var c=u.Column+"_"+n;l=" ["+u.Column+"] = @"+c,e.query.parameters[c]=e.query.IDUser,o(e,c,u);break;default:continue}n>0&&(i+=","),i+=l,n++}return!(!a||""===i)&&i}(e);return e.query.disableDeleteTracking=a,u?"UPDATE"+r+" SET"+u+i+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?a(e,!0):"*",o=n(e),i=f(e),u=s(e),l=c(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const d=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:o,Where:u,OrderBy:"",IndexHints:l,Limit:"",Distinct:d,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${d}${t||"*"}) AS Row_Count FROM${o}${l}${i}${u};`}};return Object.defineProperty(d,"name",{get:function(){return"MSSQL"},enumerable:!0}),d}},{}],88:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},o=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":var o={};return o[t]=n,o;case"!=":var a={};return a[t]={$ne:n},a;case">":var i={};return i[t]={$gt:n},i;case">=":var u={};return u[t]={$gte:n},u;case"<":var s={};return s[t]={$lt:n},s;case"<=":var l={};return l[t]={$lte:n},l;case"LIKE":var c=String(n).replace(/%/g,".*").replace(/_/g,"."),f={};return f[t]={$regex:c,$options:"i"},f;case"IN":var d={};return d[t]={$in:Array.isArray(n)?n:[n]},d;case"NOT IN":var p={};return p[t]={$nin:Array.isArray(n)?n:[n]},p;case"IS NULL":var h={};return h[t]=null,h;case"IS NOT NULL":var y={};return y[t]={$ne:null},y;default:var g={};return g[t]=n,g}},a=function(e){if(!e||0===e.length)return{};if(1===e.length){var t=e[0];return delete t._connector,t}for(var r={},n=!1,o=0;o<e.length;o++){for(var a=Object.keys(e[o]),i=0;i<a.length;i++){var u=a[i];if("_connector"!==u){if("$"===u.charAt(0)){n=!0;break}if(r[u]){n=!0;break}r[u]=!0}}if(n)break}if(n){for(var s=[],l=0;l<e.length;l++){var c=e[l];delete c._connector,s.push(c)}return{$and:s}}for(var f={},d=0;d<e.length;d++)for(var p=e[d],h=Object.keys(p),y=0;y<h.length;y++)"_connector"!==h[y]&&(f[h[y]]=p[h[y]]);return f},i=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],i=0;i<n.length;i++)if("Deleted"===n[i].Type){for(var u=!1,s=0;s<t.length;s++)if(r(t[s].Column)===n[i].Column){u=!0;break}u||t.push({Column:n[i].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return{};var l=[[]];for(i=0;i<t.length;i++){var c=t[i];if("("===c.Operator)l.push([]);else if(")"===c.Operator){for(var f,d=l.pop(),p=!1,h=0;h<d.length;h++)if("OR"===d[h]._connector){p=!0;break}if(p){for(var y=[],g=0;g<d.length;g++)delete d[g]._connector,y.push(d[g]);f={$or:y}}else f=a(d);f._connector=c.Connector||"AND",l[l.length-1].push(f)}else{var b=o(c);b._connector=c.Connector||"AND",l[l.length-1].push(b)}}var m=l[0];return a(m)},u={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type)switch(i.Type){case"AutoIdentity":e.query.disableAutoIdentity?o[a]=t[0][a]:o[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?o[a]=t[0][a]:o[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?o[a]=t[0][a]:o[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?o[a]=t[0][a]:o[a]=e.query.IDUser;break;case"Deleted":o[a]=0;break;default:o[a]=t[0][a]}}return 0!==Object.keys(o).length&&o}(e);if(!t)return!1;var r={collection:e.scope,operation:"insertOne",document:t};return e.query.parameters.mongoOperation=r,JSON.stringify(r)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("MongoDB dialect does not support JOINs; join parameter will be ignored.");var n=i(e),o=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return{};for(var n={},o=0;o<t.length;o++){var a=t[o];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&(n[a]=1)}return n}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return{};for(var n={},o=0;o<t.length;o++)n[r(t[o].Column)]="Descending"===t[o].Direction?-1:1;return n}(e),u={collection:e.scope,operation:"find",filter:n};return Object.keys(o).length>0&&(u.projection=o),Object.keys(a).length>0&&(u.sort=a),e.cap&&(u.limit=e.cap),!1!==e.begin&&e.begin>0&&(u.skip=e.begin),e.distinct&&(u.distinct=!0),e.query.parameters.mongoOperation=u,JSON.stringify(u)},Update:function(e){var t=i(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==i.Type){switch(i.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(i.Type){case"UpdateDate":e.query.disableAutoDateStamp?o[a]=t[0][a]:o[a]="$$NOW";break;case"UpdateIDUser":o[a]=e.query.IDUser;break;default:o[a]=t[0][a]}}}return 0!==Object.keys(o).length&&o}(e);if(!r)return!1;var o={collection:e.scope,operation:"updateMany",filter:t,update:{$set:r}};return e.query.parameters.mongoOperation=o,JSON.stringify(o)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]=1,r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]="$$NOW";break;case"DeleteIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=i(e);if(t){var n={collection:e.scope,operation:"updateMany",filter:r,update:{$set:t}};return e.query.parameters.mongoOperation=n,JSON.stringify(n)}var o={collection:e.scope,operation:"deleteMany",filter:r};return e.query.parameters.mongoOperation=o,JSON.stringify(o)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]=0,r=!0;break;case"UpdateDate":n[a.Column]="$$NOW";break;case"UpdateIDUser":n[a.Column]=e.query.IDUser;break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=i(e);if(e.query.disableDeleteTracking=r,t){var o={collection:e.scope,operation:"updateMany",filter:n,update:{$set:t}};return e.query.parameters.mongoOperation=o,JSON.stringify(o)}var a={collection:e.scope,operation:"noop"};return e.query.parameters.mongoOperation=a,JSON.stringify(a)},Count:function(e){var t=i(e),n={collection:e.scope,operation:"countDocuments",filter:t};if(e.distinct){n.distinct=!0;var o=e.dataElements;if(Array.isArray(o)&&o.length>0){for(var a=[],u=0;u<o.length;u++){var s=Array.isArray(o[u])?o[u][0]:o[u];"*"!==(s=r(s))&&a.push(s)}a.length>0&&(n.distinctFields=a)}else for(var l=Array.isArray(e.query.schema)?e.query.schema:[],c=0;c<l.length;c++)if("AutoIdentity"===l[c].Type){n.distinctFields=[l[c].Column];break}}return e.query.parameters.mongoOperation=n,JSON.stringify(n)}};return Object.defineProperty(u,"name",{get:function(){return"MongoDB"},enumerable:!0}),u}},{}],89:[function(e,t,r){t.exports=function(e){const t="NOW(3)";let r=e;var n=function(e){return e.scope&&e.scope.indexOf("`")>=0?" "+e.scope:" `"+e.scope+"`"},o=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const o=Array.isArray(e.query.schema)?e.query.schema:[];if(o.length<1)return"";const a=o.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const i=`${r}.${a.Column}`;return` ${u(i)}`}for(var o=" ",a=0;a<r.length;a++)a>0&&(o+=", "),Array.isArray(r[a])?(o+=u(r[a][0]),r[a].length>1&&r[a][1]&&(o+=" AS "+u(r[a][1]))):o+=u(r[a]);return o};const a=/^[` ]+|[` ]+$/g,i=e=>e.replace(a,"");var u=function(e){let t=e.split(".");if(t.length>1){const e=i(t[1]);return"*"===e?"`"+i(t[0])+"`.*":"`"+i(t[0])+"`.`"+e+"`"}return"*"===i(t[0])?"*":"`"+i(t[0])+"`"},s=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var o=r[n],a=0;a<t.length;a++){if(t[a].Column===o&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:o,path:"$."+r.slice(n+1).join(".")}}return null},l=function(e){var t=Array.isArray(e.filter)?e.filter:[],r=n(e);if(!e.query.disableDeleteTracking)for(var o=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<o.length;a++){var i=o[a];if("Deleted"===i.Type){var u=!1;if(t.length>0)for(var l=0;l<t.length;l++)if(t[l].Column===i.Column){u=!0;break}u||t.push({Column:r+"."+i.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",f=!1;for(a=0;a<t.length;a++){var d;if("NONE"!=t[a].Connector&&")"!=t[a].Operator&&" WHERE"!=c&&0==f&&(c+=" "+t[a].Connector),f=!1,"("===t[a].Operator)c+=" (",f=!0;else if(")"===t[a].Operator)c+=" )";else if("IN"===t[a].Operator||"NOT IN"===t[a].Operator)d=t[a].Parameter+"_w"+a,c+=" "+t[a].Column+" "+t[a].Operator+" ( :"+d+" )",e.query.parameters[d]=t[a].Value;else if("IS NULL"===t[a].Operator)c+=" "+t[a].Column+" "+t[a].Operator;else if("IS NOT NULL"===t[a].Operator)c+=" "+t[a].Column+" "+t[a].Operator;else{d=t[a].Parameter+"_w"+a;o=Array.isArray(e.query.schema)?e.query.schema:[];var p=s(t[a].Column,o);c+=p?" JSON_EXTRACT(`"+p.column+"`, '"+p.path+"') "+t[a].Operator+" :"+d:" "+t[a].Column+" "+t[a].Operator+" :"+d,e.query.parameters[d]=t[a].Value}}return c},c=function(e){return!Array.isArray(e.indexHints)||e.indexHints.length<1?"":` USE INDEX (${e.indexHints.join(",")})`},f=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var o=t[n];o.Type&&o.Table&&o.From&&o.To&&(r+=` ${o.Type} ${o.Table} ON ${o.From} = ${o.To}`)}return r},d={Create:function(e){var r=n(e),o=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var o in t[0]){for(var a={Column:o,Type:"Default"},i=0;i<r.length;i++)if(o==r[i].Column){a=r[i];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"JSON":default:""!=n&&(n+=","),n+=" "+o;break;case"JSONProxy":""!=n&&(n+=","),n+=" "+a.StorageColumn}}return n}(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in r[0]){for(var u={Column:i,Type:"Default"},s=0;s<n.length;s++)if(i==n[s].Column){u=n[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==u.Type&&"DeleteIDUser"!==u.Type){a>0&&(o+=",");var l,c=function(){var t=i+"_"+a;o+=" :"+t,e.query.parameters[t]=r[0][i]};switch(u.Type){case"AutoIdentity":e.query.disableAutoIdentity?c():o+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||r[0][i]&&r[0][i].length>=5&&"0x0000000000000000"!==r[0][i]?c():(o+=" :"+(l=i+"_"+a),e.query.parameters[l]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?c():o+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?c():(o+=" :"+(l=i+"_"+a),e.query.parameters[l]=e.query.IDUser);break;case"JSON":var f=i+"_"+a;o+=" :"+f,e.query.parameters[f]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;case"JSONProxy":var d=i+"_"+a;o+=" :"+d,e.query.parameters[d]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;default:c()}a++}}return""!==o&&o}(e);return!!a&&"INSERT INTO"+r+" ("+o+") VALUES ("+a+");"},Read:function(e){var t=o(e),a=n(e),i=l(e),u=f(e),s=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",n=0;n<t.length;n++)n>0&&(r+=","),r+=" "+t[n].Column,"Descending"==t[n].Direction&&(r+=" DESC");return r}(e),d=function(e){if(!e.cap)return"";var t=" LIMIT";return!1!==e.begin&&(t+=" "+e.begin+","),t+" "+e.cap}(e),p=c(e);const h=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:a,Where:i,Join:u,OrderBy:s,Limit:d,IndexHints:p,Distinct:h,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${h}${t} FROM${a}${p}${u}${i}${s}${d};`},Update:function(e){var r=n(e),o=l(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in r[0]){for(var u={Column:i,Type:"Default"},s=0;s<n.length;s++)if(i==n[s].Column){u=n[s];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==u.Type){switch(u.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(o+=","),u.Type){case"UpdateDate":e.query.disableAutoDateStamp?(o+=" "+i+" = :"+(l=i+"_"+a),e.query.parameters[l]=r[0][i]):o+=" "+i+" = "+t;break;case"UpdateIDUser":var l;o+=" "+i+" = :"+(l=i+"_"+a),e.query.parameters[l]=e.query.IDUser;break;case"JSON":var c=i+"_"+a;o+=" "+i+" = :"+c,e.query.parameters[c]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;case"JSONProxy":var f=u.StorageColumn+"_"+a;o+=" "+u.StorageColumn+" = :"+f,e.query.parameters[f]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;default:var d=i+"_"+a;o+=" "+i+" = :"+d,e.query.parameters[d]=r[0][i]}a++}}return""!==o&&o}(e);return!!a&&"UPDATE"+r+" SET"+a+o+";"},Delete:function(e){var r=n(e),o=l(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,o=!1,a="",i={Type:"Default"},u=0;u<r.length;u++){var s=null;switch((i=r[u]).Type){case"Deleted":s=" "+i.Column+" = 1",o=!0;break;case"DeleteDate":case"UpdateDate":s=" "+i.Column+" = "+t;break;case"DeleteIDUser":var l=i.Column+"_"+n;s=" "+i.Column+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=s,n++}return!(!o||""===a)&&a}(e);return a?"UPDATE"+r+" SET"+a+o+";":"DELETE FROM"+r+o+";"},Undelete:function(e){var r=n(e);let o=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=l(e),i=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,o=!1,a="",i={Type:"Default"},u=0;u<r.length;u++){var s=null;switch((i=r[u]).Type){case"Deleted":s=" "+i.Column+" = 0",o=!0;break;case"UpdateDate":s=" "+i.Column+" = "+t;break;case"UpdateIDUser":var l=i.Column+"_"+n;s=" "+i.Column+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=s,n++}return!(!o||""===a)&&a}(e);return e.query.disableDeleteTracking=o,i?"UPDATE"+r+" SET"+i+a+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?o(e,!0):"*",a=n(e),i=f(e),u=l(e),s=c(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const d=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:a,Where:u,OrderBy:"",Limit:"",IndexHints:s,Distinct:d,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${d}${t||"*"}) AS RowCount FROM${a}${s}${i}${u};`}};return Object.defineProperty(d,"name",{get:function(){return"MySQL"},enumerable:!0}),d}},{}],90:[function(e,t,r){t.exports=function(e){const t="NOW()";let r=e;var n=function(e){return e.scope&&e.scope.indexOf('"')>=0?" "+e.scope:' "'+e.scope+'"'},o=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){const r=n(e);if(!t)return r+".*";const o=Array.isArray(e.query.schema)?e.query.schema:[];if(o.length<1)return"";const a=o.find(e=>"AutoIdentity"===e.Type);if(!a)return"";const i=`${r}.${a.Column}`;return` ${u(i)}`}for(var o=" ",a=0;a<r.length;a++)a>0&&(o+=", "),Array.isArray(r[a])?(o+=u(r[a][0]),r[a].length>1&&r[a][1]&&(o+=" AS "+u(r[a][1]))):o+=u(r[a]);return o};const a=/^[" ]+|[" ]+$/g,i=e=>e.replace(a,"");var u=function(e){let t=e.split(".");if(t.length>1){const e=i(t[1]);return"*"===e?'"'+i(t[0])+'".*':'"'+i(t[0])+'"."'+e+'"'}return"*"===i(t[0])?"*":'"'+i(t[0])+'"'},s=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var o=r[n],a=0;a<t.length;a++){if(t[a].Column===o&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:o,path:"$."+r.slice(n+1).join(".")}}return null},l=function(e){var t=Array.isArray(e.filter)?e.filter:[];n(e);if(!e.query.disableDeleteTracking)for(var r=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<r.length;o++){var a=r[o];if("Deleted"===a.Type){var i=!1;if(t.length>0)for(var l=0;l<t.length;l++)if(t[l].Column===a.Column){i=!0;break}i||t.push({Column:u(e.scope+"."+a.Column),Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var c=" WHERE",f=!1;for(o=0;o<t.length;o++){var d;if("NONE"!=t[o].Connector&&")"!=t[o].Operator&&" WHERE"!=c&&0==f&&(c+=" "+t[o].Connector),f=!1,"("===t[o].Operator)c+=" (",f=!0;else if(")"===t[o].Operator)c+=" )";else if("IN"===t[o].Operator||"NOT IN"===t[o].Operator)d=t[o].Parameter+"_w"+o,c+=" "+u(t[o].Column)+" "+t[o].Operator+" ( :"+d+" )",e.query.parameters[d]=t[o].Value;else if("IS NULL"===t[o].Operator)c+=" "+u(t[o].Column)+" "+t[o].Operator;else if("IS NOT NULL"===t[o].Operator)c+=" "+u(t[o].Column)+" "+t[o].Operator;else{d=t[o].Parameter+"_w"+o;r=Array.isArray(e.query.schema)?e.query.schema:[];var p=s(t[o].Column,r);if(p){var h=p.path.replace("$.","").split(".");1===h.length?c+=' "'+p.column+"\"->>'"+h[0]+"' "+t[o].Operator+" :"+d:c+=' "'+p.column+"\"#>>'{"+h.join(",")+"}' "+t[o].Operator+" :"+d}else c+=" "+u(t[o].Column)+" "+t[o].Operator+" :"+d;e.query.parameters[d]=t[o].Value}}return c},c=function(e){var t=e.join;if(!Array.isArray(t)||t.length<1)return"";for(var r="",n=0;n<t.length;n++){var o=t[n];o.Type&&o.Table&&o.From&&o.To&&(r+=` ${o.Type} ${o.Table} ON ${o.From} = ${o.To}`)}return r},f={Create:function(e){var r=n(e),o=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],n="";for(var o in t[0]){for(var a={Column:o,Type:"Default"},i=0;i<r.length;i++)if(o==r[i].Column){a=r[i];break}if(e.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"JSON":default:""!=n&&(n+=","),n+=" "+u(o);break;case"JSONProxy":""!=n&&(n+=","),n+=" "+u(a.StorageColumn)}}return n}(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in r[0]){for(var u={Column:i,Type:"Default"},s=0;s<n.length;s++)if(i==n[s].Column){u=n[s];break}if(e.query.disableDeleteTracking||"DeleteDate"!==u.Type&&"DeleteIDUser"!==u.Type){a>0&&(o+=",");var l,c=function(){var t=i+"_"+a;o+=" :"+t,e.query.parameters[t]=r[0][i]};switch(u.Type){case"AutoIdentity":e.query.disableAutoIdentity?c():o+=" DEFAULT";break;case"AutoGUID":e.query.disableAutoIdentity||r[0][i]&&r[0][i].length>=5&&"0x0000000000000000"!==r[0][i]?c():(o+=" :"+(l=i+"_"+a),e.query.parameters[l]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?c():o+=" "+t;break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?c():(o+=" :"+(l=i+"_"+a),e.query.parameters[l]=e.query.IDUser);break;case"JSON":var f=i+"_"+a;o+=" :"+f,e.query.parameters[f]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;case"JSONProxy":var d=i+"_"+a;o+=" :"+d,e.query.parameters[d]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;default:c()}a++}}return""!==o&&o}(e);return!!a&&"INSERT INTO"+r+" ("+o+") VALUES ("+a+") RETURNING *;"},Read:function(e){var t=o(e),a=n(e),i=l(e),s=c(e),f=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",n=0;n<t.length;n++)n>0&&(r+=","),r+=" "+u(t[n].Column),"Descending"==t[n].Direction&&(r+=" DESC");return r}(e),d=function(e){if(!e.cap)return"";var t=" LIMIT "+e.cap;return!1!==e.begin&&(t+=" OFFSET "+e.begin),t}(e);const p=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:a,Where:i,Join:s,OrderBy:f,Limit:d,Distinct:p,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${p}${t} FROM${a}${s}${i}${f}${d};`},Update:function(e){var r=n(e),o=l(e),a=function(e){var r=e.query.records;if(!Array.isArray(r)||r.length<1)return!1;var n=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in r[0]){for(var s={Column:i,Type:"Default"},l=0;l<n.length;l++)if(i==n[l].Column){s=n[l];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==s.Type){switch(s.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(o+=","),s.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var c=i+"_"+a;o+=" "+u(i)+" = :"+c,e.query.parameters[c]=r[0][i]}else o+=" "+u(i)+" = "+t;break;case"UpdateIDUser":c=i+"_"+a,o+=" "+u(i)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;case"JSON":var f=i+"_"+a;o+=" "+u(i)+" = :"+f,e.query.parameters[f]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;case"JSONProxy":var d=s.StorageColumn+"_"+a;o+=" "+u(s.StorageColumn)+" = :"+d,e.query.parameters[d]="string"==typeof r[0][i]?r[0][i]:JSON.stringify(r[0][i]||{});break;default:var p=i+"_"+a;o+=" "+u(i)+" = :"+p,e.query.parameters[p]=r[0][i]}a++}}return""!==o&&o}(e);return!!a&&"UPDATE"+r+" SET"+a+o+";"},Delete:function(e){var r=n(e),o=l(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,o=!1,a="",i={Type:"Default"},s=0;s<r.length;s++){var l=null;switch((i=r[s]).Type){case"Deleted":l=" "+u(i.Column)+" = 1",o=!0;break;case"DeleteDate":case"UpdateDate":l=" "+u(i.Column)+" = "+t;break;case"DeleteIDUser":var c=i.Column+"_"+n;l=" "+u(i.Column)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=l,n++}return!(!o||""===a)&&a}(e);return a?"UPDATE"+r+" SET"+a+o+";":"DELETE FROM"+r+o+";"},Undelete:function(e){var r=n(e);let o=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=l(e),i=function(e){for(var r=Array.isArray(e.query.schema)?e.query.schema:[],n=0,o=!1,a="",i={Type:"Default"},s=0;s<r.length;s++){var l=null;switch((i=r[s]).Type){case"Deleted":l=" "+u(i.Column)+" = 0",o=!0;break;case"UpdateDate":l=" "+u(i.Column)+" = "+t;break;case"UpdateIDUser":var c=i.Column+"_"+n;l=" "+u(i.Column)+" = :"+c,e.query.parameters[c]=e.query.IDUser;break;default:continue}n>0&&(a+=","),a+=l,n++}return!(!o||""===a)&&a}(e);return e.query.disableDeleteTracking=o,i?"UPDATE"+r+" SET"+i+a+";":"SELECT NULL;"},Count:function(e){var t=e.distinct?o(e,!0):"*",a=n(e),i=c(e),u=l(e);e.distinct&&t.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const s=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:a,Where:u,OrderBy:"",Limit:"",Distinct:s,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${s}${t||"*"}) AS RowCount FROM${a}${i}${u};`}};return Object.defineProperty(f,"name",{get:function(){return"PostgreSQL"},enumerable:!0}),f}},{}],91:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){return" "+e.scope},n=(e,t)=>{if(e.indexOf(".")<0)return"`"+e+"`";var r=t.scope;return e.indexOf(r+".")>-1?"`"+e.replace(r+".","")+"`":"`"+e+"`"},o=function(e,t){var r=e.dataElements;if(!Array.isArray(r)||r.length<1){if(!t)return" *";const r=Array.isArray(e.query.schema)?e.query.schema:[];if(r.length<1)return"";const n=r.find(e=>"AutoIdentity"===e.Type);return n?` ${n.Column}`:""}for(var o=" ",a=0;a<r.length;a++)a>0&&(o+=", "),o+=n(r[a],e);return o},a=function(e,t){if(!Array.isArray(t)||t.length<1)return null;for(var r=e.replace(/`/g,"").replace(/"/g,"").split("."),n=0;n<Math.min(r.length-1,2);n++)for(var o=r[n],a=0;a<t.length;a++){if(t[a].Column===o&&("JSON"===t[a].Type||"JSONProxy"===t[a].Type))return{column:"JSONProxy"===t[a].Type?t[a].StorageColumn:o,path:"$."+r.slice(n+1).join(".")}}return null},i=function(e){var t=Array.isArray(e.filter)?e.filter:[],o=r(e).trim();if(!e.query.disableDeleteTracking)for(var i=Array.isArray(e.query.schema)?e.query.schema:[],u=0;u<i.length;u++){var s=i[u];if("Deleted"===s.Type){var l=!1;if(t.length>0)for(var c=0;c<t.length;c++)if(t[c].Column===s.Column){l=!0;break}l||t.push({Column:o+"."+s.Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}}if(t.length<1)return"";var f=" WHERE",d=!1;for(u=0;u<t.length;u++){var p;if("NONE"!=t[u].Connector&&")"!=t[u].Operator&&" WHERE"!=f&&0==d&&(f+=" "+t[u].Connector),d=!1,"("===t[u].Operator)f+=" (",d=!0;else if(")"===t[u].Operator)f+=" )";else if("IN"===t[u].Operator||"NOT IN"===t[u].Operator){p=t[u].Parameter+"_w"+u;var h=t[u].Value;if(Array.isArray(h)){for(var y=[],g=0;g<h.length;g++){var b=p+"_"+g;y.push(":"+b),e.query.parameters[b]=h[g]}f+=" "+n(t[u].Column,e)+" "+t[u].Operator+" ( "+y.join(", ")+" )"}else f+=" "+n(t[u].Column,e)+" "+t[u].Operator+" ( :"+p+" )",e.query.parameters[p]=h}else if("IS NOT NULL"===t[u].Operator)f+=" "+n(t[u].Column,e)+" "+t[u].Operator;else{p=t[u].Parameter+"_w"+u;i=Array.isArray(e.query.schema)?e.query.schema:[];var m=a(t[u].Column,i);f+=m?" json_extract(`"+m.column+"`, '"+m.path+"') "+t[u].Operator+" :"+p:" "+n(t[u].Column,e)+" "+t[u].Operator+" :"+p,e.query.parameters[p]=t[u].Value}}return f},u={Create:function(e){var t=r(e),o=function(e){var t=e.query.records,r=Array.isArray(e.query.schema)?e.query.schema:[],o="";for(var a in t[0]){for(var i={Column:a,Type:"Default"},u=0;u<r.length;u++)if(a==r[u].Column){i=r[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type)switch(i.Type){case"JSON":""!=o&&(o+=","),o+=" "+a;break;case"JSONProxy":""!=o&&(o+=","),o+=" "+i.StorageColumn;break;default:""!=o&&(o+=","),o+=" "+n(a,e)}}return o}(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],n="",o=0;for(var a in t[0]){for(var i={Column:a,Type:"Default"},u=0;u<r.length;u++)if(a==r[u].Column){i=r[u];break}if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type){o>0&&(n+=",");var s,l=function(){var r=a+"_"+o;n+=" :"+r,e.query.parameters[r]=t[0][a]};switch(i.Type){case"AutoIdentity":e.query.disableAutoIdentity?l():n+=" NULL";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?l():(n+=" :"+(s=a+"_"+o),e.query.parameters[s]=e.query.UUID);break;case"UpdateDate":case"CreateDate":case"DeleteDate":e.query.disableAutoDateStamp?l():n+=" NOW()";break;case"UpdateIDUser":case"CreateIDUser":case"DeleteIDUser":e.query.disableAutoUserStamp?l():(n+=" :"+(s=a+"_"+o),e.query.parameters[s]=e.query.IDUser);break;case"JSON":var c=a+"_"+o;n+=" :"+c,e.query.parameters[c]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;case"JSONProxy":var f=a+"_"+o;n+=" :"+f,e.query.parameters[f]="string"==typeof t[0][a]?t[0][a]:JSON.stringify(t[0][a]||{});break;default:l()}o++}}return""!==n&&n}(e);return!!a&&"INSERT INTO"+t+" ("+o+") VALUES ("+a+");"},Read:function(e){var a=o(e),u=r(e),s=i(e),l=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var r=" ORDER BY",o=0;o<t.length;o++)o>0&&(r+=","),r+=" "+n(t[o].Column,e),"Descending"==t[o].Direction&&(r+=" DESC");return r}(e),c=function(e){if(!e.cap)return"";var t=" LIMIT";return t+=" "+e.cap,!1!==e.begin&&(t+=" OFFSET "+e.begin),t}(e);const f=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:a,TableName:u,Where:s,OrderBy:l,Limit:c,Distinct:f,_Params:e})}catch(t){return console.log("Error with custom Read Query ["+e.queryOverride+"]: "+t),!1}return`SELECT${f}${a} FROM${u}${s}${l}${c};`},Update:function(e){var t=r(e),o=i(e),a=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o="",a=0;for(var i in t[0]){for(var u={Column:i,Type:"Default"},s=0;s<r.length;s++)if(i==r[s].Column){u=r[s];break}if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==u.Type){switch(u.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a>0&&(o+=","),u.Type){case"UpdateDate":if(e.query.disableAutoDateStamp){var l=i+"_"+a;o+=" "+n(i,e)+" = :"+l,e.query.parameters[l]=t[0][i]}else o+=" "+n(i,e)+" = NOW()";break;case"UpdateIDUser":l=i+"_"+a,o+=" "+n(i,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;case"JSON":var c=i+"_"+a;o+=" "+i+" = :"+c,e.query.parameters[c]="string"==typeof t[0][i]?t[0][i]:JSON.stringify(t[0][i]||{});break;case"JSONProxy":var f=u.StorageColumn+"_"+a;o+=" "+u.StorageColumn+" = :"+f,e.query.parameters[f]="string"==typeof t[0][i]?t[0][i]:JSON.stringify(t[0][i]||{});break;default:var d=i+"_"+a;o+=" "+n(i,e)+" = :"+d,e.query.parameters[d]=t[0][i]}a++}}return""!==o&&o}(e);return!!a&&"UPDATE"+t+" SET"+a+o+";"},Delete:function(e){var t=r(e),o=i(e),a=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,o=!1,a="",i={Type:"Default"},u=0;u<t.length;u++){var s=null;switch((i=t[u]).Type){case"Deleted":s=" "+n(i.Column,e)+" = 1",o=!0;break;case"DeleteDate":case"UpdateDate":s=" "+n(i.Column,e)+" = NOW()";break;case"DeleteIDUser":var l=i.Column+"_"+r;s=" "+n(i.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=s,r++}return!(!o||""===a)&&a}(e);return a?"UPDATE"+t+" SET"+a+o+";":"DELETE FROM"+t+o+";"},Undelete:function(e){var t=r(e);let o=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var a=i(e),u=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=0,o=!1,a="",i={Type:"Default"},u=0;u<t.length;u++){var s=null;switch((i=t[u]).Type){case"Deleted":s=" "+n(i.Column,e)+" = 0",o=!0;break;case"UpdateDate":s=" "+n(i.Column,e)+" = NOW()";break;case"UpdateIDUser":var l=i.Column+"_"+r;s=" "+n(i.Column,e)+" = :"+l,e.query.parameters[l]=e.query.IDUser;break;default:continue}r>0&&(a+=","),a+=s,r++}return!(!o||""===a)&&a}(e);return e.query.disableDeleteTracking=o,u?"UPDATE"+t+" SET"+u+a+";":"SELECT NULL;"},Count:function(e){var n=r(e),a=i(e);const u=e.distinct?o(e,!0):"*";e.distinct&&u.length<1&&console.warn("Distinct requested but no field list or schema are available, so not honoring distinct for count query.");const s=e.distinct&&u.length>0?"DISTINCT":"";if(e.queryOverride)try{return t.Utility.template(e.queryOverride)({FieldList:[],TableName:n,Where:a,OrderBy:"",Limit:"",Distinct:s,_Params:e})}catch(t){return console.log("Error with custom Count Query ["+e.queryOverride+"]: "+t),!1}return`SELECT COUNT(${s}${u||"*"}) AS RowCount FROM${n}${a};`}};return Object.defineProperty(u,"name",{get:function(){return"SQLite"},enumerable:!0}),u}},{}],92:[function(e,t,r){t.exports=function(e){let t=e;var r=function(e){if("string"!=typeof e)return e;var t=e.replace(/[`"]/g,"");if(t.indexOf(".")>=0){var r=t.split(".");return"*"===r[r.length-1]?"*":r[r.length-1]}return t},n=function(e,t){for(var r=0;r<t.length;r++)if(e==t[r].Column)return t[r];return{Column:e,Type:"Default"}},o=function(e){return"number"==typeof e?String(e):"boolean"==typeof e?e?"1":"0":'"'+function(e){return"string"!=typeof e?e:e.replace(/([+\-&|!(){}\[\]^"~*?:\\/])/g,"\\$1")}(String(e))+'"'},a=function(e){var t=r(e.Column),n=e.Value;switch(e.Operator){case"=":default:return t+":"+o(n);case"!=":return"(*:* NOT "+t+":"+o(n)+")";case">":return t+":{"+o(n)+" TO *}";case">=":return t+":["+o(n)+" TO *]";case"<":return t+":{* TO "+o(n)+"}";case"<=":return t+":[* TO "+o(n)+"]";case"LIKE":return t+":"+String(n).replace(/%/g,"*").replace(/_/g,"?");case"IN":for(var a=Array.isArray(n)?n:[n],i=[],u=0;u<a.length;u++)i.push(o(a[u]));return t+":("+i.join(" OR ")+")";case"NOT IN":for(var s=Array.isArray(n)?n:[n],l=[],c=0;c<s.length;c++)l.push(o(s[c]));return"(*:* NOT "+t+":("+l.join(" OR ")+"))";case"IS NULL":return"(*:* NOT "+t+":[* TO *])";case"IS NOT NULL":return t+":[* TO *]"}},i=function(e){var t=Array.isArray(e.filter)?e.filter.slice():[];if(!e.query.disableDeleteTracking)for(var n=Array.isArray(e.query.schema)?e.query.schema:[],o=0;o<n.length;o++)if("Deleted"===n[o].Type){for(var i=!1,u=0;u<t.length;u++)if(r(t[u].Column)===n[o].Column){i=!0;break}i||t.push({Column:n[o].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}if(t.length<1)return"";var s=[[]];for(o=0;o<t.length;o++){var l=t[o];if("("===l.Operator)s.push([]);else if(")"===l.Operator){for(var c=s.pop(),f=!1,d=0;d<c.length;d++)if("OR"===c[d].connector){f=!0;break}for(var p="",h=0;h<c.length;h++)h>0&&(p+=f?" OR ":" AND "),p+=c[h].text;s[s.length-1].push({text:"("+p+")",connector:l.Connector||"AND"})}else s[s.length-1].push({text:a(l),connector:l.Connector||"AND"})}var y=s[0];if(0===y.length)return"";for(var g="",b=0;b<y.length;b++)b>0&&(g+=" "+y[b].connector+" "),g+=y[b].text;return g},u={Create:function(e){var t=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(e.query.disableDeleteTracking||"DeleteDate"!==i.Type&&"DeleteIDUser"!==i.Type)switch(i.Type){case"AutoIdentity":e.query.disableAutoIdentity?o[a]=t[0][a]:o[a]="$$AUTOINCREMENT";break;case"AutoGUID":e.query.disableAutoIdentity||t[0][a]&&t[0][a].length>=5&&"0x0000000000000000"!==t[0][a]?o[a]=t[0][a]:o[a]=e.query.UUID;break;case"UpdateDate":case"CreateDate":e.query.disableAutoDateStamp?o[a]=t[0][a]:o[a]="$$NOW";break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.query.disableAutoUserStamp?o[a]=t[0][a]:o[a]=e.query.IDUser;break;case"Deleted":o[a]=0;break;default:o[a]=t[0][a]}}return 0!==Object.keys(o).length&&o}(e);if(!t)return!1;for(var r=!1,o=Array.isArray(e.query.schema)?e.query.schema:[],a=0;a<o.length;a++)if("AutoIdentity"===o[a].Type&&!e.query.disableAutoIdentity){r=e.scope+"."+o[a].Column;break}var i={collection:e.scope,operation:"add",document:t};return r&&(i.counterScope=r),e.query.parameters.solrOperation=i,JSON.stringify(i)},Read:function(e){e.join&&Array.isArray(e.join)&&e.join.length>0&&t.log.warn("Solr dialect does not support JOINs; join parameter will be ignored.");var n=i(e),o=function(e){var t=e.dataElements;if(!Array.isArray(t)||t.length<1)return"*";for(var n=[],o=0;o<t.length;o++){var a=t[o];Array.isArray(a)&&(a=a[0]),"*"!==(a=r(a))&&n.indexOf(a)<0&&n.push(a)}return 0===n.length?"*":n.join(",")}(e),a=function(e){var t=e.sort;if(!Array.isArray(t)||t.length<1)return"";for(var n=[],o=0;o<t.length;o++){var a=r(t[o].Column),i="Descending"===t[o].Direction?"desc":"asc";n.push(a+" "+i)}return n.join(", ")}(e),u={collection:e.scope,operation:"search",query:"*:*"};return n&&(u.filterQuery=n),"*"!==o&&(u.fields=o),a&&(u.sort=a),e.cap&&(u.rows=e.cap),!1!==e.begin&&e.begin>0&&(u.start=e.begin),e.distinct&&(u.distinct=!0),e.query.parameters.solrOperation=u,JSON.stringify(u)},Update:function(e){var t=i(e),r=function(e){var t=e.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r=Array.isArray(e.query.schema)?e.query.schema:[],o={};for(var a in t[0]){var i=n(a,r);if(!e.query.disableAutoUserStamp||"UpdateIDUser"!==i.Type){switch(i.Type){case"AutoIdentity":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(i.Type){case"UpdateDate":e.query.disableAutoDateStamp?o[a]={set:t[0][a]}:o[a]={set:"$$NOW"};break;case"UpdateIDUser":o[a]={set:e.query.IDUser};break;default:o[a]={set:t[0][a]}}}}return 0!==Object.keys(o).length&&o}(e);if(!r)return!1;var o={collection:e.scope,operation:"atomicUpdate",filterQuery:t||"*:*",update:r};return e.query.parameters.solrOperation=o,JSON.stringify(o)},Delete:function(e){var t=function(e){if(e.query.disableDeleteTracking)return!1;for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]={set:1},r=!0;break;case"DeleteDate":case"UpdateDate":n[a.Column]={set:"$$NOW"};break;case"DeleteIDUser":n[a.Column]={set:e.query.IDUser};break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=i(e);if(t){var n={collection:e.scope,operation:"atomicUpdate",filterQuery:r||"*:*",update:t};return e.query.parameters.solrOperation=n,JSON.stringify(n)}var o={collection:e.scope,operation:"deleteByQuery",filterQuery:r||"*:*"};return e.query.parameters.solrOperation=o,JSON.stringify(o)},Undelete:function(e){var t=function(e){for(var t=Array.isArray(e.query.schema)?e.query.schema:[],r=!1,n={},o=0;o<t.length;o++){var a=t[o];switch(a.Type){case"Deleted":n[a.Column]={set:0},r=!0;break;case"UpdateDate":n[a.Column]={set:"$$NOW"};break;case"UpdateIDUser":n[a.Column]={set:e.query.IDUser};break;default:continue}}return!(!r||0===Object.keys(n).length)&&n}(e),r=e.query.disableDeleteTracking;e.query.disableDeleteTracking=!0;var n=i(e);if(e.query.disableDeleteTracking=r,t){var o={collection:e.scope,operation:"atomicUpdate",filterQuery:n||"*:*",update:t};return e.query.parameters.solrOperation=o,JSON.stringify(o)}var a={collection:e.scope,operation:"noop"};return e.query.parameters.solrOperation=a,JSON.stringify(a)},Count:function(e){var t=i(e),n={collection:e.scope,operation:"search",query:"*:*",rows:0,isCount:!0};if(t&&(n.filterQuery=t),e.distinct){n.distinct=!0;var o=e.dataElements;if(Array.isArray(o)&&o.length>0){for(var a=[],u=0;u<o.length;u++){var s=Array.isArray(o[u])?o[u][0]:o[u];"*"!==(s=r(s))&&a.push(s)}a.length>0&&(n.distinctFields=a)}else for(var l=Array.isArray(e.query.schema)?e.query.schema:[],c=0;c<l.length;c++)if("AutoIdentity"===l[c].Type){n.distinctFields=[l[c].Column];break}}return e.query.parameters.solrOperation=n,JSON.stringify(n)}};return Object.defineProperty(u,"name",{get:function(){return"Solr"},enumerable:!0}),u}},{}],93:[function(e,t,r){var n=Object.prototype.toString,o=Math.max,a=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};t.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==n.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,i=function(e,t){for(var r=[],n=t||0,o=0;n<e.length;n+=1,o+=1)r[o]=e[n];return r}(arguments,1),u=o(0,t.length-i.length),s=[],l=0;l<u;l++)s[l]="$"+l;if(r=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(s,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var n=t.apply(this,a(i,arguments));return Object(n)===n?n:this}return t.apply(e,a(i,arguments))}),t.prototype){var c=function(){};c.prototype=t.prototype,r.prototype=new c,c.prototype=null}return r}},{}],94:[function(e,t,r){var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":93}],95:[function(e,t,r){for(var n=e("util"),o=e("is-property"),a=/[\{\[]/,i=/[\}\]]/,u=["do","if","in","for","let","new","try","var","case","else","enum","eval","null","this","true","void","with","await","break","catch","class","const","false","super","throw","while","yield","delete","export","import","public","return","static","switch","typeof","default","extends","finally","package","private","continue","debugger","function","arguments","interface","protected","implements","instanceof","NaN","undefined"],s={},l=0;l<u.length;l++)s[u[l]]=!0;var c={s:function(e){return""+e},d:function(e){return""+Number(e)},o:function(e){return JSON.stringify(e)}},f=function(){var e=[],t=0,r={},u=function(r){for(var n="";n.length<2*t;)n+=" ";e.push(n+r)},l=function(e){return i.test(e.trim()[0])&&a.test(e[e.length-1])?(t--,u(e),void t++):a.test(e[e.length-1])?(u(e),void t++):i.test(e.trim()[0])?(t--,void u(e)):void u(e)},f=function(e){if(!e)return f;if(1===arguments.length&&e.indexOf("\n")>-1)for(var t=e.trim().split("\n"),r=0;r<t.length;r++)l(t[r].trim());else l(n.format.apply(n,arguments));return f};return f.scope={},f.formats=c,f.sym=function(e){return e&&function(e){return o(e)&&!s.hasOwnProperty(e)}(e)||(e="tmp"),r[e]||(r[e]=0),e+(r[e]++||"")},f.property=function(e,t){return 1===arguments.length&&(t=e,e=""),o(t+="")?e?e+"."+t:t:e?e+"["+JSON.stringify(t)+"]":JSON.stringify(t)},f.toString=function(){return e.join("\n")},f.toFunction=function(e){e||(e={});var t="return ("+f.toString()+")";Object.keys(f.scope).forEach(function(t){e[t]||(e[t]=f.scope[t])});var r=Object.keys(e).map(function(e){return e}),n=r.map(function(t){return e[t]});return Function.apply(null,r.concat(t)).apply(null,n)},arguments.length&&f.apply(null,arguments),f};f.formats=c,t.exports=f},{"is-property":118,util:221}],96:[function(e,t,r){var n=e("is-property"),o=function(e,t){return n(t)?e+"."+t:e+"["+JSON.stringify(t)+"]"};o.valid=n,o.property=function(e){return n(e)?e:JSON.stringify(e)},t.exports=o},{"is-property":118}],97:[function(e,t,r){var n;t.exports=function(){if(void 0===n)try{n=Function("return function* () {}")().constructor}catch(e){n=!1}return n}},{}],98:[function(e,t,r){var n,o=e("es-object-atoms"),a=e("es-errors"),i=e("es-errors/eval"),u=e("es-errors/range"),s=e("es-errors/ref"),l=e("es-errors/syntax"),c=e("es-errors/type"),f=e("es-errors/uri"),d=e("math-intrinsics/abs"),p=e("math-intrinsics/floor"),h=e("math-intrinsics/max"),y=e("math-intrinsics/min"),g=e("math-intrinsics/pow"),b=e("math-intrinsics/round"),m=e("math-intrinsics/sign"),v=Function,w=function(e){try{return v('"use strict"; return ('+e+").constructor;")()}catch(e){}},S=e("gopd"),D=e("es-define-property"),E=function(){throw new c},O=S?function(){try{return E}catch(e){try{return S(arguments,"callee").get}catch(e){return E}}}():E,A=e("has-symbols")(),_=e("get-proto"),R=e("get-proto/Object.getPrototypeOf"),C=e("get-proto/Reflect.getPrototypeOf"),q=e("call-bind-apply-helpers/functionApply"),T=e("call-bind-apply-helpers/functionCall"),j={},x="undefined"!=typeof Uint8Array&&_?_(Uint8Array):n,L={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":A&&_?_([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":j,"%AsyncGenerator%":j,"%AsyncGeneratorFunction%":j,"%AsyncIteratorPrototype%":j,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":a,"%eval%":eval,"%EvalError%":i,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":j,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&_?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&_?_((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":u,"%ReferenceError%":s,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&_?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&_?_(""[Symbol.iterator]()):n,"%Symbol%":A?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":O,"%TypedArray%":x,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":q,"%Object.defineProperty%":D,"%Object.getPrototypeOf%":R,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":h,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":C};if(_)try{null.error}catch(e){var I=_(_(e));L["%Error.prototype%"]=I}var U=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&_&&(r=_(o.prototype))}return L[t]=r,r},k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},N=e("function-bind"),M=e("hasown"),P=N.call(T,Array.prototype.concat),B=N.call(q,Array.prototype.splice),F=N.call(T,String.prototype.replace),Q=N.call(T,String.prototype.slice),$=N.call(T,RegExp.prototype.exec),J=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,W=function(e,t){var r,n=e;if(M(k,n)&&(n="%"+(r=k[n])[0]+"%"),M(L,n)){var o=L[n];if(o===j&&(o=U(n)),void 0===o&&!t)throw new c("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new l("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new c('"allowMissing" argument must be a boolean');if(null===$(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=Q(e,0,1),r=Q(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return F(e,J,function(e,t,r,o){n[n.length]=r?F(o,H,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=W("%"+n+"%",t),a=o.name,i=o.value,u=!1,s=o.alias;s&&(n=s[0],B(r,P([0,1],s)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],h=Q(p,0,1),y=Q(p,-1);if(('"'===h||"'"===h||"`"===h||'"'===y||"'"===y||"`"===y)&&h!==y)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&d||(u=!0),M(L,a="%"+(n+="."+p)+"%"))i=L[a];else if(null!=i){if(!(p in i)){if(!t)throw new c("base intrinsic for "+e+" exists, but the property is not available.");return}if(S&&f+1>=r.length){var g=S(i,p);i=(d=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:i[p]}else d=M(i,p),i=i[p];d&&!u&&(L[a]=i)}}return i}},{"call-bind-apply-helpers/functionApply":61,"call-bind-apply-helpers/functionCall":62,"es-define-property":69,"es-errors":71,"es-errors/eval":70,"es-errors/range":72,"es-errors/ref":73,"es-errors/syntax":74,"es-errors/type":75,"es-errors/uri":76,"es-object-atoms":77,"function-bind":94,"get-proto":101,"get-proto/Object.getPrototypeOf":99,"get-proto/Reflect.getPrototypeOf":100,gopd:103,"has-symbols":105,hasown:108,"math-intrinsics/abs":123,"math-intrinsics/floor":124,"math-intrinsics/max":126,"math-intrinsics/min":127,"math-intrinsics/pow":128,"math-intrinsics/round":129,"math-intrinsics/sign":130}],99:[function(e,t,r){var n=e("es-object-atoms");t.exports=n.getPrototypeOf||null},{"es-object-atoms":77}],100:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],101:[function(e,t,r){var n=e("./Reflect.getPrototypeOf"),o=e("./Object.getPrototypeOf"),a=e("dunder-proto/get");t.exports=n?function(e){return n(e)}:o?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return o(e)}:a?function(e){return a(e)}:null},{"./Object.getPrototypeOf":99,"./Reflect.getPrototypeOf":100,"dunder-proto/get":68}],102:[function(e,t,r){t.exports=Object.getOwnPropertyDescriptor},{}],103:[function(e,t,r){var n=e("./gOPD");if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"./gOPD":102}],104:[function(e,t,r){var n=e("es-define-property"),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},t.exports=o},{"es-define-property":69}],105:[function(e,t,r){var n="undefined"!=typeof Symbol&&Symbol,o=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":106}],106:[function(e,t,r){t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var o=Object.getOwnPropertySymbols(e);if(1!==o.length||o[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},{}],107:[function(e,t,r){var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":106}],108:[function(e,t,r){var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,a=e("function-bind");t.exports=a.call(n,o)},{"function-bind":94}],109:[function(e,t,r){var n=e("http"),o=e("url"),a=t.exports;for(var i in n)n.hasOwnProperty(i)&&(a[i]=n[i]);function u(e){if("string"==typeof e&&(e=o.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}a.request=function(e,t){return e=u(e),n.request.call(this,e,t)},a.get=function(e,t){return e=u(e),n.get.call(this,e,t)}},{http:194,url:217}],110:[function(e,t,r){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */r.read=function(e,t,r,n,o){var a,i,u=8*o-n-1,s=(1<<u)-1,l=s>>1,c=-7,f=r?o-1:0,d=r?-1:1,p=e[t+f];for(f+=d,a=p&(1<<-c)-1,p>>=-c,c+=u;c>0;a=256*a+e[t+f],f+=d,c-=8);for(i=a&(1<<-c)-1,a>>=-c,c+=n;c>0;i=256*i+e[t+f],f+=d,c-=8);if(0===a)a=1-l;else{if(a===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),a-=l}return(p?-1:1)*i*Math.pow(2,a-n)},r.write=function(e,t,r,n,o,a){var i,u,s,l=8*a-o-1,c=(1<<l)-1,f=c>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),(t+=i+f>=1?d/s:d*Math.pow(2,1-f))*s>=2&&(i++,s/=2),i+f>=c?(u=0,i=c):i+f>=1?(u=(t*s-1)*Math.pow(2,o),i+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),i=0));o>=8;e[r+p]=255&u,p+=h,u/=256,o-=8);for(i=i<<o|u,l+=o;l>0;e[r+p]=255&i,p+=h,i/=256,l-=8);e[r+p-h]|=128*y}},{}],111:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],112:[function(e,t,r){var n=e("has-tostringtag/shams")(),o=e("call-bound")("Object.prototype.toString"),a=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},i=function(e){return!!a(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"callee"in e&&"[object Function]"===o(e.callee)},u=function(){return a(arguments)}();a.isLegacyArguments=i,t.exports=u?a:i},{"call-bound":66,"has-tostringtag/shams":107}],113:[function(e,t,r){var n,o,a=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw o}}),o={},i(function(){throw 42},null,n)}catch(e){e!==o&&(i=null)}else i=null;var u=/^\s*class\b/,s=function(e){try{var t=a.call(e);return u.test(t)}catch(e){return!1}},l=function(e){try{return!s(e)&&(a.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,f="function"==typeof Symbol&&!!Symbol.toStringTag,d=!(0 in[,]),p=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(p=function(e){if((d||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=i?function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,n)}catch(e){if(e!==o)return!1}return!s(e)&&l(e)}:function(e){if(p(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(f)return l(e);if(s(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&l(e)}},{}],114:[function(e,t,r){var n=e("call-bound"),o=e("safe-regex-test")(/^\s*(?:function)?\*/),a=e("has-tostringtag/shams")(),i=e("get-proto"),u=n("Object.prototype.toString"),s=n("Function.prototype.toString"),l=e("generator-function");t.exports=function(e){if("function"!=typeof e)return!1;if(o(s(e)))return!0;if(!a)return"[object GeneratorFunction]"===u(e);if(!i)return!1;var t=l();return t&&i(e)===t.prototype}},{"call-bound":66,"generator-function":97,"get-proto":101,"has-tostringtag/shams":107,"safe-regex-test":171}],115:[function(e,t,r){var n=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o=/\/\d{1,3}(?=%|$)/,a=/\//,i=/%.*$/,u=/([^0-9a-f:/%])/i,s=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/i;function l(e){if(!n.test(e))return!1;var t=e.split(".");if(4!==t.length)return!1;if("0"===t[0][0]&&t[0].length>1)return!1;if("0"===t[1][0]&&t[1].length>1)return!1;if("0"===t[2][0]&&t[2].length>1)return!1;if("0"===t[3][0]&&t[3].length>1)return!1;var r=Number(t[0]),o=Number(t[1]),a=Number(t[2]),i=Number(t[3]);return r>=0&&r<256&&o>=0&&o<256&&a>=0&&a<256&&i>=0&&i<256}function c(e){var t=e.replace(o,""),r=e.length!==t.length;if(r)return!1;if(!r&&a.test(e))return!1;var n=t.replace(i,""),c=n.lastIndexOf(":");if(-1===c)return!1;var f=l(n.substring(c+1))?n.substring(0,c+1)+"1234:5678":n;if(u.test(f))return!1;if(s.test(f))return!1;var d=f.split("::");if(d.length>2)return!1;if(2===d.length){var p=""===d[0]?[]:d[0].split(":"),h=""===d[1]?[]:d[1].split(":");if(8-(p.length+h.length)<=0)return!1}else if(8!==f.split(":").length)return!1;return!0}function f(e){return l(e)||c(e)}t.exports=function(e){if(e||(e={}),4===e.version)return l;if(6===e.version)return c;if(null==e.version)return f;throw new Error("Unknown version: "+e.version)},t.exports.__all_regexes__=[n,o,a,i,u,s]},{}],116:[function(e,t,r){var n=e("is-my-ip-valid"),o=/\s/,a=/^[a-zA-Z0-9.-]+$/,i=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/,u=/^\+[0-9][0-9 ]{5,27}[0-9]$/,s=/ {2}/,l=/ /g;r["date-time"]=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(?:\.\d+|)([zZ]|[+-]\d{2}:\d{2})$/,r.date=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/,r.time=/^\d{2}:\d{2}:\d{2}$/,r.email=function(e){return-1!==e.indexOf("@")&&!o.test(e)},r["ip-address"]=r.ipv4=n({version:4}),r.ipv6=n({version:6}),r.uri=/^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/,r.color=/(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/,r.hostname=function(e){if(!a.test(e))return!1;for(var t=e.split("."),r=0;r<t.length;r++)if(!i.test(t[r]))return!1;return!0},r.alpha=/^[a-zA-Z]+$/,r.alphanumeric=/^[a-zA-Z0-9]+$/,r.style=/.:\s*[^;]/g,r.phone=function(e){if(!u.test(e))return!1;if(s.test(e))return!1;var t=e.substring(1).replace(l,"").length;return t>=7&&t<=15},r["utc-millisec"]=/^[0-9]{1,15}\.?[0-9]{0,15}$/},{"is-my-ip-valid":115}],117:[function(e,t,r){var n=e("generate-object-property"),o=e("generate-function"),a=e("jsonpointer"),i=e("xtend"),u=e("./formats"),s={any:function(){return"true"},null:function(e){return e+" === null"},boolean:function(e){return"typeof "+e+' === "boolean"'},array:function(e){return"Array.isArray("+e+")"},object:function(e){return"typeof "+e+' === "object" && '+e+" && !Array.isArray("+e+")"},number:function(e){return"typeof "+e+' === "number" && isFinite('+e+")"},integer:function(e){return"typeof "+e+' === "number" && (Math.floor('+e+") === "+e+" || "+e+" > 9007199254740992 || "+e+" < -9007199254740992)"},string:function(e){return"typeof "+e+' === "string"'}},l=function(e,t){t=Math.min(-1===t?e.length:t,e.length);for(var r=[],n=0;n<t;n++)r.push("object"==typeof e[n]?JSON.stringify(e[n]):e[n]);for(n=1;n<r.length;n++)if(r.indexOf(r[n])!==n)return!1;return!0},c=function(e,t){var r,n=(0|t)!==t?Math.pow(10,t.toString().split(".").pop().length):1;n>1?r=((0|e)!==e?Math.pow(10,e.toString().split(".").pop().length):1)>n||Math.round(n*e)%(n*t):r=e%t;return!r},f=function(e,t,r){return r>-1&&t.length>r||e.test(t)},d=function(e,t,r,p,h){var y=h?i(u,h.formats):u,g={unique:l,formats:y,isMultipleOf:c,testLimitedRegex:f},b=!!h&&!!h.verbose,m=!(!h||void 0===h.greedy)&&h.greedy,v={},w=[],S=function(e){var t=e+(v[e]=(v[e]||0)+1);return w.push(t),t},D=function(e){var t=JSON.stringify(e);try{for(var r=/\[([^\[\]"]+)\]/;r.test(t);)t=t.replace(r,n);return t}catch(t){return JSON.stringify(e)}function n(e,t){if(-1===w.indexOf(t))throw new Error("Unreplaceable");return'." + '+t+' + "'}},E={},O=function(e){if(E[e])return E[e];var t=S("pattern");return g[t]=new RegExp(e),E[e]=t,t},A=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],_=function(){var e=A.shift();return A.push(e+e[0]),w.push(e),e},R=function(e,o,i,l,c){var f=o.properties,p=o.type,v=!1;Array.isArray(o.items)&&(f={},o.items.forEach(function(e,t){f[t]=e}),p="array",v=!0);var w=0,E=function(t,r,n){C("errors++"),!0===i&&(C("if (validate.errors === null) validate.errors = []"),b?C("validate.errors.push({field:%s,message:%s,value:%s,type:%s,schemaPath:%s})",D(r||e),JSON.stringify(t),n||e,JSON.stringify(p),JSON.stringify(c)):C("validate.errors.push({field:%s,message:%s})",D(r||e),JSON.stringify(t)))};!0===o.required?(w++,C("if (%s === undefined) {",e),E("is required"),C("} else {")):(w++,C("if (%s !== undefined) {",e));var A=[].concat(p).map(function(t){if(t&&!s.hasOwnProperty(t))throw new Error("Unknown type: "+t);return s[t||"any"](e)}).join(" || ")||"true";if("true"!==A&&(w++,C("if (!(%s)) {",A),E("is the wrong type"),C("} else {")),v)if(!1===o.additionalItems)C("if (%s.length > %d) {",e,o.items.length),E("has additional items"),C("}");else if(o.additionalItems){var q=_();C("for (var %s = %d; %s < %s.length; %s++) {",q,o.items.length,q,e,q),R(e+"["+q+"]",o.additionalItems,i,l,c.concat("additionalItems")),C("}")}if(o.format&&y[o.format]){"string"!==p&&u[o.format]&&C("if (%s) {",s.string(e));var T=S("format");g[T]=y[o.format],"function"==typeof g[T]?C("if (!%s(%s)) {",T,e):C("if (!testLimitedRegex(%s, %s, %d)) {",T,e,void 0===o.maxLength?-1:o.maxLength),E("must be "+o.format+" format"),C("}"),"string"!==p&&u[o.format]&&C("}")}if(Array.isArray(o.required)){T=S("missing");C("var %s = 0",T);C("if ((%s)) {","object"!==p?s.object(e):"true"),o.required.map(function(t){var r=n(e,t);C("if (%s === undefined) {",r),E("is required",r),C("%s++",T),C("}")}),C("}"),m||(C("if (%s === 0) {",T),w++)}if(o.uniqueItems&&("array"!==p&&C("if (%s) {",s.array(e)),C("if (!(unique(%s, %d))) {",e,o.maxItems||-1),E("must be unique"),C("}"),"array"!==p&&C("}")),o.enum){var j=o.enum.some(function(e){return"object"==typeof e})?function(t){return"JSON.stringify("+e+") !== JSON.stringify("+JSON.stringify(t)+")"}:function(t){return e+" !== "+JSON.stringify(t)};C("if (%s) {",o.enum.map(j).join(" && ")||"false"),E("must be an enum value"),C("}")}if(o.dependencies&&("object"!==p&&C("if (%s) {",s.object(e)),Object.keys(o.dependencies).forEach(function(t){var r=o.dependencies[t];"string"==typeof r&&(r=[r]);Array.isArray(r)&&(C("if (%s !== undefined && !(%s)) {",n(e,t),r.map(function(t){return n(e,t)+" !== undefined"}).join(" && ")||"true"),E("dependencies not set"),C("}")),"object"==typeof r&&(C("if (%s !== undefined) {",n(e,t)),R(e,r,i,l,c.concat(["dependencies",t])),C("}"))}),"object"!==p&&C("}")),o.additionalProperties||!1===o.additionalProperties){"object"!==p&&C("if (%s) {",s.object(e));q=_();var x=S("keys"),L=Object.keys(f||{}).map(function(e){return x+"["+q+"] !== "+JSON.stringify(e)}).concat(Object.keys(o.patternProperties||{}).map(function(e){return"!"+O(e)+".test("+x+"["+q+"])"})).join(" && ")||"true";C("var %s = Object.keys(%s)",x,e)("for (var %s = 0; %s < %s.length; %s++) {",q,q,x,q)("if (%s) {",L),!1===o.additionalProperties?(l&&C("delete %s",e+"["+x+"["+q+"]]"),E("has additional properties",null,JSON.stringify(e+".")+" + "+x+"["+q+"]")):R(e+"["+x+"["+q+"]]",o.additionalProperties,i,l,c.concat(["additionalProperties"])),C("}")("}"),"object"!==p&&C("}")}if(o.$ref){var I=function(e,t,r){var n=function(e){return e&&e.id===r?e:"object"==typeof e&&e?Object.keys(e).reduce(function(t,r){return t||n(e[r])},null):null},o=n(e);if(o)return o;r=(r=r.replace(/^#/,"")).replace(/\/$/,"");try{return a.get(e,decodeURI(r))}catch(e){var i,u=r.indexOf("#");if(0!==u)if(-1===u)i=t[r];else{i=t[r.slice(0,u)];var s=r.slice(u).replace(/^#/,"");try{return a.get(i,s)}catch(e){}}else i=t[r];return i||null}}(r,h&&h.schemas||{},o.$ref);if(I){var U=t[o.$ref];U||(t[o.$ref]=function(e){return U(e)},U=d(I,t,r,!1,h));T=S("ref");g[T]=U,C("if (!(%s(%s))) {",T,e),E("referenced schema does not match"),C("}")}}if(o.not){var k=S("prev");C("var %s = errors",k),R(e,o.not,!1,l,c.concat("not")),C("if (%s === errors) {",k),E("negative schema matches"),C("} else {")("errors = %s",k)("}")}if(o.items&&!v){"array"!==p&&C("if (%s) {",s.array(e));q=_();C("for (var %s = 0; %s < %s.length; %s++) {",q,q,e,q),R(e+"["+q+"]",o.items,i,l,c.concat("items")),C("}"),"array"!==p&&C("}")}if(o.patternProperties){"object"!==p&&C("if (%s) {",s.object(e));x=S("keys"),q=_();C("var %s = Object.keys(%s)",x,e)("for (var %s = 0; %s < %s.length; %s++) {",q,q,x,q),Object.keys(o.patternProperties).forEach(function(t){var r=O(t);C("if (%s.test(%s)) {",r,x+"["+q+"]"),R(e+"["+x+"["+q+"]]",o.patternProperties[t],i,l,c.concat(["patternProperties",t])),C("}")}),C("}"),"object"!==p&&C("}")}if(o.pattern){var N=O(o.pattern);"string"!==p&&C("if (%s) {",s.string(e)),C("if (!(testLimitedRegex(%s, %s, %d))) {",N,e,void 0===o.maxLength?-1:o.maxLength),E("pattern mismatch"),C("}"),"string"!==p&&C("}")}if(o.allOf&&o.allOf.forEach(function(t,r){R(e,t,i,l,c.concat(["allOf",r]))}),o.anyOf&&o.anyOf.length){k=S("prev");o.anyOf.forEach(function(t,r){0===r?C("var %s = errors",k):C("if (errors !== %s) {",k)("errors = %s",k),R(e,t,!1,!1,c)}),o.anyOf.forEach(function(e,t){t&&C("}")}),C("if (%s !== errors) {",k),E("no schemas match"),C("}")}if(o.oneOf&&o.oneOf.length){k=S("prev");var M=S("passes");C("var %s = errors",k)("var %s = 0",M),o.oneOf.forEach(function(t,r){R(e,t,!1,!1,c),C("if (%s === errors) {",k)("%s++",M)("} else {")("errors = %s",k)("}")}),C("if (%s !== 1) {",M),E("no (or more than one) schemas match"),C("}")}for(void 0!==o.multipleOf&&("number"!==p&&"integer"!==p&&C("if (%s) {",s.number(e)),C("if (!isMultipleOf(%s, %d)) {",e,o.multipleOf),E("has a remainder"),C("}"),"number"!==p&&"integer"!==p&&C("}")),void 0!==o.maxProperties&&("object"!==p&&C("if (%s) {",s.object(e)),C("if (Object.keys(%s).length > %d) {",e,o.maxProperties),E("has more properties than allowed"),C("}"),"object"!==p&&C("}")),void 0!==o.minProperties&&("object"!==p&&C("if (%s) {",s.object(e)),C("if (Object.keys(%s).length < %d) {",e,o.minProperties),E("has less properties than allowed"),C("}"),"object"!==p&&C("}")),void 0!==o.maxItems&&("array"!==p&&C("if (%s) {",s.array(e)),C("if (%s.length > %d) {",e,o.maxItems),E("has more items than allowed"),C("}"),"array"!==p&&C("}")),void 0!==o.minItems&&("array"!==p&&C("if (%s) {",s.array(e)),C("if (%s.length < %d) {",e,o.minItems),E("has less items than allowed"),C("}"),"array"!==p&&C("}")),void 0!==o.maxLength&&("string"!==p&&C("if (%s) {",s.string(e)),C("if (%s.length > %d) {",e,o.maxLength),E("has longer length than allowed"),C("}"),"string"!==p&&C("}")),void 0!==o.minLength&&("string"!==p&&C("if (%s) {",s.string(e)),C("if (%s.length < %d) {",e,o.minLength),E("has less length than allowed"),C("}"),"string"!==p&&C("}")),void 0!==o.minimum&&("number"!==p&&"integer"!==p&&C("if (%s) {",s.number(e)),C("if (%s %s %d) {",e,o.exclusiveMinimum?"<=":"<",o.minimum),E("is less than minimum"),C("}"),"number"!==p&&"integer"!==p&&C("}")),void 0!==o.maximum&&("number"!==p&&"integer"!==p&&C("if (%s) {",s.number(e)),C("if (%s %s %d) {",e,o.exclusiveMaximum?">=":">",o.maximum),E("is more than maximum"),C("}"),"number"!==p&&"integer"!==p&&C("}")),f&&Object.keys(f).forEach(function(t){Array.isArray(p)&&-1!==p.indexOf("null")&&C("if (%s !== null) {",e),R(n(e,t),f[t],i,l,c.concat(v?t:["properties",t])),Array.isArray(p)&&-1!==p.indexOf("null")&&C("}")});w--;)C("}")},C=o("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return R("data",e,p,h&&h.filter,[]),C("return errors === 0")("}"),(C=C.toFunction(g)).errors=null,Object.defineProperty&&Object.defineProperty(C,"error",{get:function(){return C.errors?C.errors.map(function(e){return e.field+" "+e.message}).join("\n"):""}}),C.toJSON=function(){return e},C};t.exports=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),d(e,{},e,!0,t)},t.exports.filter=function(e,r){var n=t.exports(e,i(r,{filter:!0}));return function(e){return n(e),e}}},{"./formats":116,"generate-function":95,"generate-object-property":96,jsonpointer:122,xtend:224}],118:[function(e,t,r){t.exports=function(e){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(e)}},{}],119:[function(e,t,r){var n,o=e("call-bound"),a=e("has-tostringtag/shams")(),i=e("hasown"),u=e("gopd");if(a){var s=o("RegExp.prototype.exec"),l={},c=function(){throw l},f={toString:c,valueOf:c};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=c),n=function(e){if(!e||"object"!=typeof e)return!1;var t=u(e,"lastIndex");if(!(t&&i(t,"value")))return!1;try{s(e,f)}catch(e){return e===l}}}else{var d=o("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===d(e)}}t.exports=n},{"call-bound":66,gopd:103,"has-tostringtag/shams":107,hasown:108}],120:[function(e,t,r){var n=e("which-typed-array");t.exports=function(e){return!!n(e)}},{"which-typed-array":222}],121:[function(e,t,r){(function(e){(function(){var r={},n=r.LEFT_BRACE=1,o=r.RIGHT_BRACE=2,a=r.LEFT_BRACKET=3,i=r.RIGHT_BRACKET=4,u=r.COLON=5,s=r.COMMA=6,l=r.TRUE=7,c=r.FALSE=8,f=r.NULL=9,d=r.STRING=10,p=r.NUMBER=11,h=r.START=17,y=r.STOP=18,g=r.TRUE1=33,b=r.TRUE2=34,m=r.TRUE3=35,v=r.FALSE1=49,w=r.FALSE2=50,S=r.FALSE3=51,D=r.FALSE4=52,E=r.NULL1=65,O=r.NULL2=66,A=r.NULL3=67,_=r.NUMBER1=81,R=r.NUMBER3=83,C=r.STRING1=97,q=r.STRING2=98,T=r.STRING3=99,j=r.STRING4=100,x=r.STRING5=101,L=r.STRING6=102,I=r.VALUE=113,U=r.KEY=114,k=r.OBJECT=129,N=r.ARRAY=130,M="\\".charCodeAt(0),P="/".charCodeAt(0),B="\b".charCodeAt(0),F="\f".charCodeAt(0),Q="\n".charCodeAt(0),$="\r".charCodeAt(0),J="\t".charCodeAt(0),H=65536;function W(){this.tState=h,this.value=void 0,this.string=void 0,this.stringBuffer=e.alloc?e.alloc(H):new e(H),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=I,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new e(2),3:new e(3),4:new e(4)},this.offset=-1}W.toknam=function(e){for(var t=Object.keys(r),n=0,o=t.length;n<o;n++){var a=t[n];if(r[a]===e)return a}return e&&"0x"+e.toString(16)};var G=W.prototype;G.onError=function(e){throw e},G.charError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(e[t]))+" at position "+t+" in state "+W.toknam(this.tState)))},G.appendStringChar=function(e){this.stringBufferOffset>=H&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=e},G.appendStringBuf=function(e,t,r){var n=e.length;"number"==typeof t&&(n="number"==typeof r?r<0?e.length-t+r:r-t:e.length-t),n<0&&(n=0),this.stringBufferOffset+n>H&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),e.copy(this.stringBuffer,this.stringBufferOffset,t,r),this.stringBufferOffset+=n},G.write=function(t){var r;"string"==typeof t&&(t=new e(t));for(var y=0,I=t.length;y<I;y++)if(this.tState===h){if(r=t[y],this.offset++,123===r)this.onToken(n,"{");else if(125===r)this.onToken(o,"}");else if(91===r)this.onToken(a,"[");else if(93===r)this.onToken(i,"]");else if(58===r)this.onToken(u,":");else if(44===r)this.onToken(s,",");else if(116===r)this.tState=g;else if(102===r)this.tState=v;else if(110===r)this.tState=E;else if(34===r)this.string="",this.stringBufferOffset=0,this.tState=C;else if(45===r)this.string="-",this.tState=_;else if(r>=48&&r<64)this.string=String.fromCharCode(r),this.tState=R;else if(32!==r&&9!==r&&10!==r&&13!==r)return this.charError(t,y)}else if(this.tState===C)if(r=t[y],this.bytes_remaining>0){for(var U=0;U<this.bytes_remaining;U++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+U]=t[U];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,y=y+U-1}else if(0===this.bytes_remaining&&r>=128){if(r<=193||r>244)return this.onError(new Error("Invalid UTF-8 character at position "+y+" in state "+W.toknam(this.tState)));if(r>=194&&r<=223&&(this.bytes_in_sequence=2),r>=224&&r<=239&&(this.bytes_in_sequence=3),r>=240&&r<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+y>t.length){for(var k=0;k<=t.length-1-y;k++)this.temp_buffs[this.bytes_in_sequence][k]=t[y+k];this.bytes_remaining=y+this.bytes_in_sequence-t.length,y=t.length-1}else this.appendStringBuf(t,y,y+this.bytes_in_sequence),y=y+this.bytes_in_sequence-1}else if(34===r)this.tState=h,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(d,this.string),this.offset+=e.byteLength(this.string,"utf8")+1,this.string=void 0;else if(92===r)this.tState=q;else{if(!(r>=32))return this.charError(t,y);this.appendStringChar(r)}else if(this.tState===q)if(34===(r=t[y]))this.appendStringChar(r),this.tState=C;else if(92===r)this.appendStringChar(M),this.tState=C;else if(47===r)this.appendStringChar(P),this.tState=C;else if(98===r)this.appendStringChar(B),this.tState=C;else if(102===r)this.appendStringChar(F),this.tState=C;else if(110===r)this.appendStringChar(Q),this.tState=C;else if(114===r)this.appendStringChar($),this.tState=C;else if(116===r)this.appendStringChar(J),this.tState=C;else{if(117!==r)return this.charError(t,y);this.unicode="",this.tState=T}else if(this.tState===T||this.tState===j||this.tState===x||this.tState===L){if(!((r=t[y])>=48&&r<64||r>64&&r<=70||r>96&&r<=102))return this.charError(t,y);if(this.unicode+=String.fromCharCode(r),this.tState++===L){var N=parseInt(this.unicode,16);this.unicode=void 0,void 0!==this.highSurrogate&&N>=56320&&N<57344?(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate,N))),this.highSurrogate=void 0):void 0===this.highSurrogate&&N>=55296&&N<56320?this.highSurrogate=N:(void 0!==this.highSurrogate&&(this.appendStringBuf(new e(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new e(String.fromCharCode(N)))),this.tState=C}}else if(this.tState===_||this.tState===R)switch(r=t[y]){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(r),this.tState=R;break;default:this.tState=h;var H=Number(this.string);if(isNaN(H))return this.charError(t,y);this.string.match(/[0-9]+/)==this.string&&H.toString()!=this.string?this.onToken(d,this.string):this.onToken(p,H),this.offset+=this.string.length-1,this.string=void 0,y--}else if(this.tState===g){if(114!==t[y])return this.charError(t,y);this.tState=b}else if(this.tState===b){if(117!==t[y])return this.charError(t,y);this.tState=m}else if(this.tState===m){if(101!==t[y])return this.charError(t,y);this.tState=h,this.onToken(l,!0),this.offset+=3}else if(this.tState===v){if(97!==t[y])return this.charError(t,y);this.tState=w}else if(this.tState===w){if(108!==t[y])return this.charError(t,y);this.tState=S}else if(this.tState===S){if(115!==t[y])return this.charError(t,y);this.tState=D}else if(this.tState===D){if(101!==t[y])return this.charError(t,y);this.tState=h,this.onToken(c,!1),this.offset+=4}else if(this.tState===E){if(117!==t[y])return this.charError(t,y);this.tState=O}else if(this.tState===O){if(108!==t[y])return this.charError(t,y);this.tState=A}else if(this.tState===A){if(108!==t[y])return this.charError(t,y);this.tState=h,this.onToken(f,null),this.offset+=3}},G.onToken=function(e,t){},G.parseError=function(e,t){this.tState=y,this.onError(new Error("Unexpected "+W.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+W.toknam(this.state)))},G.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},G.pop=function(){var e=this.value,t=this.stack.pop();this.value=t.value,this.key=t.key,this.mode=t.mode,this.emit(e),this.mode||(this.state=I)},G.emit=function(e){this.mode&&(this.state=s),this.onValue(e)},G.onValue=function(e){},G.onToken=function(e,t){if(this.state===I)if(e===d||e===p||e===l||e===c||e===f)this.value&&(this.value[this.key]=t),this.emit(t);else if(e===n)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=U,this.mode=k;else if(e===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=N,this.state=I;else if(e===o){if(this.mode!==k)return this.parseError(e,t);this.pop()}else{if(e!==i)return this.parseError(e,t);if(this.mode!==N)return this.parseError(e,t);this.pop()}else if(this.state===U)if(e===d)this.key=t,this.state=u;else{if(e!==o)return this.parseError(e,t);this.pop()}else if(this.state===u){if(e!==u)return this.parseError(e,t);this.state=I}else{if(this.state!==s)return this.parseError(e,t);if(e===s)this.mode===N?(this.key++,this.state=I):this.mode===k&&(this.state=U);else{if(!(e===i&&this.mode===N||e===o&&this.mode===k))return this.parseError(e,t);this.pop()}}},W.C=r,t.exports=W}).call(this)}).call(this,e("buffer").Buffer)},{buffer:57}],122:[function(e,t,r){var n=/~/,o=/~[01]/g;function a(e){switch(e){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+e)}function i(e){return n.test(e)?e.replace(o,a):e}function u(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e;throw new Error("Invalid JSON pointer.")}if(Array.isArray(e)){for(const t of e)if("string"!=typeof t&&"number"!=typeof t)throw new Error("Invalid JSON pointer. Must be of type string or number.");return e}throw new Error("Invalid JSON pointer.")}function s(e,t){if("object"!=typeof e)throw new Error("Invalid input object.");var r=(t=u(t)).length;if(1===r)return e;for(var n=1;n<r;){if(e=e[i(t[n++])],r===n)return e;if("object"!=typeof e||null===e)return}}function l(e,t,r){if("object"!=typeof e)throw new Error("Invalid input object.");if(0===(t=u(t)).length)throw new Error("Invalid JSON pointer for set.");return function(e,t,r){for(var n,o,a=1,u=t.length;a<u;){if("constructor"===t[a]||"prototype"===t[a]||"__proto__"===t[a])return e;if(n=i(t[a++]),o=u>a,void 0===e[n]&&(Array.isArray(e)&&"-"===n&&(n=e.length),o&&(""!==t[a]&&t[a]<1/0||"-"===t[a]?e[n]=[]:e[n]={})),!o)break;e=e[n]}var s=e[n];return void 0===r?delete e[n]:e[n]=r,s}(e,t,r)}r.get=s,r.set=l,r.compile=function(e){var t=u(e);return{get:function(e){return s(e,t)},set:function(e,r){return l(e,t,r)}}}},{}],123:[function(e,t,r){t.exports=Math.abs},{}],124:[function(e,t,r){t.exports=Math.floor},{}],125:[function(e,t,r){t.exports=Number.isNaN||function(e){return e!=e}},{}],126:[function(e,t,r){t.exports=Math.max},{}],127:[function(e,t,r){t.exports=Math.min},{}],128:[function(e,t,r){t.exports=Math.pow},{}],129:[function(e,t,r){t.exports=Math.round},{}],130:[function(e,t,r){var n=e("./isNaN");t.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},{"./isNaN":125}],131:[function(e,t,r){
|
|
21
|
+
var n=e("fs");t.exports=new function(){return function e(t){if("object"!=typeof t||!("fable"in t))return{new:e};var r=t,i={};function a(e,t){return i[e]=t,r}return{loadQuery:function(e,t,i){var o="function"==typeof i?i:function(){};return n.readFile(t,"utf8",function(n,i){n?(r.fable.log.error("Problem loading custom query file.",{QueryTag:e,FileName:t,Error:n}),a(e,""),o(!1)):(r.fable.log.trace("Loaded custom query file.",{QueryTag:e,FileName:t}),a(e,i),o(!0))}),r},setQuery:a,checkQuery:function(e){return i.hasOwnProperty(e)},getQuery:function(e){return!!i.hasOwnProperty(e)&&i[e]},new:e}}()}},{fs:79}],215:[function(e,t,r){
|
|
24
22
|
/**
|
|
25
|
-
* Meadow Endpoint Utility Function - Parse a Filter String and put it into a Query.
|
|
26
|
-
*
|
|
27
23
|
* @license MIT
|
|
28
|
-
*
|
|
29
|
-
* @author Steven Velozo <steven@velozo.com>
|
|
30
|
-
* @module Meadow
|
|
24
|
+
* @author <steven@velozo.com>
|
|
31
25
|
*/
|
|
32
|
-
|
|
26
|
+
var n=e("is-my-json-valid");t.exports=new function(){return function e(t,r){var i=!1,a=!1,o=!1,s=!1,u={},f=function(e){i="object"==typeof e?e:{title:"Unknown",type:"object",required:[]}};f(r);var c=function(e){s=n(a="object"==typeof e?e:{title:"Unknown",type:"object",required:[]},{greedy:!0,verbose:!0})};c(t);var l=function(e){o="object"==typeof e?e:{}};l();var d={setSchema:f,setJsonSchema:c,setDefault:l,setAuthorizer:function(e){u="object"==typeof e?e:{}},validateObject:function(e){var t={Valid:s(e)};return t.Valid||(t.Errors=s.errors),t},new:e};return Object.defineProperty(d,"schema",{get:function(){return i},enumerable:!0}),Object.defineProperty(d,"jsonSchema",{get:function(){return a},enumerable:!0}),Object.defineProperty(d,"defaultObject",{get:function(){return o},enumerable:!0}),Object.defineProperty(d,"authorizer",{get:function(){return u},enumerable:!0}),d}()}},{"is-my-json-valid":195}],216:[function(e,t,r){
|
|
33
27
|
/**
|
|
34
28
|
* @license MIT
|
|
35
29
|
* @author <steven@velozo.com>
|
|
36
30
|
*/
|
|
37
|
-
var n=e("
|
|
31
|
+
var n=e("foxhound");t.exports=new function(){return function t(r,i,a,o){if("object"!=typeof r||!("fable"in r))return{new:t};var s=r;s.settingsManager.fill({MeadowProvider:"None"});var u=0,f="string"==typeof i?i:"Unknown",c=e("./Meadow-Schema.js").new(a,o),l=n.new(s).setScope(f),d=e("./Meadow-RawQuery.js").new(s),h=e("./behaviors/Meadow-Create.js"),p=e("./behaviors/Meadow-Read.js"),y=e("./behaviors/Meadow-Reads.js"),b=e("./behaviors/Meadow-Update.js"),m=e("./behaviors/Meadow-Delete.js"),g=e("./behaviors/Meadow-Undelete.js"),v=e("./behaviors/Meadow-Count.js"),w=!1,_=!1,S="ID"+f,E="GUID"+f,M=e("./Meadow-PackageFileLoader.js"),A=e("./Meadow-PackageObjectLoader.js"),D=()=>("function"==typeof w.setSchema&&w.setSchema(f,c.schema,S,E),this),k={ALASQL:e("./providers/Meadow-Provider-ALASQL.js"),MeadowEndpoints:e("./providers/Meadow-Provider-MeadowEndpoints.js"),MySQL:e("./providers/Meadow-Provider-MySQL.js"),MSSQL:e("./providers/Meadow-Provider-MSSQL.js"),SQLite:e("./providers/Meadow-Provider-SQLite.js"),PostgreSQL:e("./providers/Meadow-Provider-PostgreSQL.js"),MongoDB:e("./providers/Meadow-Provider-MongoDB.js"),DGraph:e("./providers/Meadow-Provider-DGraph.js"),Solr:e("./providers/Meadow-Provider-Solr.js"),RocksDB:e("./providers/Meadow-Provider-RocksDB.js"),RetoldDataBeacon:e("./providers/Meadow-Provider-RetoldDataBeacon.js"),None:e("./providers/Meadow-Provider-None.js")},O=function(e){"string"!=typeof e&&(e="None");try{w=k[e].new(s),D(),_=e}catch(t){s.log.error("Provider not set - require load problem",{InvalidProvider:e,error:t}),O("None")}return this};let x;O(s.settings.MeadowProvider),x=Array.isArray(s.settings.MeadowRoleNames)?s.settings.MeadowRoleNames:["Unauthenticated","User","Manager","Director","Executive","Administrator"];var R={doCreate:function(e,t){return h(this,e,t)},doRead:function(e,t){return p(this,e,t)},doReads:function(e,t){return y(this,e,t)},doUpdate:function(e,t){return b(this,e,t)},doDelete:function(e,t){return m(this,e,t)},doUndelete:function(e,t){return g(this,e,t)},doCount:function(e,t){return v(this,e,t)},validateObject:c.validateObject,marshalRecordFromSourceToObject:function(e){var t=s.Utility.extend({},c.defaultObject);return w.marshalRecordFromSourceToObject(t,e,c.schema),t},setProvider:O,setIDUser:function(e){return u=e,this},loadFromPackage:function(e){return M(this,e)},loadFromPackageObject:function(e){return A(this,e)},setScope:function(e){return f=e,l.setScope(e),D(),this},setDomain:function(e){return this},setSchema:function(e){return c.setSchema(e),D(),this},setJsonSchema:function(e){return c.setJsonSchema(e),this},setDefault:function(e){return c.setDefault(e),this},setDefaultIdentifier:function(e){return S=e,E="GU"+e,D(),this},setAuthorizer:function(e){return c.setAuthorizer(e),this},getRoleName:function(e){return e<0||e>=x.length?"Unauthenticated":x[e]},logSlowQuery:function(e,t){var r=t.query||{body:"",parameters:{}},n=r.body;if(r.parameters.length)for(var i in r.parameters)n=n.replace(":"+i,r.parameters[i]);s.log.warn("Slow Read query took "+e+"ms",{Provider:_,Query:{Body:r.body,Parameters:r.parameters,FullQuery:n}})},new:t};return Object.defineProperty(R,"scope",{get:function(){return f},enumerable:!0}),Object.defineProperty(R,"schema",{get:function(){return c.schema},enumerable:!0}),Object.defineProperty(R,"schemaFull",{get:function(){return c},enumerable:!0}),Object.defineProperty(R,"defaultIdentifier",{get:function(){return S},enumerable:!0}),Object.defineProperty(R,"defaultGUIdentifier",{get:function(){return E},enumerable:!0}),Object.defineProperty(R,"jsonSchema",{get:function(){return c.jsonSchema},enumerable:!0}),Object.defineProperty(R,"userIdentifier",{get:function(){return u},enumerable:!0}),Object.defineProperty(R,"query",{get:function(){var e=l.clone();return e.query.schema=c.schema,e},enumerable:!0}),Object.defineProperty(R,"rawQueries",{get:function(){return d},enumerable:!0}),Object.defineProperty(R,"provider",{get:function(){return w},enumerable:!0}),Object.defineProperty(R,"providerName",{get:function(){return _},enumerable:!0}),"function"==typeof s.addServices?s.addServices(R):(Object.defineProperty(R,"fable",{get:function(){return s},enumerable:!1}),Object.defineProperty(R,"settings",{get:function(){return s.settings},enumerable:!1}),Object.defineProperty(R,"log",{get:function(){return s.log},enumerable:!1})),R}()}},{"./Meadow-PackageFileLoader.js":212,"./Meadow-PackageObjectLoader.js":213,"./Meadow-RawQuery.js":214,"./Meadow-Schema.js":215,"./behaviors/Meadow-Count.js":218,"./behaviors/Meadow-Create.js":219,"./behaviors/Meadow-Delete.js":220,"./behaviors/Meadow-Read.js":221,"./behaviors/Meadow-Reads.js":222,"./behaviors/Meadow-Undelete.js":223,"./behaviors/Meadow-Update.js":224,"./providers/Meadow-Provider-ALASQL.js":225,"./providers/Meadow-Provider-DGraph.js":226,"./providers/Meadow-Provider-MSSQL.js":227,"./providers/Meadow-Provider-MeadowEndpoints.js":228,"./providers/Meadow-Provider-MongoDB.js":229,"./providers/Meadow-Provider-MySQL.js":230,"./providers/Meadow-Provider-None.js":231,"./providers/Meadow-Provider-PostgreSQL.js":232,"./providers/Meadow-Provider-RetoldDataBeacon.js":233,"./providers/Meadow-Provider-RocksDB.js":234,"./providers/Meadow-Provider-SQLite.js":235,"./providers/Meadow-Provider-Solr.js":236,foxhound:144}],217:[function(e,t,r){
|
|
38
32
|
/**
|
|
39
33
|
* @license MIT
|
|
40
34
|
* @author <steven@velozo.com>
|
|
41
35
|
*/
|
|
42
|
-
var n=e("
|
|
36
|
+
var n=e("crypto"),i="__mdsd_",a=function(e,t,r){var a=String(e)+":"+String(t)+":"+String(r),o=n.createHash("sha1").update(a).digest("hex").slice(0,16);return i+o},o=function(e){var t=[];if(!Array.isArray(e))return t;for(var r={},n=0;n<e.length;n++){var i=e[n];"AutoGUID"===i.Type&&t.push({Columns:[i.Column],GroupName:"__autoguid_"+i.Column,AutoGUID:!0}),!0===i.Unique&&t.push({Columns:[i.Column],GroupName:null,AutoGUID:!1}),"string"==typeof i.UniqueGroup&&i.UniqueGroup.length>0&&(r[i.UniqueGroup]||(r[i.UniqueGroup]={Columns:[],GroupName:i.UniqueGroup,AutoGUID:!1}),r[i.UniqueGroup].Columns.push(i.Column))}for(var a=Object.keys(r),o=0;o<a.length;o++)t.push(r[a[o]]);return t},s=function(e){if(!Array.isArray(e))return null;for(var t=0;t<e.length;t++)if("Deleted"===e[t].Type)return e[t].Column;return null};t.exports=function(e,t,r){var n=o(e.schema);if(n.length<1)return r();var i=s(e.schema);if(!i)return r();var u=function(o){if(o>=n.length)return r();!function(e,t,r,n,i){for(var o=0;o<r.Columns.length;o++){var s=r.Columns[o];if(!Object.prototype.hasOwnProperty.call(t,s))return i();var u=t[s];if(""===u||null==u)return i();if(r.AutoGUID&&("string"!=typeof u||u.length<5||"0x0000000000000000"===u))return i()}for(var f=e.query.clone().setDisableDeleteTracking(!0),c=0;c<r.Columns.length;c++)f.addFilter(r.Columns[c],t[r.Columns[c]]);e.provider.Read(f,function(){if(f.error)return i(f.error);var o=f.result.value;if(!Array.isArray(o)||o.length<1)return i();for(var s=[],u=0;u<o.length;u++){var c=n?o[u][n]:0;1!=c&&!0!==c||s.push(o[u])}if(s.length<1){if(r.AutoGUID){var l=t[r.Columns[0]];return i("Record with GUID "+l+" already exists!")}return i()}var d=function(t){if(t>=s.length)return i();var n=s[t],o=n[e.defaultIdentifier],u={};u[e.defaultIdentifier]=o;for(var f=0;f<r.Columns.length;f++){var c=r.Columns[f];u[c]=a(o,c,n[c])}var l=e.query.clone().setDisableDeleteTracking(!0).addRecord(u).addFilter(e.defaultIdentifier,o);l.query.IDUser=e.userIdentifier,e.provider.Update(l,function(){return l.error?i(l.error):d(t+1)})};d(0)})}(e,t,n[o],i,function(e){return e?r(e):u(o+1)})};u(0)},t.exports.buildRenamedValue=a,t.exports.collectUniqueConstraints=o,t.exports.findDeletedColumn=s,t.exports.COLLISION_RENAME_PREFIX=i,t.exports.COLLISION_RENAME_HASH_LENGTH=16},{crypto:101}],218:[function(e,t,r){
|
|
43
37
|
/**
|
|
44
38
|
* @license MIT
|
|
45
39
|
* @author <steven@velozo.com>
|
|
46
40
|
*/
|
|
47
|
-
var n=e("
|
|
41
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){var i=new Date;return n([function(r){e.rawQueries.checkQuery("Count")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Count")),e.provider.Count(t,function(){r(t.result.error,t)})},function(t,r){var n=(new Date).getTime()-i.getTime();if(n>(e.fable.settings.QueryThresholdWarnTime||200)&&e.logSlowQuery(n,t),"number"!=typeof t.parameters.result.value)return r("Count did not return valid results.",t,!1);r(t.result.error,t,t.result.value)}],function(t,n,i){t&&e.fable.log.warn("Error during the count waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)}),e}},{"async/waterfall":33}],219:[function(e,t,r){
|
|
48
42
|
/**
|
|
49
43
|
* @license MIT
|
|
50
44
|
* @author <steven@velozo.com>
|
|
51
45
|
*/
|
|
52
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){
|
|
46
|
+
var n=e("async/waterfall"),i=e("./Meadow-CollisionRename.js");t.exports=function(e,t,r){return n([function(r){if(!t.query.records||!t.query.records[0])return r("No record submitted",t,!1);i(e,t.query.records[0],function(n){return n?(e.fable.log.warn("Error during the unique-constraint pre-flight",{Error:n,Message:n&&n.message}),r(n,t,!1)):r()})},function(r){t.query.IDUser||("number"==typeof t.userID&&t.userID%1==0&&t.userID>=0?t.query.IDUser=t.userID:t.query.IDUser=e.userIdentifier),t.query.records[0]=e.fable.Utility.extend({},e.schemaFull.defaultObject,t.query.records[0]),e.provider.Create(t,function(){r(t.result.error,t)})},function(e,t){if(!1===e.parameters.result.value)return t("Creation failed",e,!1);var r=e.result.value;t(e.result.error,e,r)},function(t,r,n){var i=t.clone().addFilter(e.defaultIdentifier,r).setDisableDeleteTracking(t.parameters.query.disableDeleteTracking);e.rawQueries.checkQuery("Read")&&(i.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(i,function(){n(i.result.error,t,i)})},function(t,r,n){if(r.parameters.result.value.length<1)return n("No record found after create.",t,r,!1);var i=e.marshalRecordFromSourceToObject(r.result.value[0]);n(t.result.error,t,r,i)}],function(t,n,i,a){t&&e.fable.log.warn("Error during the create waterfall",{Error:t,Message:t.message,Query:n.query,Stack:t.stack}),r(t,n,i,a)}),e}},{"./Meadow-CollisionRename.js":217,"async/waterfall":33}],220:[function(e,t,r){
|
|
53
47
|
/**
|
|
54
48
|
* @license MIT
|
|
55
49
|
* @author <steven@velozo.com>
|
|
56
50
|
*/
|
|
57
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){
|
|
51
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Delete")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Delete")),e.provider.Delete(t,function(){r(t.result.error,t,t.result.value)})}],function(t,n,i){t&&e.fable.log.warn("Error during the delete waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)}),e}},{"async/waterfall":33}],221:[function(e,t,r){
|
|
58
52
|
/**
|
|
59
53
|
* @license MIT
|
|
60
54
|
* @author <steven@velozo.com>
|
|
61
55
|
*/
|
|
62
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("
|
|
56
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Read")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(t,function(){r(t.result.error,t)})},function(t,r){if(t.parameters.result.value.length<1)return r(void 0,t,!1);var n=e.marshalRecordFromSourceToObject(t.result.value[0]);r(t.result.error,t,n)}],(t,n,i)=>{t&&e.fable.log.warn("Error during the read waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)}),e}},{"async/waterfall":33}],222:[function(e,t,r){
|
|
63
57
|
/**
|
|
64
58
|
* @license MIT
|
|
65
59
|
* @author <steven@velozo.com>
|
|
66
60
|
*/
|
|
67
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("
|
|
61
|
+
var n=e("async/waterfall"),i=e("async/eachSeries");t.exports=function(e,t,r){var a=new Date;return n([function(r){e.rawQueries.checkQuery("Reads")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Reads")),e.provider.Read(t,function(){r(t.result.error,t)})},function(t,r){var n=(new Date).getTime()-a.getTime();n>(e.fable.settings.QueryThresholdWarnTime||200)&&e.logSlowQuery(n,t);var o=[];i(t.parameters.result.value,function(t,r){o.push(e.marshalRecordFromSourceToObject(t)),r()},function(){r(t.result.error,t,o)})}],function(t,n,i){t&&e.fable.log.warn("Error during the read multiple waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)}),e}},{"async/eachSeries":19,"async/waterfall":33}],223:[function(e,t,r){
|
|
68
62
|
/**
|
|
69
63
|
* @license MIT
|
|
70
64
|
* @author <steven@velozo.com>
|
|
71
65
|
*/
|
|
72
|
-
var n=e("async/waterfall")
|
|
66
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Undelete")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Undelete")),e.provider.Undelete(t,function(){r(t.result.error,t,t.result.value)})}],function(t,n,i){t&&e.fable.log.warn("Error during the undelete waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i)}),e}},{"async/waterfall":33}],224:[function(e,t,r){
|
|
73
67
|
/**
|
|
74
68
|
* @license MIT
|
|
75
69
|
* @author <steven@velozo.com>
|
|
76
70
|
*/
|
|
77
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.rawQueries.checkQuery("Undelete")&&(t.parameters.queryOverride=e.rawQueries.getQuery("Undelete")),e.provider.Undelete(t,function(){r(t.result.error,t,t.result.value)})}],function(t,n,o){t&&e.fable.log.warn("Error during the undelete waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,o)}),e}},{"async/waterfall":52}],144:[function(e,t,r){
|
|
71
|
+
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){if(t.query.IDUser||("number"==typeof t.userID&&t.userID%1==0&&t.userID>=0?t.query.IDUser=t.userID:t.query.IDUser=e.userIdentifier),!t.query.records)return r("No record submitted",t,!1);if(!t.query.records[0].hasOwnProperty(e.defaultIdentifier))return r("Automated update missing default identifier",t,!1);for(var n=0;n<e.schema.length;n++)switch(e.schema[n].Type){case"UpdateIDUser":t.query.disableAutoUserStamp||(t.query.records[0][e.schema[n].Column]=!1);break;case"UpdateDate":t.query.disableAutoDateStamp||(t.query.records[0][e.schema[n].Column]=!1)}if(t.addFilter(e.defaultIdentifier,t.query.records[0][e.defaultIdentifier]),!1===t.parameters.filter||t.parameters.filter.length<1)return r("Automated update missing filters... aborting!",t,!1);e.provider.Update(t,function(){r(t.result.error,t)})},function(e,t){if("object"!=typeof e.parameters.result.value)return t("No record updated.",e,!1);t(e.result.error,e)},function(t,r){var n=t.clone();e.rawQueries.checkQuery("Read")&&(n.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(n,function(){r(n.result.error,t,n)})},function(t,r,n){if(0===r.result.value.length)return n("No record found to update!",r.result,!1);var i=e.marshalRecordFromSourceToObject(r.result.value[0]);n(t.result.error,t,r,i)}],function(t,n,i,a){t&&e.fable.log.warn("Error during Update waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,i,a)}),e}},{"async/waterfall":33}],225:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;if(r.settings.ArrayStorage&&(n=r.settings.ArrayStorage.GlobalLogLevel||0),!r.hasOwnProperty("ALASQL"))return r.log.fatal("Meadow is trying to perform queries without a valid [Fable.ALASQL] object. See the documentation for how to initialize one."),!1;var i=r.ALASQL,a="Unknown_Meadow_ALASQL_Scope",o={},s="ID",u=()=>{var e="",t=a,n=o;if(e+="CREATE TABLE IF NOT EXISTS\n "+t+"\n",n.length>0){e+=" (\n";for(var u=0;u<n.length;u++)switch(u>0&&(e+=","),e+="\n",n[u].Type){case"AutoIdentity":e+=" `"+n[u].Column+"` INT UNSIGNED NOT NULL AUTO_INCREMENT",s=n[u].Column;break;case"AutoGUID":e+=" `"+n[u].Column+"` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'",n[u].Column;break;case"Boolean":case"Deleted":case"CreateIDUser":case"UpdateIDUser":case"DeleteIDUser":case"Numeric":e+=" `"+n[u].Column+"` INT NOT NULL DEFAULT 0";break;case"Decimal":e+=" `"+n[u].Column+"` DECIMAL("+n[u].Size+")";break;case"String":e+=" `"+n[u].Column+"` VARCHAR NOT NULL DEFAULT ''";break;case"Text":case"JSON":e+=" `"+n[u].Column+"` TEXT";break;case"JSONProxy":e+=" `"+n[u].StorageColumn+"` TEXT";break;case"CreateDate":case"UpdateDate":case"DeleteDate":case"DateTime":e+=" `"+n[u].Column+"` DATETIME"}e+="\n )"}return e+=";",r.log.info("Auto Creating ALASQL database `"+t+"`",{CreateStatement:e}),i(e),this},f=e=>{"Unknown_Meadow_ALASQL_Scope"==a&&void 0!==e.scope&&(a=e.scope),r.ALASQL.tables.hasOwnProperty(a)||u()};return{setSchema:(e,t,r,n)=>(a=e,o=t,s=r,this),marshalRecordFromSourceToObject:function(e,t,r){var n={},i={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(i[r[a].StorageColumn]=r[a].Column);for(var o in t)if(n[o])try{e[o]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[o]={}}else if(i.hasOwnProperty(o)){var s=i[o];try{e[s]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[s]={}}}else e[o]=t[o]},constructFromObject:e=>{if("object"!=typeof e||"object"!=typeof e.Meadow)return!1;"string"!=typeof e.Scope&&(e.Scope="DATA"),"object"!=typeof e.ObjectPrototype&&(e.ObjectPrototype={}),"boolean"!=typeof e.AuditData&&(e.AuditData=!0),"boolean"!=typeof e.Import&&(e.Import=!0),Array.isArray(e.Data)||(e.Data=[]);var t,n=e.Meadow.new(r,e.Scope).setProvider("ALASQL"),i=[];for(var a in e.AuditData&&(t="ID"+e.Scope,i.push({Column:t,Type:"AutoIdentity"}),i.push({Column:"GU"+t,Type:"AutoGUID"}),i.push({Column:"CreateDate",Type:"CreateDate"}),i.push({Column:"CreatingIDUser",Type:"CreateIDUser"}),i.push({Column:"UpdateDate",Type:"UpdateDate"}),i.push({Column:"UpdatingIDUser",Type:"UpdateIDUser"}),i.push({Column:"DeleteDate",Type:"DeleteDate"}),i.push({Column:"DeletingIDUser",Type:"DeleteIDUser"}),i.push({Column:"Deleted",Type:"Deleted"})),e.ObjectPrototype){switch(typeof e.ObjectPrototype[a]){case"undefined":case"object":case"function":default:break;case"boolean":i.push({Column:a,Type:"Boolean"});break;case"number":case"string":i.push({Column:a,Type:"Text"})}!1}if(n.setSchema(i),void 0===t&&n.setDefaultIdentifier(t),e.Import)for(var o=0;o<e.Data.length;o++)n.doCreate(n.query.clone().addRecord(e.Data[o]),function(e,t,n,i){r.log.trace("Auto imported record",i)});else n.provider.bindObject(e.Data);return n},bindObject:e=>!!Array.isArray(e)&&(f({}),!!r.ALASQL.tables.hasOwnProperty(a)&&(r.ALASQL.tables[a].data=e,!0)),Create:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildCreateQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=0,o(e.query.parameters)>0&&(i.tables[e.parameters.scope].identities[s]?a.value=i.autoval(e.parameters.scope,s):e.query.records.length>0&&e.query.records[0].hasOwnProperty(s)&&(a.value=e.query.records[0][s])),a.executed=!0}catch(e){a.error=e}t()},Read:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildReadQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=o(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Update:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildUpdateQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value={affectedRows:o(e.query.parameters)},a.executed=!0}catch(e){a.error=e}t()},Delete:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildDeleteQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=o(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Undelete:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildUndeleteQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=o(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Count:function(e,t){var a=e.parameters.result;f(e.parameters),e.setDialect("ALASQL").buildCountQuery();var o=i.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=o(e.query.parameters)[0].RowCount,a.executed=!0}catch(e){a.error=e}t()},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{}],226:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.DGraph&&(n=r.settings.DGraph.GlobalLogLevel||0);var i=function(){return!("object"!=typeof r.MeadowDGraphProvider||!r.MeadowDGraphProvider.connected)&&r.MeadowDGraphProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=(new Date).toISOString():"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)if("uid"!==r&&"dgraph.type"!==r){var n=r,i=n.indexOf(".");i>=0&&(n=n.substring(i+1)),e[n]=t[r]}},Create:function(e,t){var o=e.parameters.result;e.setDialect("DGraph").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No DGraph connection available."),o.executed=!0,t();var u=e.query.parameters.dgraphOperation;if(!u)return o.error=new Error("No DGraph operation generated."),o.executed=!0,t();var f=a(JSON.parse(JSON.stringify(u.document))),c=!1;for(var l in f)if("$$AUTOINCREMENT"===f[l]){c=l;break}if(c)!function(e,t,r,n){var i=t+"."+r,a='{ counter(func: eq(MeadowCounter.scope, "'+i+'")) { uid MeadowCounter.sequence } }',o=e.newTxn();o.query(a).then(function(e){var t=(e.data||{}).counter||[];if(t.length>0){var r=(t[0]["MeadowCounter.sequence"]||0)+1,a={setJson:{uid:t[0].uid,"MeadowCounter.sequence":r}};return o.mutate(a).then(function(){return o.commit()}).then(function(){return n(null,r)})}return a={setJson:{"dgraph.type":"MeadowCounter","MeadowCounter.scope":i,"MeadowCounter.sequence":1}},o.mutate(a).then(function(){return o.commit()}).then(function(){return n(null,1)})}).catch(function(e){try{o.discard()}catch(e){}return n(e)})}(s,u.type,c,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();f[c]=r;var n=s.newTxn();n.mutate({setJson:f}).then(function(){return n.commit()}).then(function(){return o.error=null,o.value=r,o.executed=!0,t()}).catch(function(e){try{n.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})});else{var d=s.newTxn();d.mutate({setJson:f}).then(function(e){return d.commit().then(function(){o.error=null;var r=e.data&&e.data.uids;return o.value=!r||r[Object.keys(r)[0]],o.executed=!0,t()})}).catch(function(e){try{d.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})}},Read:function(e,t){var a=e.parameters.result;e.setDialect("DGraph").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No DGraph connection available."),a.executed=!0,t();var s=e.query.parameters.dgraphOperation;o.newTxn({readOnly:!0}).query(s.query).then(function(e){var r=e.data||{};return a.error=null,a.value=r[s.queryName]||[],a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},Update:function(e,t){var o=e.parameters.result;e.setDialect("DGraph").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No DGraph connection available."),o.executed=!0,t();var u=e.query.parameters.dgraphOperation;if(!u)return o.error=new Error("No DGraph operation generated."),o.executed=!0,t();s.newTxn({readOnly:!0}).query(u.queryForUIDs).then(function(e){var r=(e.data||{})[u.queryName]||[];if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=a(JSON.parse(JSON.stringify(u.update))),i=[],f=0;f<r.length;f++){var c=JSON.parse(JSON.stringify(n));c.uid=r[f].uid,i.push(c)}var l=s.newTxn();l.mutate({setJson:i}).then(function(){return l.commit()}).then(function(){return o.error=null,o.value=i,o.executed=!0,t()}).catch(function(e){try{l.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Delete:function(e,t){var o=e.parameters.result;e.setDialect("DGraph").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No DGraph connection available."),o.executed=!0,t();var u=e.query.parameters.dgraphOperation;s.newTxn({readOnly:!0}).query(u.queryForUIDs).then(function(e){var r=(e.data||{})[u.queryName]||[];if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();if("upsert"===u.operation){for(var n=a(JSON.parse(JSON.stringify(u.update))),i=[],f=0;f<r.length;f++){var c=JSON.parse(JSON.stringify(n));c.uid=r[f].uid,i.push(c)}(h=s.newTxn()).mutate({setJson:i}).then(function(){return h.commit()}).then(function(){return o.error=null,o.value=r.length,o.executed=!0,t()}).catch(function(e){try{h.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})}else{for(var l=[],d=0;d<r.length;d++)l.push({uid:r[d].uid});var h;(h=s.newTxn()).mutate({deleteJson:l}).then(function(){return h.commit()}).then(function(){return o.error=null,o.value=r.length,o.executed=!0,t()}).catch(function(e){try{h.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})}}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("DGraph").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No DGraph connection available."),o.executed=!0,t();var u=e.query.parameters.dgraphOperation;if(!u||"noop"===u.operation)return o.error=null,o.value=0,o.executed=!0,t();s.newTxn({readOnly:!0}).query(u.queryForUIDs).then(function(e){var r=(e.data||{})[u.queryName]||[];if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=a(JSON.parse(JSON.stringify(u.update))),i=[],f=0;f<r.length;f++){var c=JSON.parse(JSON.stringify(n));c.uid=r[f].uid,i.push(c)}var l=s.newTxn();l.mutate({setJson:i}).then(function(){return l.commit()}).then(function(){return o.error=null,o.value=r.length,o.executed=!0,t()}).catch(function(e){try{l.discard()}catch(e){}return o.error=e,o.value=!1,o.executed=!0,t()})}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Count:function(e,t){var a=e.parameters.result;e.setDialect("DGraph").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No DGraph connection available."),a.executed=!0,t();var s=e.query.parameters.dgraphOperation;o.newTxn({readOnly:!0}).query(s.query).then(function(e){var r=(e.data||{})[s.queryName]||[];return a.error=null,r.length>0&&void 0!==r[0].total?a.value=r[0].total:a.value=0,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowDGraphProvider&&r.MeadowDGraphProvider},providerCreatesSupported:!0,new:e}}()}},{}],227:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MSSQL&&(n=r.settings.MSSQL.GlobalLogLevel||0);var i=function(e){let t=r.MeadowMSSQLProvider.preparedStatement,n=Object.keys(e.query.parameterTypes);const i=e.query.schema,a={};for(let e=0;e<i.length;e++)a[i[e].Column]=i[e];for(let i=0;i<n.length;i++){let o=e.query.parameterTypes[n[i]];void 0===r.MeadowMSSQLProvider.MSSQL[o]&&(o="VarChar");let s=!1;if("Char"===o||"VarChar"===o)s=r.MeadowMSSQLProvider.MSSQL[o](r.MeadowMSSQLProvider.MSSQL.Max);else if("Text"===o)s=r.MeadowMSSQLProvider.MSSQL.VarChar(r.MeadowMSSQLProvider.MSSQL.Max);else if("Decimal"===o){const e=a[n[i]]?.Size;if(e&&"string"==typeof e){let[t,n]=e.split(",");const i=parseInt(t.trim()),a=n?parseInt(n.trim()):0;s=r.MeadowMSSQLProvider.MSSQL.Decimal(i,a)}else s=r.MeadowMSSQLProvider.MSSQL.Decimal(18,8)}else s=r.MeadowMSSQLProvider.MSSQL[o];t.input(n[i],s)}return t};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},i={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(i[r[a].StorageColumn]=r[a].Column);for(var o in t)if(n[o])try{e[o]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[o]={}}else if(i.hasOwnProperty(o)){var s=i[o];try{e[s]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[s]={}}}else e[o]=t[o]},Create:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e),s=`${e.query.body} \nSELECT SCOPE_IDENTITY() AS value;`;e.AllowIdentityInsert&&(s=`SET IDENTITY_INSERT [${e.parameters.scope}] ON; \n${s} \nSET IDENTITY_INSERT [${e.parameters.scope}] OFF;`),o.prepare(s,n=>{if(n)return r.log.error(`CREATE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(e,n)=>{o.unprepare(i=>(i&&r.log.error(`CREATE Error unpreparing prepared statement: ${i}`,i),a.error=e,n&&Array.isArray(n.recordset)&&n.recordset.length>0&&n.recordset[0].value&&(a.value=n.recordset[0].value),a.executed=!0,t()))})})},Read:function(e,t){var a=e.parameters.result;r.settings.MSSQL&&r.settings.MSSQL.LegacyPagination&&(e.parameters.legacyPagination=!0),e.setDialect("MSSQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e);o.prepare(e.query.body,n=>{if(n)return r.log.error(`READ Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(e,n)=>{o.unprepare(i=>{i&&r.log.error(`READ Error unpreparing prepared statement: ${i}`,i),a.error=e;try{a.value=n.recordset}catch(e){r.log.error(`READ Error marshaling prepared statement result: ${e}`,e)}return a.executed=!0,t()})})})},Update:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e);o.prepare(e.query.body,n=>{if(n)return r.log.error(`UPDATE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(e,n)=>{o.unprepare(i=>(i&&r.log.error(`UPDATE Error unpreparing prepared statement: ${i}`,i),a.error=e,a.value=n,a.executed=!0,t()))})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e);o.prepare(e.query.body,n=>{if(n)return r.log.error(`DELETE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(n,i)=>{o.unprepare(o=>{o&&r.log.error(`DELETE Error unpreparing prepared statement: ${o}`,o),a.error=n,a.value=!1;try{a.value=i.rowsAffected[0]}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},Undelete:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e);o.prepare(e.query.body,n=>{if(n)return r.log.error(`UNDELETE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(n,i)=>{o.unprepare(o=>{o&&r.log.error(`UNDELETE Error unpreparing prepared statement: ${o}`,o),a.error=n,a.value=!1;try{a.value=i.rowsAffected[0]}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let o=i(e);o.prepare(e.query.body,n=>{if(n)return r.log.error(`COUNT Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();o.execute(e.query.parameters,(n,i)=>{o.unprepare(o=>{o&&r.log.error(`COUNT Error unpreparing prepared statement: ${o}`,o),a.error=n,a.value=!1;try{a.value=i.recordset[0].Row_Count}catch(t){r.log.warn("Error getting affected rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},getProvider:function(){return!("object"!=typeof r.MeadowMSSQLProvider||!r.MeadowMSSQLProvider.connected)&&r.MeadowMSSQLProvider},providerCreatesSupported:!0,new:e}}()}},{}],228:[function(e,t,r){
|
|
78
72
|
/**
|
|
79
73
|
* @license MIT
|
|
80
74
|
* @author <steven@velozo.com>
|
|
81
75
|
*/
|
|
82
|
-
var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){if(t.query.IDUser||("number"==typeof t.userID&&t.userID%1==0&&t.userID>=0?t.query.IDUser=t.userID:t.query.IDUser=e.userIdentifier),!t.query.records)return r("No record submitted",t,!1);if(!t.query.records[0].hasOwnProperty(e.defaultIdentifier))return r("Automated update missing default identifier",t,!1);for(var n=0;n<e.schema.length;n++)switch(e.schema[n].Type){case"UpdateIDUser":t.query.disableAutoUserStamp||(t.query.records[0][e.schema[n].Column]=!1);break;case"UpdateDate":t.query.disableAutoDateStamp||(t.query.records[0][e.schema[n].Column]=!1)}if(t.addFilter(e.defaultIdentifier,t.query.records[0][e.defaultIdentifier]),!1===t.parameters.filter||t.parameters.filter.length<1)return r("Automated update missing filters... aborting!",t,!1);e.provider.Update(t,function(){r(t.result.error,t)})},function(e,t){if("object"!=typeof e.parameters.result.value)return t("No record updated.",e,!1);t(e.result.error,e)},function(t,r){var n=t.clone();e.rawQueries.checkQuery("Read")&&(n.parameters.queryOverride=e.rawQueries.getQuery("Read")),e.provider.Read(n,function(){r(n.result.error,t,n)})},function(t,r,n){if(0===r.result.value.length)return n("No record found to update!",r.result,!1);var o=e.marshalRecordFromSourceToObject(r.result.value[0]);n(t.result.error,t,r,o)}],function(t,n,o,a){t&&e.fable.log.warn("Error during Update waterfall",{Error:t,Message:t.message,Query:n.query}),r(t,n,o,a)}),e}},{"async/waterfall":52}],145:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;if(r.settings.ArrayStorage&&(n=r.settings.ArrayStorage.GlobalLogLevel||0),!r.hasOwnProperty("ALASQL"))return r.log.fatal("Meadow is trying to perform queries without a valid [Fable.ALASQL] object. See the documentation for how to initialize one."),!1;var o=r.ALASQL,a="Unknown_Meadow_ALASQL_Scope",i={},u="ID",s=()=>{var e="",t=a,n=i;if(e+="CREATE TABLE IF NOT EXISTS\n "+t+"\n",n.length>0){e+=" (\n";for(var s=0;s<n.length;s++)switch(s>0&&(e+=","),e+="\n",n[s].Type){case"AutoIdentity":e+=" `"+n[s].Column+"` INT UNSIGNED NOT NULL AUTO_INCREMENT",u=n[s].Column;break;case"AutoGUID":e+=" `"+n[s].Column+"` CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'",n[s].Column;break;case"Boolean":case"Deleted":case"CreateIDUser":case"UpdateIDUser":case"DeleteIDUser":case"Numeric":e+=" `"+n[s].Column+"` INT NOT NULL DEFAULT 0";break;case"Decimal":e+=" `"+n[s].Column+"` DECIMAL("+n[s].Size+")";break;case"String":e+=" `"+n[s].Column+"` VARCHAR NOT NULL DEFAULT ''";break;case"Text":case"JSON":e+=" `"+n[s].Column+"` TEXT";break;case"JSONProxy":e+=" `"+n[s].StorageColumn+"` TEXT";break;case"CreateDate":case"UpdateDate":case"DeleteDate":case"DateTime":e+=" `"+n[s].Column+"` DATETIME"}e+="\n )"}return e+=";",r.log.info("Auto Creating ALASQL database `"+t+"`",{CreateStatement:e}),o(e),this},l=e=>{"Unknown_Meadow_ALASQL_Scope"==a&&void 0!==e.scope&&(a=e.scope),r.ALASQL.tables.hasOwnProperty(a)||s()};return{setSchema:(e,t,r,n)=>(a=e,i=t,u=r,this),marshalRecordFromSourceToObject:function(e,t,r){var n={},o={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(o[r[a].StorageColumn]=r[a].Column);for(var i in t)if(n[i])try{e[i]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[i]={}}else if(o.hasOwnProperty(i)){var u=o[i];try{e[u]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[u]={}}}else e[i]=t[i]},constructFromObject:e=>{if("object"!=typeof e||"object"!=typeof e.Meadow)return!1;"string"!=typeof e.Scope&&(e.Scope="DATA"),"object"!=typeof e.ObjectPrototype&&(e.ObjectPrototype={}),"boolean"!=typeof e.AuditData&&(e.AuditData=!0),"boolean"!=typeof e.Import&&(e.Import=!0),Array.isArray(e.Data)||(e.Data=[]);var t,n=e.Meadow.new(r,e.Scope).setProvider("ALASQL"),o=[];for(var a in e.AuditData&&(t="ID"+e.Scope,o.push({Column:t,Type:"AutoIdentity"}),o.push({Column:"GU"+t,Type:"AutoGUID"}),o.push({Column:"CreateDate",Type:"CreateDate"}),o.push({Column:"CreatingIDUser",Type:"CreateIDUser"}),o.push({Column:"UpdateDate",Type:"UpdateDate"}),o.push({Column:"UpdatingIDUser",Type:"UpdateIDUser"}),o.push({Column:"DeleteDate",Type:"DeleteDate"}),o.push({Column:"DeletingIDUser",Type:"DeleteIDUser"}),o.push({Column:"Deleted",Type:"Deleted"})),e.ObjectPrototype){switch(typeof e.ObjectPrototype[a]){case"undefined":case"object":case"function":default:break;case"boolean":o.push({Column:a,Type:"Boolean"});break;case"number":case"string":o.push({Column:a,Type:"Text"})}!1}if(n.setSchema(o),void 0===t&&n.setDefaultIdentifier(t),e.Import)for(var i=0;i<e.Data.length;i++)n.doCreate(n.query.clone().addRecord(e.Data[i]),function(e,t,n,o){r.log.trace("Auto imported record",o)});else n.provider.bindObject(e.Data);return n},bindObject:e=>!!Array.isArray(e)&&(l({}),!!r.ALASQL.tables.hasOwnProperty(a)&&(r.ALASQL.tables[a].data=e,!0)),Create:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildCreateQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=0,i(e.query.parameters)>0&&(o.tables[e.parameters.scope].identities[u]?a.value=o.autoval(e.parameters.scope,u):e.query.records.length>0&&e.query.records[0].hasOwnProperty(u)&&(a.value=e.query.records[0][u])),a.executed=!0}catch(e){a.error=e}t()},Read:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildReadQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=i(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Update:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildUpdateQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value={affectedRows:i(e.query.parameters)},a.executed=!0}catch(e){a.error=e}t()},Delete:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildDeleteQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=i(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Undelete:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildUndeleteQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=i(e.query.parameters),a.executed=!0}catch(e){a.error=e}t()},Count:function(e,t){var a=e.parameters.result;l(e.parameters),e.setDialect("ALASQL").buildCountQuery();var i=o.compile(e.query.body);(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);try{a.error=void 0,a.executed=!1,a.value=i(e.query.parameters)[0].RowCount,a.executed=!0}catch(e){a.error=e}t()},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{}],146:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.DGraph&&(n=r.settings.DGraph.GlobalLogLevel||0);var o=function(){return!("object"!=typeof r.MeadowDGraphProvider||!r.MeadowDGraphProvider.connected)&&r.MeadowDGraphProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=(new Date).toISOString():"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)if("uid"!==r&&"dgraph.type"!==r){var n=r,o=n.indexOf(".");o>=0&&(n=n.substring(o+1)),e[n]=t[r]}},Create:function(e,t){var i=e.parameters.result;e.setDialect("DGraph").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No DGraph connection available."),i.executed=!0,t();var s=e.query.parameters.dgraphOperation;if(!s)return i.error=new Error("No DGraph operation generated."),i.executed=!0,t();var l=a(JSON.parse(JSON.stringify(s.document))),c=!1;for(var f in l)if("$$AUTOINCREMENT"===l[f]){c=f;break}if(c)!function(e,t,r,n){var o=t+"."+r,a='{ counter(func: eq(MeadowCounter.scope, "'+o+'")) { uid MeadowCounter.sequence } }',i=e.newTxn();i.query(a).then(function(e){var t=(e.data||{}).counter||[];if(t.length>0){var r=(t[0]["MeadowCounter.sequence"]||0)+1,a={setJson:{uid:t[0].uid,"MeadowCounter.sequence":r}};return i.mutate(a).then(function(){return i.commit()}).then(function(){return n(null,r)})}return a={setJson:{"dgraph.type":"MeadowCounter","MeadowCounter.scope":o,"MeadowCounter.sequence":1}},i.mutate(a).then(function(){return i.commit()}).then(function(){return n(null,1)})}).catch(function(e){try{i.discard()}catch(e){}return n(e)})}(u,s.type,c,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();l[c]=r;var n=u.newTxn();n.mutate({setJson:l}).then(function(){return n.commit()}).then(function(){return i.error=null,i.value=r,i.executed=!0,t()}).catch(function(e){try{n.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})});else{var d=u.newTxn();d.mutate({setJson:l}).then(function(e){return d.commit().then(function(){i.error=null;var r=e.data&&e.data.uids;return i.value=!r||r[Object.keys(r)[0]],i.executed=!0,t()})}).catch(function(e){try{d.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})}},Read:function(e,t){var a=e.parameters.result;e.setDialect("DGraph").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No DGraph connection available."),a.executed=!0,t();var u=e.query.parameters.dgraphOperation;i.newTxn({readOnly:!0}).query(u.query).then(function(e){var r=e.data||{};return a.error=null,a.value=r[u.queryName]||[],a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},Update:function(e,t){var i=e.parameters.result;e.setDialect("DGraph").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No DGraph connection available."),i.executed=!0,t();var s=e.query.parameters.dgraphOperation;if(!s)return i.error=new Error("No DGraph operation generated."),i.executed=!0,t();u.newTxn({readOnly:!0}).query(s.queryForUIDs).then(function(e){var r=(e.data||{})[s.queryName]||[];if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=a(JSON.parse(JSON.stringify(s.update))),o=[],l=0;l<r.length;l++){var c=JSON.parse(JSON.stringify(n));c.uid=r[l].uid,o.push(c)}var f=u.newTxn();f.mutate({setJson:o}).then(function(){return f.commit()}).then(function(){return i.error=null,i.value=o,i.executed=!0,t()}).catch(function(e){try{f.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Delete:function(e,t){var i=e.parameters.result;e.setDialect("DGraph").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No DGraph connection available."),i.executed=!0,t();var s=e.query.parameters.dgraphOperation;u.newTxn({readOnly:!0}).query(s.queryForUIDs).then(function(e){var r=(e.data||{})[s.queryName]||[];if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();if("upsert"===s.operation){for(var n=a(JSON.parse(JSON.stringify(s.update))),o=[],l=0;l<r.length;l++){var c=JSON.parse(JSON.stringify(n));c.uid=r[l].uid,o.push(c)}(p=u.newTxn()).mutate({setJson:o}).then(function(){return p.commit()}).then(function(){return i.error=null,i.value=r.length,i.executed=!0,t()}).catch(function(e){try{p.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})}else{for(var f=[],d=0;d<r.length;d++)f.push({uid:r[d].uid});var p;(p=u.newTxn()).mutate({deleteJson:f}).then(function(){return p.commit()}).then(function(){return i.error=null,i.value=r.length,i.executed=!0,t()}).catch(function(e){try{p.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})}}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Undelete:function(e,t){var i=e.parameters.result;e.setDialect("DGraph").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No DGraph connection available."),i.executed=!0,t();var s=e.query.parameters.dgraphOperation;if(!s||"noop"===s.operation)return i.error=null,i.value=0,i.executed=!0,t();u.newTxn({readOnly:!0}).query(s.queryForUIDs).then(function(e){var r=(e.data||{})[s.queryName]||[];if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=a(JSON.parse(JSON.stringify(s.update))),o=[],l=0;l<r.length;l++){var c=JSON.parse(JSON.stringify(n));c.uid=r[l].uid,o.push(c)}var f=u.newTxn();f.mutate({setJson:o}).then(function(){return f.commit()}).then(function(){return i.error=null,i.value=r.length,i.executed=!0,t()}).catch(function(e){try{f.discard()}catch(e){}return i.error=e,i.value=!1,i.executed=!0,t()})}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Count:function(e,t){var a=e.parameters.result;e.setDialect("DGraph").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No DGraph connection available."),a.executed=!0,t();var u=e.query.parameters.dgraphOperation;i.newTxn({readOnly:!0}).query(u.query).then(function(e){var r=(e.data||{})[u.queryName]||[];return a.error=null,r.length>0&&void 0!==r[0].total?a.value=r[0].total:a.value=0,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowDGraphProvider&&r.MeadowDGraphProvider},providerCreatesSupported:!0,new:e}}()}},{}],147:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MSSQL&&(n=r.settings.MSSQL.GlobalLogLevel||0);var o=function(e){let t=r.MeadowMSSQLProvider.preparedStatement,n=Object.keys(e.query.parameterTypes);const o=e.query.schema,a={};for(let e=0;e<o.length;e++)a[o[e].Column]=o[e];for(let o=0;o<n.length;o++){let i=e.query.parameterTypes[n[o]];void 0===r.MeadowMSSQLProvider.MSSQL[i]&&(i="VarChar");let u=!1;if("Char"===i||"VarChar"===i)u=r.MeadowMSSQLProvider.MSSQL[i](r.MeadowMSSQLProvider.MSSQL.Max);else if("Text"===i)u=r.MeadowMSSQLProvider.MSSQL.VarChar(r.MeadowMSSQLProvider.MSSQL.Max);else if("Decimal"===i){const e=a[n[o]]?.Size;if(e&&"string"==typeof e){let[t,n]=e.split(",");const o=parseInt(t.trim()),a=n?parseInt(n.trim()):0;u=r.MeadowMSSQLProvider.MSSQL.Decimal(o,a)}else u=r.MeadowMSSQLProvider.MSSQL.Decimal(18,8)}else u=r.MeadowMSSQLProvider.MSSQL[i];t.input(n[o],u)}return t};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},o={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(o[r[a].StorageColumn]=r[a].Column);for(var i in t)if(n[i])try{e[i]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[i]={}}else if(o.hasOwnProperty(i)){var u=o[i];try{e[u]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[u]={}}}else e[i]=t[i]},Create:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e),u=`${e.query.body} \nSELECT SCOPE_IDENTITY() AS value;`;e.AllowIdentityInsert&&(u=`SET IDENTITY_INSERT [${e.parameters.scope}] ON; \n${u} \nSET IDENTITY_INSERT [${e.parameters.scope}] OFF;`),i.prepare(u,n=>{if(n)return r.log.error(`CREATE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(e,n)=>{i.unprepare(o=>(o&&r.log.error(`CREATE Error unpreparing prepared statement: ${o}`,o),a.error=e,n&&Array.isArray(n.recordset)&&n.recordset.length>0&&n.recordset[0].value&&(a.value=n.recordset[0].value),a.executed=!0,t()))})})},Read:function(e,t){var a=e.parameters.result;r.settings.MSSQL&&r.settings.MSSQL.LegacyPagination&&(e.parameters.legacyPagination=!0),e.setDialect("MSSQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e);i.prepare(e.query.body,n=>{if(n)return r.log.error(`READ Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(e,n)=>{i.unprepare(o=>{o&&r.log.error(`READ Error unpreparing prepared statement: ${o}`,o),a.error=e;try{a.value=n.recordset}catch(e){r.log.error(`READ Error marshaling prepared statement result: ${e}`,e)}return a.executed=!0,t()})})})},Update:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e);i.prepare(e.query.body,n=>{if(n)return r.log.error(`UPDATE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(e,n)=>{i.unprepare(o=>(o&&r.log.error(`UPDATE Error unpreparing prepared statement: ${o}`,o),a.error=e,a.value=n,a.executed=!0,t()))})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e);i.prepare(e.query.body,n=>{if(n)return r.log.error(`DELETE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(n,o)=>{i.unprepare(i=>{i&&r.log.error(`DELETE Error unpreparing prepared statement: ${i}`,i),a.error=n,a.value=!1;try{a.value=o.rowsAffected[0]}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},Undelete:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e);i.prepare(e.query.body,n=>{if(n)return r.log.error(`UNDELETE Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(n,o)=>{i.unprepare(i=>{i&&r.log.error(`UNDELETE Error unpreparing prepared statement: ${i}`,i),a.error=n,a.value=!1;try{a.value=o.rowsAffected[0]}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MSSQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);let i=o(e);i.prepare(e.query.body,n=>{if(n)return r.log.error(`COUNT Error preparing prepared statement: ${n}`,n),a.error=n,a.executed=!0,t();i.execute(e.query.parameters,(n,o)=>{i.unprepare(i=>{i&&r.log.error(`COUNT Error unpreparing prepared statement: ${i}`,i),a.error=n,a.value=!1;try{a.value=o.recordset[0].Row_Count}catch(t){r.log.warn("Error getting affected rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})})},getProvider:function(){return!("object"!=typeof r.MeadowMSSQLProvider||!r.MeadowMSSQLProvider.connected)&&r.MeadowMSSQLProvider},providerCreatesSupported:!0,new:e}}()}},{}],148:[function(e,t,r){
|
|
76
|
+
var n=e("simple-get");t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,i="MeadowEndpoints",a={},o=[],s=r.settings.hasOwnProperty("MeadowEndpoints")?JSON.parse(JSON.stringify(r.settings.MeadowEndpoints)):{ServerProtocol:"http",ServerAddress:"127.0.0.1",ServerPort:"8086",ServerEndpointPrefix:"1.0/"},u=function(e){var t;e.logLevel>0&&r.log.trace(e.query.body,e.query.records);let n={url:(t=e.query.body,`${s.ServerProtocol}://${s.ServerAddress}:${s.ServerPort}/${s.ServerEndpointPrefix}${t}`),headers:r.Utility.extend({cookie:""},a)};return n.headers.cookie=o.join(";"),e.logLevel>0&&r.log.debug("Request options built...",n),n};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){var a=e.parameters.result;e.setDialect(i).buildCreateQuery();let o=u(e);if(!e.query.records.length>0)return a.error="No records passed for proxying to Meadow-Endpoints.",t();o.body=e.query.records[0],o.json=!0,n.post(o,(n,i)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e POST request connected"),n)return t(a);let o="";i.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e POST data chunk size ${t.length}b received`),o+=t}),i.on("end",()=>{if(o)try{a.value=JSON.parse(o)}catch(e){return a.error=new Error(`Failed to parse Create response as JSON: ${e.message}`),t()}const n=`ID${e.parameters.scope}`;return a.value&&a.value.hasOwnProperty(n)&&(a.value=a.value[n]),e.logLevel>0&&r.log.debug(`==> POST completed data size ${o.length}b received`,a),t()})})},Read:function(e,t){var a=e.parameters.result;e.setDialect(i).buildReadQuery();let o=u(e);n.get(o,(n,i)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(a);let o="";i.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),o+=t}),i.on("end",()=>{if(o)try{a.value=JSON.parse(o)}catch(e){return a.error=new Error(`Failed to parse Read response as JSON: ${e.message}`),t()}e.query.body.startsWith(`${e.parameters.scope}/`)&&(a.value=[a.value]),e.logLevel>0&&r.log.debug(`==> GET completed data size ${o.length}b received`,a),t()})})},Update:function(e,t){var a=e.parameters.result;e.setDialect(i).buildUpdateQuery();let o=u(e);if(!e.query.records.length>0)return a.error="No records passed for proxying to Meadow-Endpoints.",t();o.body=e.query.records[0],o.json=!0,n.put(o,(n,i)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e PUT request connected"),n)return t(a);let o="";i.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e PUT data chunk size ${t.length}b received`),o+=t}),i.on("end",()=>{if(o)try{a.value=JSON.parse(o)}catch(e){return a.error=new Error(`Failed to parse Update response as JSON: ${e.message}`),t()}return e.logLevel>0&&r.log.debug(`==> PUT completed data size ${o.length}b received`,a),t()})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect(i).buildDeleteQuery();let o=u(e);n.delete(o,(n,i)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e DEL request connected"),n)return t(a);let o="";i.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e DEL data chunk size ${t.length}b received`),o+=t}),i.on("end",()=>{if(o)try{a.value=JSON.parse(o)}catch(e){return a.error=new Error(`Failed to parse Delete response as JSON: ${e.message}`),t()}a.value&&a.value.hasOwnProperty("Count")&&(a.value=a.value.Count),e.logLevel>0&&r.log.debug(`==> DEL completed data size ${o.length}b received`,a),t()})})},Count:function(e,t){var a=e.parameters.result;e.setDialect(i).buildCountQuery();let o=u(e);n.get(o,(n,i)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(a);let o="";i.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),o+=t}),i.on("end",()=>{if(o)try{a.value=JSON.parse(o)}catch(e){return a.error=new Error(`Failed to parse Count response as JSON: ${e.message}`),t()}try{a.value=a.value.Count}catch(t){a.value=-1,r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}e.logLevel>0&&r.log.debug(`==> GET completed data size ${o.length}b received`,a),t()})})},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{"simple-get":307}],229:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MongoDB&&(n=r.settings.MongoDB.GlobalLogLevel||0);var i=function(){return!("object"!=typeof r.MeadowMongoDBProvider||!r.MeadowMongoDBProvider.connected)&&r.MeadowMongoDBProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=new Date:"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)"_id"!==r&&(e[r]=t[r])},Create:function(e,t){var o=e.parameters.result;e.setDialect("MongoDB").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No MongoDB connection available."),o.executed=!0,t();var u=e.query.parameters.mongoOperation;if(!u)return o.error=new Error("No MongoDB operation generated."),o.executed=!0,t();var f=s.collection(u.collection),c=a(JSON.parse(JSON.stringify(u.document))),l=!1;for(var d in c)if("$$AUTOINCREMENT"===c[d]){l=d;break}l?function(e,t,r,n){var i=t+"."+r;e.collection("_meadow_counters").findOneAndUpdate({_id:i},{$inc:{seq:1}},{upsert:!0,returnDocument:"after"}).then(function(e){return n(null,e.seq)}).catch(function(e){return n(e)})}(s,u.collection,l,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();c[l]=r,f.insertOne(c).then(function(e){return o.error=null,o.value=r,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})}):f.insertOne(c).then(function(e){return o.error=null,o.value=e.insertedId,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Read:function(e,t){var a=e.parameters.result;e.setDialect("MongoDB").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MongoDB connection available."),a.executed=!0,t();var s=e.query.parameters.mongoOperation,u=o.collection(s.collection),f={};s.projection&&Object.keys(s.projection).length>0&&(f.projection=s.projection),s.sort&&Object.keys(s.sort).length>0&&(f.sort=s.sort),s.skip&&(f.skip=s.skip),s.limit&&(f.limit=s.limit),u.find(s.filter,f).toArray().then(function(e){return a.error=null,a.value=e,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},Update:function(e,t){var o=e.parameters.result;e.setDialect("MongoDB").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No MongoDB connection available."),o.executed=!0,t();var u=e.query.parameters.mongoOperation;if(!u)return o.error=new Error("No MongoDB operation generated."),o.executed=!0,t();var f=s.collection(u.collection),c=a(JSON.parse(JSON.stringify(u.update)));f.updateMany(u.filter,c).then(function(e){return o.error=null,o.value=e,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Delete:function(e,t){var o=e.parameters.result;e.setDialect("MongoDB").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No MongoDB connection available."),o.executed=!0,t();var u=e.query.parameters.mongoOperation,f=s.collection(u.collection);if("updateMany"===u.operation){var c=a(JSON.parse(JSON.stringify(u.update)));f.updateMany(u.filter,c).then(function(e){return o.error=null,o.value=e.modifiedCount,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})}else f.deleteMany(u.filter).then(function(e){return o.error=null,o.value=e.deletedCount,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("MongoDB").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No MongoDB connection available."),o.executed=!0,t();var u=e.query.parameters.mongoOperation;if(!u||"noop"===u.operation)return o.error=null,o.value=0,o.executed=!0,t();var f=s.collection(u.collection),c=a(JSON.parse(JSON.stringify(u.update)));f.updateMany(u.filter,c).then(function(e){return o.error=null,o.value=e.modifiedCount,o.executed=!0,t()}).catch(function(e){return o.error=e,o.value=!1,o.executed=!0,t()})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MongoDB").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MongoDB connection available."),a.executed=!0,t();var s=e.query.parameters.mongoOperation,u=o.collection(s.collection);if(s.distinct&&s.distinctFields&&s.distinctFields.length>0){for(var f={},c=0;c<s.distinctFields.length;c++)f[s.distinctFields[c]]="$"+s.distinctFields[c];var l=[{$match:s.filter},{$group:{_id:f}},{$count:"RowCount"}];u.aggregate(l).toArray().then(function(e){return a.error=null,a.value=e.length>0?e[0].RowCount:0,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})}else u.countDocuments(s.filter).then(function(e){return a.error=null,a.value=e,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowMongoDBProvider&&r.MeadowMongoDBProvider},providerCreatesSupported:!0,new:e}}()}},{}],230:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MySQL&&(n=r.settings.MySQL.GlobalLogLevel||0);var i=function(){return"object"==typeof r.MeadowMySQLConnectionPool?r.MeadowMySQLConnectionPool:!("object"!=typeof r.MeadowMySQLProvider||!r.MeadowMySQLProvider.connected)&&r.MeadowMySQLProvider.pool};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},i={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(i[r[a].StorageColumn]=r[a].Column);for(var o in t)if(n[o])try{e[o]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[o]={}}else if(i.hasOwnProperty(o)){var s=i[o];try{e[s]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[s]={}}}else e[o]=t[o]},Create:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during create query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(n,o){i.release(),a.error=n,a.value=!1;try{a.value=o.insertId}catch(t){r.log.warn("Error getting insert ID during create query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Read:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during read query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(e,r){return i.release(),a.error=e,a.value=r,a.executed=!0,t()})})},Update:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during update query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(e,r){return i.release(),a.error=e,a.value=r,a.executed=!0,t()})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during delete query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(n,o){i.release(),a.error=n,a.value=!1;try{a.value=o.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Undelete:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during undelete query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(n,o){i.release(),a.error=n,a.value=!1;try{a.value=o.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();o.getConnection(function(n,i){if(n||!i)return r.log.error("Error getting connection from MySQL pool during count query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();i.query(e.query.body,e.query.parameters,function(n,o){i.release(),a.executed=!0,a.error=n,a.value=!1;try{a.value=o[0].RowCount}catch(t){r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})})},getProvider:function(){return"object"==typeof r.MeadowMySQLConnectionPool?r.MeadowMySQLConnectionPool:"object"==typeof r.MeadowMySQLProvider&&r.MeadowMySQLProvider},providerCreatesSupported:!1,new:e}}()}},{}],231:[function(e,t,r){t.exports=new function(){return function e(t){return"object"==typeof t&&"fable"in t?{marshalRecordFromSourceToObject:function(){},Create:function(e,t){e.parameters.result.executed=!0,t()},Read:function(e,t){e.parameters.result.executed=!0,e.parameters.result.value=[!0],t()},Update:function(e,t){e.parameters.result.executed=!0,t()},Delete:function(e,t){e.parameters.result.executed=!0,t()},Undelete:function(e,t){e.parameters.result.executed=!0,t()},Count:function(e,t){e.parameters.result.executed=!0,t()},getProvider:{},providerCreatesSupported:!1,new:e}:{new:e}}()}},{}],232:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.PostgreSQL&&(n=r.settings.PostgreSQL.GlobalLogLevel||0);var i=function(e,t){var r=[],n=0,i={};return{text:e.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g,function(e,a){if(!t.hasOwnProperty(a))return e;if(i.hasOwnProperty(a))return"$"+i[a];n++,i[a]=n;var o=t[a];if(Array.isArray(o)){for(var s=[],u=0;u<o.length;u++)u>0&&n++,r.push(o[u]),s.push("$"+n);return s.join(", ")}return r.push(o),"$"+n}),values:r}},a=function(){return!("object"!=typeof r.MeadowPostgreSQLProvider||!r.MeadowPostgreSQLProvider.connected)&&r.MeadowPostgreSQLProvider.pool};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},i={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(i[r[a].StorageColumn]=r[a].Column);for(var o in t)if(n[o])try{e[o]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[o]={}}else if(i.hasOwnProperty(o)){var s=i[o];try{e[s]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[s]={}}}else e[o]=t[o]},Create:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(n,i){o.error=n,o.value=!1;try{if(i&&i.rows&&i.rows.length>0){for(var a=Array.isArray(e.query.schema)?e.query.schema:[],s=!1,u=0;u<a.length;u++)if("AutoIdentity"===a[u].Type){s=a[u].Column;break}if(s&&i.rows[0].hasOwnProperty(s))o.value=i.rows[0][s];else{var f=Object.keys(i.rows[0])[0];o.value=i.rows[0][f]}}}catch(t){r.log.warn("Error getting insert ID during create query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()})},Read:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(e,r){return o.error=e,o.value=r?r.rows:[],o.executed=!0,t()})},Update:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(e,r){return o.error=e,o.value=r?r.rows:[],o.executed=!0,t()})},Delete:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(n,i){o.error=n,o.value=!1;try{o.value=i?i.rowCount:0}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()})},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(n,i){o.error=n,o.value=!1;try{o.value=i?i.rowCount:0}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:e.query.body,Parameters:e.query.parameters})}return o.executed=!0,t()})},Count:function(e,t){var o=e.parameters.result;e.setDialect("PostgreSQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i(e.query.body,e.query.parameters);a().query(s.text,s.values,function(n,i){o.executed=!0,o.error=n,o.value=!1;try{o.value=parseInt(i.rows[0].rowcount,10)}catch(t){r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})},getProvider:function(){return"object"==typeof r.MeadowPostgreSQLProvider&&r.MeadowPostgreSQLProvider},providerCreatesSupported:!1,new:e}}()}},{}],233:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n="MeadowEndpoints",i=function(e,t,n){var i=e.parameters.result;i.executed=!0;var a=r.MeadowRetoldDataBeaconProvider;if(!a||"function"!=typeof a.dispatchRequest)return i.error=new Error("MeadowProviderRetoldDataBeacon: no connection registered on _Fable.MeadowRetoldDataBeaconProvider"),n();var o,s=a._TargetConnectionHash||"",u=e.query.body||"";o=s?"/1.0/"+s+"/"+u:"/"!==u.charAt(0)?"/1.0/"+u:u;var f=null;("POST"===t||"PUT"===t)&&e.query.records&&e.query.records.length>0&&(f=e.query.records[0]),a.dispatchRequest({Method:t,Path:o,Body:null!==f?JSON.stringify(f):""},function(a,s){if(a)return i.error=a,n();if(s&&s.length>0)try{i.value=JSON.parse(s)}catch(e){return i.error=new Error("MeadowProviderRetoldDataBeacon: failed to parse response as JSON: "+e.message),n()}return e.logLevel>0&&r.log.debug(`==> ${t} ${o} completed`,i),n()})};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){if(e.setDialect(n).buildCreateQuery(),!e.query.records||0===e.query.records.length)return e.parameters.result.error="No records passed for proxying to Retold-DataBeacon.",t();i(e,"POST",function(){var r=e.parameters.result,n=`ID${e.parameters.scope}`;return r.value&&r.value.hasOwnProperty(n)&&(r.value=r.value[n]),t()})},Read:function(e,t){e.setDialect(n).buildReadQuery(),i(e,"GET",function(){var r=e.parameters.result;return e.query.body&&e.query.body.startsWith(`${e.parameters.scope}/`)&&void 0!==r.value&&null!==r.value&&(r.value=[r.value]),t()})},Update:function(e,t){if(e.setDialect(n).buildUpdateQuery(),!e.query.records||0===e.query.records.length)return e.parameters.result.error="No records passed for proxying to Retold-DataBeacon.",t();i(e,"PUT",function(){return t()})},Delete:function(e,t){e.setDialect(n).buildDeleteQuery(),i(e,"DELETE",function(){var r=e.parameters.result;return r.value&&r.value.hasOwnProperty("Count")&&(r.value=r.value.Count),t()})},Count:function(e,t){e.setDialect(n).buildCountQuery(),i(e,"GET",function(){var n=e.parameters.result;try{n.value=n.value.Count}catch(t){n.value=-1,r.log.warn("MeadowProviderRetoldDataBeacon: error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{}],234:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.RocksDB&&(n=r.settings.RocksDB.GlobalLogLevel||0);var i=r.settings.RocksDB&&"ID"===r.settings.RocksDB.KeyMode?"ID":"GUID",a="Unknown",o=[],s="ID",u="GUID",f=function(e){for(var t=0;t<o.length;t++)if(o[t].Column===e)return o[t];return{Column:e,Type:"Default"}},c=function(e){if("string"!=typeof e)return e;var t=e.indexOf(".");return t>-1?e.substring(t+1):e},l=function(){return!("object"!=typeof r.MeadowRocksDBProvider||!r.MeadowRocksDBProvider.connected)&&r.MeadowRocksDBProvider.db},d=function(e,t){var r=Array.isArray(e.parameters.filter)?e.parameters.filter.slice():[];if(!(t||e.parameters.query.disableDeleteTracking))for(var n=0;n<o.length;n++)if("Deleted"===o[n].Type){for(var i=!1,a=0;a<r.length;a++)if(c(r[a].Column)===o[n].Column){i=!0;break}i||r.push({Column:o[n].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}return r},h=function(e,t){var r=t[c(e.Column)],n=e.Value;switch(e.Operator){case"=":return r==n;case"!=":return r!=n;case">":return r>n;case">=":return r>=n;case"<":return r<n;case"<=":return r<=n;case"LIKE":var i=String(n).replace(/%/g,".*").replace(/_/g,".");try{return new RegExp("^"+i+"$","i").test(String(r||""))}catch(e){return!1}case"IN":if(!Array.isArray(n))return!1;for(var a=0;a<n.length;a++)if(r==n[a])return!0;return!1;case"NOT IN":if(!Array.isArray(n))return!0;for(var o=0;o<n.length;o++)if(r==n[o])return!1;return!0;case"IS NULL":return null==r;case"IS NOT NULL":return null!=r;case"(":case")":return!0;default:return r==n}},p=function(e,t){if(!e||0===e.length)return!0;for(var r=[[]],n=0;n<e.length;n++){var i=e[n];if("("===i.Operator)r.push([]);else if(")"===i.Operator){var a=r.pop(),o=y(a);r[r.length-1].push({result:o,connector:i.Connector||"AND"})}else{var s=h(i,t);r[r.length-1].push({result:s,connector:i.Connector||"AND"})}}return y(r[0])},y=function(e){if(!e||0===e.length)return!0;for(var t=e[0].result,r=1;r<e.length;r++){t="OR"===(e[r].connector||"AND")?t||e[r].result:t&&e[r].result}return t},b=function(e,t,n,a,o,s,u){var f=function(e){return"GUID"===i?"M-E-"+e+"-":"M-EBI-"+e+"-"}(t);!function(e,t,n){var i=[],a=e.iterator({gte:t,lt:t+"",keyAsBuffer:!1,valueAsBuffer:!1});!function e(){a.next(function(t,o,s){if(t)return a.end(function(){return n(t,i)});if(void 0===o)return a.end(function(){return n(null,i)});try{var u=JSON.parse(s.toString());u._rocksdb_key=o.toString(),i.push(u)}catch(e){r.log.error("RocksDB: Failed to parse record at key ["+o+"]: "+e)}e()})}()}(e,f,function(e,t){if(e)return u(e,[]);for(var r=[],i=0;i<t.length;i++)p(n,t[i])&&r.push(t[i]);return r=function(e,t){return Array.isArray(t)&&0!==t.length?(e.sort(function(e,r){for(var n=0;n<t.length;n++){var i=c(t[n].Column),a="Descending"===t[n].Direction?-1:1,o=e[i],s=r[i];if(null==o&&(o=""),null==s&&(s=""),o<s)return-1*a;if(o>s)return 1*a}return 0}),e):e}(r,a),r=function(e,t,r){var n=!1!==t&&t>0?t:0;return r?e.slice(n,n+r):n>0?e.slice(n):e}(r,o,s),u(null,r)})};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)"_rocksdb_key"!==r&&(e[r]=t[r])},Create:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Create",{scope:a});var c=l();if(!c)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var d=function(e){var t=e.parameters.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r={},n=t[0];for(var i in n)if(n.hasOwnProperty(i)){var a=f(i);if(e.parameters.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"AutoIdentity":e.parameters.query.disableAutoIdentity?r[i]=n[i]:r[i]="$$AUTOINCREMENT";break;case"AutoGUID":e.parameters.query.disableAutoIdentity||n[i]&&n[i].length>=5&&"0x0000000000000000"!==n[i]?r[i]=n[i]:r[i]=e.parameters.query.UUID;break;case"UpdateDate":case"CreateDate":e.parameters.query.disableAutoDateStamp?r[i]=n[i]:r[i]=(new Date).toISOString();break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.parameters.query.disableAutoUserStamp?r[i]=n[i]:r[i]=e.parameters.query.IDUser;break;case"Deleted":e.parameters.query.disableDeleteTracking?r[i]=n[i]:r[i]=0;break;default:r[i]=n[i]}}return r}(e);if(!d)return o.error=new Error("No RocksDB document generated for Create."),o.executed=!0,t();var h=!1;for(var p in d)if("$$AUTOINCREMENT"===d[p]){h=p;break}var y=function(e){h&&e&&(d[h]=e);var r,n,f=(r=a,n=d,"GUID"===i&&u&&n[u]?"M-E-"+r+"-"+n[u]:"M-EBI-"+r+"-"+n[s]),l=JSON.stringify(d);c.put(f,l,function(r){return r?(o.error=r,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=e||d[s],o.executed=!0,t())})};h?function(e,t,r){var n=function(e){return"M-SEQ-"+e}(t);e.get(n,function(t,i){var a=1;!t&&i&&(a=parseInt(i.toString(),10)+1),e.put(n,String(a),function(e){return r(e,a)})})}(c,a,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();y(r)}):y()},Read:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Read",{scope:a,filter:e.parameters.filter});var o=l();if(!o)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var s=d(e),u=e.parameters.sort||!1,f=e.parameters.begin,c=e.parameters.cap;b(o,a,s,u,f,c,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();for(var n=0;n<r.length;n++)delete r[n]._rocksdb_key;return i.error=null,i.value=r,i.executed=!0,t()})},Update:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Update",{scope:a,filter:e.parameters.filter});var o=l();if(!o)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var s=function(e){var t=e.parameters.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r={},n=t[0];for(var i in n)if(n.hasOwnProperty(i)){var a=f(i);switch(a.Type){case"AutoIdentity":case"AutoGUID":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a.Type){case"UpdateDate":e.parameters.query.disableAutoDateStamp||(r[i]=(new Date).toISOString());break;case"UpdateIDUser":e.parameters.query.disableAutoUserStamp||(r[i]=e.parameters.query.IDUser);break;default:r[i]=n[i]}}return r}(e);if(!s||0===Object.keys(s).length)return i.error=null,i.value=0,i.executed=!0,t();var u=d(e);b(o,a,u,!1,!1,!1,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var u=r[a],f=u._rocksdb_key;for(var c in s)s.hasOwnProperty(c)&&(u[c]=s[c]);delete u._rocksdb_key,n.push({type:"put",key:f,value:JSON.stringify(u)})}o.batch(n,function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value={changes:r.length},i.executed=!0,t())})})},Delete:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Delete",{scope:a,filter:e.parameters.filter});var s=l();if(!s)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var u=function(e){if(e.parameters.query.disableDeleteTracking)return!1;for(var t=!1,r={},n=0;n<o.length;n++){var i=o[n];switch(i.Type){case"Deleted":r[i.Column]=1,t=!0;break;case"DeleteDate":case"UpdateDate":r[i.Column]=(new Date).toISOString();break;case"DeleteIDUser":r[i.Column]=e.parameters.query.IDUser;break;default:continue}}return!(!t||0===Object.keys(r).length)&&r}(e),f=d(e);b(s,a,f,!1,!1,!1,u?function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var o=r[a],f=o._rocksdb_key;for(var c in u)u.hasOwnProperty(c)&&(o[c]=u[c]);delete o._rocksdb_key,n.push({type:"put",key:f,value:JSON.stringify(o)})}s.batch(n,function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=r.length,i.executed=!0,t())})}:function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=[],a=0;a<r.length;a++)n.push({type:"del",key:r[a]._rocksdb_key});s.batch(n,function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=r.length,i.executed=!0,t())})})},Undelete:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Undelete",{scope:a,filter:e.parameters.filter});var s=l();if(!s)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var u=function(e){for(var t=!1,r={},n=0;n<o.length;n++){var i=o[n];switch(i.Type){case"Deleted":r[i.Column]=0,t=!0;break;case"UpdateDate":r[i.Column]=(new Date).toISOString();break;case"UpdateIDUser":r[i.Column]=e.parameters.query.IDUser;break;default:continue}}return!(!t||0===Object.keys(r).length)&&r}(e);if(!u)return i.error=null,i.value=0,i.executed=!0,t();var f=d(e,!0);b(s,a,f,!1,!1,!1,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();if(0===r.length)return i.error=null,i.value=0,i.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var o=r[a],f=o._rocksdb_key;for(var c in u)u.hasOwnProperty(c)&&(o[c]=u[c]);delete o._rocksdb_key,n.push({type:"put",key:f,value:JSON.stringify(o)})}s.batch(n,function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=r.length,i.executed=!0,t())})})},Count:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Count",{scope:a,filter:e.parameters.filter});var o=l();if(!o)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var s=d(e);b(o,a,s,!1,!1,!1,function(e,r){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=r.length,i.executed=!0,t())})},setSchema:function(e,t,r,n){a=e||"Unknown",o=Array.isArray(t)?t:[],s=r||"ID"+a,u=n||"GUID"+a},getProvider:function(){return"object"==typeof r.MeadowRocksDBProvider&&r.MeadowRocksDBProvider},providerCreatesSupported:!0,new:e}}()}},{}],235:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=function(){return!("object"!=typeof r.MeadowSQLiteProvider||!r.MeadowSQLiteProvider.connected)&&r.MeadowSQLiteProvider.db},i=function(e){return"string"!=typeof e?e:e.replace(/NOW\(\d*\)/g,"datetime('now')")},a=function(e){if("object"!=typeof e||null===e)return e;for(var t=Object.keys(e),r=0;r<t.length;r++){var n=e[t[r]];Array.isArray(n)?1===n.length&&(e[t[r]]=n[0]):"boolean"==typeof n?e[t[r]]=n?1:0:void 0===n&&(e[t[r]]=null)}return e};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},i={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(i[r[a].StorageColumn]=r[a].Column);for(var o in t)if(n[o])try{e[o]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[o]={}}else if(i.hasOwnProperty(o)){var s=i[o];try{e[s]="string"==typeof t[o]?JSON.parse(t[o]):t[o]||{}}catch(t){e[s]={}}}else e[o]=t[o]},Create:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildCreateQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).run(e.query.parameters);o.error=null,o.value=!1;try{o.value=Number(f.lastInsertRowid)}catch(t){r.log.warn("Error getting insert ID during create query",{Body:s,Parameters:e.query.parameters})}o.executed=!0}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},Read:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildReadQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).all(e.query.parameters);o.error=null,o.value=f,o.executed=!0}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},Update:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildUpdateQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).run(e.query.parameters);o.error=null,o.value=f,o.executed=!0}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},Delete:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildDeleteQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).run(e.query.parameters);o.error=null,o.value=!1;try{o.value=f.changes}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:s,Parameters:e.query.parameters})}o.executed=!0}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildUndeleteQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).run(e.query.parameters);o.error=null,o.value=!1;try{o.value=f.changes}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:s,Parameters:e.query.parameters})}o.executed=!0}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},Count:function(e,t){var o=e.parameters.result;e.setDialect("SQLite").buildCountQuery();var s=i(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(s,e.query.parameters);try{var u=n();if(!u)return o.error=new Error("No SQLite database connection available."),o.executed=!0,t();var f=u.prepare(s).all(e.query.parameters);o.executed=!0,o.error=null,o.value=!1;try{o.value=f[0].RowCount}catch(t){r.log.warn("Error getting rowcount during count query",{Body:s,Parameters:e.query.parameters})}}catch(e){o.error=e,o.value=!1,o.executed=!0}return t()},getProvider:function(){return"object"==typeof r.MeadowSQLiteProvider&&r.MeadowSQLiteProvider},providerCreatesSupported:!0,new:e}}()}},{}],236:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.Solr&&(n=r.settings.Solr.GlobalLogLevel||0);var i=function(){return!("object"!=typeof r.MeadowSolrProvider||!r.MeadowSolrProvider.connected)&&r.MeadowSolrProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=(new Date).toISOString():"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)if("_version_"!==r){var n=t[r];Array.isArray(n)&&1===n.length&&(n=n[0]),e[r]=n}},Create:function(e,t){var o=e.parameters.result;e.setDialect("Solr").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No Solr connection available."),o.executed=!0,t();var u=e.query.parameters.solrOperation;if(!u)return o.error=new Error("No Solr operation generated."),o.executed=!0,t();var f=a(JSON.parse(JSON.stringify(u.document))),c=!1;for(var l in f)if("$$AUTOINCREMENT"===f[l]){c=l;break}c?function(e,t,r,n){var i=t+"."+r,a=e.query().q('id:"'+i+'"').rows(1);e.search(a,function(t,r){if(t)return n(t);var a=1;r&&r.response&&r.response.docs&&r.response.docs.length>0&&(a=(r.response.docs[0].seq||0)+1);var o={id:i,seq:a};e.add(o,function(t){if(t)return n(t);e.commit(function(e){return e?n(e):n(null,a)})})})}(s,u.collection,c,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();f[c]=r,s.add(f,function(e){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=r,o.executed=!0,t())})})}):s.add(f,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=f.id||!0,o.executed=!0,t())})})},Read:function(e,t){var a=e.parameters.result;e.setDialect("Solr").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No Solr connection available."),a.executed=!0,t();var s=e.query.parameters.solrOperation,u=o.query().q(s.query||"*:*");s.filterQuery&&u.parameters.push("fq="+encodeURIComponent(s.filterQuery)),s.fields&&(u=u.fl(s.fields)),s.sort&&u.parameters.push("sort="+encodeURIComponent(s.sort)),void 0!==s.rows&&(u=u.rows(s.rows)),s.start&&(u=u.start(s.start)),o.search(u,function(e,r){return e?(a.error=e,a.value=!1,a.executed=!0,t()):(a.error=null,a.value=r&&r.response?r.response.docs:[],a.executed=!0,t())})},Update:function(e,t){var o=e.parameters.result;e.setDialect("Solr").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No Solr connection available."),o.executed=!0,t();var u=e.query.parameters.solrOperation;if(!u)return o.error=new Error("No Solr operation generated."),o.executed=!0,t();var f=s.query().q(u.filterQuery||"*:*").fl("id").rows(1e6);s.search(f,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return o.error=null,o.value=0,o.executed=!0,t();for(var i=a(JSON.parse(JSON.stringify(u.update))),f=[],c=0;c<n.length;c++){var l={id:n[c].id};for(var d in i)l[d]=i[d];f.push(l)}s.add(f,function(e){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=f,o.executed=!0,t())})})})},Delete:function(e,t){var o=e.parameters.result;e.setDialect("Solr").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No Solr connection available."),o.executed=!0,t();var u=e.query.parameters.solrOperation;if("atomicUpdate"===u.operation){var f=s.query().q(u.filterQuery||"*:*").fl("id").rows(1e6);s.search(f,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return o.error=null,o.value=0,o.executed=!0,t();for(var i=a(JSON.parse(JSON.stringify(u.update))),f=[],c=0;c<n.length;c++){var l={id:n[c].id};for(var d in i)l[d]=i[d];f.push(l)}s.add(f,function(e){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=n.length,o.executed=!0,t())})})})}else{var c=s.query().q(u.filterQuery||"*:*").rows(0);s.search(c,function(e,r){var n=0;!e&&r&&r.response&&(n=r.response.numFound||0),s.deleteByQuery(u.filterQuery||"*:*",function(e){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=n,o.executed=!0,t())})})})}},Undelete:function(e,t){var o=e.parameters.result;e.setDialect("Solr").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var s=i();if(!s)return o.error=new Error("No Solr connection available."),o.executed=!0,t();var u=e.query.parameters.solrOperation;if(!u||"noop"===u.operation)return o.error=null,o.value=0,o.executed=!0,t();var f=s.query().q(u.filterQuery||"*:*").fl("id").rows(1e6);s.search(f,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return o.error=null,o.value=0,o.executed=!0,t();for(var i=a(JSON.parse(JSON.stringify(u.update))),f=[],c=0;c<n.length;c++){var l={id:n[c].id};for(var d in i)l[d]=i[d];f.push(l)}s.add(f,function(e){if(e)return o.error=e,o.value=!1,o.executed=!0,t();s.commit(function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=n.length,o.executed=!0,t())})})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("Solr").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var o=i();if(!o)return a.error=new Error("No Solr connection available."),a.executed=!0,t();var s=e.query.parameters.solrOperation,u=o.query().q(s.query||"*:*").rows(0);if(s.filterQuery&&u.parameters.push("fq="+encodeURIComponent(s.filterQuery)),s.distinct&&s.distinctFields&&s.distinctFields.length>0){for(var f={},c=0;c<s.distinctFields.length;c++)f[s.distinctFields[c]]="$"+s.distinctFields[c];u=u.groupBy(s.distinctFields[0]).groupNGroups(!0)}o.search(u,function(e,r){if(e)return a.error=e,a.value=!1,a.executed=!0,t();if(a.error=null,s.distinct&&r&&r.grouped){var n=Object.keys(r.grouped);n.length>0?a.value=r.grouped[n[0]].ngroups||0:a.value=0}else a.value=r&&r.response?r.response.numFound:0;return a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowSolrProvider&&r.MeadowSolrProvider},providerCreatesSupported:!0,new:e}}()}},{}],237:[function(e,t,r){var n=e("bn.js"),i=e("brorand");function a(e){this.rand=e||new i.Rand}t.exports=a,a.create=function(e){return new a(e)},a.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},a.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},a.prototype.test=function(e,t,r){var i=e.bitLength(),a=n.mont(e),o=new n(1).toRed(a);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var f=e.shrn(u),c=s.toRed(a);t>0;t--){var l=this._randrange(new n(2),s);r&&r(l);var d=l.toRed(a).redPow(f);if(0!==d.cmp(o)&&0!==d.cmp(c)){for(var h=1;h<u;h++){if(0===(d=d.redSqr()).cmp(o))return!1;if(0===d.cmp(c))break}if(h===u)return!1}}return!0},a.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),a=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var o=e.subn(1),s=0;!o.testn(s);s++);for(var u=e.shrn(s),f=o.toRed(i);t>0;t--){var c=this._randrange(new n(2),o),l=e.gcd(c);if(0!==l.cmpn(1))return l;var d=c.toRed(i).redPow(u);if(0!==d.cmp(a)&&0!==d.cmp(f)){for(var h=1;h<s;h++){if(0===(d=d.redSqr()).cmp(a))return d.fromRed().subn(1).gcd(e);if(0===d.cmp(f))break}if(h===s)return(d=d.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},{"bn.js":238,brorand:37}],238:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{buffer:38,dup:16}],239:[function(e,t,r){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=n,n.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},{}],240:[function(e,t,r){var n=r;function i(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),a=i>>8,o=255&i;a?r.push(a,o):r.push(o)}return r},n.zero2=i,n.toHex=a,n.encode=function(e,t){return"hex"===t?a(e):e}},{}],241:[function(e,t,r){(function(r){(function(){var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=n&&i&&"function"==typeof i.get?i.get:null,o=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,u=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,f=s&&u&&"function"==typeof u.get?u.get:null,c=s&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,h="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,y=Object.prototype.toString,b=Function.prototype.toString,m=String.prototype.match,g=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,_=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,M=Array.prototype.join,A=Array.prototype.slice,D=Math.floor,k="function"==typeof BigInt?BigInt.prototype.valueOf:null,O=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,R="function"==typeof Symbol&&"object"==typeof Symbol.iterator,C="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===R||"symbol")?Symbol.toStringTag:null,j=Object.prototype.propertyIsEnumerable,q=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-D(-e):D(e);if(n!==e){var i=String(n),a=g.call(t,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var T=e("./util.inspect"),L=T.custom,U=H(L)?L:null,P={__proto__:null,double:'"',single:"'"},B={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function N(e,t,r){var n=r.quoteStyle||t,i=P[n];return i+e+i}function F(e){return v.call(String(e),/"/g,""")}function Q(e){return!C||!("object"==typeof e&&(C in e||void 0!==e[C]))}function $(e){return"[object Array]"===V(e)&&Q(e)}function z(e){return"[object RegExp]"===V(e)&&Q(e)}function H(e){if(R)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!x)return!1;try{return x.call(e),!0}catch(e){}return!1}t.exports=function e(t,n,i,s){var u=n||{};if(W(u,"quoteStyle")&&!W(P,u.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(u,"maxStringLength")&&("number"==typeof u.maxStringLength?u.maxStringLength<0&&u.maxStringLength!==1/0:null!==u.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!W(u,"customInspect")||u.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(u,"indent")&&null!==u.indent&&"\t"!==u.indent&&!(parseInt(u.indent,10)===u.indent&&u.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(u,"numericSeparator")&&"boolean"!=typeof u.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=u.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return K(t,u);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?I(t,S):S}if("bigint"==typeof t){var D=String(t)+"n";return w?I(t,D):D}var O=void 0===u.depth?5:u.depth;if(void 0===i&&(i=0),i>=O&&O>0&&"object"==typeof t)return $(t)?"[Array]":"[Object]";var L=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=M.call(Array(e.indent+1)," ")}return{base:r,prev:M.call(Array(t+1),r)}}(u,i);if(void 0===s)s=[];else if(G(s,t)>=0)return"[Circular]";function B(t,r,n){if(r&&(s=A.call(s)).push(r),n){var a={depth:u.depth};return W(u,"quoteStyle")&&(a.quoteStyle=u.quoteStyle),e(t,a,i+1,s)}return e(t,u,i+1,s)}if("function"==typeof t&&!z(t)){var J=function(e){if(e.name)return e.name;var t=m.call(b.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),X=re(t,B);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(X.length>0?" { "+M.call(X,", ")+" }":"")}if(H(t)){var ne=R?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(t);return"object"!=typeof t||R?ne:Z(ne)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var ie="<"+_.call(String(t.nodeName)),ae=t.attributes||[],oe=0;oe<ae.length;oe++)ie+=" "+ae[oe].name+"="+N(F(ae[oe].value),"double",u);return ie+=">",t.childNodes&&t.childNodes.length&&(ie+="..."),ie+="</"+_.call(String(t.nodeName))+">"}if($(t)){if(0===t.length)return"[]";var se=re(t,B);return L&&!function(e){for(var t=0;t<e.length;t++)if(G(e[t],"\n")>=0)return!1;return!0}(se)?"["+te(se,L)+"]":"[ "+M.call(se,", ")+" ]"}if(function(e){return"[object Error]"===V(e)&&Q(e)}(t)){var ue=re(t,B);return"cause"in Error.prototype||!("cause"in t)||j.call(t,"cause")?0===ue.length?"["+String(t)+"]":"{ ["+String(t)+"] "+M.call(ue,", ")+" }":"{ ["+String(t)+"] "+M.call(E.call("[cause]: "+B(t.cause),ue),", ")+" }"}if("object"==typeof t&&y){if(U&&"function"==typeof t[U]&&T)return T(t,{depth:O-i});if("symbol"!==y&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{f.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var fe=[];return o&&o.call(t,function(e,r){fe.push(B(r,t,!0)+" => "+B(e,t))}),ee("Map",a.call(t),fe,L)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return c&&c.call(t,function(e){ce.push(B(e,t))}),ee("Set",f.call(t),ce,L)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Y("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{l.call(e,l)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Y("WeakSet");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{return h.call(e),!0}catch(e){}return!1}(t))return Y("WeakRef");if(function(e){return"[object Number]"===V(e)&&Q(e)}(t))return Z(B(Number(t)));if(function(e){if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch(e){}return!1}(t))return Z(B(k.call(t)));if(function(e){return"[object Boolean]"===V(e)&&Q(e)}(t))return Z(p.call(t));if(function(e){return"[object String]"===V(e)&&Q(e)}(t))return Z(B(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r&&t===r)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===V(e)&&Q(e)}(t)&&!z(t)){var le=re(t,B),de=q?q(t)===Object.prototype:t instanceof Object||t.constructor===Object,he=t instanceof Object?"":"null prototype",pe=!de&&C&&Object(t)===t&&C in t?g.call(V(t),8,-1):he?"Object":"",ye=(de||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(pe||he?"["+M.call(E.call([],pe||[],he||[]),": ")+"] ":"");return 0===le.length?ye+"{}":L?ye+"{"+te(le,L)+"}":ye+"{ "+M.call(le,", ")+" }"}return String(t)};var J=Object.prototype.hasOwnProperty||function(e){return e in this};function W(e,t){return J.call(e,t)}function V(e){return y.call(e)}function G(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function K(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return K(g.call(e,0,t.maxStringLength),t)+n}var i=B[t.quoteStyle||"single"];return i.lastIndex=0,N(v.call(v.call(e,i,"\\$1"),/[\x00-\x1f]/g,X),"single",t)}function X(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Z(e){return"Object("+e+")"}function Y(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):M.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+M.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=$(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=W(e,i)?t(e[i],e):""}var a,o="function"==typeof O?O(e):[];if(R){a={};for(var s=0;s<o.length;s++)a["$"+o[s]]=o[s]}for(var u in e)W(e,u)&&(r&&String(Number(u))===u&&u<e.length||R&&a["$"+u]instanceof Symbol||(S.call(/[^\w$]/,u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof O)for(var f=0;f<o.length;f++)j.call(e,o[f])&&n.push("["+t(o[f])+"]: "+t(e[o[f]],e));return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":38}],242:[function(e,t,r){var n=e("wrappy");function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function a(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(i),t.exports.strict=n(a),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return a(this)},configurable:!0})})},{wrappy:356}],243:[function(e,t,r){t.exports={"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"}},{}],244:[function(e,t,r){var n=e("asn1.js");r.certificate=e("./certificate");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())});r.RSAPrivateKey=i;var a=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=a;var o=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())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())});r.PublicKey=s;var u=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var f=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())});r.EncryptedPrivateKey=f;var c=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())});r.DSAPrivateKey=c,r.DSAparam=n.define("DSAparam",function(){this.int()});var l=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),d=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())});r.ECPrivateKey=d,r.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":245,"asn1.js":2}],245:[function(e,t,r){var n=e("asn1.js"),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),a=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(a)}),f=n.define("RDNSequence",function(){this.seqof(u)}),c=n.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),l=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),h=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(c),this.key("validity").use(l),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(h),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],246:[function(e,t,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,a=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=e("evp_bytestokey"),s=e("browserify-aes"),u=e("safe-buffer").Buffer;t.exports=function(e,t){var r,f=e.toString(),c=f.match(n);if(c){var l="aes"+c[1],d=u.from(c[2],"hex"),h=u.from(c[3].replace(/[\r\n]/g,""),"base64"),p=o(t,d.slice(0,8),parseInt(c[1],10)).key,y=[],b=s.createDecipheriv(l,p,d);y.push(b.update(h)),y.push(b.final()),r=u.concat(y)}else{var m=f.match(a);r=u.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:f.match(i)[1],data:r}}},{"browserify-aes":41,evp_bytestokey:142,"safe-buffer":291}],247:[function(e,t,r){var n=e("./asn1"),i=e("./aesid.json"),a=e("./fixProc"),o=e("browserify-aes"),s=e("pbkdf2").pbkdf2Sync,u=e("safe-buffer").Buffer;function f(e){var t;"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var r,f,c=a(e,t),l=c.tag,d=c.data;switch(l){case"CERTIFICATE":f=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(f||(f=n.PublicKey.decode(d,"der")),r=f.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.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=n.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(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),a=i[e.algorithm.decrypt.cipher.algo.join(".")],f=e.algorithm.decrypt.cipher.iv,c=e.subjectPrivateKey,l=parseInt(a.split("-")[1],10)/8,d=s(t,r,n,l,"sha1"),h=o.createDecipheriv(a,d,f),p=[];return p.push(h.update(c)),p.push(h.final()),u.concat(p)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(r=(f=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(f.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:f.algorithm.curve,privateKey:n.ECPrivateKey.decode(f.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return f.algorithm.params.priv_key=n.DSAparam.decode(f.subjectPrivateKey,"der"),{type:"dsa",params:f.algorithm.params};default:throw new Error("unknown key id "+r)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+l)}}f.signature=n.signature,t.exports=f},{"./aesid.json":243,"./asn1":244,"./fixProc":246,"browserify-aes":41,pbkdf2:248,"safe-buffer":291}],248:[function(e,t,r){r.pbkdf2=e("./lib/async"),r.pbkdf2Sync=e("./lib/sync")},{"./lib/async":249,"./lib/sync":252}],249:[function(e,t,r){(function(r){(function(){var n,i,a=e("safe-buffer").Buffer,o=e("./precondition"),s=e("./default-encoding"),u=e("./sync"),f=e("./to-buffer"),c=r.crypto&&r.crypto.subtle,l={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"},d=[];function h(){return i||(i=r.process&&r.process.nextTick?r.process.nextTick:r.queueMicrotask?r.queueMicrotask:r.setImmediate?r.setImmediate:r.setTimeout)}function p(e,t,r,n,i){return c.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return c.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return a.from(e)})}t.exports=function(e,t,i,y,b,m){if("function"==typeof b&&(m=b,b=void 0),o(i,y),e=f(e,s,"Password"),t=f(t,s,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");var g=l[(b=b||"sha1").toLowerCase()];g&&"function"==typeof r.Promise?function(e,t){e.then(function(e){h()(function(){t(null,e)})},function(e){h()(function(){t(e)})})}(function(e){if(r.process&&!r.process.browser)return Promise.resolve(!1);if(!c||!c.importKey||!c.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var t=p(n=n||a.alloc(8),n,10,128,e).then(function(){return!0},function(){return!1});return d[e]=t,t}(g).then(function(r){return r?p(e,t,i,y,g):u(e,t,i,y,b)}),m):h()(function(){var r;try{r=u(e,t,i,y,b)}catch(e){return void m(e)}m(null,r)})}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":250,"./precondition":251,"./sync":252,"./to-buffer":253,"safe-buffer":291}],250:[function(e,t,r){(function(e,r){(function(){var n;if(r.process&&r.process.browser)n="utf-8";else if(r.process&&r.process.version){n=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:256}],251:[function(e,t,r){var n=isFinite,i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0||!n(e))throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>i||t!=t)throw new TypeError("Bad key length")}},{}],252:[function(e,t,r){var n=e("create-hash/md5"),i=e("ripemd160"),a=e("sha.js"),o=e("safe-buffer").Buffer,s=e("./precondition"),u=e("./default-encoding"),f=e("./to-buffer"),c=o.alloc(128),l={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},d={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function h(e){return(new i).update(e).digest()}function p(e,t,r){var i=function(e){return"rmd160"===e||"ripemd160"===e?h:"md5"===e?n:function(t){return a(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=i(t):t.length<s&&(t=o.concat([t,c],s));for(var u=o.allocUnsafe(s+l[e]),f=o.allocUnsafe(s+l[e]),d=0;d<s;d++)u[d]=54^t[d],f[d]=92^t[d];var p=o.allocUnsafe(s+r+4);u.copy(p,0,0,s),this.ipad1=p,this.ipad2=u,this.opad=f,this.alg=e,this.blocksize=s,this.hash=i,this.size=l[e]}p.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(e,t,r,n,i){s(r,n),e=f(e,u,"Password"),t=f(t,u,"Salt");var a=(i||"sha1").toLowerCase(),c=d[a]||a,h=l[c];if("number"!=typeof h||!h)throw new TypeError("Digest algorithm not supported: "+i);var y=new p(c,e,t.length),b=o.allocUnsafe(n),m=o.allocUnsafe(t.length+4);t.copy(m,0,0,t.length);for(var g=0,v=h,w=Math.ceil(n/v),_=1;_<=w;_++){m.writeUInt32BE(_,t.length);for(var S=y.run(m,y.ipad1),E=S,M=1;M<r;M++){E=y.run(E,y.ipad2);for(var A=0;A<v;A++)S[A]^=E[A]}S.copy(b,g),g+=v}return b}},{"./default-encoding":250,"./precondition":251,"./to-buffer":253,"create-hash/md5":98,ripemd160:275,"safe-buffer":291,"sha.js":295}],253:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("to-buffer"),a="undefined"!=typeof Uint8Array,o=a&&"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView;t.exports=function(e,t,r){if("string"==typeof e||n.isBuffer(e)||a&&e instanceof Uint8Array||o&&o(e))return i(e,t);throw new TypeError(r+" must be a string, a Buffer, a Uint8Array, or a DataView")}},{"safe-buffer":291,"to-buffer":345}],254:[function(e,t,r){t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},{}],255:[function(e,t,r){(function(e){(function(){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 a,o,s=arguments.length;switch(s){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(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return e.nextTick(function(){t.apply(null,a)})}}}:t.exports=e}).call(this)}).call(this,e("_process"))},{_process:256}],256:[function(e,t,r){var n,i,a=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],l=!1,d=-1;function h(){l&&f&&(l=!1,f.length?c=f.concat(c):d=-1,c.length&&p())}function p(){if(!l){var e=u(h);l=!0;for(var t=c.length;t;){for(f=c,c=[];++d<t;)f&&f[d].run();d=-1,t=c.length}f=null,l=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function b(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||l||u(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=b,a.addListener=b,a.once=b,a.off=b,a.removeListener=b,a.removeAllListeners=b,a.emit=b,a.prependListener=b,a.prependOnceListener=b,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],257:[function(e,t,r){r.publicEncrypt=e("./publicEncrypt"),r.privateDecrypt=e("./privateDecrypt"),r.privateEncrypt=function(e,t){return r.publicEncrypt(e,t,!0)},r.publicDecrypt=function(e,t){return r.privateDecrypt(e,t,!0)}},{"./privateDecrypt":260,"./publicEncrypt":261}],258:[function(e,t,r){var n=e("create-hash"),i=e("safe-buffer").Buffer;function a(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}t.exports=function(e,t){for(var r,o=i.alloc(0),s=0;o.length<t;)r=a(s++),o=i.concat([o,n("sha1").update(e).update(r).digest()]);return o.slice(0,t)}},{"create-hash":97,"safe-buffer":291}],259:[function(e,t,r){arguments[4][16][0].apply(r,arguments)},{buffer:38,dup:16}],260:[function(e,t,r){var n=e("parse-asn1"),i=e("./mgf"),a=e("./xor"),o=e("bn.js"),s=e("browserify-rsa"),u=e("create-hash"),f=e("./withPublic"),c=e("safe-buffer").Buffer;t.exports=function(e,t,r){var l;l=e.padding?e.padding:r?1:4;var d,h=n(e),p=h.modulus.byteLength();if(t.length>p||new o(t).cmp(h.modulus)>=0)throw new Error("decryption error");d=r?f(new o(t),h):s(t,h);var y=c.alloc(p-d.length);if(d=c.concat([y,d],p),4===l)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(c.alloc(0)).digest(),o=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,o+1),f=t.slice(o+1),l=a(s,i(f,o)),d=a(f,i(l,r-o-1));if(function(e,t){e=c.from(e),t=c.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,d.slice(0,o)))throw new Error("decryption error");var h=o;for(;0===d[h];)h++;if(1!==d[h++])throw new Error("decryption error");return d.slice(h)}(h,d);if(1===l)return function(e,t,r){var n=t.slice(0,2),i=2,a=0;for(;0!==t[i++];)if(i>=t.length){a++;break}var o=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&a++;o.length<8&&a++;if(a)throw new Error("decryption error");return t.slice(i)}(0,d,r);if(3===l)return d;throw new Error("unknown padding")}},{"./mgf":258,"./withPublic":262,"./xor":263,"bn.js":259,"browserify-rsa":59,"create-hash":97,"parse-asn1":247,"safe-buffer":291}],261:[function(e,t,r){var n=e("parse-asn1"),i=e("randombytes"),a=e("create-hash"),o=e("./mgf"),s=e("./xor"),u=e("bn.js"),f=e("./withPublic"),c=e("browserify-rsa"),l=e("safe-buffer").Buffer;t.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var h,p=n(e);if(4===d)h=function(e,t){var r=e.modulus.byteLength(),n=t.length,f=a("sha1").update(l.alloc(0)).digest(),c=f.length,d=2*c;if(n>r-d-2)throw new Error("message too long");var h=l.alloc(r-n-d-2),p=r-c-1,y=i(c),b=s(l.concat([f,h,l.alloc(1,1),t],p),o(y,p)),m=s(y,o(b,c));return new u(l.concat([l.alloc(1),m,b],r))}(p,t);else if(1===d)h=function(e,t,r){var n,a=t.length,o=e.modulus.byteLength();if(a>o-11)throw new Error("message too long");n=r?l.alloc(o-a-3,255):function(e){var t,r=l.allocUnsafe(e),n=0,a=i(2*e),o=0;for(;n<e;)o===a.length&&(a=i(2*e),o=0),(t=a[o++])&&(r[n++]=t);return r}(o-a-3);return new u(l.concat([l.from([0,r?1:2]),n,l.alloc(1),t],o))}(p,t,r);else{if(3!==d)throw new Error("unknown padding");if((h=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?c(h,p):f(h,p)}},{"./mgf":258,"./withPublic":262,"./xor":263,"bn.js":259,"browserify-rsa":59,"create-hash":97,"parse-asn1":247,randombytes:273,"safe-buffer":291}],262:[function(e,t,r){var n=e("bn.js"),i=e("safe-buffer").Buffer;t.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},{"bn.js":259,"safe-buffer":291}],263:[function(e,t,r){t.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},{}],264:[function(e,t,r){(function(e){(function(){!function(n){var i="object"==typeof r&&r&&!r.nodeType&&r,a="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(n=o);var s,u,f=2147483647,c=36,l=/^xn--/,d=/[^\x20-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,p={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,b=String.fromCharCode;function m(e){throw new RangeError(p[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(h,".")).split("."),t).join(".")}function w(e){for(var t,r,n=[],i=0,a=e.length;i<a;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<a?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function _(e){return g(e,function(e){var t="";return e>65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=b(e)}).join("")}function S(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function M(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=c)e=y(e/35);return y(n+36*e/(e+38))}function A(e){var t,r,n,i,a,o,s,u,l,d,h=[],p=e.length,b=0,g=128,v=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&m("not-basic"),h.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<p;){for(a=b,o=1,s=c;i>=p&&m("invalid-input"),((u=S(e.charCodeAt(i++)))>=c||u>y((f-b)/o))&&m("overflow"),b+=u*o,!(u<(l=s<=v?1:s>=v+26?26:s-v));s+=c)o>y(f/(d=c-l))&&m("overflow"),o*=d;v=M(b-a,t=h.length+1,0==a),y(b/t)>f-g&&m("overflow"),g+=y(b/t),b%=t,h.splice(b++,0,g)}return _(h)}function D(e){var t,r,n,i,a,o,s,u,l,d,h,p,g,v,_,S=[];for(p=(e=w(e)).length,t=128,r=0,a=72,o=0;o<p;++o)(h=e[o])<128&&S.push(b(h));for(n=i=S.length,i&&S.push("-");n<p;){for(s=f,o=0;o<p;++o)(h=e[o])>=t&&h<s&&(s=h);for(s-t>y((f-r)/(g=n+1))&&m("overflow"),r+=(s-t)*g,t=s,o=0;o<p;++o)if((h=e[o])<t&&++r>f&&m("overflow"),h==t){for(u=r,l=c;!(u<(d=l<=a?1:l>=a+26?26:l-a));l+=c)_=u-d,v=c-d,S.push(b(E(d+_%v,0))),u=y(_/v);S.push(b(E(u,0))),a=M(r,g,n==i),r=0,++n}++r,++t}return S.join("")}if(s={version:"1.4.1",ucs2:{decode:w,encode:_},decode:A,encode:D,toASCII:function(e){return v(e,function(e){return d.test(e)?"xn--"+D(e):e})},toUnicode:function(e){return v(e,function(e){return l.test(e)?A(e.slice(4).toLowerCase()):e})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return s});else if(i&&a)if(t.exports==i)a.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],265:[function(e,t,r){var n=String.prototype.replace,i=/%20/g,a="RFC1738",o="RFC3986";t.exports={default:o,formatters:{RFC1738:function(e){return n.call(e,i,"+")},RFC3986:function(e){return String(e)}},RFC1738:a,RFC3986:o}},{}],266:[function(e,t,r){var n=e("./stringify"),i=e("./parse"),a=e("./formats");t.exports={formats:a,parse:i,stringify:n}},{"./formats":265,"./parse":267,"./stringify":268}],267:[function(e,t,r){var n=e("./utils"),i=Object.prototype.hasOwnProperty,a=Array.isArray,o={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},u=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},f=function(e,t,r,a){if(e){var o=function(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&i.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var n=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),o=a?r.slice(0,a.index):r,s=[];if(o){if(!t.plainObjects&&i.call(Object.prototype,o)&&!t.allowPrototypes)return;s[s.length]=o}for(var u=0;null!==(a=n.exec(r))&&u<t.depth;){u+=1;var f=a[1].slice(1,-1);if(!t.plainObjects&&i.call(Object.prototype,f)&&!t.allowPrototypes)return;s[s.length]=a[1]}if(a){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");s[s.length]="["+r.slice(a.index)+"]"}return s}(e,r);if(o)return function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var s=i?t:u(t,r,a),f=e.length-1;f>=0;--f){var c,l=e[f];if("[]"===l&&r.parseArrays)c=n.isOverflow(s)?s:r.allowEmptyArrays&&(""===s||r.strictNullHandling&&null===s)?[]:n.combine([],s,r.arrayLimit,r.plainObjects);else{c=r.plainObjects?{__proto__:null}:{};var d="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,h=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,p=parseInt(h,10),y=!isNaN(p)&&l!==h&&String(p)===h&&p>=0&&r.parseArrays;if(r.parseArrays||""!==h)if(y&&p<r.arrayLimit)(c=[])[p]=s;else{if(y&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");y?(c[p]=s,n.markOverflow(c,p)):"__proto__"!==h&&(c[h]=s)}else c={0:s}}s=c}return s}(o,t,r,a)}};t.exports=function(e,t){var r=function(e){if(!e)return o;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?o.charset:e.charset,r=void 0===e.duplicates?o.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||o.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:o.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:o.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:o.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:o.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:o.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:o.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:o.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:o.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:o.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:o.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:o.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:o.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:o.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:o.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:o.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:o.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var c="string"==typeof e?function(e,t){var r={__proto__:null},f=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;f=f.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=t.parameterLimit===1/0?void 0:t.parameterLimit,l=f.split(t.delimiter,t.throwOnLimitExceeded?c+1:c);if(t.throwOnLimitExceeded&&l.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var d,h=-1,p=t.charset;if(t.charsetSentinel)for(d=0;d<l.length;++d)0===l[d].indexOf("utf8=")&&("utf8=%E2%9C%93"===l[d]?p="utf-8":"utf8=%26%2310003%3B"===l[d]&&(p="iso-8859-1"),h=d,d=l.length);for(d=0;d<l.length;++d)if(d!==h){var y,b,m=l[d],g=m.indexOf("]="),v=-1===g?m.indexOf("="):g+1;if(-1===v?(y=t.decoder(m,o.decoder,p,"key"),b=t.strictNullHandling?null:""):null!==(y=t.decoder(m.slice(0,v),o.decoder,p,"key"))&&(b=n.maybeMap(u(m.slice(v+1),t,a(r[y])?r[y].length:0),function(e){return t.decoder(e,o.decoder,p,"value")})),b&&t.interpretNumericEntities&&"iso-8859-1"===p&&(b=s(String(b))),m.indexOf("[]=")>-1&&(b=a(b)?[b]:b),t.comma&&a(b)&&b.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");b=n.combine([],b,t.arrayLimit,t.plainObjects)}if(null!==y){var w=i.call(r,y);w&&("combine"===t.duplicates||m.indexOf("[]=")>-1)?r[y]=n.combine(r[y],b,t.arrayLimit,t.plainObjects):w&&"last"!==t.duplicates||(r[y]=b)}}return r}(e,r):e,l=r.plainObjects?{__proto__:null}:{},d=Object.keys(c),h=0;h<d.length;++h){var p=d[h],y=f(p,c[p],r,"string"==typeof e);l=n.merge(l,y,r)}return!0===r.allowSparse?l:n.compact(l)}},{"./utils":269}],268:[function(e,t,r){var n=e("side-channel"),i=e("./utils"),a=e("./formats"),o=Object.prototype.hasOwnProperty,s={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},u=Array.isArray,f=Array.prototype.push,c=function(e,t){f.apply(e,u(t)?t:[t])},l=Date.prototype.toISOString,d=a.default,h={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:a.formatters[d],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},p={},y=function e(t,r,a,o,s,f,l,d,y,b,m,g,v,w,_,S,E,M){for(var A,D=t,k=M,O=0,x=!1;void 0!==(k=k.get(p))&&!x;){var R=k.get(t);if(O+=1,void 0!==R){if(R===O)throw new RangeError("Cyclic object value");x=!0}void 0===k.get(p)&&(O=0)}if("function"==typeof b?D=b(r,D):D instanceof Date?D=v(D):"comma"===a&&u(D)&&(D=i.maybeMap(D,function(e){return e instanceof Date?v(e):e})),null===D){if(f)return y&&!S?y(r,h.encoder,E,"key",w):r;D=""}if("string"==typeof(A=D)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||i.isBuffer(D))return y?[_(S?r:y(r,h.encoder,E,"key",w))+"="+_(y(D,h.encoder,E,"value",w))]:[_(r)+"="+_(String(D))];var C,j=[];if(void 0===D)return j;if("comma"===a&&u(D))S&&y&&(D=i.maybeMap(D,y)),C=[{value:D.length>0?D.join(",")||null:void 0}];else if(u(b))C=b;else{var q=Object.keys(D);C=m?q.sort(m):q}var I=d?String(r).replace(/\./g,"%2E"):String(r),T=o&&u(D)&&1===D.length?I+"[]":I;if(s&&u(D)&&0===D.length)return T+"[]";for(var L=0;L<C.length;++L){var U=C[L],P="object"==typeof U&&U&&void 0!==U.value?U.value:D[U];if(!l||null!==P){var B=g&&d?String(U).replace(/\./g,"%2E"):String(U),N=u(D)?"function"==typeof a?a(T,B):T:T+(g?"."+B:"["+B+"]");M.set(t,O);var F=n();F.set(p,M),c(j,e(P,N,a,o,s,f,l,d,"comma"===a&&S&&u(D)?null:y,b,m,g,v,w,_,S,E,F))}}return j};t.exports=function(e,t){var r,i=e,f=function(e){if(!e)return h;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||h.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=a.default;if(void 0!==e.format){if(!o.call(a.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,i=a.formatters[r],f=h.filter;if(("function"==typeof e.filter||u(e.filter))&&(f=e.filter),n=e.arrayFormat in s?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":h.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===e.allowDots?!0===e.encodeDotInKeys||h.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:h.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:h.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:h.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?h.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:h.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:h.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:h.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:h.encodeValuesOnly,filter:f,format:r,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:h.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:h.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:h.strictNullHandling}}(t);"function"==typeof f.filter?i=(0,f.filter)("",i):u(f.filter)&&(r=f.filter);var l=[];if("object"!=typeof i||null===i)return"";var d=s[f.arrayFormat],p="comma"===d&&f.commaRoundTrip;r||(r=Object.keys(i)),f.sort&&r.sort(f.sort);for(var b=n(),m=0;m<r.length;++m){var g=r[m],v=i[g];f.skipNulls&&null===v||c(l,y(v,g,d,p,f.allowEmptyArrays,f.strictNullHandling,f.skipNulls,f.encodeDotInKeys,f.encode?f.encoder:null,f.filter,f.sort,f.allowDots,f.serializeDate,f.format,f.formatter,f.encodeValuesOnly,f.charset,b))}var w=l.join(f.delimiter),_=!0===f.addQueryPrefix?"?":"";return f.charsetSentinel&&("iso-8859-1"===f.charset?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),w.length>0?_+w:""}},{"./formats":265,"./utils":269,"side-channel":305}],269:[function(e,t,r){var n=e("./formats"),i=e("side-channel"),a=Object.prototype.hasOwnProperty,o=Array.isArray,s=i(),u=function(e,t){return s.set(e,t),e},f=function(e){return s.has(e)},c=function(e){return s.get(e)},l=function(e,t){s.set(e,t)},d=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),h=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},p=1024;t.exports={arrayToObject:h,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t,r,n){if(f(e)){var i=c(e)+1;return e[i]=t,l(e,i),e}var a=[].concat(e,t);return a.length>r?u(h(a,{plainObjects:n}),a.length-1):a},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],a=i.obj[i.prop],s=Object.keys(a),u=0;u<s.length;++u){var f=s[u],c=a[f];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(t[t.length]={obj:a,prop:f},r[r.length]=c)}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&(n[n.length]=r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,a){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var s="",u=0;u<o.length;u+=p){for(var f=o.length>=p?o.slice(u,u+p):o,c=[],l=0;l<f.length;++l){var h=f.charCodeAt(l);45===h||46===h||95===h||126===h||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||a===n.RFC1738&&(40===h||41===h)?c[c.length]=f.charAt(l):h<128?c[c.length]=d[h]:h<2048?c[c.length]=d[192|h>>6]+d[128|63&h]:h<55296||h>=57344?c[c.length]=d[224|h>>12]+d[128|h>>6&63]+d[128|63&h]:(l+=1,h=65536+((1023&h)<<10|1023&f.charCodeAt(l)),c[c.length]=d[240|h>>18]+d[128|h>>12&63]+d[128|h>>6&63]+d[128|63&h])}s+=c.join("")}return s},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:f,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:u,maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r[r.length]=t(e[n]);return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(o(t)){var i=t.length;if(n&&"number"==typeof n.arrayLimit&&i>n.arrayLimit)return u(h(t.concat(r),n),i);t[i]=r}else{if(!t||"object"!=typeof t)return[t,r];if(f(t)){var s=c(t)+1;t[s]=r,l(t,s)}else{if(n&&n.strictMerge)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!a.call(Object.prototype,r))&&(t[r]=!0)}}return t}if(!t||"object"!=typeof t){if(f(r)){for(var d=Object.keys(r),p=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},y=0;y<d.length;y++){p[parseInt(d[y],10)+1]=r[d[y]]}return u(p,c(r)+1)}var b=[t].concat(r);return n&&"number"==typeof n.arrayLimit&&b.length>n.arrayLimit?u(h(b,n),b.length-1):b}var m=t;return o(t)&&!o(r)&&(m=h(t,n)),o(t)&&o(r)?(r.forEach(function(r,i){if(a.call(t,i)){var o=t[i];o&&"object"==typeof o&&r&&"object"==typeof r?t[i]=e(o,r,n):t[t.length]=r}else t[i]=r}),t):Object.keys(r).reduce(function(t,i){var o=r[i];if(a.call(t,i)?t[i]=e(t[i],o,n):t[i]=o,f(r)&&!f(t)&&u(t,c(r)),f(t)){var s=parseInt(i,10);String(s)===i&&s>=0&&s>c(t)&&l(t,s)}return t},m)}}},{"./formats":265,"side-channel":305}],270:[function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var f=e.length;u>0&&f>u&&(f=u);for(var c=0;c<f;++c){var l,d,h,p,y=e[c].replace(s,"%20"),b=y.indexOf(r);b>=0?(l=y.substr(0,b),d=y.substr(b+1)):(l=y,d=""),h=decodeURIComponent(l),p=decodeURIComponent(d),n(o,h)?i(o[h])?o[h].push(p):o[h]=[o[h],p]:o[h]=p}return o};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],271:[function(e,t,r){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?a(o(e),function(o){var s=encodeURIComponent(n(o))+r;return i(e[o])?a(e[o],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[o]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],272:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":270,"./encode":271}],273:[function(e,t,r){(function(r,n){(function(){var i=65536,a=4294967295;var o=e("safe-buffer").Buffer,s=n.crypto||n.msCrypto;s&&s.getRandomValues?t.exports=function(e,t){if(e>a)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(e);if(e>0)if(e>i)for(var u=0;u<e;u+=i)s.getRandomValues(n.slice(u,u+i));else s.getRandomValues(n);if("function"==typeof t)return r.nextTick(function(){t(null,n)});return n}: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)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:256,"safe-buffer":291}],274:[function(e,t,r){(function(t,n){(function(){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var a=e("safe-buffer"),o=e("randombytes"),s=a.Buffer,u=a.kMaxLength,f=n.crypto||n.msCrypto,c=Math.pow(2,32)-1;function l(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>c||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function d(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>c||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function h(e,r,n,i){if(t.browser){var a=e.buffer,s=new Uint8Array(a,r,n);return f.getRandomValues(s),i?void t.nextTick(function(){i(null,e)}):e}if(!i)return o(n).copy(e,r),e;o(n,function(t,n){if(t)return i(t);n.copy(e,r),i(null,e)})}f&&f.getRandomValues||!t.browser?(r.randomFill=function(e,t,r,i){if(!(s.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)i=t,t=0,r=e.length;else if("function"==typeof r)i=r,r=e.length-t;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return l(t,e.length),d(r,t,e.length),h(e,t,r,i)},r.randomFillSync=function(e,t,r){void 0===t&&(t=0);if(!(s.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');l(t,e.length),void 0===r&&(r=e.length-t);return d(r,t,e.length),h(e,t,r)}):(r.randomFill=i,r.randomFillSync=i)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:256,randombytes:273,"safe-buffer":291}],275:[function(e,t,r){var n=e("buffer").Buffer,i=e("inherits"),a=e("hash-base"),o=new Array(16),s=[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],f=[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],c=[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],l=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function h(e,t){return e<<t|e>>>32-t}function p(e,t,r,n,i,a,o,s){return h(e+(t^r^n)+a+o|0,s)+i|0}function y(e,t,r,n,i,a,o,s){return h(e+(t&r|~t&n)+a+o|0,s)+i|0}function b(e,t,r,n,i,a,o,s){return h(e+((t|~r)^n)+a+o|0,s)+i|0}function m(e,t,r,n,i,a,o,s){return h(e+(t&n|r&~n)+a+o|0,s)+i|0}function g(e,t,r,n,i,a,o,s){return h(e+(t^(r|~n))+a+o|0,s)+i|0}function v(){a.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}i(v,a),v.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,v=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,E=0|this._d,M=0|this._e,A=0;A<80;A+=1){var D,k;A<16?(D=p(r,n,i,a,v,e[s[A]],l[0],f[A]),k=g(w,_,S,E,M,e[u[A]],d[0],c[A])):A<32?(D=y(r,n,i,a,v,e[s[A]],l[1],f[A]),k=m(w,_,S,E,M,e[u[A]],d[1],c[A])):A<48?(D=b(r,n,i,a,v,e[s[A]],l[2],f[A]),k=b(w,_,S,E,M,e[u[A]],d[2],c[A])):A<64?(D=m(r,n,i,a,v,e[s[A]],l[3],f[A]),k=y(w,_,S,E,M,e[u[A]],d[3],c[A])):(D=g(r,n,i,a,v,e[s[A]],l[4],f[A]),k=p(w,_,S,E,M,e[u[A]],d[4],c[A])),r=v,v=a,a=h(i,10),i=n,n=D,w=M,M=E,E=h(S,10),S=_,_=k}var O=this._b+i+E|0;this._b=this._c+a+M|0,this._c=this._d+v+w|0,this._d=this._e+r+_|0,this._e=this._a+n+S|0,this._a=O},v.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,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 e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=v},{buffer:83,"hash-base":276,inherits:189}],276:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("./to-buffer"),a=e("readable-stream").Transform;function o(e){a.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(o,a),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(this._finalized)throw new Error("Digest already called");for(var r=i(e,t),n=this._block,a=0;this._blockOffset+r.length-a>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)n[o]=r[a],o+=1,a+=1;this._update(),this._blockOffset=0}for(;a<r.length;)n[this._blockOffset]=r[a],this._blockOffset+=1,a+=1;for(var s=0,u=8*r.length;u>0;++s)this._length[s]+=u,(u=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*u);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},{"./to-buffer":277,inherits:189,"readable-stream":288,"safe-buffer":291}],277:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("to-buffer"),a="undefined"!=typeof Uint8Array,o=a&&"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView;t.exports=function(e,t){if("string"==typeof e||n.isBuffer(e)||a&&e instanceof Uint8Array||o&&o(e))return i(e,t);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')}},{"safe-buffer":291,"to-buffer":345}],278:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],279:[function(e,t,r){arguments[4][67][0].apply(r,arguments)},{"./_stream_readable":281,"./_stream_writable":283,"core-util-is":94,dup:67,inherits:189,"process-nextick-args":255}],280:[function(e,t,r){arguments[4][68][0].apply(r,arguments)},{"./_stream_transform":282,"core-util-is":94,dup:68,inherits:189}],281:[function(e,t,r){(function(r,n){(function(){var i=e("process-nextick-args");t.exports=v;var a,o=e("isarray");v.ReadableState=g;e("events").EventEmitter;var s=function(e,t){return e.listeners(t).length},u=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l=Object.create(e("core-util-is"));l.inherits=e("inherits");var d=e("util"),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,y=e("./internal/streams/BufferList"),b=e("./internal/streams/destroy");l.inherits(v,u);var m=["error","close","destroy","pause","resume"];function g(t,r){t=t||{};var n=r instanceof(a=a||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,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=e("string_decoder/").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function v(t){if(a=a||e("./_stream_duplex"),!(this instanceof v))return new v(t);this._readableState=new g(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(e,t,r,n,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,M(e)}(e,o)):(i||(a=function(e,t){var r;n=t,f.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var n;return r}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=function(e){return f.from(e)}(t)),n?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?_(e,o,t,!1):D(e,o)):_(e,o,t,!1))):n||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(o)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&M(e)),D(e,t)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(t){return p||(p=e("string_decoder/").StringDecoder),this._readableState.decoder=new p(t),this._readableState.encoding=t,this};var S=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function M(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(A,e):A(e))}function A(e){h("emit readable"),e.emit("readable"),R(e)}function D(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(k,e,t))}function k(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(h("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){h("readable nexttick read 0"),e.read(0)}function x(e,t){t.reading||(h("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(h("flow",t.flowing);t.flowing&&null!==e.read(););}function C(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;e-=i.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=f.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(a.copy(r,r.length-e,0,o),0===(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function j(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(q,t,e))}function q(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}v.prototype.read=function(e){h("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):M(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&h("length less than watermark",i=!0),t.ended||t.reading?h("reading or ended",i=!1):i&&(h("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?C(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:v;function f(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",b),e.removeListener("unpipe",f),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",y),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",f);var l=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",l);var d=!1;var p=!1;function y(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==I(a.pipes,e))&&!d&&(h("false write response, pause",a.awaitDrain),a.awaitDrain++,p=!0),n.pause())}function b(t){h("onerror",t),v(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),v()}function g(){h("onfinish"),e.removeListener("close",m),v()}function v(){h("unpipe"),n.unpipe(e)}return n.on("data",y),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=I(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&M(this):i.nextTick(O,this))}return r},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var e=this._readableState;return e.flowing||(h("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(x,e,t))}(this,e)),this},v.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},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(h("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(h("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<m.length;a++)e.on(m[a],this.emit.bind(this,m[a]));return this._read=function(t){h("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=C}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":279,"./internal/streams/BufferList":284,"./internal/streams/destroy":285,"./internal/streams/stream":286,_process:256,"core-util-is":94,events:141,inherits:189,isarray:278,"process-nextick-args":255,"safe-buffer":287,"string_decoder/":289,util:38}],282:[function(e,t,r){arguments[4][70][0].apply(r,arguments)},{"./_stream_duplex":279,"core-util-is":94,dup:70,inherits:189}],283:[function(e,t,r){(function(r,n,i){(function(){var a=e("process-nextick-args");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}t.exports=g;var s,u=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?i:a.nextTick;g.WritableState=m;var f=Object.create(e("core-util-is"));f.inherits=e("inherits");var c={deprecate:e("util-deprecate")},l=e("./internal/streams/stream"),d=e("safe-buffer").Buffer,h=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var p,y=e("./internal/streams/destroy");function b(){}function m(t,r){s=s||e("./_stream_duplex"),t=t||{};var n=r instanceof s;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,f=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(f||0===f)?f:c,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(a.nextTick(i,n),a.nextTick(M,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),M(e,t))}(e,r,n,t,i);else{var o=S(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,o,i):w(e,r,o,i)}}(r,e)},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 o(this)}function g(t){if(s=s||e("./_stream_duplex"),!(p.call(g,this)||this instanceof s))return new g(t);this._writableState=new m(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)),l.call(this)}function v(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),M(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,v(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(v(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),M(e,t)})}function M(e,t){var r=S(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}f.inherits(g,l),m.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(m.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===g&&(e&&e._writableState instanceof m)}})):p=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,d.isBuffer(n)||n instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=b),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),a.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(n,o),i=!1),i}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,a);return u}(this,i,s,e,t,r)),o},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||_(this,e))},g.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,M(e,t),r&&(t.finished?a.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("timers").setImmediate)},{"./_stream_duplex":279,"./internal/streams/destroy":285,"./internal/streams/stream":286,_process:256,"core-util-is":94,inherits:189,"process-nextick-args":255,"safe-buffer":287,timers:344,"util-deprecate":350}],284:[function(e,t,r){arguments[4][72][0].apply(r,arguments)},{dup:72,"safe-buffer":287,util:38}],285:[function(e,t,r){arguments[4][73][0].apply(r,arguments)},{dup:73,"process-nextick-args":255}],286:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{dup:74,events:141}],287:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{buffer:83,dup:75}],288:[function(e,t,r){arguments[4][76][0].apply(r,arguments)},{"./lib/_stream_duplex.js":279,"./lib/_stream_passthrough.js":280,"./lib/_stream_readable.js":281,"./lib/_stream_transform.js":282,"./lib/_stream_writable.js":283,dup:76}],289:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,"safe-buffer":290}],290:[function(e,t,r){arguments[4][75][0].apply(r,arguments)},{buffer:83,dup:75}],291:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),i=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=o),o.prototype=Object.create(i.prototype),a(i,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:83}],292:[function(e,t,r){var n=e("call-bound"),i=e("is-regex"),a=n("RegExp.prototype.exec"),o=e("es-errors/type");t.exports=function(e){if(!i(e))throw new o("`regex` must be a RegExp");return function(t){return null!==a(e,t)}}},{"call-bound":92,"es-errors/type":138,"is-regex":197}],293:[function(e,t,r){var n=e("get-intrinsic"),i=e("define-data-property"),a=e("has-property-descriptors")(),o=e("gopd"),s=e("es-errors/type"),u=n("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,f=!0;if("length"in e&&o){var c=o(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(f=!1)}return(n||f||!r)&&(a?i(e,"length",t,!0,!0):i(e,"length",t)),e}},{"define-data-property":102,"es-errors/type":138,"get-intrinsic":162,gopd:167,"has-property-descriptors":168}],294:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("to-buffer");function a(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}a.prototype.update=function(e,t){e=i(e,t||"utf8");for(var r=this._block,n=this._blockSize,a=e.length,o=this._len,s=0;s<a;){for(var u=o%n,f=Math.min(a-s,n-u),c=0;c<f;c++)r[u+c]=e[s+c];s+=f,(o+=f)%n===0&&this._update(r)}return this._len+=a,this},a.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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 a=this._hash();return e?a.toString(e):a},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=a},{"safe-buffer":291,"to-buffer":345}],295:[function(e,t,r){t.exports=function(e){var r=e.toLowerCase(),n=t.exports[r];if(!n)throw new Error(r+" is not supported (we accept pull requests)");return new n},t.exports.sha=e("./sha"),t.exports.sha1=e("./sha1"),t.exports.sha224=e("./sha224"),t.exports.sha256=e("./sha256"),t.exports.sha384=e("./sha384"),t.exports.sha512=e("./sha512")},{"./sha":296,"./sha1":297,"./sha224":298,"./sha256":299,"./sha384":300,"./sha512":301}],296:[function(e,t,r){var n=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<5|e>>>27}function c(e){return e<<30|e>>>2}function l(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^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(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var d=0;d<80;++d){var h=~~(d/20),p=f(r)+l(h,n,i,a)+s+t[d]+o[h]|0;s=a,a=i,i=c(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=u},{"./hash":294,inherits:189,"safe-buffer":291}],297:[function(e,t,r){var n=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e){return e<<1|e>>>31}function c(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function d(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^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(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,s=0|this._e,u=0;u<16;++u)t[u]=e.readInt32BE(4*u);for(;u<80;++u)t[u]=f(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var h=0;h<80;++h){var p=~~(h/20),y=c(r)+d(p,n,i,a)+s+t[h]+o[p]|0;s=a,a=i,i=l(n),n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0},u.prototype._hash=function(){var e=a.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=u},{"./hash":294,inherits:189,"safe-buffer":291}],298:[function(e,t,r){var n=e("inherits"),i=e("./sha256"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,a.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 e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":294,"./sha256":299,inherits:189,"safe-buffer":291}],299:[function(e,t,r){var n=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,o=[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],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function p(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}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(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,a=0|this._d,s=0|this._e,u=0|this._f,y=0|this._g,b=0|this._h,m=0;m<16;++m)t[m]=e.readInt32BE(4*m);for(;m<64;++m)t[m]=p(t[m-2])+t[m-7]+h(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var v=b+d(s)+f(s,u,y)+o[g]+t[g]|0,w=l(r)+c(r,n,i)|0;b=y,y=u,u=s,s=a+v|0,a=i,i=n,n=r,r=v+w|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=u+this._f|0,this._g=y+this._g|0,this._h=b+this._h|0},u.prototype._hash=function(){var e=a.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=u},{"./hash":294,inherits:189,"safe-buffer":291}],300:[function(e,t,r){var n=e("inherits"),i=e("./sha512"),a=e("./hash"),o=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,a.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 e=o.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=u},{"./hash":294,"./sha512":301,inherits:189,"safe-buffer":291}],301:[function(e,t,r){var n=e("inherits"),i=e("./hash"),a=e("safe-buffer").Buffer,o=[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],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function f(e,t,r){return r^e&(t^r)}function c(e,t,r){return e&t|r&(e|t)}function l(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>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(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,a=0|this._dh,s=0|this._eh,u=0|this._fh,g=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,M=0|this._el,A=0|this._fl,D=0|this._gl,k=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var x=t[O-30],R=t[O-30+1],C=h(x,R),j=p(R,x),q=y(x=t[O-4],R=t[O-4+1]),I=b(R,x),T=t[O-14],L=t[O-14+1],U=t[O-32],P=t[O-32+1],B=j+L|0,N=C+T+m(B,j)|0;N=(N=N+q+m(B=B+I|0,I)|0)+U+m(B=B+P|0,P)|0,t[O]=N,t[O+1]=B}for(var F=0;F<160;F+=2){N=t[F],B=t[F+1];var Q=c(r,n,i),$=c(w,_,S),z=l(r,w),H=l(w,r),J=d(s,M),W=d(M,s),V=o[F],G=o[F+1],K=f(s,u,g),X=f(M,A,D),Z=k+W|0,Y=v+J+m(Z,k)|0;Y=(Y=(Y=Y+K+m(Z=Z+X|0,X)|0)+V+m(Z=Z+G|0,G)|0)+N+m(Z=Z+B|0,B)|0;var ee=H+$|0,te=z+Q+m(ee,H)|0;v=g,k=D,g=u,D=A,u=s,A=M,s=a+Y+m(M=E+Z|0,E)|0,a=i,E=S,i=n,S=_,n=r,_=w,r=Y+te+m(w=Z+ee|0,Z)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+M|0,this._fl=this._fl+A|0,this._gl=this._gl+D|0,this._hl=this._hl+k|0,this._ah=this._ah+r+m(this._al,w)|0,this._bh=this._bh+n+m(this._bl,_)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+a+m(this._dl,E)|0,this._eh=this._eh+s+m(this._el,M)|0,this._fh=this._fh+u+m(this._fl,A)|0,this._gh=this._gh+g+m(this._gl,D)|0,this._hh=this._hh+v+m(this._hl,k)|0},u.prototype._hash=function(){var e=a.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=u},{"./hash":294,inherits:189,"safe-buffer":291}],302:[function(e,t,r){var n=e("object-inspect"),i=e("es-errors/type"),a=function(e,t,r){for(var n,i=e;null!=(n=i.next);i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return a(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=a(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!a(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=a(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},{"es-errors/type":138,"object-inspect":241}],303:[function(e,t,r){var n=e("get-intrinsic"),i=e("call-bound"),a=e("object-inspect"),o=e("es-errors/type"),s=n("%Map%",!0),u=i("Map.prototype.get",!0),f=i("Map.prototype.set",!0),c=i("Map.prototype.has",!0),l=i("Map.prototype.delete",!0),d=i("Map.prototype.size",!0);t.exports=!!s&&function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+a(e))},delete:function(t){if(e){var r=l(e,t);return 0===d(e)&&(e=void 0),r}return!1},get:function(t){if(e)return u(e,t)},has:function(t){return!!e&&c(e,t)},set:function(t,r){e||(e=new s),f(e,t,r)}};return t}},{"call-bound":92,"es-errors/type":138,"get-intrinsic":162,"object-inspect":241}],304:[function(e,t,r){var n=e("get-intrinsic"),i=e("call-bound"),a=e("object-inspect"),o=e("side-channel-map"),s=e("es-errors/type"),u=n("%WeakMap%",!0),f=i("WeakMap.prototype.get",!0),c=i("WeakMap.prototype.set",!0),l=i("WeakMap.prototype.has",!0),d=i("WeakMap.prototype.delete",!0);t.exports=u?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new s("Side channel does not contain "+a(e))},delete:function(r){if(u&&r&&("object"==typeof r||"function"==typeof r)){if(e)return d(e,r)}else if(o&&t)return t.delete(r);return!1},get:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&e?f(e,r):t&&t.get(r)},has:function(r){return u&&r&&("object"==typeof r||"function"==typeof r)&&e?l(e,r):!!t&&t.has(r)},set:function(r,n){u&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new u),c(e,r,n)):o&&(t||(t=o()),t.set(r,n))}};return r}:o},{"call-bound":92,"es-errors/type":138,"get-intrinsic":162,"object-inspect":241,"side-channel-map":303}],305:[function(e,t,r){var n=e("es-errors/type"),i=e("object-inspect"),a=e("side-channel-list"),o=e("side-channel-map"),s=e("side-channel-weakmap")||o||a;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+i(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=s()),e.set(t,r)}};return t}},{"es-errors/type":138,"object-inspect":241,"side-channel-list":302,"side-channel-map":303,"side-channel-weakmap":304}],306:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",function(e){n.push(e)}),t.once("end",function(){r&&r(null,e.concat(n)),r=null}),t.once("error",function(e){r&&r(e),r=null})}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83}],307:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=l;const n=e("simple-concat"),i=e("decompress-response"),a=e("http"),o=e("https"),s=e("once"),u=e("querystring"),f=e("url"),c=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function l(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=s(t),e.url){const{hostname:t,port:r,protocol:n,auth:i,path:a}=f.parse(e.url);delete e.url,t||r||n||i?Object.assign(e,{hostname:t,port:r,protocol:n,auth:i,path:a}):e.path=a}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach(t=>n[t.toLowerCase()]=e.headers[t]),e.headers=n,e.body?d=e.json&&!c(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:u.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),c(d)||(e.headers["content-length"]=r.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const h=e.hostname,p=("https:"===e.protocol?o:a).request(e,r=>{if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();const n=f.parse(e.url).hostname;return null!==n&&n!==h&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0===e.maxRedirects--?t(new Error("too many redirects")):l(e,t)}const n="function"==typeof i&&"HEAD"!==e.method;t(null,n?i(r):r)});return p.on("timeout",()=>{p.abort(),t(new Error("Request timed out"))}),p.on("error",t),c(d)?d.on("error",t).pipe(p):p.end(d),p}l.concat=(e,t)=>l(e,(r,i)=>{if(r)return t(r);n(i,(r,n)=>{if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,i,n)}t(null,i,n)})}),["get","post","put","patch","head","delete"].forEach(e=>{l[e]=(t,r)=>("string"==typeof t&&(t={url:t}),l(Object.assign({method:e.toUpperCase()},t),r))})}).call(this)}).call(this,e("buffer").Buffer)},{buffer:83,"decompress-response":38,http:323,https:187,once:242,querystring:272,"simple-concat":306,url:349}],308:[function(e,t,r){t.exports=i;var n=e("events").EventEmitter;function i(){n.call(this)}e("inherits")(i,n),i.Readable=e("readable-stream/lib/_stream_readable.js"),i.Writable=e("readable-stream/lib/_stream_writable.js"),i.Duplex=e("readable-stream/lib/_stream_duplex.js"),i.Transform=e("readable-stream/lib/_stream_transform.js"),i.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),i.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var o=!1;function s(){o||(o=!0,e.end())}function u(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function f(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",a),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",f),e.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",f),e.on("error",f),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},{events:141,inherits:189,"readable-stream/lib/_stream_duplex.js":310,"readable-stream/lib/_stream_passthrough.js":311,"readable-stream/lib/_stream_readable.js":312,"readable-stream/lib/_stream_transform.js":313,"readable-stream/lib/_stream_writable.js":314,"readable-stream/lib/internal/streams/end-of-stream.js":318,"readable-stream/lib/internal/streams/pipeline.js":320}],309:[function(e,t,r){var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,i,o,s;if("string"==typeof t&&(i="not ",t.substr(!o||o<0?0:+o,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var u=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(u," ").concat(n," ").concat(a(t,"type"))}return s+=". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],310:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(f,i);for(var o=n(a.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=a.prototype[u])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":312,"./_stream_writable":314,_process:256,inherits:189}],311:[function(e,t,r){t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":313,inherits:189}],312:[function(e,t,r){(function(r,n){(function(){var i;t.exports=A,A.ReadableState=M;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},o=e("./internal/streams/stream"),s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,c=e("util");f=c&&c.debuglog?c.debuglog("stream"):function(){};var l,d,h,p=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),b=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(A,o);var S=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function M(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(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&&(l||(l=e("string_decoder/").StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||e("./_stream_duplex"),!(this instanceof A))return new A(t);var r=this instanceof i;this._readableState=new M(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function D(e,t,r,n,i){f("readableAddChunk",t);var a,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(f("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,o);else if(i||(a=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(o,t)),a)S(e,a);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)o.endEmitted?S(e,new _):k(e,o,t,!0);else if(o.ended)S(e,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?k(e,o,t,!1):j(e,o)):k(e,o,t,!1)}else n||(o.reading=!1,j(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function k(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),j(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),D(this,e,t,!1,r)},A.prototype.unshift=function(e){return D(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){l||(l=e("string_decoder/").StringDecoder);var r=new l(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var O=1073741824;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(C,e))}function C(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function j(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(q,e,t))}function q(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(f("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function T(e){f("readable nexttick read 0"),e.read(0)}function L(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(N,t,e))}function N(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):R(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",i=!0),t.ended||t.reading?f("reading or ended",i=!1):i&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(r,t))),null===(n=e>0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new w("_read()"))},A.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function s(t,r){f("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function u(){f("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,U(e))}}(n);e.on("drain",c);var l=!1;function d(t){f("ondata");var r=e.write(t);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!l&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){f("onerror",t),b(),e.removeListener("error",h),0===a(e,"error")&&S(e,t)}function p(){e.removeListener("finish",y),b()}function y(){f("onfinish"),e.removeListener("close",p),b()}function b(){f("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(T,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},A.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(L,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(f("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){f("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(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(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=P,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===h&&(h=e("./internal/streams/from")),h(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":309,"./_stream_duplex":310,"./internal/streams/async_iterator":315,"./internal/streams/buffer_list":316,"./internal/streams/destroy":317,"./internal/streams/from":319,"./internal/streams/state":321,"./internal/streams/stream":322,_process:256,buffer:83,events:141,inherits:189,"string_decoder/":342,util:38}],313:[function(e,t,r){t.exports=c;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function f(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",l)}function l(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new o;return e.push(null)}e("inherits")(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":309,"./_stream_duplex":310,inherits:189}],314:[function(e,t,r){(function(r,n){(function(){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=A,A.WritableState=M;var o={deprecate:e("util-deprecate")},s=e("./internal/streams/stream"),u=e("buffer").Buffer,f=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,h=e("../errors").codes,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;function E(){}function M(t,n,o){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof a),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if("function"!=typeof a)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(C,e,t),e._writableState.errorEmitted=!0,S(e,i)):(a(i),e._writableState.errorEmitted=!0,S(e,i),C(e,t))}(e,n,i,t,a);else{var o=x(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||O(e,n),i?r.nextTick(k,e,n,o,a):k(e,n,o,a)}}(n,e)},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 r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(A,this))return new A(t);this._writableState=new M(t,this,r),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)),s.call(this)}function D(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)a[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;a.allBuffers=u,D(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(D(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var n=x(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(A,s),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(M.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===A&&(e&&e._writableState instanceof M)}})):c=function(e){return e instanceof this},A.prototype.pipe=function(){S(this,new m)},A.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,u.isBuffer(i)||i instanceof f);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=E),a.ending?function(e,t){var n=new w;S(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a;return null===n?a=new v:"string"==typeof n||t.objectMode||(a=new p("chunk",["string","Buffer"],n)),!a||(S(e,a),r.nextTick(i,a),!1)}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else D(e,t,!1,s,n,i,a);return f}(this,a,s,e,t,n)),o},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,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(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),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(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":309,"./_stream_duplex":310,"./internal/streams/destroy":317,"./internal/streams/state":321,"./internal/streams/stream":322,_process:256,buffer:83,inherits:189,"util-deprecate":350}],315:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[o]=null,e[s]=null,t(h(r,!1)))}}function y(e){r.nextTick(p,e)}var b=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[u]?n(e[u]):t(h(void 0,!0))})});var n,i=this[c];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[f]?r(h(void 0,!0)):t[l](r,n)},n)}}(i,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(h(a,!1));n=new Promise(this[l])}return this[c]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),n),b);t.exports=function(e){var t,r=Object.create(m,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[o]=null,r[s]=null,e(h(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[c]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[c]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[f]=!0}),e.on("readable",y.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":318,_process:256}],316:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var u=e("buffer").Buffer,f=e("util").inspect,c=f&&f.custom||"inspect";function l(e,t,r){u.prototype.copy.call(e,t,r)}t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)l(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0===(e-=a)){a===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return f(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:83,util:38}],317:[function(e,t,r){(function(e){(function(){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(a?a(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){!a&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):a?(e.nextTick(n,o),a(t)):e.nextTick(n,o)}),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:256}],318:[function(e,t,r){var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||i);var o=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||c()},f=t._writableState&&t._writableState.finished,c=function(){s=!1,f=!0,o||a.call(t)},l=t._readableState&&t._readableState.endEmitted,d=function(){o=!1,l=!0,s||a.call(t)},h=function(e){a.call(t,e)},p=function(){var e;return o&&!l?(t._readableState&&t._readableState.ended||(e=new n),a.call(t,e)):s&&!f?(t._writableState&&t._writableState.ended||(e=new n),a.call(t,e)):void 0},y=function(){t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?s&&!t._writableState&&(t.on("end",u),t.on("close",u)):(t.on("complete",c),t.on("abort",p),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",c),!1!==r.error&&t.on("error",h),t.on("close",p),function(){t.removeListener("complete",c),t.removeListener("abort",p),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",h),t.removeListener("close",p)}}},{"../../../errors":309}],319:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],320:[function(e,t,r){var n;var i=e("../../../errors").codes,a=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e){e()}function f(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];var c,l=function(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a("streams");var d=r.map(function(t,i){var a=i<r.length-1;return function(t,r,i,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var s=!1;t.on("close",function(){s=!0}),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},function(e){if(e)return a(e);s=!0,a()});var u=!1;return function(e){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void a(e||new o("pipe"))}}(t,a,i>0,function(e){c||(c=e),e&&d.forEach(u),a||(d.forEach(u),l(c))})});return r.reduce(f)}},{"../../../errors":309,"./end-of-stream":318}],321:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(i?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":309}],322:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{dup:74,events:141}],323:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),i=e("./lib/response"),a=e("xtend"),o=e("builtin-status-codes"),s=e("url"),u=r;u.request=function(e,r){e="string"==typeof e?s.parse(e):a(e);var i=-1===t.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||i,u=e.hostname||e.host,f=e.port,c=e.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),e.url=(u?o+"//"+u:"")+(f?":"+f:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var l=new n(e);return r&&l.on("response",r),l},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=o,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":325,"./lib/response":326,"builtin-status-codes":84,url:349,xtend:357}],324:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}r.fetch=a(e.fetch)&&a(e.ReadableStream),r.writableStream=a(e.WritableStream),r.abortController=a(e.AbortController),r.arraybuffer=r.fetch||i("arraybuffer"),r.msstream=!r.fetch&&i("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&i("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&a(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],325:[function(e,t,r){(function(r,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("./response"),u=e("readable-stream"),f=s.IncomingMessage,c=s.readyStates;var l=t.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+i.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};o(l,u.Writable),l.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},l.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},l.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},l.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var i=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(i["content-type"]||{}).value||""}));var s=[];if(Object.keys(i).forEach(function(e){var t=i[e].name,r=i[e].value;Array.isArray(r)?r.forEach(function(e){s.push([t,e])}):s.push([t,r])}),"fetch"===e._mode){var u=null;if(a.abortController){var f=new AbortController;u=f.signal,e._fetchAbortController=f,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:s,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:u}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)})}else{var l=e._xhr=new n.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),s.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{l.send(o)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}}}},l.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},l.prototype._connect=function(){var e=this;e._destroyed||(e._response=new f(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},l.prototype._write=function(e,t,r){this._body.push(e),r()},l.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout(function(){t.emit("timeout")},t._socketTimeout))},l.prototype.abort=l.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},l.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},l.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},l.prototype.flushHeaders=function(){},l.prototype.setNoDelay=function(){},l.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":324,"./response":326,_process:256,buffer:83,inherits:189,"readable-stream":341}],326:[function(e,t,r){(function(t,n,i){(function(){var a=e("./capability"),o=e("inherits"),s=e("readable-stream"),u=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=r.IncomingMessage=function(e,r,n,o){var u=this;if(s.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",function(){t.nextTick(function(){u.emit("close")})}),"fetch"===n){if(u._fetchResponse=r,u.url=r.url,u.statusCode=r.status,u.statusMessage=r.statusText,r.headers.forEach(function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)}),a.writableStream){var f=new WritableStream({write:function(e){return o(!1),new Promise(function(t,r){u._destroyed?r():u.push(i.from(e))?t():u._resumeFetch=t})},close:function(){o(!0),u._destroyed||u.push(null)},abort:function(e){o(!0),u._destroyed||u.emit("error",e)}});try{return void r.body.pipeTo(f).catch(function(e){o(!0),u._destroyed||u.emit("error",e)})}catch(p){}}var c=r.body.getReader();function h(){c.read().then(function(e){u._destroyed||(o(e.done),e.done?u.push(null):(u.push(i.from(e.value)),h()))}).catch(function(e){o(!0),u._destroyed||u.emit("error",e)})}h()}else{if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}}),u._charset="x-user-defined",!a.overrideMimeType){var l=u.rawHeaders["mime-type"];if(l){var d=l.match(/;\s*charset=([^;])(;|$)/);d&&(u._charset=d[1].toLowerCase())}u._charset||(u._charset="utf-8")}}};o(f,s.Readable),f.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},f.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,a=null;switch(t._mode){case"text":if((a=r.responseText).length>t._pos){var o=a.substr(t._pos);if("x-user-defined"===t._charset){for(var s=i.alloc(o.length),f=0;f<o.length;f++)s[f]=255&o.charCodeAt(f);t.push(s)}else t.push(o,t._charset);t._pos=a.length}break;case"arraybuffer":if(r.readyState!==u.DONE||!r.response)break;a=r.response,t.push(i.from(new Uint8Array(a)));break;case"moz-chunked-arraybuffer":if(a=r.response,r.readyState!==u.LOADING||!a)break;t.push(i.from(new Uint8Array(a)));break;case"ms-stream":if(a=r.response,r.readyState!==u.LOADING)break;var c=new n.MSStreamReader;c.onprogress=function(){c.result.byteLength>t._pos&&(t.push(i.from(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){e(!0),t.push(null)},c.readAsArrayBuffer(a)}t._xhr.readyState===u.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":324,_process:256,buffer:83,inherits:189,"readable-stream":341}],327:[function(e,t,r){arguments[4][309][0].apply(r,arguments)},{dup:309}],328:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var i=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(f,i);for(var o=n(a.prototype),s=0;s<o.length;s++){var u=o[s];f.prototype[u]||(f.prototype[u]=a.prototype[u])}function f(e){if(!(this instanceof f))return new f(e);i.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":330,"./_stream_writable":332,_process:256,inherits:189}],329:[function(e,t,r){arguments[4][311][0].apply(r,arguments)},{"./_stream_transform":331,dup:311,inherits:189}],330:[function(e,t,r){(function(r,n){(function(){var i;t.exports=A,A.ReadableState=M;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},o=e("./internal/streams/stream"),s=e("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,c=e("util");f=c&&c.debuglog?c.debuglog("stream"):function(){};var l,d,h,p=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),b=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,g=m.ERR_INVALID_ARG_TYPE,v=m.ERR_STREAM_PUSH_AFTER_EOF,w=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(A,o);var S=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function M(t,r,n){i=i||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=b(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&&(l||(l=e("string_decoder/").StringDecoder),this.decoder=new l(t.encoding),this.encoding=t.encoding)}function A(t){if(i=i||e("./_stream_duplex"),!(this instanceof A))return new A(t);var r=this instanceof i;this._readableState=new M(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function D(e,t,r,n,i){f("readableAddChunk",t);var a,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(f("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?R(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}(e,o);else if(i||(a=function(e,t){var r;n=t,s.isBuffer(n)||n instanceof u||"string"==typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(o,t)),a)S(e,a);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),n)o.endEmitted?S(e,new _):k(e,o,t,!0);else if(o.ended)S(e,new v);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?k(e,o,t,!1):j(e,o)):k(e,o,t,!1)}else n||(o.reading=!1,j(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function k(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&R(e)),j(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=s.from(e,t),t=""),r=!0),D(this,e,t,!1,r)},A.prototype.unshift=function(e){return D(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){l||(l=e("string_decoder/").StringDecoder);var r=new l(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var O=1073741824;function x(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function R(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(C,e))}function C(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function j(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(q,e,t))}function q(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(f("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function T(e){f("readable nexttick read 0"),e.read(0)}function L(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function B(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(N,t,e))}function N(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):R(this),null;if(0===(e=x(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",i=!0),t.ended||t.reading?f("reading or ended",i=!1):i&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=x(r,t))),null===(n=e>0?P(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){S(this,new w("_read()"))},A.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?u:b;function s(t,r){f("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),e.removeListener("close",p),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",s),n.removeListener("end",u),n.removeListener("end",b),n.removeListener("data",d),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function u(){f("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,U(e))}}(n);e.on("drain",c);var l=!1;function d(t){f("ondata");var r=e.write(t);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!l&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function h(t){f("onerror",t),b(),e.removeListener("error",h),0===a(e,"error")&&S(e,t)}function p(){e.removeListener("finish",y),b()}function y(){f("onfinish"),e.removeListener("close",p),b()}function b(){f("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",y),e.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var n=o.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?R(this):i.reading||r.nextTick(T,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},A.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(L,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(f("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i)||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){f("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(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(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=P,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===h&&(h=e("./internal/streams/from")),h(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":327,"./_stream_duplex":328,"./internal/streams/async_iterator":333,"./internal/streams/buffer_list":334,"./internal/streams/destroy":335,"./internal/streams/from":337,"./internal/streams/state":339,"./internal/streams/stream":340,_process:256,buffer:83,events:141,inherits:189,"string_decoder/":342,util:38}],331:[function(e,t,r){arguments[4][313][0].apply(r,arguments)},{"../errors":327,"./_stream_duplex":328,dup:313,inherits:189}],332:[function(e,t,r){(function(r,n){(function(){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=A,A.WritableState=M;var o={deprecate:e("util-deprecate")},s=e("./internal/streams/stream"),u=e("buffer").Buffer,f=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,l=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,h=e("../errors").codes,p=h.ERR_INVALID_ARG_TYPE,y=h.ERR_METHOD_NOT_IMPLEMENTED,b=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,v=h.ERR_STREAM_NULL_VALUES,w=h.ERR_STREAM_WRITE_AFTER_END,_=h.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;function E(){}function M(t,n,o){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof o&&(o=n instanceof a),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,a=n.writecb;if("function"!=typeof a)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,a){--t.pendingcb,n?(r.nextTick(a,i),r.nextTick(C,e,t),e._writableState.errorEmitted=!0,S(e,i)):(a(i),e._writableState.errorEmitted=!0,S(e,i),C(e,t))}(e,n,i,t,a);else{var o=x(n)||e.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||O(e,n),i?r.nextTick(k,e,n,o,a):k(e,n,o,a)}}(n,e)},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 r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(A,this))return new A(t);this._writableState=new M(t,this,r),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)),s.call(this)}function D(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function O(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)a[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;a.allBuffers=u,D(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,l=r.callback;if(D(e,t,!1,t.objectMode?1:f.length,f,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)})}function C(e,t){var n=x(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return n}e("inherits")(A,s),M.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(M.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===A&&(e&&e._writableState instanceof M)}})):c=function(e){return e instanceof this},A.prototype.pipe=function(){S(this,new m)},A.prototype.write=function(e,t,n){var i,a=this._writableState,o=!1,s=!a.objectMode&&(i=e,u.isBuffer(i)||i instanceof f);return s&&!u.isBuffer(e)&&(e=function(e){return u.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=E),a.ending?function(e,t){var n=new w;S(e,n),r.nextTick(t,n)}(this,n):(s||function(e,t,n,i){var a;return null===n?a=new v:"string"==typeof n||t.objectMode||(a=new p("chunk",["string","Buffer"],n)),!a||(S(e,a),r.nextTick(i,a),!1)}(this,a,e,n))&&(a.pendingcb++,o=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=u.from(t,r));return t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else D(e,t,!1,s,n,i,a);return f}(this,a,s,e,t,n)),o},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||O(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,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(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var i=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n),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(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":327,"./_stream_duplex":328,"./internal/streams/destroy":335,"./internal/streams/state":339,"./internal/streams/stream":340,_process:256,buffer:83,inherits:189,"util-deprecate":350}],333:[function(e,t,r){(function(r){(function(){var n;function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),o=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),l=Symbol("handlePromise"),d=Symbol("stream");function h(e,t){return{value:e,done:t}}function p(e){var t=e[o];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[o]=null,e[s]=null,t(h(r,!1)))}}function y(e){r.nextTick(p,e)}var b=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var e=this,t=this[u];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(h(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[u]?n(e[u]):t(h(void 0,!0))})});var n,i=this[c];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[f]?r(h(void 0,!0)):t[l](r,n)},n)}}(i,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(h(a,!1));n=new Promise(this[l])}return this[c]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(h(void 0,!0))})})}),n),b);t.exports=function(e){var t,r=Object.create(m,(i(t={},d,{value:e,writable:!0}),i(t,o,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,f,{value:e._readableState.endEmitted,writable:!0}),i(t,l,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[o]=null,r[s]=null,e(h(n,!1))):(r[o]=e,r[s]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[c]=null,r[o]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[o];null!==n&&(r[c]=null,r[o]=null,r[s]=null,n(h(void 0,!0))),r[f]=!0}),e.on("readable",y.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":336,_process:256}],334:[function(e,t,r){arguments[4][316][0].apply(r,arguments)},{buffer:83,dup:316,util:38}],335:[function(e,t,r){(function(e){(function(){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var o=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(a?a(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){!a&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(n,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):a?(e.nextTick(n,o),a(t)):e.nextTick(n,o)}),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:256}],336:[function(e,t,r){arguments[4][318][0].apply(r,arguments)},{"../../../errors":327,dup:318}],337:[function(e,t,r){arguments[4][319][0].apply(r,arguments)},{dup:319}],338:[function(e,t,r){arguments[4][320][0].apply(r,arguments)},{"../../../errors":327,"./end-of-stream":336,dup:320}],339:[function(e,t,r){arguments[4][321][0].apply(r,arguments)},{"../../../errors":327,dup:321}],340:[function(e,t,r){arguments[4][74][0].apply(r,arguments)},{dup:74,events:141}],341:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":328,"./lib/_stream_passthrough.js":329,"./lib/_stream_readable.js":330,"./lib/_stream_transform.js":331,"./lib/_stream_writable.js":332,"./lib/internal/streams/end-of-stream.js":336,"./lib/internal/streams/pipeline.js":338}],342:[function(e,t,r){arguments[4][77][0].apply(r,arguments)},{dup:77,"safe-buffer":291}],343:[function(e,t,r){(function(r){(function(){var n=e("stream");function i(e,t,i){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var a=!1,o=!1,s=[],u=!1,f=new n;function c(){for(;s.length&&!f.paused;){var e=s.shift();if(null===e)return f.emit("end");f.emit("data",e)}}return f.readable=f.writable=!0,f.paused=!1,f.autoDestroy=!(i&&!1===i.autoDestroy),f.write=function(t){return e.call(this,t),!f.paused},f.queue=f.push=function(e){return u||(null===e&&(u=!0),s.push(e),c()),f},f.on("end",function(){f.readable=!1,!f.writable&&f.autoDestroy&&r.nextTick(function(){f.destroy()})}),f.end=function(e){if(!a)return a=!0,arguments.length&&f.write(e),f.writable=!1,t.call(f),!f.readable&&f.autoDestroy&&f.destroy(),f},f.destroy=function(){if(!o)return o=!0,a=!0,s.length=0,f.writable=f.readable=!1,f.emit("close"),f},f.pause=function(){if(!f.paused)return f.paused=!0,f},f.resume=function(){return f.paused&&(f.paused=!1,f.emit("resume")),c(),f.paused||f.emit("drain"),f},f}t.exports=i,i.through=i}).call(this)}).call(this,e("_process"))},{_process:256,stream:308}],344:[function(e,t,r){(function(t,n){(function(){var i=e("process/browser.js").nextTick,a=Function.prototype.apply,o=Array.prototype.slice,s={},u=0;function f(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new f(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new f(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},f.prototype.unref=f.prototype.ref=function(){},f.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=u++,n=!(arguments.length<2)&&o.call(arguments,1);return s[t]=!0,i(function(){s[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete s[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":256,timers:344}],345:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("isarray"),a=e("typed-array-buffer"),o=ArrayBuffer.isView||function(e){try{return a(e),!0}catch(e){return!1}},s="undefined"!=typeof Uint8Array,u="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,f=u&&(n.prototype instanceof Uint8Array||n.TYPED_ARRAY_SUPPORT);t.exports=function(e,t){if(n.isBuffer(e))return e.constructor&&!("isBuffer"in e)?n.from(e):e;if("string"==typeof e)return n.from(e,t);if(u&&o(e)){if(0===e.byteLength)return n.alloc(0);if(f){var r=n.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}var a=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),c=n.from(a);if(c.length===e.byteLength)return c}if(s&&e instanceof Uint8Array)return n.from(e);var l=i(e);if(l)for(var d=0;d<e.length;d+=1){var h=e[d];if("number"!=typeof h||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(l||n.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return n.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},{isarray:346,"safe-buffer":291,"typed-array-buffer":347}],346:[function(e,t,r){arguments[4][66][0].apply(r,arguments)},{dup:66}],347:[function(e,t,r){var n=e("es-errors/type"),i=e("call-bound")("TypedArray.prototype.buffer",!0),a=e("is-typed-array");t.exports=i||function(e){if(!a(e))throw new n("Not a Typed Array");return e.buffer}},{"call-bound":92,"es-errors/type":138,"is-typed-array":198}],348:[function(e,t,r){(function(e){(function(){!function(e,n){"object"==typeof r&&void 0!==t?t.exports=n():"function"==typeof define&&define.amd?define("underscore",n):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var t=e._,r=e._=n();r.noConflict=function(){return e._=t,r}}())}(this,function(){var t="1.13.8",r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},n=Array.prototype,i=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,o=n.push,s=n.slice,u=i.toString,f=i.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,d=Array.isArray,h=Object.keys,p=Object.create,y=c&&ArrayBuffer.isView,b=isNaN,m=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),v=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1;function _(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var a=Array(t+1);for(i=0;i<t;i++)a[i]=arguments[i];return a[t]=n,e.apply(this,a)}}function S(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function E(e){return void 0===e}function M(e){return!0===e||!1===e||"[object Boolean]"===u.call(e)}function A(e){var t="[object "+e+"]";return function(e){return u.call(e)===t}}var D=A("String"),k=A("Number"),O=A("Date"),x=A("RegExp"),R=A("Error"),C=A("Symbol"),j=A("ArrayBuffer"),q=A("Function"),I=r.document&&r.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof I&&(q=function(e){return"function"==typeof e||!1});var T=q,L=A("Object"),U=l&&(!/\[native code\]/.test(String(DataView))||L(new DataView(new ArrayBuffer(8)))),P="undefined"!=typeof Map&&L(new Map),B=A("DataView");var N=U?function(e){return null!=e&&T(e.getInt8)&&j(e.buffer)}:B,F=d||A("Array");function Q(e,t){return null!=e&&f.call(e,t)}var $=A("Arguments");!function(){$(arguments)||($=function(e){return Q(e,"callee")})}();var z=$;function H(e){return k(e)&&b(e)}function J(e){return function(){return e}}function W(e){return function(t){var r=e(t);return"number"==typeof r&&r>=0&&r<=w}}function V(e){return function(t){return null==t?void 0:t[e]}}var G=V("byteLength"),K=W(G),X=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var Z=c?function(e){return y?y(e)&&!N(e):K(e)&&X.test(u.call(e))}:J(!1),Y=V("length");function ee(e,t){t=function(e){for(var t={},r=e.length,n=0;n<r;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(r){return t[r]=!0,e.push(r)}}}(t);var r=v.length,n=e.constructor,a=T(n)&&n.prototype||i,o="constructor";for(Q(e,o)&&!t.contains(o)&&t.push(o);r--;)(o=v[r])in e&&e[o]!==a[o]&&!t.contains(o)&&t.push(o)}function te(e){if(!S(e))return[];if(h)return h(e);var t=[];for(var r in e)Q(e,r)&&t.push(r);return g&&ee(e,t),t}function re(e,t){var r=te(t),n=r.length;if(null==e)return!n;for(var i=Object(e),a=0;a<n;a++){var o=r[a];if(t[o]!==i[o]||!(o in i))return!1}return!0}function ne(e){return e instanceof ne?e:this instanceof ne?void(this._wrapped=e):new ne(e)}function ie(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,G(e))}ne.VERSION=t,ne.prototype.value=function(){return this._wrapped},ne.prototype.valueOf=ne.prototype.toJSON=ne.prototype.value,ne.prototype.toString=function(){return String(this._wrapped)};var ae="[object DataView]";function oe(e){if(!S(e))return[];var t=[];for(var r in e)t.push(r);return g&&ee(e,t),t}function se(e){var t=Y(e);return function(r){if(null==r)return!1;var n=oe(r);if(Y(n))return!1;for(var i=0;i<t;i++)if(!T(r[e[i]]))return!1;return e!==de||!T(r[ue])}}var ue="forEach",fe=["clear","delete"],ce=["get","has","set"],le=fe.concat(ue,ce),de=fe.concat(ce),he=["add"].concat(fe,ue,"has"),pe=P?se(le):A("Map"),ye=P?se(de):A("WeakMap"),be=P?se(he):A("Set"),me=A("WeakSet");function ge(e){for(var t=te(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=e[t[i]];return n}function ve(e){for(var t={},r=te(e),n=0,i=r.length;n<i;n++)t[e[r[n]]]=r[n];return t}function we(e){var t=[];for(var r in e)T(e[r])&&t.push(r);return t.sort()}function _e(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||null==r)return r;for(var i=1;i<n;i++)for(var a=arguments[i],o=e(a),s=o.length,u=0;u<s;u++){var f=o[u];t&&void 0!==r[f]||(r[f]=a[f])}return r}}var Se=_e(oe),Ee=_e(te),Me=_e(oe,!0);function Ae(e){if(!S(e))return{};if(p)return p(e);var t=function(){};t.prototype=e;var r=new t;return t.prototype=null,r}function De(e){return F(e)?e:[e]}function ke(e){return ne.toPath(e)}function Oe(e,t){for(var r=t.length,n=0;n<r;n++){if(null==e)return;e=e[t[n]]}return r?e:void 0}function xe(e,t,r){var n=Oe(e,ke(t));return E(n)?r:n}function Re(e){return e}function Ce(e){return e=Ee({},e),function(t){return re(t,e)}}function je(e){return e=ke(e),function(t){return Oe(t,e)}}function qe(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,a){return e.call(t,r,n,i,a)}}return function(){return e.apply(t,arguments)}}function Ie(e,t,r){return null==e?Re:T(e)?qe(e,t,r):S(e)&&!F(e)?Ce(e):je(e)}function Te(e,t){return Ie(e,t,1/0)}function Le(e,t,r){return ne.iteratee!==Te?ne.iteratee(e,t):Ie(e,t,r)}function Ue(){}function Pe(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ne.toPath=De,ne.iteratee=Te;var Be=Date.now||function(){return(new Date).getTime()};function Ne(e){var t=function(t){return e[t]},r="(?:"+te(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}}var Fe={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Qe=Ne(Fe),$e=Ne(ve(Fe)),ze=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},He=/(.)^/,Je={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},We=/\\|'|\r|\n|\u2028|\u2029/g;function Ve(e){return"\\"+Je[e]}var Ge=/^\s*(\w|\$)+\s*$/;var Ke=0;function Xe(e,t,r,n,i){if(!(n instanceof t))return e.apply(r,i);var a=Ae(e.prototype),o=e.apply(a,i);return S(o)?o:a}var Ze=_(function(e,t){var r=Ze.placeholder,n=function(){for(var i=0,a=t.length,o=Array(a),s=0;s<a;s++)o[s]=t[s]===r?arguments[i++]:t[s];for(;i<arguments.length;)o.push(arguments[i++]);return Xe(e,n,this,this,o)};return n});Ze.placeholder=ne;var Ye=_(function(e,t,r){if(!T(e))throw new TypeError("Bind must be called on a function");var n=_(function(i){return Xe(e,n,t,this,r.concat(i))});return n}),et=W(Y);function tt(e,t,r){t||0===t||(t=1/0);for(var n=[],i=0,a=0,o=Y(e)||0,s=[];;)if(a>=o){if(!s.length)break;var u=s.pop();a=u.i,e=u.v,o=Y(e)}else{var f=e[a++];s.length>=t?n[i++]=f:et(f)&&(F(f)||z(f))?(s.push({i:a,v:e}),a=0,o=Y(e=f)):r||(n[i++]=f)}return n}var rt=_(function(e,t){var r=(t=tt(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=Ye(e[n],e)}return e});var nt=_(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)}),it=Ze(nt,ne,1);function at(e){return function(){return!e.apply(this,arguments)}}function ot(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var st=Ze(ot,2);function ut(e,t,r){t=Le(t,r);for(var n,i=te(e),a=0,o=i.length;a<o;a++)if(t(e[n=i[a]],n,e))return n}function ft(e){return function(t,r,n){r=Le(r,n);for(var i=Y(t),a=e>0?0:i-1;a>=0&&a<i;a+=e)if(r(t[a],a,t))return a;return-1}}var ct=ft(1),lt=ft(-1);function dt(e,t,r,n){for(var i=(r=Le(r,n,1))(t),a=0,o=Y(e);a<o;){var s=Math.floor((a+o)/2);r(e[s])<i?a=s+1:o=s}return a}function ht(e,t,r){return function(n,i,a){var o=0,u=Y(n);if("number"==typeof a)e>0?o=a>=0?a:Math.max(a+u,o):u=a>=0?Math.min(a+1,u):a+u+1;else if(r&&a&&u)return n[a=r(n,i)]===i?a:-1;if(i!=i)return(a=t(s.call(n,o,u),H))>=0?a+o:-1;for(a=e>0?o:u-1;a>=0&&a<u;a+=e)if(n[a]===i)return a;return-1}}var pt=ht(1,ct,dt),yt=ht(-1,lt);function bt(e,t,r){var n=(et(e)?ct:ut)(e,t,r);if(void 0!==n&&-1!==n)return e[n]}function mt(e,t,r){var n,i;if(t=qe(t,r),et(e))for(n=0,i=e.length;n<i;n++)t(e[n],n,e);else{var a=te(e);for(n=0,i=a.length;n<i;n++)t(e[a[n]],a[n],e)}return e}function gt(e,t,r){t=Le(t,r);for(var n=!et(e)&&te(e),i=(n||e).length,a=Array(i),o=0;o<i;o++){var s=n?n[o]:o;a[o]=t(e[s],s,e)}return a}function vt(e){return function(t,r,n,i){var a=arguments.length>=3;return function(t,r,n,i){var a=!et(t)&&te(t),o=(a||t).length,s=e>0?0:o-1;for(i||(n=t[a?a[s]:s],s+=e);s>=0&&s<o;s+=e){var u=a?a[s]:s;n=r(n,t[u],u,t)}return n}(t,qe(r,i,4),n,a)}}var wt=vt(1),_t=vt(-1);function St(e,t,r){var n=[];return t=Le(t,r),mt(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Et(e,t,r){t=Le(t,r);for(var n=!et(e)&&te(e),i=(n||e).length,a=0;a<i;a++){var o=n?n[a]:a;if(!t(e[o],o,e))return!1}return!0}function Mt(e,t,r){t=Le(t,r);for(var n=!et(e)&&te(e),i=(n||e).length,a=0;a<i;a++){var o=n?n[a]:a;if(t(e[o],o,e))return!0}return!1}function At(e,t,r,n){return et(e)||(e=ge(e)),("number"!=typeof r||n)&&(r=0),pt(e,t,r)>=0}var Dt=_(function(e,t,r){var n,i;return T(t)?i=t:(t=ke(t),n=t.slice(0,-1),t=t[t.length-1]),gt(e,function(e){var a=i;if(!a){if(n&&n.length&&(e=Oe(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,r)})});function kt(e,t){return gt(e,je(t))}function Ot(e,t,r){var n,i,a=-1/0,o=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=et(e)?e:ge(e)).length;s<u;s++)null!=(n=e[s])&&n>a&&(a=n);else t=Le(t,r),mt(e,function(e,r,n){((i=t(e,r,n))>o||i===-1/0&&a===-1/0)&&(a=e,o=i)});return a}var xt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Rt(e){return e?F(e)?s.call(e):D(e)?e.match(xt):et(e)?gt(e,Re):ge(e):[]}function Ct(e,t,r){if(null==t||r)return et(e)||(e=ge(e)),e[Pe(e.length-1)];var n=Rt(e),i=Y(n);t=Math.max(Math.min(t,i),0);for(var a=i-1,o=0;o<t;o++){var s=Pe(o,a),u=n[o];n[o]=n[s],n[s]=u}return n.slice(0,t)}function jt(e,t){return function(r,n,i){var a=t?[[],[]]:{};return n=Le(n,i),mt(r,function(t,i){var o=n(t,i,r);e(a,t,o)}),a}}var qt=jt(function(e,t,r){Q(e,r)?e[r].push(t):e[r]=[t]}),It=jt(function(e,t,r){e[r]=t}),Tt=jt(function(e,t,r){Q(e,r)?e[r]++:e[r]=1}),Lt=jt(function(e,t,r){e[r?0:1].push(t)},!0);function Ut(e,t,r){return t in r}var Pt=_(function(e,t){var r={},n=t[0];if(null==e)return r;T(n)?(t.length>1&&(n=qe(n,t[1])),t=oe(e)):(n=Ut,t=tt(t,!1,!1),e=Object(e));for(var i=0,a=t.length;i<a;i++){var o=t[i],s=e[o];n(s,o,e)&&(r[o]=s)}return r}),Bt=_(function(e,t){var r,n=t[0];return T(n)?(n=at(n),t.length>1&&(r=t[1])):(t=gt(tt(t,!1,!1),String),n=function(e,r){return!At(t,r)}),Pt(e,n,r)});function Nt(e,t,r){return s.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))}function Ft(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[0]:Nt(e,e.length-t)}function Qt(e,t,r){return s.call(e,null==t||r?1:t)}var $t=_(function(e,t){return t=tt(t,!0,!0),St(e,function(e){return!At(t,e)})}),zt=_(function(e,t){return $t(e,t)});function Ht(e,t,r,n){M(t)||(n=r,r=t,t=!1),null!=r&&(r=Le(r,n));for(var i=[],a=[],o=0,s=Y(e);o<s;o++){var u=e[o],f=r?r(u,o,e):u;t&&!r?(o&&a===f||i.push(u),a=f):r?At(a,f)||(a.push(f),i.push(u)):At(i,u)||i.push(u)}return i}var Jt=_(function(e){return Ht(tt(e,!0,!0))});function Wt(e){for(var t=e&&Ot(e,Y).length||0,r=Array(t),n=0;n<t;n++)r[n]=kt(e,n);return r}var Vt=_(Wt);function Gt(e,t){return e._chain?ne(t).chain():t}function Kt(e){return mt(we(e),function(t){var r=ne[t]=e[t];ne.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),Gt(this,r.apply(ne,e))}}),ne}mt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];ne.prototype[e]=function(){var r=this._wrapped;return null!=r&&(t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0]),Gt(this,r)}}),mt(["concat","join","slice"],function(e){var t=n[e];ne.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),Gt(this,e)}});var Xt={__proto__:null,VERSION:t,restArguments:_,isObject:S,isNull:function(e){return null===e},isUndefined:E,isBoolean:M,isElement:function(e){return!(!e||1!==e.nodeType)},isString:D,isNumber:k,isDate:O,isRegExp:x,isError:R,isSymbol:C,isArrayBuffer:j,isDataView:N,isArray:F,isFunction:T,isArguments:z,isFinite:function(e){return!C(e)&&m(e)&&!isNaN(parseFloat(e))},isNaN:H,isTypedArray:Z,isEmpty:function(e){if(null==e)return!0;var t=Y(e);return"number"==typeof t&&(F(e)||D(e)||z(e))?0===t:0===Y(te(e))},isMatch:re,isEqual:function(e,t){for(var r=[{a:e,b:t}],n=[],i=[];r.length;){var o=r.pop();if(!0!==o){if((e=o.a)===(t=o.b)){if(0!==e||1/e==1/t)continue;return!1}if(null==e||null==t)return!1;if(e!=e){if(t!=t)continue;return!1}var s=typeof e;if("function"!==s&&"object"!==s&&"object"!=typeof t)return!1;e instanceof ne&&(e=e._wrapped),t instanceof ne&&(t=t._wrapped);var f=u.call(e);if(f!==u.call(t))return!1;if(U&&"[object Object]"==f&&N(e)){if(!N(t))return!1;f=ae}switch(f){case"[object RegExp]":case"[object String]":if(""+e==""+t)continue;return!1;case"[object Number]":r.push({a:+e,b:+t});continue;case"[object Date]":case"[object Boolean]":if(+e===+t)continue;return!1;case"[object Symbol]":if(a.valueOf.call(e)===a.valueOf.call(t))continue;return!1;case"[object ArrayBuffer]":case ae:r.push({a:ie(e),b:ie(t)});continue}var c="[object Array]"===f;if(!c&&Z(e)){if(G(e)!==G(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,d=t.constructor;if(l!==d&&!(T(l)&&l instanceof l&&T(d)&&d instanceof d)&&"constructor"in e&&"constructor"in t)return!1}for(var h=n.length;h--;)if(n[h]===e){if(i[h]===t)break;return!1}if(!(h>=0))if(n.push(e),i.push(t),r.push(!0),c){if((h=e.length)!==t.length)return!1;for(;h--;)r.push({a:e[h],b:t[h]})}else{var p,y=te(e);if(h=y.length,te(t).length!==h)return!1;for(;h--;){if(!Q(t,p=y[h]))return!1;r.push({a:e[p],b:t[p]})}}}else n.pop(),i.pop()}return!0},isMap:pe,isWeakMap:ye,isSet:be,isWeakSet:me,keys:te,allKeys:oe,values:ge,pairs:function(e){for(var t=te(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=[t[i],e[t[i]]];return n},invert:ve,functions:we,methods:we,extend:Se,extendOwn:Ee,assign:Ee,defaults:Me,create:function(e,t){var r=Ae(e);return t&&Ee(r,t),r},clone:function(e){return S(e)?F(e)?e.slice():Se({},e):e},tap:function(e,t){return t(e),e},get:xe,has:function(e,t){for(var r=(t=ke(t)).length,n=0;n<r;n++){var i=t[n];if(!Q(e,i))return!1;e=e[i]}return!!r},mapObject:function(e,t,r){t=Le(t,r);for(var n=te(e),i=n.length,a={},o=0;o<i;o++){var s=n[o];a[s]=t(e[s],s,e)}return a},identity:Re,constant:J,noop:Ue,toPath:De,property:je,propertyOf:function(e){return null==e?Ue:function(t){return xe(e,t)}},matcher:Ce,matches:Ce,times:function(e,t,r){var n=Array(Math.max(0,e));t=qe(t,r,1);for(var i=0;i<e;i++)n[i]=t(i);return n},random:Pe,now:Be,escape:Qe,unescape:$e,templateSettings:ze,template:function(e,t,r){!t&&r&&(t=r),t=Me({},t,ne.templateSettings);var n=RegExp([(t.escape||He).source,(t.interpolate||He).source,(t.evaluate||He).source].join("|")+"|$","g"),i=0,a="__p+='";e.replace(n,function(t,r,n,o,s){return a+=e.slice(i,s).replace(We,Ve),i=s+t.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":o&&(a+="';\n"+o+"\n__p+='"),t}),a+="';\n";var o,s=t.variable;if(s){if(!Ge.test(s))throw new Error("variable is not a bare identifier: "+s)}else a="with(obj||{}){\n"+a+"}\n",s="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{o=new Function(s,"_",a)}catch(e){throw e.source=a,e}var u=function(e){return o.call(this,e,ne)};return u.source="function("+s+"){\n"+a+"}",u},result:function(e,t,r){var n=(t=ke(t)).length;if(!n)return T(r)?r.call(e):r;for(var i=0;i<n;i++){var a=null==e?void 0:e[t[i]];void 0===a&&(a=r,i=n),e=T(a)?a.call(e):a}return e},uniqueId:function(e){var t=++Ke+"";return e?e+t:t},chain:function(e){var t=ne(e);return t._chain=!0,t},iteratee:Te,partial:Ze,bind:Ye,bindAll:rt,memoize:function(e,t){var r=function(n){var i=r.cache,a=""+(t?t.apply(this,arguments):n);return Q(i,a)||(i[a]=e.apply(this,arguments)),i[a]};return r.cache={},r},delay:nt,defer:it,throttle:function(e,t,r){var n,i,a,o,s=0;r||(r={});var u=function(){s=!1===r.leading?0:Be(),n=null,o=e.apply(i,a),n||(i=a=null)},f=function(){var f=Be();s||!1!==r.leading||(s=f);var c=t-(f-s);return i=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),s=f,o=e.apply(i,a),n||(i=a=null)):n||!1===r.trailing||(n=setTimeout(u,c)),o};return f.cancel=function(){clearTimeout(n),s=0,n=i=a=null},f},debounce:function(e,t,r){var n,i,a,o,s,u=function(){var f=Be()-i;t>f?n=setTimeout(u,t-f):(n=null,r||(o=e.apply(s,a)),n||(a=s=null))},f=_(function(f){return s=this,a=f,i=Be(),n||(n=setTimeout(u,t),r&&(o=e.apply(s,a))),o});return f.cancel=function(){clearTimeout(n),n=a=s=null},f},wrap:function(e,t){return Ze(t,e)},negate:at,compose:function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:ot,once:st,findKey:ut,findIndex:ct,findLastIndex:lt,sortedIndex:dt,indexOf:pt,lastIndexOf:yt,find:bt,detect:bt,findWhere:function(e,t){return bt(e,Ce(t))},each:mt,forEach:mt,map:gt,collect:gt,reduce:wt,foldl:wt,inject:wt,reduceRight:_t,foldr:_t,filter:St,select:St,reject:function(e,t,r){return St(e,at(Le(t)),r)},every:Et,all:Et,some:Mt,any:Mt,contains:At,includes:At,include:At,invoke:Dt,pluck:kt,where:function(e,t){return St(e,Ce(t))},max:Ot,min:function(e,t,r){var n,i,a=1/0,o=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=et(e)?e:ge(e)).length;s<u;s++)null!=(n=e[s])&&n<a&&(a=n);else t=Le(t,r),mt(e,function(e,r,n){((i=t(e,r,n))<o||i===1/0&&a===1/0)&&(a=e,o=i)});return a},shuffle:function(e){return Ct(e,1/0)},sample:Ct,sortBy:function(e,t,r){var n=0;return t=Le(t,r),kt(gt(e,function(e,r,i){return{value:e,index:n++,criteria:t(e,r,i)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index}),"value")},groupBy:qt,indexBy:It,countBy:Tt,partition:Lt,toArray:Rt,size:function(e){return null==e?0:et(e)?e.length:te(e).length},pick:Pt,omit:Bt,first:Ft,head:Ft,take:Ft,initial:Nt,last:function(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[e.length-1]:Qt(e,Math.max(0,e.length-t))},rest:Qt,tail:Qt,drop:Qt,compact:function(e){return St(e,Boolean)},flatten:function(e,t){return tt(e,t,!1)},without:zt,uniq:Ht,unique:Ht,union:Jt,intersection:function(e){for(var t=[],r=arguments.length,n=0,i=Y(e);n<i;n++){var a=e[n];if(!At(t,a)){var o;for(o=1;o<r&&At(arguments[o],a);o++);o===r&&t.push(a)}}return t},difference:$t,unzip:Wt,transpose:Wt,zip:Vt,object:function(e,t){for(var r={},n=0,i=Y(e);n<i;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r},range:function(e,t,r){null==t&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),i=Array(n),a=0;a<n;a++,e+=r)i[a]=e;return i},chunk:function(e,t){if(null==t||t<1)return[];for(var r=[],n=0,i=e.length;n<i;)r.push(s.call(e,n,n+=t));return r},mixin:Kt,default:ne},Zt=Kt(Xt);return Zt._=Zt,Zt})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],349:[function(e,t,r){var n=e("punycode/");function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),c=["%","/","?",";","#"].concat(f),l=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=e("qs");function g(e,t,r){if(e&&"object"==typeof e&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=-1!==i&&i<e.indexOf("#")?"?":"#",u=e.split(o);u[0]=u[0].replace(/\\/g,"/");var g=e=u.join(o);if(g=g.trim(),!r&&1===e.split("#").length){var v=s.exec(g);if(v)return this.path=g,this.href=g,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(g);if(w){var _=(w=w[0]).toLowerCase();this.protocol=_,g=g.substr(w.length)}if(r||w||g.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===g.substr(0,2);!S||w&&y[w]||(g=g.substr(2),this.slashes=!0)}if(!y[w]&&(S||w&&!b[w])){for(var E,M,A=-1,D=0;D<l.length;D++){-1!==(k=g.indexOf(l[D]))&&(-1===A||k<A)&&(A=k)}-1!==(M=-1===A?g.lastIndexOf("@"):g.lastIndexOf("@",A))&&(E=g.slice(0,M),g=g.slice(M+1),this.auth=decodeURIComponent(E)),A=-1;for(D=0;D<c.length;D++){var k;-1!==(k=g.indexOf(c[D]))&&(-1===A||k<A)&&(A=k)}-1===A&&(A=g.length),this.host=g.slice(0,A),g=g.slice(A),this.parseHost(),this.hostname=this.hostname||"";var O="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!O)for(var x=this.hostname.split(/\./),R=(D=0,x.length);D<R;D++){var C=x[D];if(C&&!C.match(d)){for(var j="",q=0,I=C.length;q<I;q++)C.charCodeAt(q)>127?j+="x":j+=C[q];if(!j.match(d)){var T=x.slice(0,D),L=x.slice(D+1),U=C.match(h);U&&(T.push(U[1]),L.unshift(U[2])),L.length&&(g="/"+L.join(".")+g),this.hostname=T.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),O||(this.hostname=n.toASCII(this.hostname));var P=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+P,this.href+=this.host,O&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!p[_])for(D=0,R=f.length;D<R;D++){var N=f[D];if(-1!==g.indexOf(N)){var F=encodeURIComponent(N);F===N&&(F=escape(N)),g=g.split(N).join(F)}}var Q=g.indexOf("#");-1!==Q&&(this.hash=g.substr(Q),g=g.slice(0,Q));var $=g.indexOf("?");if(-1!==$?(this.search=g.substr($),this.query=g.substr($+1),t&&(this.query=m.parse(this.query)),g=g.slice(0,$)):t&&(this.search="",this.query={}),g&&(this.pathname=g),b[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){P=this.pathname||"";var z=this.search||"";this.path=P+z}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,a="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(a=m.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var o=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(o=o.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),a=0;a<n.length;a++){var o=n[a];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var f=s[u];"protocol"!==f&&(r[f]=e[f])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var c=Object.keys(e),l=0;l<c.length;l++){var d=c[l];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var h=(e.pathname||"").split("/");h.length&&!(e.host=h.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==h[0]&&h.unshift(""),h.length<2&&h.unshift(""),r.pathname=h.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",m=r.search||"";r.path=p+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=v||g||r.host&&e.pathname,_=w,S=r.pathname&&r.pathname.split("/")||[],E=(h=e.pathname&&e.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===h[0]?h[0]=e.host:h.unshift(e.host)),e.host=null),w=w&&(""===h[0]||""===S[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=h;else if(h.length)S||(S=[]),S.pop(),S=S.concat(h),r.search=e.search,r.query=e.query;else if(null!=e.search){if(E)r.host=S.shift(),r.hostname=r.host,(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname);return r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var M=S.slice(-1)[0],A=(r.host||e.host||S.length>1)&&("."===M||".."===M)||""===M,D=0,k=S.length;k>=0;k--)"."===(M=S[k])?S.splice(k,1):".."===M?(S.splice(k,1),D++):D&&(S.splice(k,1),D--);if(!w&&!_)for(;D--;D)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var O,x=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(r.hostname=x?"":S.length?S.shift():"",r.host=r.hostname,(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.hostname=O.shift(),r.host=r.hostname));return(w=w||r.host&&S.length)&&!x&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},r.parse=g,r.resolve=function(e,t){return g(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?g(e,!1,!0).resolveObject(t):t},r.format=function(e){return"string"==typeof e&&(e=g(e)),e instanceof i?e.format():i.prototype.format.call(e)},r.Url=i},{"punycode/":264,qs:266}],350:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],351:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],352:[function(e,t,r){var n=e("is-arguments"),i=e("is-generator-function"),a=e("which-typed-array"),o=e("is-typed-array");function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,f="undefined"!=typeof Symbol,c=s(Object.prototype.toString),l=s(Number.prototype.valueOf),d=s(String.prototype.valueOf),h=s(Boolean.prototype.valueOf);if(u)var p=s(BigInt.prototype.valueOf);if(f)var y=s(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===c(e)}function g(e){return"[object Set]"===c(e)}function v(e){return"[object WeakMap]"===c(e)}function w(e){return"[object WeakSet]"===c(e)}function _(e){return"[object ArrayBuffer]"===c(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(_.working?_(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===c(e)}function M(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}r.isArgumentsObject=n,r.isGeneratorFunction=i,r.isTypedArray=o,r.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},r.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||M(e)},r.isUint8Array=function(e){return"Uint8Array"===a(e)},r.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},r.isUint16Array=function(e){return"Uint16Array"===a(e)},r.isUint32Array=function(e){return"Uint32Array"===a(e)},r.isInt8Array=function(e){return"Int8Array"===a(e)},r.isInt16Array=function(e){return"Int16Array"===a(e)},r.isInt32Array=function(e){return"Int32Array"===a(e)},r.isFloat32Array=function(e){return"Float32Array"===a(e)},r.isFloat64Array=function(e){return"Float64Array"===a(e)},r.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},r.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},m.working="undefined"!=typeof Map&&m(new Map),r.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},g.working="undefined"!=typeof Set&&g(new Set),r.isSet=function(e){return"undefined"!=typeof Set&&(g.working?g(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),r.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),r.isWeakSet=function(e){return w(e)},_.working="undefined"!=typeof ArrayBuffer&&_(new ArrayBuffer),r.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=M;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function D(e){return"[object SharedArrayBuffer]"===c(e)}function k(e){return void 0!==A&&(void 0===D.working&&(D.working=D(new A)),D.working?D(e):e instanceof A)}function O(e){return b(e,l)}function x(e){return b(e,d)}function R(e){return b(e,h)}function C(e){return u&&b(e,p)}function j(e){return f&&b(e,y)}r.isSharedArrayBuffer=k,r.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},r.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},r.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},r.isGeneratorObject=function(e){return"[object Generator]"===c(e)},r.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},r.isNumberObject=O,r.isStringObject=x,r.isBooleanObject=R,r.isBigIntObject=C,r.isSymbolObject=j,r.isBoxedPrimitive=function(e){return O(e)||x(e)||R(e)||C(e)||j(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(r,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},{"is-arguments":190,"is-generator-function":192,"is-typed-array":198,"which-typed-array":355}],353:[function(e,t,r){(function(t){(function(){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;r.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,o=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),s=n[r];r<a;s=n[++r])b(s)||!_(s)?o+=" "+s:o+=" "+u(s);return o},r.deprecate=function(e,n){if(void 0!==t&&!0===t.noDeprecation)return e;if(void 0===t)return function(){return r.deprecate(e,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 e.apply(this,arguments)}};var a={},o=/^$/;if(t.env.NODE_DEBUG){var s=t.env.NODE_DEBUG;s=s.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+s+"$","i")}function u(e,t){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),l(n,e,n.depth)}function f(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function c(e,t){return e}function l(e,t,n){if(e.customInspect&&t&&M(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return g(i)||(i=l(e,i,n)),i}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(e,t);if(a)return a;var o=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),E(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return d(t);if(0===o.length){if(M(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return d(t)}var f,c="",_=!1,A=["{","}"];(p(t)&&(_=!0,A=["[","]"]),M(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return w(t)&&(c=" "+RegExp.prototype.toString.call(t)),S(t)&&(c=" "+Date.prototype.toUTCString.call(t)),E(t)&&(c=" "+d(t)),0!==o.length||_&&0!=t.length?n<0?w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),f=_?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)O(t,String(o))?a.push(h(e,t,r,n,String(o),!0)):a.push("");return i.forEach(function(i){i.match(/^\d+$/)||a.push(h(e,t,r,n,i,!0))}),a}(e,t,n,s,o):o.map(function(r){return h(e,t,n,s,r,_)}),e.seen.pop(),function(e,t,r){var n=e.reduce(function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(f,c,A)):A[0]+c+A[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),O(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?l(e,u.value,null):l(e,u.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return _(e)&&"[object RegExp]"===A(e)}function _(e){return"object"==typeof e&&null!==e}function S(e){return _(e)&&"[object Date]"===A(e)}function E(e){return _(e)&&("[object Error]"===A(e)||e instanceof Error)}function M(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function D(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(o.test(e)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else a[e]=function(){};return a[e]},r.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"},r.types=e("./support/types"),r.isArray=p,r.isBoolean=y,r.isNull=b,r.isNullOrUndefined=function(e){return null==e},r.isNumber=m,r.isString=g,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=w,r.types.isRegExp=w,r.isObject=_,r.isDate=S,r.types.isDate=S,r.isError=E,r.types.isNativeError=E,r.isFunction=M,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(x&&e[x]){var t;if("function"!=typeof(t=e[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),x&&Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},r.promisify.custom=x,r.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 a=this,o=function(){return i.apply(a,arguments)};e.apply(this,r).then(function(e){t.nextTick(o.bind(null,null,e))},function(e){t.nextTick(R.bind(null,e,o))})}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this)}).call(this,e("_process"))},{"./support/isBuffer":351,"./support/types":352,_process:256,inherits:189}],354:[function(require,module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return-1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(e),function(t){r[t]=e[t]}),forEach(globals,function(t){e[t]&&(r[t]=e[t])});var a=Object_keys(r),o=n.call(r,this.code);return forEach(Object_keys(r),function(t){(t in e||-1===indexOf(a,t))&&(e[t]=r[t])}),forEach(globals,function(t){t in e||defineProp(e,t,r[t])}),document.body.removeChild(t),o},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(r){e[r]=t[r]}),r},forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}}),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}},{}],355:[function(e,t,r){(function(r){(function(){var n=e("for-each"),i=e("available-typed-arrays"),a=e("call-bind"),o=e("call-bound"),s=e("gopd"),u=e("get-proto"),f=o("Object.prototype.toString"),c=e("has-tostringtag/shams")(),l="undefined"==typeof globalThis?r:globalThis,d=i(),h=o("String.prototype.slice"),p=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(d,c&&s&&u?function(e){var t=new l[e];if(Symbol.toStringTag in t&&u){var r=u(t),n=s(r,Symbol.toStringTag);if(!n&&r){var i=u(r);n=s(i,Symbol.toStringTag)}if(n&&n.get){var o=a(n.get);y["$"+e]=o}}}:function(e){var t=new l[e],r=t.slice||t.set;if(r){var n=a(r);y["$"+e]=n}});t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!c){var t=h(f(e),8,-1);return p(d,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=h(n,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(e){}}),t}(e):null}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":34,"call-bind":91,"call-bound":92,"for-each":143,"get-proto":165,gopd:167,"has-tostringtag/shams":171}],356:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach(function(e){n[e]=i[e]}),n}}},{}],357:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],358:[function(e,t,r){
|
|
83
77
|
/**
|
|
78
|
+
* Meadow Endpoints Service Data Broker Library
|
|
79
|
+
*
|
|
84
80
|
* @license MIT
|
|
85
|
-
* @author <steven@velozo.com>
|
|
81
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
82
|
+
*/
|
|
83
|
+
const n=e("./controller/Meadow-Endpoints-Controller-Base.js"),i=e("meadow");class a{constructor(t,r){if(this._Meadow=t,this.DAL=this._Meadow,this._Controller=!1,this._ControllerOptions="object"==typeof r?r:{},"object"!=typeof t)throw new Error("Meadow endpoints requires a valid Meadow DAL object as the first parameter of the constructor.");this._ControllerOptions.hasOwnProperty("ControllerInstance")?this._Controller=this._ControllerOptions.ControllerInstance:this._ControllerOptions.hasOwnProperty("ControllerClass")?this._Controller=new this._ControllerOptions.ControllerClass(this):this._Controller=new n(this),this.EndpointVersion=this._Controller.settings.MeadowEndpointVersion||"1.0",this.EndpointName=this.DAL.scope,this.EndpointPrefix=`/${this.EndpointVersion}/${this.EndpointName}`,this._EnabledBehaviorSets={Create:!0,Read:!0,Reads:!0,Update:!0,Delete:!0,Count:!0,Schema:!0,Validate:!0,New:!0},this._Endpoints={Create:e("./endpoints/create/Meadow-Endpoint-Create.js"),Creates:e("./endpoints/create/Meadow-Endpoint-BulkCreate.js"),Read:e("./endpoints/read/Meadow-Endpoint-Read.js"),ReadMax:e("./endpoints/read/Meadow-Endpoint-ReadMax.js"),Reads:e("./endpoints/read/Meadow-Endpoint-Reads.js"),ReadsBy:e("./endpoints/read/Meadow-Endpoint-ReadsBy.js"),ReadSelectList:e("./endpoints/read/Meadow-Endpoint-ReadSelectList.js"),ReadLiteList:e("./endpoints/read/Meadow-Endpoint-ReadLiteList.js"),ReadDistinctList:e("./endpoints/read/Meadow-Endpoint-ReadDistinctList.js"),Update:e("./endpoints/update/Meadow-Endpoint-Update.js"),Updates:e("./endpoints/update/Meadow-Endpoint-BulkUpdate.js"),Upsert:e("./endpoints/upsert/Meadow-Endpoint-Upsert.js"),Upserts:e("./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js"),UpsertsDetailed:e("./endpoints/upsert/Meadow-Endpoint-BulkUpsertDetailed.js"),Delete:e("./endpoints/delete/Meadow-Endpoint-Delete.js"),Undelete:e("./endpoints/delete/Meadow-Endpoint-Undelete.js"),Count:e("./endpoints/count/Meadow-Endpoint-Count.js"),CountBy:e("./endpoints/count/Meadow-Endpoint-CountBy.js"),Schema:e("./endpoints/schema/Meadow-Endpoint-Schema.js"),Validate:e("./endpoints/schema/Meadow-Endpoint-Validate.js"),New:e("./endpoints/schema/Meadow-Endpoint-New.js")}}get controller(){return this._Controller}set controller(e){this._Controller=e}setBehaviorEndpoint(e,t){return"function"==typeof t&&(this._Endpoints[e]=t),this}connectRoute(e,t,r,n,i){let a=`${this.EndpointPrefix}${r}`,o="string"==typeof i?i:"an unnamed custom behavior";this._Controller.log.trace(`...meadow-endpoints mapping a ${t} endpoint for scope ${this.DAL.scope} on route [${a}] which runs ${o}.`);try{e[t](a,n.bind(this._Controller))}catch(e){this._Controller.log.error(`...error mapping ${i} to method ${t} for scope ${this.DAL.scope} to route [${a}]: ${e}`,e.stack)}return!0}connectRoutes(e){this._Controller.log.trace(`Creating automatic meadow endpoints at prefix [${this.EndpointPrefix}] for scope ${this.DAL.scope}...`),this._EnabledBehaviorSets.Schema&&this.connectRoute(e,"get","/Schema",this._Endpoints.Schema,"the internal behavior _Endpoints.Schema"),this._EnabledBehaviorSets.New&&this.connectRoute(e,"get","/Schema/New",this._Endpoints.New,"the internal behavior _Endpoints.New"),this._EnabledBehaviorSets.Validate&&this.connectRoute(e,"postWithBodyParser","/Schema/Validate",this._Endpoints.Validate,"the internal behavior _Endpoints.Validate"),this._EnabledBehaviorSets.Create&&(this.connectRoute(e,"postWithBodyParser","",this._Endpoints.Create,"the internal behavior _Endpoints.Create"),this.connectRoute(e,"postWithBodyParser","s",this._Endpoints.Creates,"the internal behavior _Endpoints.Creates")),this._EnabledBehaviorSets.Read&&(this.connectRoute(e,"get","/Max/:ColumnName",this._Endpoints.ReadMax,"the internal behavior _Endpoints.ReadMax"),this.connectRoute(e,"get","/:IDRecord",this._Endpoints.Read,"the internal behavior _Endpoints.Read")),this._EnabledBehaviorSets.Reads&&(this.connectRoute(e,"get","s",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/By/:ByField/:ByValue",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/By/:ByField/:ByValue/:Begin/:Cap",this._Endpoints.ReadsBy,"the internal behavior _Endpoints.ReadsBy"),this.connectRoute(e,"get","s/FilteredTo/:Filter",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","s/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads"),this.connectRoute(e,"get","Select",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","Select/:Begin/:Cap",this._Endpoints.ReadSelectList,"the internal behavior _Endpoints.ReadSelectList"),this.connectRoute(e,"get","s/Lite",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Lite/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/LiteExtended/:ExtraColumns/:Begin/:Cap",this._Endpoints.ReadLiteList,"the internal behavior _Endpoints.ReadLiteList"),this.connectRoute(e,"get","s/Distinct/:Columns",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/FilteredTo/:Filter/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/Distinct/:Columns/:Begin/:Cap",this._Endpoints.ReadDistinctList,"the internal behavior _Endpoints.ReadDistinctList"),this.connectRoute(e,"get","s/:Begin/:Cap",this._Endpoints.Reads,"the internal behavior _Endpoints.Reads")),this._EnabledBehaviorSets.Update&&(this.connectRoute(e,"putWithBodyParser","",this._Endpoints.Update,"the internal behavior _Endpoints.Update"),this.connectRoute(e,"putWithBodyParser","s",this._Endpoints.Updates,"the internal behavior _Endpoints.Updates"),this.connectRoute(e,"putWithBodyParser","/Upsert",this._Endpoints.Upsert,"the internal behavior _Endpoints.Upsert"),this.connectRoute(e,"putWithBodyParser","/Upserts",this._Endpoints.Upserts,"the internal behavior _Endpoints.Upserts"),this.connectRoute(e,"putWithBodyParser","/Upserts/Detailed",this._Endpoints.UpsertsDetailed,"the internal behavior _Endpoints.UpsertsDetailed"),this.connectRoute(e,"putWithBodyParser","/:IDRecord",this._Endpoints.Update,"the internal behavior _Endpoints.Update (by-id PUT)"),this.connectRoute(e,"patchWithBodyParser","/:IDRecord",this._Endpoints.Update,"the internal behavior _Endpoints.Update (by-id PATCH)")),this._EnabledBehaviorSets.Delete&&(this.connectRoute(e,"del","",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"del","/:IDRecord",this._Endpoints.Delete,"the internal behavior _Endpoints.Delete"),this.connectRoute(e,"get","/Undelete/:IDRecord",this._Endpoints.Undelete,"the internal behavior _Endpoints.Undelete")),this._EnabledBehaviorSets.Count&&(this.connectRoute(e,"get","s/Count",this._Endpoints.Count,"the internal behavior _Endpoints.Count"),this.connectRoute(e,"get","s/Count/By/:ByField/:ByValue",this._Endpoints.CountBy,"the internal behavior _Endpoints.CountBy"),this.connectRoute(e,"get","s/Count/FilteredTo/:Filter",this._Endpoints.Count,"the internal behavior _Endpoints.Count"))}}t.exports=a,t.exports.new=function(e,t){return new a(e,t)},t.exports.Meadow=i,t.exports.BaseController=n},{"./controller/Meadow-Endpoints-Controller-Base.js":359,"./endpoints/count/Meadow-Endpoint-Count.js":366,"./endpoints/count/Meadow-Endpoint-CountBy.js":367,"./endpoints/create/Meadow-Endpoint-BulkCreate.js":368,"./endpoints/create/Meadow-Endpoint-Create.js":369,"./endpoints/delete/Meadow-Endpoint-Delete.js":371,"./endpoints/delete/Meadow-Endpoint-Undelete.js":372,"./endpoints/read/Meadow-Endpoint-Read.js":373,"./endpoints/read/Meadow-Endpoint-ReadDistinctList.js":374,"./endpoints/read/Meadow-Endpoint-ReadLiteList.js":375,"./endpoints/read/Meadow-Endpoint-ReadMax.js":376,"./endpoints/read/Meadow-Endpoint-ReadSelectList.js":377,"./endpoints/read/Meadow-Endpoint-Reads.js":378,"./endpoints/read/Meadow-Endpoint-ReadsBy.js":379,"./endpoints/schema/Meadow-Endpoint-New.js":382,"./endpoints/schema/Meadow-Endpoint-Schema.js":383,"./endpoints/schema/Meadow-Endpoint-Validate.js":384,"./endpoints/update/Meadow-Endpoint-BulkUpdate.js":385,"./endpoints/update/Meadow-Endpoint-Update.js":386,"./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js":388,"./endpoints/upsert/Meadow-Endpoint-BulkUpsertDetailed.js":389,"./endpoints/upsert/Meadow-Endpoint-Upsert.js":390,meadow:216}],359:[function(e,t,r){e("async/waterfall");const n=e("./components/Meadow-Endpoints-Controller-Log.js"),i=e("./components/Meadow-Endpoints-Controller-Error.js"),a=e("./components/Meadow-Endpoints-Controller-BehaviorInjection.js"),o=e("./utility/Meadow-Endpoints-Filter-Parser.js"),s=e("./utility/Meadow-Endpoints-Session-Marshaler.js"),u=e("./utility/Meadow-Endpoints-Stream-RecordArray.js");t.exports=class{constructor(e){this.DAL=e.DAL,this.ControllerOptions=e._ControllerOptions,this._Settings=null,this._LogController=null,this._BehaviorInjectionController=null,this._ErrorController=null,this.waterfall=this.DAL.fable.Utility.waterfall,this.eachLimit=this.DAL.fable.Utility.eachLimit,this.extend=this.DAL.fable.Utility.extend,this.initializeDefaultUnsetControllers(this),this._FilterParser=new o(this),this._SessionMarshaler=new s(this),this._StreamRecordArray=new u(this)}initializeDefaultUnsetControllers(e){this._Settings||(this._Settings=e.DAL.fable.settings),this._Settings.hasOwnProperty("MeadowEndpointsDefaultSessionObject")||(this._Settings.MeadowEndpointsDefaultSessionObject={CustomerID:0,SessionID:"0x0000",DeviceID:"Unset",UserID:0,UserRole:"None",UserRoleIndex:0,LoggedIn:!1}),this._LogController||(this._LogController=new n(e)),this._BehaviorInjectionController||(this._BehaviorInjectionController=new a(e)),this._ErrorController||(this._ErrorController=new i(e))}initializeRequestState(e,t){let r={};return r.Verb="string"==typeof t?t:"Unnamed_Custom_Behavior",r.SessionData=this.getSessionData(e),r}cloneAsyncSafeRequestState(e,t){let r={ParentRequestState:e,SessionData:e.SessionData};return r.Verb="string"==typeof t?t:e.Verb,r}_BeginDataRequestFunction(e,t,r){return r()}beginMeadowRequest(e,t,r){this._BeginDataRequestFunction(e,t,r)}_EndDataRequestFunction(e,t,r){return r()}endMeadowRequest(e,t,r){this._EndDataRequestFunction(e,t,r)}get settings(){return this._Settings}set settings(e){this._Settings=e}get log(){return this._LogController}set log(e){this._LogController=e}get BehaviorInjection(){return this._BehaviorInjectionController}set BehaviorInjection(e){this._BehaviorInjectionController=e}get ErrorHandler(){return this._ErrorController}set ErrorHandler(e){this._ErrorController=e}parseFilter(e,t){return this._FilterParser.parseFilter(e,t)}doStreamRecordArray(e,t,r){return this._StreamRecordArray.streamRecordArray(e,t,r)}getSessionData(e){return this._SessionMarshaler.getSessionData(e)}},t.exports.BaseErrorController=i,t.exports.BaseBehaviorInjectionController=a,t.exports.BaseFilterParser=o,t.exports.BaseSessionMarshaler=s,t.exports.BaseStreamRecordArray=u},{"./components/Meadow-Endpoints-Controller-BehaviorInjection.js":360,"./components/Meadow-Endpoints-Controller-Error.js":361,"./components/Meadow-Endpoints-Controller-Log.js":362,"./utility/Meadow-Endpoints-Filter-Parser.js":363,"./utility/Meadow-Endpoints-Session-Marshaler.js":364,"./utility/Meadow-Endpoints-Stream-RecordArray.js":365,"async/waterfall":33}],360:[function(e,t,r){const n=e("underscore");t.exports=class{constructor(e){this._Controller=e,this.template=n.template,this._BehaviorFunctions={},this._Templates={},this._TemplateFunctions={}}setBehavior(e,t){this._BehaviorFunctions[e]=t}runBehavior(e,t,r,n,i){if(this._BehaviorFunctions.hasOwnProperty(e))try{return this._BehaviorFunctions[e].call(t,r,n,i)}catch(e){return i(e)}return i()}getTemplate(e){return!!this._Templates.hasOwnProperty(e)&&this._Templates[e]}setTemplate(e,t){this._Templates[e]=t,this._TemplateFunctions[e]=this.template(t)}getTemplateFunction(e){return!!this._TemplateFunctions.hasOwnProperty(e)&&this._TemplateFunctions[e]}processTemplate(e,t,r){var n=this.getTemplateFunction(e),i=void 0===t?{}:t;return!1===n&&(this.setTemplate(e,void 0===r?"":r),n=this.getTemplateFunction(e)),n(i)}}},{underscore:348}],361:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getError(e,t,r){const n=new Error(e);return n.StatusCode="number"==typeof t?t:400,n.SuppressSoftwareTrace=void 0===r||r,n}handleErrorIfSet(e,t,r,n,i){return n?this.sendError(e,t,r,n,i):i()}sendError(e,t,r,n,i){if(this._Controller.log.logRequestError(e,t,n),!this._Controller.ControllerOptions.SendErrorStatusCodes){let e=n.hasOwnProperty("StatusCode")?n.StatusCode:500;r.status(e)}let a={Error:n.message,StatusCode:n.StatusCode};a=this._Controller.ErrorHandler.prepareRequestContextOutputObject(a,e,t,n),r.send(a),i(n)}prepareRequestContextOutputObject(e,t,r,n){if(n&&(e.Error=n.message,e.Code=n.code,e.StatusCode=n.StatusCode,n.SuppressSoftwareTrace||(e.Stack=n.stack),r.hasOwnProperty("Record")&&(e.Record=r.Record),r.hasOwnProperty("Query")&&"object"==typeof r.Query&&r.Query.query&&("string"==typeof r.Query.query.body&&(e.Query=r.Query.query.body),"object"==typeof r.Query.query.parameters))){e.QueryParameters=r.Query.query.parameters,e.RebuiltQueryString="string"==typeof e.Query?e.Query:"";let t=Object.keys(e.QueryParameters);for(let r=0;r<t.length;r++)if("number"==typeof t[r])e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),`'${e.QueryParameters[t[r]]}'`);else e.RebuiltQueryString=e.RebuiltQueryString.replace(new RegExp(`:${t[r]}\\b`,"g"),e.QueryParameters[t[r]])}return e}}},{}],362:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}prepareLogData(e,t,r){return t.hasOwnProperty("Record")&&(t.Record.hasOwnProperty(this._Controller.DAL.defaultIdentifier)&&(r[this._Controller.DAL.defaultIdentifier]=t.Record[this._Controller.DAL.defaultIdentifier]),t.Record.hasOwnProperty(this._Controller.DAL.defaultGUIdentifier)&&(r[this._Controller.DAL.defaultGUIdentifier]=t.Record[this._Controller.DAL.defaultGUIdentifier])),t.hasOwnProperty("UpdatedRecords")&&(r.UpdatedRecordCount=t.UpdatedRecords.length),t.hasOwnProperty("CreatedRecords")&&(r.UpdatedRecordCount=t.CreatedRecords.length),t.hasOwnProperty("UpsertedRecords")&&(r.UpdatedRecordCount=t.UpsertedRecords.length),r}requestCompletedSuccessfully(e,t,r){let n={SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb};this._Controller.log.info(r,this.prepareLogData(e,t,n))}logRequestError(e,t,r){let n={SessionID:t.SessionData.SessionID,RequestID:e.RequestUUID,RequestURL:e.url,Scope:this._Controller.DAL.scope,Action:`${this._Controller.DAL.scope}-${t.Verb}`,Verb:t.Verb};n=this._Controller.ErrorHandler.prepareRequestContextOutputObject(n,e,t,r),this._Controller.log.error(r.message,this.prepareLogData(e,t,n))}trace(e,t){this._Controller.DAL.log.trace(e,t)}debug(e,t){this._Controller.DAL.log.debug(e,t)}info(e,t){this._Controller.DAL.log.info(e,t)}warn(e,t){this._Controller.DAL.log.warn(e,t)}error(e,t){this._Controller.DAL.log.error(e,t)}fatal(e,t){this._Controller.DAL.log.fatal(e,t)}}},{}],363:[function(e,t,r){
|
|
84
|
+
/**
|
|
85
|
+
* Meadow Endpoint Utility Class - Parse a Filter String and put it into a Query.
|
|
86
|
+
*
|
|
87
|
+
* @license MIT
|
|
88
|
+
*
|
|
89
|
+
* @author Steven Velozo <steven@velozo.com>
|
|
90
|
+
* @module Meadow
|
|
86
91
|
*/
|
|
87
|
-
var n=e("simple-get");t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,o="MeadowEndpoints",a={},i=[],u=r.settings.hasOwnProperty("MeadowEndpoints")?JSON.parse(JSON.stringify(r.settings.MeadowEndpoints)):{ServerProtocol:"http",ServerAddress:"127.0.0.1",ServerPort:"8086",ServerEndpointPrefix:"1.0/"},s=function(e){var t;e.logLevel>0&&r.log.trace(e.query.body,e.query.records);let n={url:(t=e.query.body,`${u.ServerProtocol}://${u.ServerAddress}:${u.ServerPort}/${u.ServerEndpointPrefix}${t}`),headers:r.Utility.extend({cookie:""},a)};return n.headers.cookie=i.join(";"),e.logLevel>0&&r.log.debug("Request options built...",n),n};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){var a=e.parameters.result;e.setDialect(o).buildCreateQuery();let i=s(e);if(!e.query.records.length>0)return a.error="No records passed for proxying to Meadow-Endpoints.",t();i.body=e.query.records[0],i.json=!0,n.post(i,(n,o)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e POST request connected"),n)return t(a);let i="";o.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e POST data chunk size ${t.length}b received`),i+=t}),o.on("end",()=>{if(i)try{a.value=JSON.parse(i)}catch(e){return a.error=new Error(`Failed to parse Create response as JSON: ${e.message}`),t()}const n=`ID${e.parameters.scope}`;return a.value&&a.value.hasOwnProperty(n)&&(a.value=a.value[n]),e.logLevel>0&&r.log.debug(`==> POST completed data size ${i.length}b received`,a),t()})})},Read:function(e,t){var a=e.parameters.result;e.setDialect(o).buildReadQuery();let i=s(e);n.get(i,(n,o)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(a);let i="";o.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),i+=t}),o.on("end",()=>{if(i)try{a.value=JSON.parse(i)}catch(e){return a.error=new Error(`Failed to parse Read response as JSON: ${e.message}`),t()}e.query.body.startsWith(`${e.parameters.scope}/`)&&(a.value=[a.value]),e.logLevel>0&&r.log.debug(`==> GET completed data size ${i.length}b received`,a),t()})})},Update:function(e,t){var a=e.parameters.result;e.setDialect(o).buildUpdateQuery();let i=s(e);if(!e.query.records.length>0)return a.error="No records passed for proxying to Meadow-Endpoints.",t();i.body=e.query.records[0],i.json=!0,n.put(i,(n,o)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e PUT request connected"),n)return t(a);let i="";o.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e PUT data chunk size ${t.length}b received`),i+=t}),o.on("end",()=>{if(i)try{a.value=JSON.parse(i)}catch(e){return a.error=new Error(`Failed to parse Update response as JSON: ${e.message}`),t()}return e.logLevel>0&&r.log.debug(`==> PUT completed data size ${i.length}b received`,a),t()})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect(o).buildDeleteQuery();let i=s(e);n.delete(i,(n,o)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e DEL request connected"),n)return t(a);let i="";o.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e DEL data chunk size ${t.length}b received`),i+=t}),o.on("end",()=>{if(i)try{a.value=JSON.parse(i)}catch(e){return a.error=new Error(`Failed to parse Delete response as JSON: ${e.message}`),t()}a.value&&a.value.hasOwnProperty("Count")&&(a.value=a.value.Count),e.logLevel>0&&r.log.debug(`==> DEL completed data size ${i.length}b received`,a),t()})})},Count:function(e,t){var a=e.parameters.result;e.setDialect(o).buildCountQuery();let i=s(e);n.get(i,(n,o)=>{if(a.error=n,a.executed=!0,e.logLevel>0&&r.log.debug("--\x3e GET request connected"),n)return t(a);let i="";o.on("data",t=>{e.logLevel>0&&r.log.debug(`--\x3e GET data chunk size ${t.length}b received`),i+=t}),o.on("end",()=>{if(i)try{a.value=JSON.parse(i)}catch(e){return a.error=new Error(`Failed to parse Count response as JSON: ${e.message}`),t()}try{a.value=a.value.Count}catch(t){a.value=-1,r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}e.logLevel>0&&r.log.debug(`==> GET completed data size ${i.length}b received`,a),t()})})},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{"simple-get":178}],149:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MongoDB&&(n=r.settings.MongoDB.GlobalLogLevel||0);var o=function(){return!("object"!=typeof r.MeadowMongoDBProvider||!r.MeadowMongoDBProvider.connected)&&r.MeadowMongoDBProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=new Date:"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)"_id"!==r&&(e[r]=t[r])},Create:function(e,t){var i=e.parameters.result;e.setDialect("MongoDB").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No MongoDB connection available."),i.executed=!0,t();var s=e.query.parameters.mongoOperation;if(!s)return i.error=new Error("No MongoDB operation generated."),i.executed=!0,t();var l=u.collection(s.collection),c=a(JSON.parse(JSON.stringify(s.document))),f=!1;for(var d in c)if("$$AUTOINCREMENT"===c[d]){f=d;break}f?function(e,t,r,n){var o=t+"."+r;e.collection("_meadow_counters").findOneAndUpdate({_id:o},{$inc:{seq:1}},{upsert:!0,returnDocument:"after"}).then(function(e){return n(null,e.seq)}).catch(function(e){return n(e)})}(u,s.collection,f,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();c[f]=r,l.insertOne(c).then(function(e){return i.error=null,i.value=r,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})}):l.insertOne(c).then(function(e){return i.error=null,i.value=e.insertedId,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Read:function(e,t){var a=e.parameters.result;e.setDialect("MongoDB").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MongoDB connection available."),a.executed=!0,t();var u=e.query.parameters.mongoOperation,s=i.collection(u.collection),l={};u.projection&&Object.keys(u.projection).length>0&&(l.projection=u.projection),u.sort&&Object.keys(u.sort).length>0&&(l.sort=u.sort),u.skip&&(l.skip=u.skip),u.limit&&(l.limit=u.limit),s.find(u.filter,l).toArray().then(function(e){return a.error=null,a.value=e,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},Update:function(e,t){var i=e.parameters.result;e.setDialect("MongoDB").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No MongoDB connection available."),i.executed=!0,t();var s=e.query.parameters.mongoOperation;if(!s)return i.error=new Error("No MongoDB operation generated."),i.executed=!0,t();var l=u.collection(s.collection),c=a(JSON.parse(JSON.stringify(s.update)));l.updateMany(s.filter,c).then(function(e){return i.error=null,i.value=e,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Delete:function(e,t){var i=e.parameters.result;e.setDialect("MongoDB").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No MongoDB connection available."),i.executed=!0,t();var s=e.query.parameters.mongoOperation,l=u.collection(s.collection);if("updateMany"===s.operation){var c=a(JSON.parse(JSON.stringify(s.update)));l.updateMany(s.filter,c).then(function(e){return i.error=null,i.value=e.modifiedCount,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})}else l.deleteMany(s.filter).then(function(e){return i.error=null,i.value=e.deletedCount,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Undelete:function(e,t){var i=e.parameters.result;e.setDialect("MongoDB").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No MongoDB connection available."),i.executed=!0,t();var s=e.query.parameters.mongoOperation;if(!s||"noop"===s.operation)return i.error=null,i.value=0,i.executed=!0,t();var l=u.collection(s.collection),c=a(JSON.parse(JSON.stringify(s.update)));l.updateMany(s.filter,c).then(function(e){return i.error=null,i.value=e.modifiedCount,i.executed=!0,t()}).catch(function(e){return i.error=e,i.value=!1,i.executed=!0,t()})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MongoDB").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MongoDB connection available."),a.executed=!0,t();var u=e.query.parameters.mongoOperation,s=i.collection(u.collection);if(u.distinct&&u.distinctFields&&u.distinctFields.length>0){for(var l={},c=0;c<u.distinctFields.length;c++)l[u.distinctFields[c]]="$"+u.distinctFields[c];var f=[{$match:u.filter},{$group:{_id:l}},{$count:"RowCount"}];s.aggregate(f).toArray().then(function(e){return a.error=null,a.value=e.length>0?e[0].RowCount:0,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})}else s.countDocuments(u.filter).then(function(e){return a.error=null,a.value=e,a.executed=!0,t()}).catch(function(e){return a.error=e,a.value=!1,a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowMongoDBProvider&&r.MeadowMongoDBProvider},providerCreatesSupported:!0,new:e}}()}},{}],150:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.MySQL&&(n=r.settings.MySQL.GlobalLogLevel||0);var o=function(){return"object"==typeof r.MeadowMySQLConnectionPool?r.MeadowMySQLConnectionPool:!("object"!=typeof r.MeadowMySQLProvider||!r.MeadowMySQLProvider.connected)&&r.MeadowMySQLProvider.pool};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},o={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(o[r[a].StorageColumn]=r[a].Column);for(var i in t)if(n[i])try{e[i]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[i]={}}else if(o.hasOwnProperty(i)){var u=o[i];try{e[u]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[u]={}}}else e[i]=t[i]},Create:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during create query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(n,i){o.release(),a.error=n,a.value=!1;try{a.value=i.insertId}catch(t){r.log.warn("Error getting insert ID during create query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Read:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during read query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(e,r){return o.release(),a.error=e,a.value=r,a.executed=!0,t()})})},Update:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during update query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(e,r){return o.release(),a.error=e,a.value=r,a.executed=!0,t()})})},Delete:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during delete query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(n,i){o.release(),a.error=n,a.value=!1;try{a.value=i.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Undelete:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during undelete query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(n,i){o.release(),a.error=n,a.value=!1;try{a.value=i.affectedRows}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return a.executed=!0,t()})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("MySQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No MySQL connection pool available."),a.executed=!0,t();i.getConnection(function(n,o){if(n||!o)return r.log.error("Error getting connection from MySQL pool during count query: "+(n?n.message:"no connection returned"),{Body:e.query.body}),a.error=n||new Error("No connection returned from pool."),a.executed=!0,t();o.query(e.query.body,e.query.parameters,function(n,i){o.release(),a.executed=!0,a.error=n,a.value=!1;try{a.value=i[0].RowCount}catch(t){r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})})},getProvider:function(){return"object"==typeof r.MeadowMySQLConnectionPool?r.MeadowMySQLConnectionPool:"object"==typeof r.MeadowMySQLProvider&&r.MeadowMySQLProvider},providerCreatesSupported:!1,new:e}}()}},{}],151:[function(e,t,r){t.exports=new function(){return function e(t){return"object"==typeof t&&"fable"in t?{marshalRecordFromSourceToObject:function(){},Create:function(e,t){e.parameters.result.executed=!0,t()},Read:function(e,t){e.parameters.result.executed=!0,e.parameters.result.value=[!0],t()},Update:function(e,t){e.parameters.result.executed=!0,t()},Delete:function(e,t){e.parameters.result.executed=!0,t()},Undelete:function(e,t){e.parameters.result.executed=!0,t()},Count:function(e,t){e.parameters.result.executed=!0,t()},getProvider:{},providerCreatesSupported:!1,new:e}:{new:e}}()}},{}],152:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.PostgreSQL&&(n=r.settings.PostgreSQL.GlobalLogLevel||0);var o=function(e,t){var r=[],n=0,o={};return{text:e.replace(/:([A-Za-z_][A-Za-z0-9_]*)/g,function(e,a){if(!t.hasOwnProperty(a))return e;if(o.hasOwnProperty(a))return"$"+o[a];n++,o[a]=n;var i=t[a];if(Array.isArray(i)){for(var u=[],s=0;s<i.length;s++)s>0&&n++,r.push(i[s]),u.push("$"+n);return u.join(", ")}return r.push(i),"$"+n}),values:r}},a=function(){return!("object"!=typeof r.MeadowPostgreSQLProvider||!r.MeadowPostgreSQLProvider.connected)&&r.MeadowPostgreSQLProvider.pool};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},o={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(o[r[a].StorageColumn]=r[a].Column);for(var i in t)if(n[i])try{e[i]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[i]={}}else if(o.hasOwnProperty(i)){var u=o[i];try{e[u]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[u]={}}}else e[i]=t[i]},Create:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(n,o){i.error=n,i.value=!1;try{if(o&&o.rows&&o.rows.length>0){for(var a=Array.isArray(e.query.schema)?e.query.schema:[],u=!1,s=0;s<a.length;s++)if("AutoIdentity"===a[s].Type){u=a[s].Column;break}if(u&&o.rows[0].hasOwnProperty(u))i.value=o.rows[0][u];else{var l=Object.keys(o.rows[0])[0];i.value=o.rows[0][l]}}}catch(t){r.log.warn("Error getting insert ID during create query",{Body:e.query.body,Parameters:e.query.parameters})}return i.executed=!0,t()})},Read:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(e,r){return i.error=e,i.value=r?r.rows:[],i.executed=!0,t()})},Update:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(e,r){return i.error=e,i.value=r?r.rows:[],i.executed=!0,t()})},Delete:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(n,o){i.error=n,i.value=!1;try{i.value=o?o.rowCount:0}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:e.query.body,Parameters:e.query.parameters})}return i.executed=!0,t()})},Undelete:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(n,o){i.error=n,i.value=!1;try{i.value=o?o.rowCount:0}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:e.query.body,Parameters:e.query.parameters})}return i.executed=!0,t()})},Count:function(e,t){var i=e.parameters.result;e.setDialect("PostgreSQL").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o(e.query.body,e.query.parameters);a().query(u.text,u.values,function(n,o){i.executed=!0,i.error=n,i.value=!1;try{i.value=parseInt(o.rows[0].rowcount,10)}catch(t){r.log.warn("Error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})},getProvider:function(){return"object"==typeof r.MeadowPostgreSQLProvider&&r.MeadowPostgreSQLProvider},providerCreatesSupported:!1,new:e}}()}},{}],153:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n="MeadowEndpoints",o=function(e,t,n){var o=e.parameters.result;o.executed=!0;var a=r.MeadowRetoldDataBeaconProvider;if(!a||"function"!=typeof a.dispatchRequest)return o.error=new Error("MeadowProviderRetoldDataBeacon: no connection registered on _Fable.MeadowRetoldDataBeaconProvider"),n();var i,u=a._TargetConnectionHash||"",s=e.query.body||"";i=u?"/1.0/"+u+"/"+s:"/"!==s.charAt(0)?"/1.0/"+s:s;var l=null;("POST"===t||"PUT"===t)&&e.query.records&&e.query.records.length>0&&(l=e.query.records[0]),a.dispatchRequest({Method:t,Path:i,Body:null!==l?JSON.stringify(l):""},function(a,u){if(a)return o.error=a,n();if(u&&u.length>0)try{o.value=JSON.parse(u)}catch(e){return o.error=new Error("MeadowProviderRetoldDataBeacon: failed to parse response as JSON: "+e.message),n()}return e.logLevel>0&&r.log.debug(`==> ${t} ${i} completed`,o),n()})};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)e[r]=t[r]},Create:function(e,t){if(e.setDialect(n).buildCreateQuery(),!e.query.records||0===e.query.records.length)return e.parameters.result.error="No records passed for proxying to Retold-DataBeacon.",t();o(e,"POST",function(){var r=e.parameters.result,n=`ID${e.parameters.scope}`;return r.value&&r.value.hasOwnProperty(n)&&(r.value=r.value[n]),t()})},Read:function(e,t){e.setDialect(n).buildReadQuery(),o(e,"GET",function(){var r=e.parameters.result;return e.query.body&&e.query.body.startsWith(`${e.parameters.scope}/`)&&void 0!==r.value&&null!==r.value&&(r.value=[r.value]),t()})},Update:function(e,t){if(e.setDialect(n).buildUpdateQuery(),!e.query.records||0===e.query.records.length)return e.parameters.result.error="No records passed for proxying to Retold-DataBeacon.",t();o(e,"PUT",function(){return t()})},Delete:function(e,t){e.setDialect(n).buildDeleteQuery(),o(e,"DELETE",function(){var r=e.parameters.result;return r.value&&r.value.hasOwnProperty("Count")&&(r.value=r.value.Count),t()})},Count:function(e,t){e.setDialect(n).buildCountQuery(),o(e,"GET",function(){var n=e.parameters.result;try{n.value=n.value.Count}catch(t){n.value=-1,r.log.warn("MeadowProviderRetoldDataBeacon: error getting rowcount during count query",{Body:e.query.body,Parameters:e.query.parameters})}return t()})},getProvider:{},providerCreatesSupported:!1,new:e}}()}},{}],154:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.RocksDB&&(n=r.settings.RocksDB.GlobalLogLevel||0);var o=r.settings.RocksDB&&"ID"===r.settings.RocksDB.KeyMode?"ID":"GUID",a="Unknown",i=[],u="ID",s="GUID",l=function(e){for(var t=0;t<i.length;t++)if(i[t].Column===e)return i[t];return{Column:e,Type:"Default"}},c=function(e){if("string"!=typeof e)return e;var t=e.indexOf(".");return t>-1?e.substring(t+1):e},f=function(){return!("object"!=typeof r.MeadowRocksDBProvider||!r.MeadowRocksDBProvider.connected)&&r.MeadowRocksDBProvider.db},d=function(e,t){var r=Array.isArray(e.parameters.filter)?e.parameters.filter.slice():[];if(!(t||e.parameters.query.disableDeleteTracking))for(var n=0;n<i.length;n++)if("Deleted"===i[n].Type){for(var o=!1,a=0;a<r.length;a++)if(c(r[a].Column)===i[n].Column){o=!0;break}o||r.push({Column:i[n].Column,Operator:"=",Value:0,Connector:"AND",Parameter:"Deleted"});break}return r},p=function(e,t){var r=t[c(e.Column)],n=e.Value;switch(e.Operator){case"=":return r==n;case"!=":return r!=n;case">":return r>n;case">=":return r>=n;case"<":return r<n;case"<=":return r<=n;case"LIKE":var o=String(n).replace(/%/g,".*").replace(/_/g,".");try{return new RegExp("^"+o+"$","i").test(String(r||""))}catch(e){return!1}case"IN":if(!Array.isArray(n))return!1;for(var a=0;a<n.length;a++)if(r==n[a])return!0;return!1;case"NOT IN":if(!Array.isArray(n))return!0;for(var i=0;i<n.length;i++)if(r==n[i])return!1;return!0;case"IS NULL":return null==r;case"IS NOT NULL":return null!=r;case"(":case")":return!0;default:return r==n}},h=function(e,t){if(!e||0===e.length)return!0;for(var r=[[]],n=0;n<e.length;n++){var o=e[n];if("("===o.Operator)r.push([]);else if(")"===o.Operator){var a=r.pop(),i=y(a);r[r.length-1].push({result:i,connector:o.Connector||"AND"})}else{var u=p(o,t);r[r.length-1].push({result:u,connector:o.Connector||"AND"})}}return y(r[0])},y=function(e){if(!e||0===e.length)return!0;for(var t=e[0].result,r=1;r<e.length;r++){t="OR"===(e[r].connector||"AND")?t||e[r].result:t&&e[r].result}return t},g=function(e,t,n,a,i,u,s){var l=function(e){return"GUID"===o?"M-E-"+e+"-":"M-EBI-"+e+"-"}(t);!function(e,t,n){var o=[],a=e.iterator({gte:t,lt:t+"",keyAsBuffer:!1,valueAsBuffer:!1});!function e(){a.next(function(t,i,u){if(t)return a.end(function(){return n(t,o)});if(void 0===i)return a.end(function(){return n(null,o)});try{var s=JSON.parse(u.toString());s._rocksdb_key=i.toString(),o.push(s)}catch(e){r.log.error("RocksDB: Failed to parse record at key ["+i+"]: "+e)}e()})}()}(e,l,function(e,t){if(e)return s(e,[]);for(var r=[],o=0;o<t.length;o++)h(n,t[o])&&r.push(t[o]);return r=function(e,t){return Array.isArray(t)&&0!==t.length?(e.sort(function(e,r){for(var n=0;n<t.length;n++){var o=c(t[n].Column),a="Descending"===t[n].Direction?-1:1,i=e[o],u=r[o];if(null==i&&(i=""),null==u&&(u=""),i<u)return-1*a;if(i>u)return 1*a}return 0}),e):e}(r,a),r=function(e,t,r){var n=!1!==t&&t>0?t:0;return r?e.slice(n,n+r):n>0?e.slice(n):e}(r,i,u),s(null,r)})};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)"_rocksdb_key"!==r&&(e[r]=t[r])},Create:function(e,t){var i=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Create",{scope:a});var c=f();if(!c)return i.error=new Error("No RocksDB connection available."),i.executed=!0,t();var d=function(e){var t=e.parameters.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r={},n=t[0];for(var o in n)if(n.hasOwnProperty(o)){var a=l(o);if(e.parameters.query.disableDeleteTracking||"DeleteDate"!==a.Type&&"DeleteIDUser"!==a.Type)switch(a.Type){case"AutoIdentity":e.parameters.query.disableAutoIdentity?r[o]=n[o]:r[o]="$$AUTOINCREMENT";break;case"AutoGUID":e.parameters.query.disableAutoIdentity||n[o]&&n[o].length>=5&&"0x0000000000000000"!==n[o]?r[o]=n[o]:r[o]=e.parameters.query.UUID;break;case"UpdateDate":case"CreateDate":e.parameters.query.disableAutoDateStamp?r[o]=n[o]:r[o]=(new Date).toISOString();break;case"DeleteIDUser":case"UpdateIDUser":case"CreateIDUser":e.parameters.query.disableAutoUserStamp?r[o]=n[o]:r[o]=e.parameters.query.IDUser;break;case"Deleted":e.parameters.query.disableDeleteTracking?r[o]=n[o]:r[o]=0;break;default:r[o]=n[o]}}return r}(e);if(!d)return i.error=new Error("No RocksDB document generated for Create."),i.executed=!0,t();var p=!1;for(var h in d)if("$$AUTOINCREMENT"===d[h]){p=h;break}var y=function(e){p&&e&&(d[p]=e);var r,n,l=(r=a,n=d,"GUID"===o&&s&&n[s]?"M-E-"+r+"-"+n[s]:"M-EBI-"+r+"-"+n[u]),f=JSON.stringify(d);c.put(l,f,function(r){return r?(i.error=r,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=e||d[u],i.executed=!0,t())})};p?function(e,t,r){var n=function(e){return"M-SEQ-"+e}(t);e.get(n,function(t,o){var a=1;!t&&o&&(a=parseInt(o.toString(),10)+1),e.put(n,String(a),function(e){return r(e,a)})})}(c,a,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();y(r)}):y()},Read:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Read",{scope:a,filter:e.parameters.filter});var i=f();if(!i)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var u=d(e),s=e.parameters.sort||!1,l=e.parameters.begin,c=e.parameters.cap;g(i,a,u,s,l,c,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();for(var n=0;n<r.length;n++)delete r[n]._rocksdb_key;return o.error=null,o.value=r,o.executed=!0,t()})},Update:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Update",{scope:a,filter:e.parameters.filter});var i=f();if(!i)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var u=function(e){var t=e.parameters.query.records;if(!Array.isArray(t)||t.length<1)return!1;var r={},n=t[0];for(var o in n)if(n.hasOwnProperty(o)){var a=l(o);switch(a.Type){case"AutoIdentity":case"AutoGUID":case"CreateDate":case"CreateIDUser":case"DeleteDate":case"DeleteIDUser":continue}switch(a.Type){case"UpdateDate":e.parameters.query.disableAutoDateStamp||(r[o]=(new Date).toISOString());break;case"UpdateIDUser":e.parameters.query.disableAutoUserStamp||(r[o]=e.parameters.query.IDUser);break;default:r[o]=n[o]}}return r}(e);if(!u||0===Object.keys(u).length)return o.error=null,o.value=0,o.executed=!0,t();var s=d(e);g(i,a,s,!1,!1,!1,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var s=r[a],l=s._rocksdb_key;for(var c in u)u.hasOwnProperty(c)&&(s[c]=u[c]);delete s._rocksdb_key,n.push({type:"put",key:l,value:JSON.stringify(s)})}i.batch(n,function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value={changes:r.length},o.executed=!0,t())})})},Delete:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Delete",{scope:a,filter:e.parameters.filter});var u=f();if(!u)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var s=function(e){if(e.parameters.query.disableDeleteTracking)return!1;for(var t=!1,r={},n=0;n<i.length;n++){var o=i[n];switch(o.Type){case"Deleted":r[o.Column]=1,t=!0;break;case"DeleteDate":case"UpdateDate":r[o.Column]=(new Date).toISOString();break;case"DeleteIDUser":r[o.Column]=e.parameters.query.IDUser;break;default:continue}}return!(!t||0===Object.keys(r).length)&&r}(e),l=d(e);g(u,a,l,!1,!1,!1,s?function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var i=r[a],l=i._rocksdb_key;for(var c in s)s.hasOwnProperty(c)&&(i[c]=s[c]);delete i._rocksdb_key,n.push({type:"put",key:l,value:JSON.stringify(i)})}u.batch(n,function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=r.length,o.executed=!0,t())})}:function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=[],a=0;a<r.length;a++)n.push({type:"del",key:r[a]._rocksdb_key});u.batch(n,function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=r.length,o.executed=!0,t())})})},Undelete:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Undelete",{scope:a,filter:e.parameters.filter});var u=f();if(!u)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var s=function(e){for(var t=!1,r={},n=0;n<i.length;n++){var o=i[n];switch(o.Type){case"Deleted":r[o.Column]=0,t=!0;break;case"UpdateDate":r[o.Column]=(new Date).toISOString();break;case"UpdateIDUser":r[o.Column]=e.parameters.query.IDUser;break;default:continue}}return!(!t||0===Object.keys(r).length)&&r}(e);if(!s)return o.error=null,o.value=0,o.executed=!0,t();var l=d(e,!0);g(u,a,l,!1,!1,!1,function(e,r){if(e)return o.error=e,o.value=!1,o.executed=!0,t();if(0===r.length)return o.error=null,o.value=0,o.executed=!0,t();for(var n=[],a=0;a<r.length;a++){var i=r[a],l=i._rocksdb_key;for(var c in s)s.hasOwnProperty(c)&&(i[c]=s[c]);delete i._rocksdb_key,n.push({type:"put",key:l,value:JSON.stringify(i)})}u.batch(n,function(e){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=r.length,o.executed=!0,t())})})},Count:function(e,t){var o=e.parameters.result;(e.logLevel>0||n>0)&&r.log.trace("RocksDB Count",{scope:a,filter:e.parameters.filter});var i=f();if(!i)return o.error=new Error("No RocksDB connection available."),o.executed=!0,t();var u=d(e);g(i,a,u,!1,!1,!1,function(e,r){return e?(o.error=e,o.value=!1,o.executed=!0,t()):(o.error=null,o.value=r.length,o.executed=!0,t())})},setSchema:function(e,t,r,n){a=e||"Unknown",i=Array.isArray(t)?t:[],u=r||"ID"+a,s=n||"GUID"+a},getProvider:function(){return"object"==typeof r.MeadowRocksDBProvider&&r.MeadowRocksDBProvider},providerCreatesSupported:!0,new:e}}()}},{}],155:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=function(){return!("object"!=typeof r.MeadowSQLiteProvider||!r.MeadowSQLiteProvider.connected)&&r.MeadowSQLiteProvider.db},o=function(e){return"string"!=typeof e?e:e.replace(/NOW\(\d*\)/g,"datetime('now')")},a=function(e){if("object"!=typeof e||null===e)return e;for(var t=Object.keys(e),r=0;r<t.length;r++){var n=e[t[r]];Array.isArray(n)?1===n.length&&(e[t[r]]=n[0]):"boolean"==typeof n?e[t[r]]=n?1:0:void 0===n&&(e[t[r]]=null)}return e};return{marshalRecordFromSourceToObject:function(e,t,r){var n={},o={};if(Array.isArray(r))for(var a=0;a<r.length;a++)"JSON"===r[a].Type?n[r[a].Column]=!0:"JSONProxy"===r[a].Type&&r[a].StorageColumn&&(o[r[a].StorageColumn]=r[a].Column);for(var i in t)if(n[i])try{e[i]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[i]={}}else if(o.hasOwnProperty(i)){var u=o[i];try{e[u]="string"==typeof t[i]?JSON.parse(t[i]):t[i]||{}}catch(t){e[u]={}}}else e[i]=t[i]},Create:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildCreateQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).run(e.query.parameters);i.error=null,i.value=!1;try{i.value=Number(l.lastInsertRowid)}catch(t){r.log.warn("Error getting insert ID during create query",{Body:u,Parameters:e.query.parameters})}i.executed=!0}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},Read:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildReadQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).all(e.query.parameters);i.error=null,i.value=l,i.executed=!0}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},Update:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildUpdateQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).run(e.query.parameters);i.error=null,i.value=l,i.executed=!0}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},Delete:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildDeleteQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).run(e.query.parameters);i.error=null,i.value=!1;try{i.value=l.changes}catch(t){r.log.warn("Error getting affected rowcount during delete query",{Body:u,Parameters:e.query.parameters})}i.executed=!0}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},Undelete:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildUndeleteQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).run(e.query.parameters);i.error=null,i.value=!1;try{i.value=l.changes}catch(t){r.log.warn("Error getting affected rowcount during undelete query",{Body:u,Parameters:e.query.parameters})}i.executed=!0}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},Count:function(e,t){var i=e.parameters.result;e.setDialect("SQLite").buildCountQuery();var u=o(e.query.body);a(e.query.parameters),e.logLevel>0&&r.log.trace(u,e.query.parameters);try{var s=n();if(!s)return i.error=new Error("No SQLite database connection available."),i.executed=!0,t();var l=s.prepare(u).all(e.query.parameters);i.executed=!0,i.error=null,i.value=!1;try{i.value=l[0].RowCount}catch(t){r.log.warn("Error getting rowcount during count query",{Body:u,Parameters:e.query.parameters})}}catch(e){i.error=e,i.value=!1,i.executed=!0}return t()},getProvider:function(){return"object"==typeof r.MeadowSQLiteProvider&&r.MeadowSQLiteProvider},providerCreatesSupported:!0,new:e}}()}},{}],156:[function(e,t,r){t.exports=new function(){return function e(t){if("object"!=typeof t)return{new:e};var r=t,n=0;r.settings.Solr&&(n=r.settings.Solr.GlobalLogLevel||0);var o=function(){return!("object"!=typeof r.MeadowSolrProvider||!r.MeadowSolrProvider.connected)&&r.MeadowSolrProvider.pool},a=function(e){if("object"!=typeof e||null===e)return e;for(var t in e)e.hasOwnProperty(t)&&("$$NOW"===e[t]?e[t]=(new Date).toISOString():"object"==typeof e[t]&&null!==e[t]&&a(e[t]));return e};return{marshalRecordFromSourceToObject:function(e,t){for(var r in t)if("_version_"!==r){var n=t[r];Array.isArray(n)&&1===n.length&&(n=n[0]),e[r]=n}},Create:function(e,t){var i=e.parameters.result;e.setDialect("Solr").buildCreateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No Solr connection available."),i.executed=!0,t();var s=e.query.parameters.solrOperation;if(!s)return i.error=new Error("No Solr operation generated."),i.executed=!0,t();var l=a(JSON.parse(JSON.stringify(s.document))),c=!1;for(var f in l)if("$$AUTOINCREMENT"===l[f]){c=f;break}c?function(e,t,r,n){var o=t+"."+r,a=e.query().q('id:"'+o+'"').rows(1);e.search(a,function(t,r){if(t)return n(t);var a=1;r&&r.response&&r.response.docs&&r.response.docs.length>0&&(a=(r.response.docs[0].seq||0)+1);var i={id:o,seq:a};e.add(i,function(t){if(t)return n(t);e.commit(function(e){return e?n(e):n(null,a)})})})}(u,s.collection,c,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();l[c]=r,u.add(l,function(e){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=r,i.executed=!0,t())})})}):u.add(l,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=l.id||!0,i.executed=!0,t())})})},Read:function(e,t){var a=e.parameters.result;e.setDialect("Solr").buildReadQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No Solr connection available."),a.executed=!0,t();var u=e.query.parameters.solrOperation,s=i.query().q(u.query||"*:*");u.filterQuery&&s.parameters.push("fq="+encodeURIComponent(u.filterQuery)),u.fields&&(s=s.fl(u.fields)),u.sort&&s.parameters.push("sort="+encodeURIComponent(u.sort)),void 0!==u.rows&&(s=s.rows(u.rows)),u.start&&(s=s.start(u.start)),i.search(s,function(e,r){return e?(a.error=e,a.value=!1,a.executed=!0,t()):(a.error=null,a.value=r&&r.response?r.response.docs:[],a.executed=!0,t())})},Update:function(e,t){var i=e.parameters.result;e.setDialect("Solr").buildUpdateQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No Solr connection available."),i.executed=!0,t();var s=e.query.parameters.solrOperation;if(!s)return i.error=new Error("No Solr operation generated."),i.executed=!0,t();var l=u.query().q(s.filterQuery||"*:*").fl("id").rows(1e6);u.search(l,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return i.error=null,i.value=0,i.executed=!0,t();for(var o=a(JSON.parse(JSON.stringify(s.update))),l=[],c=0;c<n.length;c++){var f={id:n[c].id};for(var d in o)f[d]=o[d];l.push(f)}u.add(l,function(e){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=l,i.executed=!0,t())})})})},Delete:function(e,t){var i=e.parameters.result;e.setDialect("Solr").buildDeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No Solr connection available."),i.executed=!0,t();var s=e.query.parameters.solrOperation;if("atomicUpdate"===s.operation){var l=u.query().q(s.filterQuery||"*:*").fl("id").rows(1e6);u.search(l,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return i.error=null,i.value=0,i.executed=!0,t();for(var o=a(JSON.parse(JSON.stringify(s.update))),l=[],c=0;c<n.length;c++){var f={id:n[c].id};for(var d in o)f[d]=o[d];l.push(f)}u.add(l,function(e){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=n.length,i.executed=!0,t())})})})}else{var c=u.query().q(s.filterQuery||"*:*").rows(0);u.search(c,function(e,r){var n=0;!e&&r&&r.response&&(n=r.response.numFound||0),u.deleteByQuery(s.filterQuery||"*:*",function(e){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=n,i.executed=!0,t())})})})}},Undelete:function(e,t){var i=e.parameters.result;e.setDialect("Solr").buildUndeleteQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var u=o();if(!u)return i.error=new Error("No Solr connection available."),i.executed=!0,t();var s=e.query.parameters.solrOperation;if(!s||"noop"===s.operation)return i.error=null,i.value=0,i.executed=!0,t();var l=u.query().q(s.filterQuery||"*:*").fl("id").rows(1e6);u.search(l,function(e,r){if(e)return i.error=e,i.value=!1,i.executed=!0,t();var n=r&&r.response?r.response.docs:[];if(0===n.length)return i.error=null,i.value=0,i.executed=!0,t();for(var o=a(JSON.parse(JSON.stringify(s.update))),l=[],c=0;c<n.length;c++){var f={id:n[c].id};for(var d in o)f[d]=o[d];l.push(f)}u.add(l,function(e){if(e)return i.error=e,i.value=!1,i.executed=!0,t();u.commit(function(e){return e?(i.error=e,i.value=!1,i.executed=!0,t()):(i.error=null,i.value=n.length,i.executed=!0,t())})})})},Count:function(e,t){var a=e.parameters.result;e.setDialect("Solr").buildCountQuery(),(e.logLevel>0||n>0)&&r.log.trace(e.query.body,e.query.parameters);var i=o();if(!i)return a.error=new Error("No Solr connection available."),a.executed=!0,t();var u=e.query.parameters.solrOperation,s=i.query().q(u.query||"*:*").rows(0);if(u.filterQuery&&s.parameters.push("fq="+encodeURIComponent(u.filterQuery)),u.distinct&&u.distinctFields&&u.distinctFields.length>0){for(var l={},c=0;c<u.distinctFields.length;c++)l[u.distinctFields[c]]="$"+u.distinctFields[c];s=s.groupBy(u.distinctFields[0]).groupNGroups(!0)}i.search(s,function(e,r){if(e)return a.error=e,a.value=!1,a.executed=!0,t();if(a.error=null,u.distinct&&r&&r.grouped){var n=Object.keys(r.grouped);n.length>0?a.value=r.grouped[n[0]].ngroups||0:a.value=0}else a.value=r&&r.response?r.response.numFound:0;return a.executed=!0,t()})},getProvider:function(){return"object"==typeof r.MeadowSolrProvider&&r.MeadowSolrProvider},providerCreatesSupported:!0,new:e}}()}},{}],157:[function(e,t,r){(function(r){(function(){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=n&&o&&"function"==typeof o.get?o.get:null,i=n&&Map.prototype.forEach,u="function"==typeof Set&&Set.prototype,s=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=u&&s&&"function"==typeof s.get?s.get:null,c=u&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,d="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,b=String.prototype.match,m=String.prototype.slice,v=String.prototype.replace,w=String.prototype.toUpperCase,S=String.prototype.toLowerCase,D=RegExp.prototype.test,E=Array.prototype.concat,O=Array.prototype.join,A=Array.prototype.slice,_=Math.floor,R="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,j="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T||"symbol")?Symbol.toStringTag:null,x=Object.prototype.propertyIsEnumerable,L=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function I(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||D.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-_(-e):_(e);if(n!==e){var o=String(n),a=m.call(t,o.length+1);return v.call(o,r,"$&_")+"."+v.call(v.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(t,r,"$&_")}var U=e("./util.inspect"),k=U.custom,N=H(k)?k:null,M={__proto__:null,double:'"',single:"'"},P={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,o=M[n];return o+e+o}function F(e){return v.call(String(e),/"/g,""")}function Q(e){return!j||!("object"==typeof e&&(j in e||void 0!==e[j]))}function $(e){return"[object Array]"===V(e)&&Q(e)}function J(e){return"[object RegExp]"===V(e)&&Q(e)}function H(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!q)return!1;try{return q.call(e),!0}catch(e){}return!1}t.exports=function e(t,n,o,u){var s=n||{};if(G(s,"quoteStyle")&&!G(M,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(s,"maxStringLength")&&("number"==typeof s.maxStringLength?s.maxStringLength<0&&s.maxStringLength!==1/0:null!==s.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!G(s,"customInspect")||s.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(s,"indent")&&null!==s.indent&&"\t"!==s.indent&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(s,"numericSeparator")&&"boolean"!=typeof s.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=s.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return K(t,s);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var D=String(t);return w?I(t,D):D}if("bigint"==typeof t){var _=String(t)+"n";return w?I(t,_):_}var C=void 0===s.depth?5:s.depth;if(void 0===o&&(o=0),o>=C&&C>0&&"object"==typeof t)return $(t)?"[Array]":"[Object]";var k=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=O.call(Array(e.indent+1)," ")}return{base:r,prev:O.call(Array(t+1),r)}}(s,o);if(void 0===u)u=[];else if(z(u,t)>=0)return"[Circular]";function P(t,r,n){if(r&&(u=A.call(u)).push(r),n){var a={depth:s.depth};return G(s,"quoteStyle")&&(a.quoteStyle=s.quoteStyle),e(t,a,o+1,u)}return e(t,s,o+1,u)}if("function"==typeof t&&!J(t)){var W=function(e){if(e.name)return e.name;var t=b.call(g.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),Y=re(t,P);return"[Function"+(W?": "+W:" (anonymous)")+"]"+(Y.length>0?" { "+O.call(Y,", ")+" }":"")}if(H(t)){var ne=T?v.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):q.call(t);return"object"!=typeof t||T?ne:X(ne)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var oe="<"+S.call(String(t.nodeName)),ae=t.attributes||[],ie=0;ie<ae.length;ie++)oe+=" "+ae[ie].name+"="+B(F(ae[ie].value),"double",s);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+="</"+S.call(String(t.nodeName))+">"}if($(t)){if(0===t.length)return"[]";var ue=re(t,P);return k&&!function(e){for(var t=0;t<e.length;t++)if(z(e[t],"\n")>=0)return!1;return!0}(ue)?"["+te(ue,k)+"]":"[ "+O.call(ue,", ")+" ]"}if(function(e){return"[object Error]"===V(e)&&Q(e)}(t)){var se=re(t,P);return"cause"in Error.prototype||!("cause"in t)||x.call(t,"cause")?0===se.length?"["+String(t)+"]":"{ ["+String(t)+"] "+O.call(se,", ")+" }":"{ ["+String(t)+"] "+O.call(E.call("[cause]: "+P(t.cause),se),", ")+" }"}if("object"==typeof t&&y){if(N&&"function"==typeof t[N]&&U)return U(t,{depth:C-o});if("symbol"!==y&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!a||!e||"object"!=typeof e)return!1;try{a.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var le=[];return i&&i.call(t,function(e,r){le.push(P(r,t,!0)+" => "+P(e,t))}),ee("Map",a.call(t),le,k)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{a.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var ce=[];return c&&c.call(t,function(e){ce.push(P(e,t))}),ee("Set",l.call(t),ce,k)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===V(e)&&Q(e)}(t))return X(P(Number(t)));if(function(e){if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}(t))return X(P(R.call(t)));if(function(e){return"[object Boolean]"===V(e)&&Q(e)}(t))return X(h.call(t));if(function(e){return"[object String]"===V(e)&&Q(e)}(t))return X(P(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r&&t===r)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===V(e)&&Q(e)}(t)&&!J(t)){var fe=re(t,P),de=L?L(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",he=!de&&j&&Object(t)===t&&j in t?m.call(V(t),8,-1):pe?"Object":"",ye=(de||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||pe?"["+O.call(E.call([],he||[],pe||[]),": ")+"] ":"");return 0===fe.length?ye+"{}":k?ye+"{"+te(fe,k)+"}":ye+"{ "+O.call(fe,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return W.call(e,t)}function V(e){return y.call(e)}function z(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function K(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return K(m.call(e,0,t.maxStringLength),t)+n}var o=P[t.quoteStyle||"single"];return o.lastIndex=0,B(v.call(v.call(e,o,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):O.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+O.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=$(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=G(e,o)?t(e[o],e):""}var a,i="function"==typeof C?C(e):[];if(T){a={};for(var u=0;u<i.length;u++)a["$"+i[u]]=i[u]}for(var s in e)G(e,s)&&(r&&String(Number(s))===s&&s<e.length||T&&a["$"+s]instanceof Symbol||(D.call(/[^\w$]/,s)?n.push(t(s,e)+": "+t(e[s],e)):n.push(s+": "+t(e[s],e))));if("function"==typeof C)for(var l=0;l<i.length;l++)x.call(e,i[l])&&n.push("["+t(i[l])+"]: "+t(e[i[l]],e));return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":55}],158:[function(e,t,r){var n=e("wrappy");function o(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function a(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}t.exports=n(o),t.exports.strict=n(a),o.proto=o(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return o(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return a(this)},configurable:!0})})},{wrappy:223}],159:[function(e,t,r){t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},{}],160:[function(e,t,r){var n,o,a=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(e){o=u}}();var l,c=[],f=!1,d=-1;function p(){f&&l&&(f=!1,l.length?c=l.concat(c):d=-1,c.length&&h())}function h(){if(!f){var e=s(p);f=!0;for(var t=c.length;t;){for(l=c,c=[];++d<t;)l&&l[d].run();d=-1,t=c.length}l=null,f=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}a.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||f||s(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={},a.on=g,a.addListener=g,a.once=g,a.off=g,a.removeListener=g,a.removeAllListeners=g,a.emit=g,a.prependListener=g,a.prependOnceListener=g,a.listeners=function(e){return[]},a.binding=function(e){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(e){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}},{}],161:[function(e,t,r){(function(e){(function(){!function(n){var o="object"==typeof r&&r&&!r.nodeType&&r,a="object"==typeof t&&t&&!t.nodeType&&t,i="object"==typeof e&&e;i.global!==i&&i.window!==i&&i.self!==i||(n=i);var u,s,l=2147483647,c=36,f=/^xn--/,d=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,g=String.fromCharCode;function b(e){throw new RangeError(h[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function v(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(p,".")).split("."),t).join(".")}function w(e){for(var t,r,n=[],o=0,a=e.length;o<a;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<a?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function S(e){return m(e,function(e){var t="";return e>65535&&(t+=g((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=g(e)}).join("")}function D(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:c}function E(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function O(e,t,r){var n=0;for(e=r?y(e/700):e>>1,e+=y(e/t);e>455;n+=c)e=y(e/35);return y(n+36*e/(e+38))}function A(e){var t,r,n,o,a,i,u,s,f,d,p=[],h=e.length,g=0,m=128,v=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&b("not-basic"),p.push(e.charCodeAt(n));for(o=r>0?r+1:0;o<h;){for(a=g,i=1,u=c;o>=h&&b("invalid-input"),((s=D(e.charCodeAt(o++)))>=c||s>y((l-g)/i))&&b("overflow"),g+=s*i,!(s<(f=u<=v?1:u>=v+26?26:u-v));u+=c)i>y(l/(d=c-f))&&b("overflow"),i*=d;v=O(g-a,t=p.length+1,0==a),y(g/t)>l-m&&b("overflow"),m+=y(g/t),g%=t,p.splice(g++,0,m)}return S(p)}function _(e){var t,r,n,o,a,i,u,s,f,d,p,h,m,v,S,D=[];for(h=(e=w(e)).length,t=128,r=0,a=72,i=0;i<h;++i)(p=e[i])<128&&D.push(g(p));for(n=o=D.length,o&&D.push("-");n<h;){for(u=l,i=0;i<h;++i)(p=e[i])>=t&&p<u&&(u=p);for(u-t>y((l-r)/(m=n+1))&&b("overflow"),r+=(u-t)*m,t=u,i=0;i<h;++i)if((p=e[i])<t&&++r>l&&b("overflow"),p==t){for(s=r,f=c;!(s<(d=f<=a?1:f>=a+26?26:f-a));f+=c)S=s-d,v=c-d,D.push(g(E(d+S%v,0))),s=y(S/v);D.push(g(E(s,0))),a=O(r,m,n==o),r=0,++n}++r,++t}return D.join("")}if(u={version:"1.4.1",ucs2:{decode:w,encode:S},decode:A,encode:_,toASCII:function(e){return v(e,function(e){return d.test(e)?"xn--"+_(e):e})},toUnicode:function(e){return v(e,function(e){return f.test(e)?A(e.slice(4).toLowerCase()):e})}},o&&a)if(t.exports==o)a.exports=u;else for(s in u)u.hasOwnProperty(s)&&(o[s]=u[s]);else n.punycode=u}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],162:[function(e,t,r){var n=String.prototype.replace,o=/%20/g,a="RFC1738",i="RFC3986";t.exports={default:i,formatters:{RFC1738:function(e){return n.call(e,o,"+")},RFC3986:function(e){return String(e)}},RFC1738:a,RFC3986:i}},{}],163:[function(e,t,r){var n=e("./stringify"),o=e("./parse"),a=e("./formats");t.exports={formats:a,parse:o,stringify:n}},{"./formats":162,"./parse":164,"./stringify":165}],164:[function(e,t,r){var n=e("./utils"),o=Object.prototype.hasOwnProperty,a=Array.isArray,i={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},u=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},s=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},l=function(e,t,r,a){if(e){var i=function(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&o.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var n=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),i=a?r.slice(0,a.index):r,u=[];if(i){if(!t.plainObjects&&o.call(Object.prototype,i)&&!t.allowPrototypes)return;u[u.length]=i}for(var s=0;null!==(a=n.exec(r))&&s<t.depth;){s+=1;var l=a[1].slice(1,-1);if(!t.plainObjects&&o.call(Object.prototype,l)&&!t.allowPrototypes)return;u[u.length]=a[1]}if(a){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");u[u.length]="["+r.slice(a.index)+"]"}return u}(e,r);if(i)return function(e,t,r,o){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var i=e.slice(0,-1).join("");a=Array.isArray(t)&&t[i]?t[i].length:0}for(var u=o?t:s(t,r,a),l=e.length-1;l>=0;--l){var c,f=e[l];if("[]"===f&&r.parseArrays)c=n.isOverflow(u)?u:r.allowEmptyArrays&&(""===u||r.strictNullHandling&&null===u)?[]:n.combine([],u,r.arrayLimit,r.plainObjects);else{c=r.plainObjects?{__proto__:null}:{};var d="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,p=r.decodeDotInKeys?d.replace(/%2E/g,"."):d,h=parseInt(p,10),y=!isNaN(h)&&f!==p&&String(h)===p&&h>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(y&&h<r.arrayLimit)(c=[])[h]=u;else{if(y&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");y?(c[h]=u,n.markOverflow(c,h)):"__proto__"!==p&&(c[p]=u)}else c={0:u}}u=c}return u}(i,t,r,a)}};t.exports=function(e,t){var r=function(e){if(!e)return i;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?i.charset:e.charset,r=void 0===e.duplicates?i.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||i.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:i.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:i.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:i.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:i.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:i.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:i.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:i.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:i.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:i.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:i.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:i.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:i.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:i.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:i.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:i.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:i.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var c="string"==typeof e?function(e,t){var r={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=t.parameterLimit===1/0?void 0:t.parameterLimit,f=l.split(t.delimiter,t.throwOnLimitExceeded?c+1:c);if(t.throwOnLimitExceeded&&f.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var d,p=-1,h=t.charset;if(t.charsetSentinel)for(d=0;d<f.length;++d)0===f[d].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[d]?h="utf-8":"utf8=%26%2310003%3B"===f[d]&&(h="iso-8859-1"),p=d,d=f.length);for(d=0;d<f.length;++d)if(d!==p){var y,g,b=f[d],m=b.indexOf("]="),v=-1===m?b.indexOf("="):m+1;if(-1===v?(y=t.decoder(b,i.decoder,h,"key"),g=t.strictNullHandling?null:""):null!==(y=t.decoder(b.slice(0,v),i.decoder,h,"key"))&&(g=n.maybeMap(s(b.slice(v+1),t,a(r[y])?r[y].length:0),function(e){return t.decoder(e,i.decoder,h,"value")})),g&&t.interpretNumericEntities&&"iso-8859-1"===h&&(g=u(String(g))),b.indexOf("[]=")>-1&&(g=a(g)?[g]:g),t.comma&&a(g)&&g.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");g=n.combine([],g,t.arrayLimit,t.plainObjects)}if(null!==y){var w=o.call(r,y);w&&("combine"===t.duplicates||b.indexOf("[]=")>-1)?r[y]=n.combine(r[y],g,t.arrayLimit,t.plainObjects):w&&"last"!==t.duplicates||(r[y]=g)}}return r}(e,r):e,f=r.plainObjects?{__proto__:null}:{},d=Object.keys(c),p=0;p<d.length;++p){var h=d[p],y=l(h,c[h],r,"string"==typeof e);f=n.merge(f,y,r)}return!0===r.allowSparse?f:n.compact(f)}},{"./utils":166}],165:[function(e,t,r){var n=e("side-channel"),o=e("./utils"),a=e("./formats"),i=Object.prototype.hasOwnProperty,u={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},s=Array.isArray,l=Array.prototype.push,c=function(e,t){l.apply(e,s(t)?t:[t])},f=Date.prototype.toISOString,d=a.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:d,formatter:a.formatters[d],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},h={},y=function e(t,r,a,i,u,l,f,d,y,g,b,m,v,w,S,D,E,O){for(var A,_=t,R=O,C=0,q=!1;void 0!==(R=R.get(h))&&!q;){var T=R.get(t);if(C+=1,void 0!==T){if(T===C)throw new RangeError("Cyclic object value");q=!0}void 0===R.get(h)&&(C=0)}if("function"==typeof g?_=g(r,_):_ instanceof Date?_=v(_):"comma"===a&&s(_)&&(_=o.maybeMap(_,function(e){return e instanceof Date?v(e):e})),null===_){if(l)return y&&!D?y(r,p.encoder,E,"key",w):r;_=""}if("string"==typeof(A=_)||"number"==typeof A||"boolean"==typeof A||"symbol"==typeof A||"bigint"==typeof A||o.isBuffer(_))return y?[S(D?r:y(r,p.encoder,E,"key",w))+"="+S(y(_,p.encoder,E,"value",w))]:[S(r)+"="+S(String(_))];var j,x=[];if(void 0===_)return x;if("comma"===a&&s(_))D&&y&&(_=o.maybeMap(_,y)),j=[{value:_.length>0?_.join(",")||null:void 0}];else if(s(g))j=g;else{var L=Object.keys(_);j=b?L.sort(b):L}var I=d?String(r).replace(/\./g,"%2E"):String(r),U=i&&s(_)&&1===_.length?I+"[]":I;if(u&&s(_)&&0===_.length)return U+"[]";for(var k=0;k<j.length;++k){var N=j[k],M="object"==typeof N&&N&&void 0!==N.value?N.value:_[N];if(!f||null!==M){var P=m&&d?String(N).replace(/\./g,"%2E"):String(N),B=s(_)?"function"==typeof a?a(U,P):U:U+(m?"."+P:"["+P+"]");O.set(t,C);var F=n();F.set(h,O),c(x,e(M,B,a,i,u,l,f,d,"comma"===a&&D&&s(_)?null:y,g,b,m,v,w,S,D,E,F))}}return x};t.exports=function(e,t){var r,o=e,l=function(e){if(!e)return p;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=a.default;if(void 0!==e.format){if(!i.call(a.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,o=a.formatters[r],l=p.filter;if(("function"==typeof e.filter||s(e.filter))&&(l=e.filter),n=e.arrayFormat in u?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":p.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===e.allowDots?!0===e.encodeDotInKeys||p.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:p.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:l,format:r,formatter:o,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof l.filter?o=(0,l.filter)("",o):s(l.filter)&&(r=l.filter);var f=[];if("object"!=typeof o||null===o)return"";var d=u[l.arrayFormat],h="comma"===d&&l.commaRoundTrip;r||(r=Object.keys(o)),l.sort&&r.sort(l.sort);for(var g=n(),b=0;b<r.length;++b){var m=r[b],v=o[m];l.skipNulls&&null===v||c(f,y(v,m,d,h,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,g))}var w=f.join(l.delimiter),S=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?S+="utf8=%26%2310003%3B&":S+="utf8=%E2%9C%93&"),w.length>0?S+w:""}},{"./formats":162,"./utils":166,"side-channel":176}],166:[function(e,t,r){var n=e("./formats"),o=e("side-channel"),a=Object.prototype.hasOwnProperty,i=Array.isArray,u=o(),s=function(e,t){return u.set(e,t),e},l=function(e){return u.has(e)},c=function(e){return u.get(e)},f=function(e,t){u.set(e,t)},d=function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e}(),p=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},h=1024;t.exports={arrayToObject:p,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t,r,n){if(l(e)){var o=c(e)+1;return e[o]=t,f(e,o),e}var a=[].concat(e,t);return a.length>r?s(p(a,{plainObjects:n}),a.length-1):a},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var o=t[n],a=o.obj[o.prop],u=Object.keys(a),s=0;s<u.length;++s){var l=u[s],c=a[l];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(t[t.length]={obj:a,prop:l},r[r.length]=c)}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o<r.length;++o)void 0!==r[o]&&(n[n.length]=r[o]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,o,a){if(0===e.length)return e;var i=e;if("symbol"==typeof e?i=Symbol.prototype.toString.call(e):"string"!=typeof e&&(i=String(e)),"iso-8859-1"===r)return escape(i).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var u="",s=0;s<i.length;s+=h){for(var l=i.length>=h?i.slice(s,s+h):i,c=[],f=0;f<l.length;++f){var p=l.charCodeAt(f);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||a===n.RFC1738&&(40===p||41===p)?c[c.length]=l.charAt(f):p<128?c[c.length]=d[p]:p<2048?c[c.length]=d[192|p>>6]+d[128|63&p]:p<55296||p>=57344?c[c.length]=d[224|p>>12]+d[128|p>>6&63]+d[128|63&p]:(f+=1,p=65536+((1023&p)<<10|1023&l.charCodeAt(f)),c[c.length]=d[240|p>>18]+d[128|p>>12&63]+d[128|p>>6&63]+d[128|63&p])}u+=c.join("")}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isOverflow:l,isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},markOverflow:s,maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n<e.length;n+=1)r[r.length]=t(e[n]);return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(i(t)){var o=t.length;if(n&&"number"==typeof n.arrayLimit&&o>n.arrayLimit)return s(p(t.concat(r),n),o);t[o]=r}else{if(!t||"object"!=typeof t)return[t,r];if(l(t)){var u=c(t)+1;t[u]=r,f(t,u)}else{if(n&&n.strictMerge)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!a.call(Object.prototype,r))&&(t[r]=!0)}}return t}if(!t||"object"!=typeof t){if(l(r)){for(var d=Object.keys(r),h=n&&n.plainObjects?{__proto__:null,0:t}:{0:t},y=0;y<d.length;y++){h[parseInt(d[y],10)+1]=r[d[y]]}return s(h,c(r)+1)}var g=[t].concat(r);return n&&"number"==typeof n.arrayLimit&&g.length>n.arrayLimit?s(p(g,n),g.length-1):g}var b=t;return i(t)&&!i(r)&&(b=p(t,n)),i(t)&&i(r)?(r.forEach(function(r,o){if(a.call(t,o)){var i=t[o];i&&"object"==typeof i&&r&&"object"==typeof r?t[o]=e(i,r,n):t[t.length]=r}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var i=r[o];if(a.call(t,o)?t[o]=e(t[o],i,n):t[o]=i,l(r)&&!l(t)&&s(t,c(r)),l(t)){var u=parseInt(o,10);String(u)===o&&u>=0&&u>c(t)&&f(t,u)}return t},b)}}},{"./formats":162,"side-channel":176}],167:[function(e,t,r){function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var u=/\+/g;e=e.split(t);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var c=0;c<l;++c){var f,d,p,h,y=e[c].replace(u,"%20"),g=y.indexOf(r);g>=0?(f=y.substr(0,g),d=y.substr(g+1)):(f=y,d=""),p=decodeURIComponent(f),h=decodeURIComponent(d),n(i,p)?o(i[p])?i[p].push(h):i[p]=[i[p],h]:i[p]=h}return i};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],168:[function(e,t,r){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,u){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?a(i(e),function(i){var u=encodeURIComponent(n(i))+r;return o(e[i])?a(e[i],function(e){return u+encodeURIComponent(n(e))}).join(t):u+encodeURIComponent(n(e[i]))}).join(t):u?encodeURIComponent(n(u))+r+encodeURIComponent(n(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],169:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":167,"./encode":168}],170:[function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var n=e("buffer"),o=n.Buffer;function a(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return o(e,t,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(a(n,r),r.Buffer=i),i.prototype=Object.create(o.prototype),a(o,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:57}],171:[function(e,t,r){var n=e("call-bound"),o=e("is-regex"),a=n("RegExp.prototype.exec"),i=e("es-errors/type");t.exports=function(e){if(!o(e))throw new i("`regex` must be a RegExp");return function(t){return null!==a(e,t)}}},{"call-bound":66,"es-errors/type":75,"is-regex":119}],172:[function(e,t,r){var n=e("get-intrinsic"),o=e("define-data-property"),a=e("has-property-descriptors")(),i=e("gopd"),u=e("es-errors/type"),s=n("%Math.floor%");t.exports=function(e,t){if("function"!=typeof e)throw new u("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||s(t)!==t)throw new u("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,l=!0;if("length"in e&&i){var c=i(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(l=!1)}return(n||l||!r)&&(a?o(e,"length",t,!0,!0):o(e,"length",t)),e}},{"define-data-property":67,"es-errors/type":75,"get-intrinsic":98,gopd:103,"has-property-descriptors":104}],173:[function(e,t,r){var n=e("object-inspect"),o=e("es-errors/type"),a=function(e,t,r){for(var n,o=e;null!=(n=o.next);o=n)if(n.key===t)return o.next=n.next,r||(n.next=e.next,e.next=n),n};t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new o("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return a(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=a(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!a(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=a(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},{"es-errors/type":75,"object-inspect":157}],174:[function(e,t,r){var n=e("get-intrinsic"),o=e("call-bound"),a=e("object-inspect"),i=e("es-errors/type"),u=n("%Map%",!0),s=o("Map.prototype.get",!0),l=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),f=o("Map.prototype.delete",!0),d=o("Map.prototype.size",!0);t.exports=!!u&&function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+a(e))},delete:function(t){if(e){var r=f(e,t);return 0===d(e)&&(e=void 0),r}return!1},get:function(t){if(e)return s(e,t)},has:function(t){return!!e&&c(e,t)},set:function(t,r){e||(e=new u),l(e,t,r)}};return t}},{"call-bound":66,"es-errors/type":75,"get-intrinsic":98,"object-inspect":157}],175:[function(e,t,r){var n=e("get-intrinsic"),o=e("call-bound"),a=e("object-inspect"),i=e("side-channel-map"),u=e("es-errors/type"),s=n("%WeakMap%",!0),l=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),f=o("WeakMap.prototype.has",!0),d=o("WeakMap.prototype.delete",!0);t.exports=s?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new u("Side channel does not contain "+a(e))},delete:function(r){if(s&&r&&("object"==typeof r||"function"==typeof r)){if(e)return d(e,r)}else if(i&&t)return t.delete(r);return!1},get:function(r){return s&&r&&("object"==typeof r||"function"==typeof r)&&e?l(e,r):t&&t.get(r)},has:function(r){return s&&r&&("object"==typeof r||"function"==typeof r)&&e?f(e,r):!!t&&t.has(r)},set:function(r,n){s&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new s),c(e,r,n)):i&&(t||(t=i()),t.set(r,n))}};return r}:i},{"call-bound":66,"es-errors/type":75,"get-intrinsic":98,"object-inspect":157,"side-channel-map":174}],176:[function(e,t,r){var n=e("es-errors/type"),o=e("object-inspect"),a=e("side-channel-list"),i=e("side-channel-map"),u=e("side-channel-weakmap")||i||a;t.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+o(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=u()),e.set(t,r)}};return t}},{"es-errors/type":75,"object-inspect":157,"side-channel-list":173,"side-channel-map":174,"side-channel-weakmap":175}],177:[function(e,t,r){(function(e){(function(){/*! simple-concat. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=function(t,r){var n=[];t.on("data",function(e){n.push(e)}),t.once("end",function(){r&&r(null,e.concat(n)),r=null}),t.once("error",function(e){r&&r(e),r=null})}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:57}],178:[function(e,t,r){(function(r){(function(){/*! simple-get. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */t.exports=f;const n=e("simple-concat"),o=e("decompress-response"),a=e("http"),i=e("https"),u=e("once"),s=e("querystring"),l=e("url"),c=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function f(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=u(t),e.url){const{hostname:t,port:r,protocol:n,auth:o,path:a}=l.parse(e.url);delete e.url,t||r||n||o?Object.assign(e,{hostname:t,port:r,protocol:n,auth:o,path:a}):e.path=a}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach(t=>n[t.toLowerCase()]=e.headers[t]),e.headers=n,e.body?d=e.json&&!c(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:s.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),c(d)||(e.headers["content-length"]=r.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const p=e.hostname,h=("https:"===e.protocol?i:a).request(e,r=>{if(!1!==e.followRedirects&&r.statusCode>=300&&r.statusCode<400&&r.headers.location){e.url=r.headers.location,delete e.headers.host,r.resume();const n=l.parse(e.url).hostname;return null!==n&&n!==p&&(delete e.headers.cookie,delete e.headers.authorization),"POST"===e.method&&[301,302].includes(r.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0===e.maxRedirects--?t(new Error("too many redirects")):f(e,t)}const n="function"==typeof o&&"HEAD"!==e.method;t(null,n?o(r):r)});return h.on("timeout",()=>{h.abort(),t(new Error("Request timed out"))}),h.on("error",t),c(d)?d.on("error",t).pipe(h):h.end(d),h}f.concat=(e,t)=>f(e,(r,o)=>{if(r)return t(r);n(o,(r,n)=>{if(r)return t(r);if(e.json)try{n=JSON.parse(n.toString())}catch(r){return t(r,o,n)}t(null,o,n)})}),["get","post","put","patch","head","delete"].forEach(e=>{f[e]=(t,r)=>("string"==typeof t&&(t={url:t}),f(Object.assign({method:e.toUpperCase()},t),r))})}).call(this)}).call(this,e("buffer").Buffer)},{buffer:57,"decompress-response":55,http:194,https:109,once:158,querystring:169,"simple-concat":177,url:217}],179:[function(e,t,r){t.exports=o;var n=e("events").EventEmitter;function o(){n.call(this)}e("inherits")(o,n),o.Readable=e("readable-stream/lib/_stream_readable.js"),o.Writable=e("readable-stream/lib/_stream_writable.js"),o.Duplex=e("readable-stream/lib/_stream_duplex.js"),o.Transform=e("readable-stream/lib/_stream_transform.js"),o.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),o.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),o.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function o(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function a(){r.readable&&r.resume&&r.resume()}r.on("data",o),e.on("drain",a),e._isStdio||t&&!1===t.end||(r.on("end",u),r.on("close",s));var i=!1;function u(){i||(i=!0,e.end())}function s(){i||(i=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",o),e.removeListener("drain",a),r.removeListener("end",u),r.removeListener("close",s),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},{events:78,inherits:111,"readable-stream/lib/_stream_duplex.js":181,"readable-stream/lib/_stream_passthrough.js":182,"readable-stream/lib/_stream_readable.js":183,"readable-stream/lib/_stream_transform.js":184,"readable-stream/lib/_stream_writable.js":185,"readable-stream/lib/internal/streams/end-of-stream.js":189,"readable-stream/lib/internal/streams/pipeline.js":191}],180:[function(e,t,r){var n={};function o(e,t,r){r||(r=Error);var o=function(e){var r,n;function o(r,n,o){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o))||this}return n=e,(r=o).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,o}(r);o.prototype.name=r.name,o.prototype.code=e,n[e]=o}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,o,i,u;if("string"==typeof t&&(o="not ",t.substr(!i||i<0?0:+i,o.length)===o)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(n," ").concat(a(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(a(t,"type"))}return u+=". Received type ".concat(typeof r)},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" 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(e){return"Unknown encoding: "+e},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],181:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var o=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(l,o);for(var i=n(a.prototype),u=0;u<i.length;u++){var s=i[u];l.prototype[s]||(l.prototype[s]=a.prototype[s])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":183,"./_stream_writable":185,_process:160,inherits:111}],182:[function(e,t,r){t.exports=o;var n=e("./_stream_transform");function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}e("inherits")(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":184,inherits:111}],183:[function(e,t,r){(function(r,n){(function(){var o;t.exports=A,A.ReadableState=O;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},i=e("./internal/streams/stream"),u=e("buffer").Buffer,s=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,c=e("util");l=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,p,h=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),g=e("./internal/streams/state").getHighWaterMark,b=e("../errors").codes,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(A,i);var D=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function O(t,r,n){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof o),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new h,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&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(o=o||e("./_stream_duplex"),!(this instanceof A))return new A(t);var r=this instanceof o;this._readableState=new O(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),i.call(this)}function _(e,t,r,n,o){l("readableAddChunk",t);var a,i=e._readableState;if(null===t)i.reading=!1,function(e,t){if(l("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,i);else if(o||(a=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(i,t)),a)D(e,a);else if(i.objectMode||t&&t.length>0)if("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)i.endEmitted?D(e,new S):R(e,i,t,!0);else if(i.ended)D(e,new v);else{if(i.destroyed)return!1;i.reading=!1,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?R(e,i,t,!1):x(e,i)):R(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function R(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),x(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},A.prototype.unshift=function(e){return _(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){f||(f=e("string_decoder/").StringDecoder);var r=new f(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var C=1073741824;function q(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(j,e))}function j(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function x(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(l("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){l("readable nexttick read 0"),e.read(0)}function k(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function P(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):T(this),null;if(0===(e=q(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,o=t.needReadable;return l("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",o=!0),t.ended||t.reading?l("reading or ended",o=!1):o&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=q(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){D(this,new w("_read()"))},A.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var i=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:g;function u(t,r){l("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),e.removeListener("close",h),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",u),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function s(){l("onend"),e.end()}o.endEmitted?r.nextTick(i):n.once("end",i),e.on("unpipe",u);var c=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",c);var f=!1;function d(t){l("ondata");var r=e.write(t);l("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==F(o.pipes,e))&&!f&&(l("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function p(t){l("onerror",t),g(),e.removeListener("error",p),0===a(e,"error")&&D(e,t)}function h(){e.removeListener("finish",y),g()}function y(){l("onfinish"),e.removeListener("close",h),g()}function g(){l("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",y),e.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var i=F(t.pipes,e);return-1===i||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,l("on readable",o.length,o.reading),o.length?T(this):o.reading||r.nextTick(U,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},A.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(k,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(l("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(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(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=M,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":180,"./_stream_duplex":181,"./internal/streams/async_iterator":186,"./internal/streams/buffer_list":187,"./internal/streams/destroy":188,"./internal/streams/from":190,"./internal/streams/state":192,"./internal/streams/stream":193,_process:160,buffer:57,events:78,inherits:111,"string_decoder/":213,util:55}],184:[function(e,t,r){t.exports=c;var n=e("../errors").codes,o=n.ERR_METHOD_NOT_IMPLEMENTED,a=n.ERR_MULTIPLE_CALLBACK,i=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,u=n.ERR_TRANSFORM_WITH_LENGTH_0,s=e("./_stream_duplex");function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new a);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush(function(t,r){d(e,t,r)})}function d(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new u;if(e._transformState.transforming)throw new i;return e.push(null)}e("inherits")(c,s),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new o("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":180,"./_stream_duplex":181,inherits:111}],185:[function(e,t,r){(function(r,n){(function(){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=A,A.WritableState=O;var i={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),s=e("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,f=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,h=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,D=f.errorOrDestroy;function E(){}function O(t,n,i){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=n instanceof a),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,o=n.sync,a=n.writecb;if("function"!=typeof a)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,o,a){--t.pendingcb,n?(r.nextTick(a,o),r.nextTick(j,e,t),e._writableState.errorEmitted=!0,D(e,o)):(a(o),e._writableState.errorEmitted=!0,D(e,o),j(e,t))}(e,n,o,t,a);else{var i=q(n)||e.destroyed;i||n.corked||n.bufferProcessing||!n.bufferedRequest||C(e,n),o?r.nextTick(R,e,n,i,a):R(e,n,i,a)}}(n,e)},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 o(this)}function A(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(A,this))return new A(t);this._writableState=new O(t,this,r),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)),u.call(this)}function _(e,t,r,n,o,a,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}function R(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),j(e,t)}function C(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),i=t.corkedRequestsFree;i.entry=r;for(var u=0,s=!0;r;)a[u]=r,r.isBuf||(s=!1),r=r.next,u+=1;a.allBuffers=s,_(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function q(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&D(e,r),t.prefinished=!0,e.emit("prefinish"),j(e,t)})}function j(e,t){var n=q(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var o=e._readableState;(!o||o.autoDestroy&&o.endEmitted)&&e.destroy()}return n}e("inherits")(A,u),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===A&&(e&&e._writableState instanceof O)}})):c=function(e){return e instanceof this},A.prototype.pipe=function(){D(this,new b)},A.prototype.write=function(e,t,n){var o,a=this._writableState,i=!1,u=!a.objectMode&&(o=e,s.isBuffer(o)||o instanceof l);return u&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(n=t,t=null),u?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=E),a.ending?function(e,t){var n=new w;D(e,n),r.nextTick(t,n)}(this,n):(u||function(e,t,n,o){var a;return null===n?a=new v:"string"==typeof n||t.objectMode||(a=new h("chunk",["string","Buffer"],n)),!a||(D(e,a),r.nextTick(o,a),!1)}(this,a,e,n))&&(a.pendingcb++,i=function(e,t,r,n,o,a){if(!r){var i=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,r));return t}(t,n,o);n!==i&&(r=!0,o="buffer",n=i)}var u=t.objectMode?1:n.length;t.length+=u;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,u,n,o,a);return l}(this,a,u,e,t,n)),i},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||C(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,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(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,j(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),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(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":180,"./_stream_duplex":181,"./internal/streams/destroy":188,"./internal/streams/state":192,"./internal/streams/stream":193,_process:160,buffer:57,inherits:111,"util-deprecate":218}],186:[function(e,t,r){(function(r){(function(){var n;function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),i=Symbol("lastResolve"),u=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[i];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[i]=null,e[u]=null,t(p(r,!1)))}}function y(e){r.nextTick(h,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[s]?n(e[s]):t(p(void 0,!0))})});var n,o=this[c];if(o)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[l]?r(p(void 0,!0)):t[f](r,n)},n)}}(o,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[c]=n,n}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(b,(o(t={},d,{value:e,writable:!0}),o(t,i,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[i]=null,r[u]=null,e(p(n,!1))):(r[i]=e,r[u]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[c]=null,r[i]=null,r[u]=null,t(e)),void(r[s]=e)}var n=r[i];null!==n&&(r[c]=null,r[i]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),e.on("readable",y.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":189,_process:160}],187:[function(e,t,r){function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function u(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var s=e("buffer").Buffer,l=e("util").inspect,c=l&&l.custom||"inspect";function f(e,t,r){s.prototype.copy.call(e,t,r)}t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,n;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var o=t.data,a=e>o.length?o.length:e;if(a===o.length?n+=o:n+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=o.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(t,t.length-e,0,a),0===(e-=a)){a===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(a));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return l(this,o(o({},t),{},{depth:0,customInspect:!1}))}}])&&i(t.prototype,r),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:57,util:55}],188:[function(e,t,r){(function(e){(function(){function r(e,t){o(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var i=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(a?a(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(o,this,t)):e.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!a&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(n,i):(i._writableState.errorEmitted=!0,e.nextTick(r,i,t)):e.nextTick(r,i,t):a?(e.nextTick(n,i),a(t)):e.nextTick(n,i)}),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:160}],189:[function(e,t,r){var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function o(){}t.exports=function e(t,r,a){if("function"==typeof r)return e(t,null,r);r||(r={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}(a||o);var i=r.readable||!1!==r.readable&&t.readable,u=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||c()},l=t._writableState&&t._writableState.finished,c=function(){u=!1,l=!0,i||a.call(t)},f=t._readableState&&t._readableState.endEmitted,d=function(){i=!1,f=!0,u||a.call(t)},p=function(e){a.call(t,e)},h=function(){var e;return i&&!f?(t._readableState&&t._readableState.ended||(e=new n),a.call(t,e)):u&&!l?(t._writableState&&t._writableState.ended||(e=new n),a.call(t,e)):void 0},y=function(){t.req.on("finish",c)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?u&&!t._writableState&&(t.on("end",s),t.on("close",s)):(t.on("complete",c),t.on("abort",h),t.req?y():t.on("request",y)),t.on("end",d),t.on("finish",c),!1!==r.error&&t.on("error",p),t.on("close",h),function(){t.removeListener("complete",c),t.removeListener("abort",h),t.removeListener("request",y),t.req&&t.req.removeListener("finish",c),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",c),t.removeListener("end",d),t.removeListener("error",p),t.removeListener("close",h)}}},{"../../../errors":180}],190:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],191:[function(e,t,r){var n;var o=e("../../../errors").codes,a=o.ERR_MISSING_ARGS,i=o.ERR_STREAM_DESTROYED;function u(e){if(e)throw e}function s(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var c,f=function(e){return e.length?"function"!=typeof e[e.length-1]?u:e.pop():u}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new a("streams");var d=r.map(function(t,o){var a=o<r.length-1;return function(t,r,o,a){a=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(a);var u=!1;t.on("close",function(){u=!0}),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:o},function(e){if(e)return a(e);u=!0,a()});var s=!1;return function(e){if(!u&&!s)return s=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void a(e||new i("pipe"))}}(t,a,o>0,function(e){c||(c=e),e&&d.forEach(s),a||(d.forEach(s),f(c))})});return r.reduce(l)}},{"../../../errors":180,"./end-of-stream":189}],192:[function(e,t,r){var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,o){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new n(o?r:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}},{"../../../errors":180}],193:[function(e,t,r){t.exports=e("events").EventEmitter},{events:78}],194:[function(e,t,r){(function(t){(function(){var n=e("./lib/request"),o=e("./lib/response"),a=e("xtend"),i=e("builtin-status-codes"),u=e("url"),s=r;s.request=function(e,r){e="string"==typeof e?u.parse(e):a(e);var o=-1===t.location.protocol.search(/^https?:$/)?"http:":"",i=e.protocol||o,s=e.hostname||e.host,l=e.port,c=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?i+"//"+s:"")+(l?":"+l:"")+c,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var f=new n(e);return r&&f.on("response",r),f},s.get=function(e,t){var r=s.request(e,t);return r.end(),r},s.ClientRequest=n,s.IncomingMessage=o.IncomingMessage,s.Agent=function(){},s.Agent.defaultMaxSockets=4,s.globalAgent=new s.Agent,s.STATUS_CODES=i,s.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":196,"./lib/response":197,"builtin-status-codes":58,url:217,xtend:224}],195:[function(e,t,r){(function(e){(function(){var t;function n(){if(void 0!==t)return t;if(e.XMLHttpRequest){t=new e.XMLHttpRequest;try{t.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){t=null}}else t=null;return t}function o(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function a(e){return"function"==typeof e}r.fetch=a(e.fetch)&&a(e.ReadableStream),r.writableStream=a(e.WritableStream),r.abortController=a(e.AbortController),r.arraybuffer=r.fetch||o("arraybuffer"),r.msstream=!r.fetch&&o("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&o("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!n()&&a(n().overrideMimeType),t=null}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],196:[function(e,t,r){(function(r,n,o){(function(){var a=e("./capability"),i=e("inherits"),u=e("./response"),s=e("readable-stream"),l=u.IncomingMessage,c=u.readyStates;var f=t.exports=function(e){var t,r=this;s.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+o.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":"text"}(t,n),r._fetchTimer=null,r._socketTimeout=null,r._socketTimer=null,r.on("finish",function(){r._onFinish()})};i(f,s.Writable),f.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===d.indexOf(r)&&(this._headers[r]={name:e,value:t})},f.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},f.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},f.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts;"timeout"in t&&0!==t.timeout&&e.setTimeout(t.timeout);var o=e._headers,i=null;"GET"!==t.method&&"HEAD"!==t.method&&(i=new Blob(e._body,{type:(o["content-type"]||{}).value||""}));var u=[];if(Object.keys(o).forEach(function(e){var t=o[e].name,r=o[e].value;Array.isArray(r)?r.forEach(function(e){u.push([t,e])}):u.push([t,r])}),"fetch"===e._mode){var s=null;if(a.abortController){var l=new AbortController;s=l.signal,e._fetchAbortController=l,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=n.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:u,body:i||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:s}).then(function(t){e._fetchResponse=t,e._resetTimers(!1),e._connect()},function(t){e._resetTimers(!0),e._destroyed||e.emit("error",t)})}else{var f=e._xhr=new n.XMLHttpRequest;try{f.open(e._opts.method,e._opts.url,!0)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}"responseType"in f&&(f.responseType=e._mode),"withCredentials"in f&&(f.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in f&&f.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(f.timeout=t.requestTimeout,f.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(e){f.setRequestHeader(e[0],e[1])}),e._response=null,f.onreadystatechange=function(){switch(f.readyState){case c.LOADING:case c.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(f.onprogress=function(){e._onXHRProgress()}),f.onerror=function(){e._destroyed||(e._resetTimers(!0),e.emit("error",new Error("XHR error")))};try{f.send(i)}catch(t){return void r.nextTick(function(){e.emit("error",t)})}}}},f.prototype._onXHRProgress=function(){var e=this;e._resetTimers(!1),function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress(e._resetTimers.bind(e)))},f.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._resetTimers.bind(e)),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},f.prototype._write=function(e,t,r){this._body.push(e),r()},f.prototype._resetTimers=function(e){var t=this;n.clearTimeout(t._socketTimer),t._socketTimer=null,e?(n.clearTimeout(t._fetchTimer),t._fetchTimer=null):t._socketTimeout&&(t._socketTimer=n.setTimeout(function(){t.emit("timeout")},t._socketTimeout))},f.prototype.abort=f.prototype.destroy=function(e){var t=this;t._destroyed=!0,t._resetTimers(!0),t._response&&(t._response._destroyed=!0),t._xhr?t._xhr.abort():t._fetchAbortController&&t._fetchAbortController.abort(),e&&t.emit("error",e)},f.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),s.Writable.prototype.end.call(this,e,t,r)},f.prototype.setTimeout=function(e,t){var r=this;t&&r.once("timeout",t),r._socketTimeout=e,r._resetTimers(!1)},f.prototype.flushHeaders=function(){},f.prototype.setNoDelay=function(){},f.prototype.setSocketKeepAlive=function(){};var d=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":195,"./response":197,_process:160,buffer:57,inherits:111,"readable-stream":212}],197:[function(e,t,r){(function(t,n,o){(function(){var a=e("./capability"),i=e("inherits"),u=e("readable-stream"),s=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=r.IncomingMessage=function(e,r,n,i){var s=this;if(u.Readable.call(s),s._mode=n,s.headers={},s.rawHeaders=[],s.trailers={},s.rawTrailers=[],s.on("end",function(){t.nextTick(function(){s.emit("close")})}),"fetch"===n){if(s._fetchResponse=r,s.url=r.url,s.statusCode=r.status,s.statusMessage=r.statusText,r.headers.forEach(function(e,t){s.headers[t.toLowerCase()]=e,s.rawHeaders.push(t,e)}),a.writableStream){var l=new WritableStream({write:function(e){return i(!1),new Promise(function(t,r){s._destroyed?r():s.push(o.from(e))?t():s._resumeFetch=t})},close:function(){i(!0),s._destroyed||s.push(null)},abort:function(e){i(!0),s._destroyed||s.emit("error",e)}});try{return void r.body.pipeTo(l).catch(function(e){i(!0),s._destroyed||s.emit("error",e)})}catch(h){}}var c=r.body.getReader();function p(){c.read().then(function(e){s._destroyed||(i(e.done),e.done?s.push(null):(s.push(o.from(e.value)),p()))}).catch(function(e){i(!0),s._destroyed||s.emit("error",e)})}p()}else{if(s._xhr=e,s._pos=0,s.url=e.responseURL,s.statusCode=e.status,s.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===s.headers[r]&&(s.headers[r]=[]),s.headers[r].push(t[2])):void 0!==s.headers[r]?s.headers[r]+=", "+t[2]:s.headers[r]=t[2],s.rawHeaders.push(t[1],t[2])}}),s._charset="x-user-defined",!a.overrideMimeType){var f=s.rawHeaders["mime-type"];if(f){var d=f.match(/;\s*charset=([^;])(;|$)/);d&&(s._charset=d[1].toLowerCase())}s._charset||(s._charset="utf-8")}}};i(l,u.Readable),l.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},l.prototype._onXHRProgress=function(e){var t=this,r=t._xhr,a=null;switch(t._mode){case"text":if((a=r.responseText).length>t._pos){var i=a.substr(t._pos);if("x-user-defined"===t._charset){for(var u=o.alloc(i.length),l=0;l<i.length;l++)u[l]=255&i.charCodeAt(l);t.push(u)}else t.push(i,t._charset);t._pos=a.length}break;case"arraybuffer":if(r.readyState!==s.DONE||!r.response)break;a=r.response,t.push(o.from(new Uint8Array(a)));break;case"moz-chunked-arraybuffer":if(a=r.response,r.readyState!==s.LOADING||!a)break;t.push(o.from(new Uint8Array(a)));break;case"ms-stream":if(a=r.response,r.readyState!==s.LOADING)break;var c=new n.MSStreamReader;c.onprogress=function(){c.result.byteLength>t._pos&&(t.push(o.from(new Uint8Array(c.result.slice(t._pos)))),t._pos=c.result.byteLength)},c.onload=function(){e(!0),t.push(null)},c.readAsArrayBuffer(a)}t._xhr.readyState===s.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":195,_process:160,buffer:57,inherits:111,"readable-stream":212}],198:[function(e,t,r){arguments[4][180][0].apply(r,arguments)},{dup:180}],199:[function(e,t,r){(function(r){(function(){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var o=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(l,o);for(var i=n(a.prototype),u=0;u<i.length;u++){var s=i[u];l.prototype[s]||(l.prototype[s]=a.prototype[s])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||r.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":201,"./_stream_writable":203,_process:160,inherits:111}],200:[function(e,t,r){arguments[4][182][0].apply(r,arguments)},{"./_stream_transform":202,dup:182,inherits:111}],201:[function(e,t,r){(function(r,n){(function(){var o;t.exports=A,A.ReadableState=O;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},i=e("./internal/streams/stream"),u=e("buffer").Buffer,s=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,c=e("util");l=c&&c.debuglog?c.debuglog("stream"):function(){};var f,d,p,h=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),g=e("./internal/streams/state").getHighWaterMark,b=e("../errors").codes,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,S=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(A,i);var D=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function O(t,r,n){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=r instanceof o),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",n),this.buffer=new h,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&&(f||(f=e("string_decoder/").StringDecoder),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(o=o||e("./_stream_duplex"),!(this instanceof A))return new A(t);var r=this instanceof o;this._readableState=new O(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),i.call(this)}function _(e,t,r,n,o){l("readableAddChunk",t);var a,i=e._readableState;if(null===t)i.reading=!1,function(e,t){if(l("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?T(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,j(e)))}(e,i);else if(o||(a=function(e,t){var r;n=t,u.isBuffer(n)||n instanceof s||"string"==typeof t||void 0===t||e.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],t));var n;return r}(i,t)),a)D(e,a);else if(i.objectMode||t&&t.length>0)if("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)i.endEmitted?D(e,new S):R(e,i,t,!0);else if(i.ended)D(e,new v);else{if(i.destroyed)return!1;i.reading=!1,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?R(e,i,t,!1):x(e,i)):R(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function R(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),x(e,t)}Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),A.prototype.destroy=y.destroy,A.prototype._undestroy=y.undestroy,A.prototype._destroy=function(e,t){t(e)},A.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),_(this,e,t,!1,r)},A.prototype.unshift=function(e){return _(this,e,null,!0,!1)},A.prototype.isPaused=function(){return!1===this._readableState.flowing},A.prototype.setEncoding=function(t){f||(f=e("string_decoder/").StringDecoder);var r=new f(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var C=1073741824;function q(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(j,e))}function j(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function x(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(l("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){l("readable nexttick read 0"),e.read(0)}function k(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function M(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function P(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(B,t,e))}function B(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}A.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):T(this),null;if(0===(e=q(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,o=t.needReadable;return l("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",o=!0),t.ended||t.reading?l("reading or ended",o=!1):o&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=q(r,t))),null===(n=e>0?M(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){D(this,new w("_read()"))},A.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var i=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?s:g;function u(t,r){l("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,l("cleanup"),e.removeListener("close",h),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",u),n.removeListener("end",s),n.removeListener("end",g),n.removeListener("data",d),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function s(){l("onend"),e.end()}o.endEmitted?r.nextTick(i):n.once("end",i),e.on("unpipe",u);var c=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",c);var f=!1;function d(t){l("ondata");var r=e.write(t);l("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==F(o.pipes,e))&&!f&&(l("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function p(t){l("onerror",t),g(),e.removeListener("error",p),0===a(e,"error")&&D(e,t)}function h(){e.removeListener("finish",y),g()}function y(){l("onfinish"),e.removeListener("close",h),g()}function g(){l("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",y),e.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var i=F(t.pipes,e);return-1===i||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},A.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,l("on readable",o.length,o.reading),o.length?T(this):o.reading||r.nextTick(U,this))),n},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},A.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(k,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var o in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(l("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o)||(r.objectMode||o&&o.length)&&(t.push(o)||(n=!0,e.pause()))}),e)void 0===this[o]&&"function"==typeof e[o]&&(this[o]=function(t){return function(){return e[t].apply(e,arguments)}}(o));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(A.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(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(e){this._readableState&&(this._readableState.flowing=e)}}),A._fromList=M,Object.defineProperty(A.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(A.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(A,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":198,"./_stream_duplex":199,"./internal/streams/async_iterator":204,"./internal/streams/buffer_list":205,"./internal/streams/destroy":206,"./internal/streams/from":208,"./internal/streams/state":210,"./internal/streams/stream":211,_process:160,buffer:57,events:78,inherits:111,"string_decoder/":213,util:55}],202:[function(e,t,r){arguments[4][184][0].apply(r,arguments)},{"../errors":198,"./_stream_duplex":199,dup:184,inherits:111}],203:[function(e,t,r){(function(r,n){(function(){function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var a;t.exports=A,A.WritableState=O;var i={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),s=e("buffer").Buffer,l=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,f=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,h=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,S=p.ERR_UNKNOWN_ENCODING,D=f.errorOrDestroy;function E(){}function O(t,n,i){a=a||e("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=n instanceof a),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===t.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,o=n.sync,a=n.writecb;if("function"!=typeof a)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,o,a){--t.pendingcb,n?(r.nextTick(a,o),r.nextTick(j,e,t),e._writableState.errorEmitted=!0,D(e,o)):(a(o),e._writableState.errorEmitted=!0,D(e,o),j(e,t))}(e,n,o,t,a);else{var i=q(n)||e.destroyed;i||n.corked||n.bufferProcessing||!n.bufferedRequest||C(e,n),o?r.nextTick(R,e,n,i,a):R(e,n,i,a)}}(n,e)},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 o(this)}function A(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(A,this))return new A(t);this._writableState=new O(t,this,r),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)),u.call(this)}function _(e,t,r,n,o,a,i){t.writelen=n,t.writecb=i,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}function R(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),j(e,t)}function C(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,a=new Array(n),i=t.corkedRequestsFree;i.entry=r;for(var u=0,s=!0;r;)a[u]=r,r.isBuf||(s=!1),r=r.next,u+=1;a.allBuffers=s,_(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function q(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function T(e,t){e._final(function(r){t.pendingcb--,r&&D(e,r),t.prefinished=!0,e.emit("prefinish"),j(e,t)})}function j(e,t){var n=q(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(T,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var o=e._readableState;(!o||o.autoDestroy&&o.endEmitted)&&e.destroy()}return n}e("inherits")(A,u),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===A&&(e&&e._writableState instanceof O)}})):c=function(e){return e instanceof this},A.prototype.pipe=function(){D(this,new b)},A.prototype.write=function(e,t,n){var o,a=this._writableState,i=!1,u=!a.objectMode&&(o=e,s.isBuffer(o)||o instanceof l);return u&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"==typeof t&&(n=t,t=null),u?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=E),a.ending?function(e,t){var n=new w;D(e,n),r.nextTick(t,n)}(this,n):(u||function(e,t,n,o){var a;return null===n?a=new v:"string"==typeof n||t.objectMode||(a=new h("chunk",["string","Buffer"],n)),!a||(D(e,a),r.nextTick(o,a),!1)}(this,a,e,n))&&(a.pendingcb++,i=function(e,t,r,n,o,a){if(!r){var i=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=s.from(t,r));return t}(t,n,o);n!==i&&(r=!0,o="buffer",n=i)}var u=t.objectMode?1:n.length;t.length+=u;var l=t.length<t.highWaterMark;l||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,u,n,o,a);return l}(this,a,u,e,t,n)),i},A.prototype.cork=function(){this._writableState.corked++},A.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||C(this,e))},A.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,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(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,n){var o=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),o.corked&&(o.corked=1,this.uncork()),o.ending||function(e,t,n){t.ending=!0,j(e,t),n&&(t.finished?r.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,o,n),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(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":198,"./_stream_duplex":199,"./internal/streams/destroy":206,"./internal/streams/state":210,"./internal/streams/stream":211,_process:160,buffer:57,inherits:111,"util-deprecate":218}],204:[function(e,t,r){(function(r){(function(){var n;function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),i=Symbol("lastResolve"),u=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),f=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[i];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[i]=null,e[u]=null,t(p(r,!1)))}}function y(e){r.nextTick(h,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,n){r.nextTick(function(){e[s]?n(e[s]):t(p(void 0,!0))})});var n,o=this[c];if(o)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[l]?r(p(void 0,!0)):t[f](r,n)},n)}}(o,this));else{var a=this[d].read();if(null!==a)return Promise.resolve(p(a,!1));n=new Promise(this[f])}return this[c]=n,n}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(b,(o(t={},d,{value:e,writable:!0}),o(t,i,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,l,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[i]=null,r[u]=null,e(p(n,!1))):(r[i]=e,r[u]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[c]=null,r[i]=null,r[u]=null,t(e)),void(r[s]=e)}var n=r[i];null!==n&&(r[c]=null,r[i]=null,r[u]=null,n(p(void 0,!0))),r[l]=!0}),e.on("readable",y.bind(null,r)),r}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":207,_process:160}],205:[function(e,t,r){arguments[4][187][0].apply(r,arguments)},{buffer:57,dup:187,util:55}],206:[function(e,t,r){(function(e){(function(){function r(e,t){o(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}t.exports={destroy:function(t,a){var i=this,u=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return u||s?(a?a(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(o,this,t)):e.nextTick(o,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!a&&t?i._writableState?i._writableState.errorEmitted?e.nextTick(n,i):(i._writableState.errorEmitted=!0,e.nextTick(r,i,t)):e.nextTick(r,i,t):a?(e.nextTick(n,i),a(t)):e.nextTick(n,i)}),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(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:160}],207:[function(e,t,r){arguments[4][189][0].apply(r,arguments)},{"../../../errors":198,dup:189}],208:[function(e,t,r){arguments[4][190][0].apply(r,arguments)},{dup:190}],209:[function(e,t,r){arguments[4][191][0].apply(r,arguments)},{"../../../errors":198,"./end-of-stream":207,dup:191}],210:[function(e,t,r){arguments[4][192][0].apply(r,arguments)},{"../../../errors":198,dup:192}],211:[function(e,t,r){arguments[4][193][0].apply(r,arguments)},{dup:193,events:78}],212:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":199,"./lib/_stream_passthrough.js":200,"./lib/_stream_readable.js":201,"./lib/_stream_transform.js":202,"./lib/_stream_writable.js":203,"./lib/internal/streams/end-of-stream.js":207,"./lib/internal/streams/pipeline.js":209}],213:[function(e,t,r){var n=e("safe-buffer").Buffer,o=n.isEncoding||function(e){switch((e=""+e)&&e.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 a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=s,this.end=l,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(e.lastNeed=o-2),o;if(--n<r||-2===o)return 0;if(o=i(t[n]),o>=0)return o>0&&(2===o?o=0:e.lastNeed=o-3),o;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":170}],214:[function(e,t,r){(function(r){(function(){var n=e("stream");function o(e,t,o){e=e||function(e){this.queue(e)},t=t||function(){this.queue(null)};var a=!1,i=!1,u=[],s=!1,l=new n;function c(){for(;u.length&&!l.paused;){var e=u.shift();if(null===e)return l.emit("end");l.emit("data",e)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(o&&!1===o.autoDestroy),l.write=function(t){return e.call(this,t),!l.paused},l.queue=l.push=function(e){return s||(null===e&&(s=!0),u.push(e),c()),l},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick(function(){l.destroy()})}),l.end=function(e){if(!a)return a=!0,arguments.length&&l.write(e),l.writable=!1,t.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!i)return i=!0,a=!0,u.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}t.exports=o,o.through=o}).call(this)}).call(this,e("_process"))},{_process:160,stream:179}],215:[function(e,t,r){(function(t,n){(function(){var o=e("process/browser.js").nextTick,a=Function.prototype.apply,i=Array.prototype.slice,u={},s=0;function l(e,t){this._id=e,this._clearFn=t}r.setTimeout=function(){return new l(a.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(a.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(e){e.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},r.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},r._unrefActive=r.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r.setImmediate="function"==typeof t?t:function(e){var t=s++,n=!(arguments.length<2)&&i.call(arguments,1);return u[t]=!0,o(function(){u[t]&&(n?e.apply(null,n):e.call(null),r.clearImmediate(t))}),t},r.clearImmediate="function"==typeof n?n:function(e){delete u[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":160,timers:215}],216:[function(e,t,r){(function(e){(function(){!function(e,n){"object"==typeof r&&void 0!==t?t.exports=n():(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var t=e._,r=e._=n();r.noConflict=function(){return e._=t,r}}())}(this,function(){var t="1.13.8",r="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},n=Array.prototype,o=Object.prototype,a="undefined"!=typeof Symbol?Symbol.prototype:null,i=n.push,u=n.slice,s=o.toString,l=o.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,f="undefined"!=typeof DataView,d=Array.isArray,p=Object.keys,h=Object.create,y=c&&ArrayBuffer.isView,g=isNaN,b=isFinite,m=!{toString:null}.propertyIsEnumerable("toString"),v=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1;function S(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),o=0;o<r;o++)n[o]=arguments[o+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var a=Array(t+1);for(o=0;o<t;o++)a[o]=arguments[o];return a[t]=n,e.apply(this,a)}}function D(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function E(e){return void 0===e}function O(e){return!0===e||!1===e||"[object Boolean]"===s.call(e)}function A(e){var t="[object "+e+"]";return function(e){return s.call(e)===t}}var _=A("String"),R=A("Number"),C=A("Date"),q=A("RegExp"),T=A("Error"),j=A("Symbol"),x=A("ArrayBuffer"),L=A("Function"),I=r.document&&r.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof I&&(L=function(e){return"function"==typeof e||!1});var U=L,k=A("Object"),N=f&&(!/\[native code\]/.test(String(DataView))||k(new DataView(new ArrayBuffer(8)))),M="undefined"!=typeof Map&&k(new Map),P=A("DataView");var B=N?function(e){return null!=e&&U(e.getInt8)&&x(e.buffer)}:P,F=d||A("Array");function Q(e,t){return null!=e&&l.call(e,t)}var $=A("Arguments");!function(){$(arguments)||($=function(e){return Q(e,"callee")})}();var J=$;function H(e){return R(e)&&g(e)}function W(e){return function(){return e}}function G(e){return function(t){var r=e(t);return"number"==typeof r&&r>=0&&r<=w}}function V(e){return function(t){return null==t?void 0:t[e]}}var z=V("byteLength"),K=G(z),Y=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(e){return y?y(e)&&!B(e):K(e)&&Y.test(s.call(e))}:W(!1),Z=V("length");function ee(e,t){t=function(e){for(var t={},r=e.length,n=0;n<r;++n)t[e[n]]=!0;return{contains:function(e){return!0===t[e]},push:function(r){return t[r]=!0,e.push(r)}}}(t);var r=v.length,n=e.constructor,a=U(n)&&n.prototype||o,i="constructor";for(Q(e,i)&&!t.contains(i)&&t.push(i);r--;)(i=v[r])in e&&e[i]!==a[i]&&!t.contains(i)&&t.push(i)}function te(e){if(!D(e))return[];if(p)return p(e);var t=[];for(var r in e)Q(e,r)&&t.push(r);return m&&ee(e,t),t}function re(e,t){var r=te(t),n=r.length;if(null==e)return!n;for(var o=Object(e),a=0;a<n;a++){var i=r[a];if(t[i]!==o[i]||!(i in o))return!1}return!0}function ne(e){return e instanceof ne?e:this instanceof ne?void(this._wrapped=e):new ne(e)}function oe(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,z(e))}ne.VERSION=t,ne.prototype.value=function(){return this._wrapped},ne.prototype.valueOf=ne.prototype.toJSON=ne.prototype.value,ne.prototype.toString=function(){return String(this._wrapped)};var ae="[object DataView]";function ie(e){if(!D(e))return[];var t=[];for(var r in e)t.push(r);return m&&ee(e,t),t}function ue(e){var t=Z(e);return function(r){if(null==r)return!1;var n=ie(r);if(Z(n))return!1;for(var o=0;o<t;o++)if(!U(r[e[o]]))return!1;return e!==de||!U(r[se])}}var se="forEach",le=["clear","delete"],ce=["get","has","set"],fe=le.concat(se,ce),de=le.concat(ce),pe=["add"].concat(le,se,"has"),he=M?ue(fe):A("Map"),ye=M?ue(de):A("WeakMap"),ge=M?ue(pe):A("Set"),be=A("WeakSet");function me(e){for(var t=te(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=e[t[o]];return n}function ve(e){for(var t={},r=te(e),n=0,o=r.length;n<o;n++)t[e[r[n]]]=r[n];return t}function we(e){var t=[];for(var r in e)U(e[r])&&t.push(r);return t.sort()}function Se(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||null==r)return r;for(var o=1;o<n;o++)for(var a=arguments[o],i=e(a),u=i.length,s=0;s<u;s++){var l=i[s];t&&void 0!==r[l]||(r[l]=a[l])}return r}}var De=Se(ie),Ee=Se(te),Oe=Se(ie,!0);function Ae(e){if(!D(e))return{};if(h)return h(e);var t=function(){};t.prototype=e;var r=new t;return t.prototype=null,r}function _e(e){return F(e)?e:[e]}function Re(e){return ne.toPath(e)}function Ce(e,t){for(var r=t.length,n=0;n<r;n++){if(null==e)return;e=e[t[n]]}return r?e:void 0}function qe(e,t,r){var n=Ce(e,Re(t));return E(n)?r:n}function Te(e){return e}function je(e){return e=Ee({},e),function(t){return re(t,e)}}function xe(e){return e=Re(e),function(t){return Ce(t,e)}}function Le(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,o){return e.call(t,r,n,o)};case 4:return function(r,n,o,a){return e.call(t,r,n,o,a)}}return function(){return e.apply(t,arguments)}}function Ie(e,t,r){return null==e?Te:U(e)?Le(e,t,r):D(e)&&!F(e)?je(e):xe(e)}function Ue(e,t){return Ie(e,t,1/0)}function ke(e,t,r){return ne.iteratee!==Ue?ne.iteratee(e,t):Ie(e,t,r)}function Ne(){}function Me(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}ne.toPath=_e,ne.iteratee=Ue;var Pe=Date.now||function(){return(new Date).getTime()};function Be(e){var t=function(t){return e[t]},r="(?:"+te(e).join("|")+")",n=RegExp(r),o=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(o,t):e}}var Fe={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Qe=Be(Fe),$e=Be(ve(Fe)),Je=ne.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},He=/(.)^/,We={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ge=/\\|'|\r|\n|\u2028|\u2029/g;function Ve(e){return"\\"+We[e]}var ze=/^\s*(\w|\$)+\s*$/;var Ke=0;function Ye(e,t,r,n,o){if(!(n instanceof t))return e.apply(r,o);var a=Ae(e.prototype),i=e.apply(a,o);return D(i)?i:a}var Xe=S(function(e,t){var r=Xe.placeholder,n=function(){for(var o=0,a=t.length,i=Array(a),u=0;u<a;u++)i[u]=t[u]===r?arguments[o++]:t[u];for(;o<arguments.length;)i.push(arguments[o++]);return Ye(e,n,this,this,i)};return n});Xe.placeholder=ne;var Ze=S(function(e,t,r){if(!U(e))throw new TypeError("Bind must be called on a function");var n=S(function(o){return Ye(e,n,t,this,r.concat(o))});return n}),et=G(Z);function tt(e,t,r){t||0===t||(t=1/0);for(var n=[],o=0,a=0,i=Z(e)||0,u=[];;)if(a>=i){if(!u.length)break;var s=u.pop();a=s.i,e=s.v,i=Z(e)}else{var l=e[a++];u.length>=t?n[o++]=l:et(l)&&(F(l)||J(l))?(u.push({i:a,v:e}),a=0,i=Z(e=l)):r||(n[o++]=l)}return n}var rt=S(function(e,t){var r=(t=tt(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=Ze(e[n],e)}return e});var nt=S(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)}),ot=Xe(nt,ne,1);function at(e){return function(){return!e.apply(this,arguments)}}function it(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var ut=Xe(it,2);function st(e,t,r){t=ke(t,r);for(var n,o=te(e),a=0,i=o.length;a<i;a++)if(t(e[n=o[a]],n,e))return n}function lt(e){return function(t,r,n){r=ke(r,n);for(var o=Z(t),a=e>0?0:o-1;a>=0&&a<o;a+=e)if(r(t[a],a,t))return a;return-1}}var ct=lt(1),ft=lt(-1);function dt(e,t,r,n){for(var o=(r=ke(r,n,1))(t),a=0,i=Z(e);a<i;){var u=Math.floor((a+i)/2);r(e[u])<o?a=u+1:i=u}return a}function pt(e,t,r){return function(n,o,a){var i=0,s=Z(n);if("number"==typeof a)e>0?i=a>=0?a:Math.max(a+s,i):s=a>=0?Math.min(a+1,s):a+s+1;else if(r&&a&&s)return n[a=r(n,o)]===o?a:-1;if(o!=o)return(a=t(u.call(n,i,s),H))>=0?a+i:-1;for(a=e>0?i:s-1;a>=0&&a<s;a+=e)if(n[a]===o)return a;return-1}}var ht=pt(1,ct,dt),yt=pt(-1,ft);function gt(e,t,r){var n=(et(e)?ct:st)(e,t,r);if(void 0!==n&&-1!==n)return e[n]}function bt(e,t,r){var n,o;if(t=Le(t,r),et(e))for(n=0,o=e.length;n<o;n++)t(e[n],n,e);else{var a=te(e);for(n=0,o=a.length;n<o;n++)t(e[a[n]],a[n],e)}return e}function mt(e,t,r){t=ke(t,r);for(var n=!et(e)&&te(e),o=(n||e).length,a=Array(o),i=0;i<o;i++){var u=n?n[i]:i;a[i]=t(e[u],u,e)}return a}function vt(e){return function(t,r,n,o){var a=arguments.length>=3;return function(t,r,n,o){var a=!et(t)&&te(t),i=(a||t).length,u=e>0?0:i-1;for(o||(n=t[a?a[u]:u],u+=e);u>=0&&u<i;u+=e){var s=a?a[u]:u;n=r(n,t[s],s,t)}return n}(t,Le(r,o,4),n,a)}}var wt=vt(1),St=vt(-1);function Dt(e,t,r){var n=[];return t=ke(t,r),bt(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function Et(e,t,r){t=ke(t,r);for(var n=!et(e)&&te(e),o=(n||e).length,a=0;a<o;a++){var i=n?n[a]:a;if(!t(e[i],i,e))return!1}return!0}function Ot(e,t,r){t=ke(t,r);for(var n=!et(e)&&te(e),o=(n||e).length,a=0;a<o;a++){var i=n?n[a]:a;if(t(e[i],i,e))return!0}return!1}function At(e,t,r,n){return et(e)||(e=me(e)),("number"!=typeof r||n)&&(r=0),ht(e,t,r)>=0}var _t=S(function(e,t,r){var n,o;return U(t)?o=t:(t=Re(t),n=t.slice(0,-1),t=t[t.length-1]),mt(e,function(e){var a=o;if(!a){if(n&&n.length&&(e=Ce(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,r)})});function Rt(e,t){return mt(e,xe(t))}function Ct(e,t,r){var n,o,a=-1/0,i=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var u=0,s=(e=et(e)?e:me(e)).length;u<s;u++)null!=(n=e[u])&&n>a&&(a=n);else t=ke(t,r),bt(e,function(e,r,n){((o=t(e,r,n))>i||o===-1/0&&a===-1/0)&&(a=e,i=o)});return a}var qt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Tt(e){return e?F(e)?u.call(e):_(e)?e.match(qt):et(e)?mt(e,Te):me(e):[]}function jt(e,t,r){if(null==t||r)return et(e)||(e=me(e)),e[Me(e.length-1)];var n=Tt(e),o=Z(n);t=Math.max(Math.min(t,o),0);for(var a=o-1,i=0;i<t;i++){var u=Me(i,a),s=n[i];n[i]=n[u],n[u]=s}return n.slice(0,t)}function xt(e,t){return function(r,n,o){var a=t?[[],[]]:{};return n=ke(n,o),bt(r,function(t,o){var i=n(t,o,r);e(a,t,i)}),a}}var Lt=xt(function(e,t,r){Q(e,r)?e[r].push(t):e[r]=[t]}),It=xt(function(e,t,r){e[r]=t}),Ut=xt(function(e,t,r){Q(e,r)?e[r]++:e[r]=1}),kt=xt(function(e,t,r){e[r?0:1].push(t)},!0);function Nt(e,t,r){return t in r}var Mt=S(function(e,t){var r={},n=t[0];if(null==e)return r;U(n)?(t.length>1&&(n=Le(n,t[1])),t=ie(e)):(n=Nt,t=tt(t,!1,!1),e=Object(e));for(var o=0,a=t.length;o<a;o++){var i=t[o],u=e[i];n(u,i,e)&&(r[i]=u)}return r}),Pt=S(function(e,t){var r,n=t[0];return U(n)?(n=at(n),t.length>1&&(r=t[1])):(t=mt(tt(t,!1,!1),String),n=function(e,r){return!At(t,r)}),Mt(e,n,r)});function Bt(e,t,r){return u.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))}function Ft(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[0]:Bt(e,e.length-t)}function Qt(e,t,r){return u.call(e,null==t||r?1:t)}var $t=S(function(e,t){return t=tt(t,!0,!0),Dt(e,function(e){return!At(t,e)})}),Jt=S(function(e,t){return $t(e,t)});function Ht(e,t,r,n){O(t)||(n=r,r=t,t=!1),null!=r&&(r=ke(r,n));for(var o=[],a=[],i=0,u=Z(e);i<u;i++){var s=e[i],l=r?r(s,i,e):s;t&&!r?(i&&a===l||o.push(s),a=l):r?At(a,l)||(a.push(l),o.push(s)):At(o,s)||o.push(s)}return o}var Wt=S(function(e){return Ht(tt(e,!0,!0))});function Gt(e){for(var t=e&&Ct(e,Z).length||0,r=Array(t),n=0;n<t;n++)r[n]=Rt(e,n);return r}var Vt=S(Gt);function zt(e,t){return e._chain?ne(t).chain():t}function Kt(e){return bt(we(e),function(t){var r=ne[t]=e[t];ne.prototype[t]=function(){var e=[this._wrapped];return i.apply(e,arguments),zt(this,r.apply(ne,e))}}),ne}bt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=n[e];ne.prototype[e]=function(){var r=this._wrapped;return null!=r&&(t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0]),zt(this,r)}}),bt(["concat","join","slice"],function(e){var t=n[e];ne.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),zt(this,e)}});var Yt={__proto__:null,VERSION:t,restArguments:S,isObject:D,isNull:function(e){return null===e},isUndefined:E,isBoolean:O,isElement:function(e){return!(!e||1!==e.nodeType)},isString:_,isNumber:R,isDate:C,isRegExp:q,isError:T,isSymbol:j,isArrayBuffer:x,isDataView:B,isArray:F,isFunction:U,isArguments:J,isFinite:function(e){return!j(e)&&b(e)&&!isNaN(parseFloat(e))},isNaN:H,isTypedArray:X,isEmpty:function(e){if(null==e)return!0;var t=Z(e);return"number"==typeof t&&(F(e)||_(e)||J(e))?0===t:0===Z(te(e))},isMatch:re,isEqual:function(e,t){for(var r=[{a:e,b:t}],n=[],o=[];r.length;){var i=r.pop();if(!0!==i){if((e=i.a)===(t=i.b)){if(0!==e||1/e==1/t)continue;return!1}if(null==e||null==t)return!1;if(e!=e){if(t!=t)continue;return!1}var u=typeof e;if("function"!==u&&"object"!==u&&"object"!=typeof t)return!1;e instanceof ne&&(e=e._wrapped),t instanceof ne&&(t=t._wrapped);var l=s.call(e);if(l!==s.call(t))return!1;if(N&&"[object Object]"==l&&B(e)){if(!B(t))return!1;l=ae}switch(l){case"[object RegExp]":case"[object String]":if(""+e==""+t)continue;return!1;case"[object Number]":r.push({a:+e,b:+t});continue;case"[object Date]":case"[object Boolean]":if(+e===+t)continue;return!1;case"[object Symbol]":if(a.valueOf.call(e)===a.valueOf.call(t))continue;return!1;case"[object ArrayBuffer]":case ae:r.push({a:oe(e),b:oe(t)});continue}var c="[object Array]"===l;if(!c&&X(e)){if(z(e)!==z(t))return!1;if(e.buffer===t.buffer&&e.byteOffset===t.byteOffset)continue;c=!0}if(!c){if("object"!=typeof e||"object"!=typeof t)return!1;var f=e.constructor,d=t.constructor;if(f!==d&&!(U(f)&&f instanceof f&&U(d)&&d instanceof d)&&"constructor"in e&&"constructor"in t)return!1}for(var p=n.length;p--;)if(n[p]===e){if(o[p]===t)break;return!1}if(!(p>=0))if(n.push(e),o.push(t),r.push(!0),c){if((p=e.length)!==t.length)return!1;for(;p--;)r.push({a:e[p],b:t[p]})}else{var h,y=te(e);if(p=y.length,te(t).length!==p)return!1;for(;p--;){if(!Q(t,h=y[p]))return!1;r.push({a:e[h],b:t[h]})}}}else n.pop(),o.pop()}return!0},isMap:he,isWeakMap:ye,isSet:ge,isWeakSet:be,keys:te,allKeys:ie,values:me,pairs:function(e){for(var t=te(e),r=t.length,n=Array(r),o=0;o<r;o++)n[o]=[t[o],e[t[o]]];return n},invert:ve,functions:we,methods:we,extend:De,extendOwn:Ee,assign:Ee,defaults:Oe,create:function(e,t){var r=Ae(e);return t&&Ee(r,t),r},clone:function(e){return D(e)?F(e)?e.slice():De({},e):e},tap:function(e,t){return t(e),e},get:qe,has:function(e,t){for(var r=(t=Re(t)).length,n=0;n<r;n++){var o=t[n];if(!Q(e,o))return!1;e=e[o]}return!!r},mapObject:function(e,t,r){t=ke(t,r);for(var n=te(e),o=n.length,a={},i=0;i<o;i++){var u=n[i];a[u]=t(e[u],u,e)}return a},identity:Te,constant:W,noop:Ne,toPath:_e,property:xe,propertyOf:function(e){return null==e?Ne:function(t){return qe(e,t)}},matcher:je,matches:je,times:function(e,t,r){var n=Array(Math.max(0,e));t=Le(t,r,1);for(var o=0;o<e;o++)n[o]=t(o);return n},random:Me,now:Pe,escape:Qe,unescape:$e,templateSettings:Je,template:function(e,t,r){!t&&r&&(t=r),t=Oe({},t,ne.templateSettings);var n=RegExp([(t.escape||He).source,(t.interpolate||He).source,(t.evaluate||He).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(n,function(t,r,n,i,u){return a+=e.slice(o,u).replace(Ge,Ve),o=u+t.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),t}),a+="';\n";var i,u=t.variable;if(u){if(!ze.test(u))throw new Error("variable is not a bare identifier: "+u)}else a="with(obj||{}){\n"+a+"}\n",u="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{i=new Function(u,"_",a)}catch(e){throw e.source=a,e}var s=function(e){return i.call(this,e,ne)};return s.source="function("+u+"){\n"+a+"}",s},result:function(e,t,r){var n=(t=Re(t)).length;if(!n)return U(r)?r.call(e):r;for(var o=0;o<n;o++){var a=null==e?void 0:e[t[o]];void 0===a&&(a=r,o=n),e=U(a)?a.call(e):a}return e},uniqueId:function(e){var t=++Ke+"";return e?e+t:t},chain:function(e){var t=ne(e);return t._chain=!0,t},iteratee:Ue,partial:Xe,bind:Ze,bindAll:rt,memoize:function(e,t){var r=function(n){var o=r.cache,a=""+(t?t.apply(this,arguments):n);return Q(o,a)||(o[a]=e.apply(this,arguments)),o[a]};return r.cache={},r},delay:nt,defer:ot,throttle:function(e,t,r){var n,o,a,i,u=0;r||(r={});var s=function(){u=!1===r.leading?0:Pe(),n=null,i=e.apply(o,a),n||(o=a=null)},l=function(){var l=Pe();u||!1!==r.leading||(u=l);var c=t-(l-u);return o=this,a=arguments,c<=0||c>t?(n&&(clearTimeout(n),n=null),u=l,i=e.apply(o,a),n||(o=a=null)):n||!1===r.trailing||(n=setTimeout(s,c)),i};return l.cancel=function(){clearTimeout(n),u=0,n=o=a=null},l},debounce:function(e,t,r){var n,o,a,i,u,s=function(){var l=Pe()-o;t>l?n=setTimeout(s,t-l):(n=null,r||(i=e.apply(u,a)),n||(a=u=null))},l=S(function(l){return u=this,a=l,o=Pe(),n||(n=setTimeout(s,t),r&&(i=e.apply(u,a))),i});return l.cancel=function(){clearTimeout(n),n=a=u=null},l},wrap:function(e,t){return Xe(t,e)},negate:at,compose:function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},after:function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},before:it,once:ut,findKey:st,findIndex:ct,findLastIndex:ft,sortedIndex:dt,indexOf:ht,lastIndexOf:yt,find:gt,detect:gt,findWhere:function(e,t){return gt(e,je(t))},each:bt,forEach:bt,map:mt,collect:mt,reduce:wt,foldl:wt,inject:wt,reduceRight:St,foldr:St,filter:Dt,select:Dt,reject:function(e,t,r){return Dt(e,at(ke(t)),r)},every:Et,all:Et,some:Ot,any:Ot,contains:At,includes:At,include:At,invoke:_t,pluck:Rt,where:function(e,t){return Dt(e,je(t))},max:Ct,min:function(e,t,r){var n,o,a=1/0,i=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var u=0,s=(e=et(e)?e:me(e)).length;u<s;u++)null!=(n=e[u])&&n<a&&(a=n);else t=ke(t,r),bt(e,function(e,r,n){((o=t(e,r,n))<i||o===1/0&&a===1/0)&&(a=e,i=o)});return a},shuffle:function(e){return jt(e,1/0)},sample:jt,sortBy:function(e,t,r){var n=0;return t=ke(t,r),Rt(mt(e,function(e,r,o){return{value:e,index:n++,criteria:t(e,r,o)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index}),"value")},groupBy:Lt,indexBy:It,countBy:Ut,partition:kt,toArray:Tt,size:function(e){return null==e?0:et(e)?e.length:te(e).length},pick:Mt,omit:Pt,first:Ft,head:Ft,take:Ft,initial:Bt,last:function(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[e.length-1]:Qt(e,Math.max(0,e.length-t))},rest:Qt,tail:Qt,drop:Qt,compact:function(e){return Dt(e,Boolean)},flatten:function(e,t){return tt(e,t,!1)},without:Jt,uniq:Ht,unique:Ht,union:Wt,intersection:function(e){for(var t=[],r=arguments.length,n=0,o=Z(e);n<o;n++){var a=e[n];if(!At(t,a)){var i;for(i=1;i<r&&At(arguments[i],a);i++);i===r&&t.push(a)}}return t},difference:$t,unzip:Gt,transpose:Gt,zip:Vt,object:function(e,t){for(var r={},n=0,o=Z(e);n<o;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r},range:function(e,t,r){null==t&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),o=Array(n),a=0;a<n;a++,e+=r)o[a]=e;return o},chunk:function(e,t){if(null==t||t<1)return[];for(var r=[],n=0,o=e.length;n<o;)r.push(u.call(e,n,n+=t));return r},mixin:Kt,default:ne},Xt=Kt(Yt);return Xt._=Xt,Xt})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],217:[function(e,t,r){var n=e("punycode/");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(s),c=["%","/","?",";","#"].concat(l),f=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=e("qs");function m(e,t,r){if(e&&"object"==typeof e&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),i=-1!==o&&o<e.indexOf("#")?"?":"#",s=e.split(i);s[0]=s[0].replace(/\\/g,"/");var m=e=s.join(i);if(m=m.trim(),!r&&1===e.split("#").length){var v=u.exec(m);if(v)return this.path=m,this.href=m,this.pathname=v[1],v[2]?(this.search=v[2],this.query=t?b.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=a.exec(m);if(w){var S=(w=w[0]).toLowerCase();this.protocol=S,m=m.substr(w.length)}if(r||w||m.match(/^\/\/[^@/]+@[^@/]+/)){var D="//"===m.substr(0,2);!D||w&&y[w]||(m=m.substr(2),this.slashes=!0)}if(!y[w]&&(D||w&&!g[w])){for(var E,O,A=-1,_=0;_<f.length;_++){-1!==(R=m.indexOf(f[_]))&&(-1===A||R<A)&&(A=R)}-1!==(O=-1===A?m.lastIndexOf("@"):m.lastIndexOf("@",A))&&(E=m.slice(0,O),m=m.slice(O+1),this.auth=decodeURIComponent(E)),A=-1;for(_=0;_<c.length;_++){var R;-1!==(R=m.indexOf(c[_]))&&(-1===A||R<A)&&(A=R)}-1===A&&(A=m.length),this.host=m.slice(0,A),m=m.slice(A),this.parseHost(),this.hostname=this.hostname||"";var C="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!C)for(var q=this.hostname.split(/\./),T=(_=0,q.length);_<T;_++){var j=q[_];if(j&&!j.match(d)){for(var x="",L=0,I=j.length;L<I;L++)j.charCodeAt(L)>127?x+="x":x+=j[L];if(!x.match(d)){var U=q.slice(0,_),k=q.slice(_+1),N=j.match(p);N&&(U.push(N[1]),k.unshift(N[2])),k.length&&(m="/"+k.join(".")+m),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+M,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!h[S])for(_=0,T=l.length;_<T;_++){var B=l[_];if(-1!==m.indexOf(B)){var F=encodeURIComponent(B);F===B&&(F=escape(B)),m=m.split(B).join(F)}}var Q=m.indexOf("#");-1!==Q&&(this.hash=m.substr(Q),m=m.slice(0,Q));var $=m.indexOf("?");if(-1!==$?(this.search=m.substr($),this.query=m.substr($+1),t&&(this.query=b.parse(this.query)),m=m.slice(0,$)):t&&(this.search="",this.query={}),m&&(this.pathname=m),g[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var J=this.search||"";this.path=M+J}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(a=b.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var i=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),i&&"?"!==i.charAt(0)&&(i="?"+i),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(i=i.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(m(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if("string"==typeof e){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var i=n[a];r[i]=this[i]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),s=0;s<u.length;s++){var l=u[s];"protocol"!==l&&(r[l]=e[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var c=Object.keys(e),f=0;f<c.length;f++){var d=c[f];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var h=r.pathname||"",b=r.search||"";r.path=h+b}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=v||m||r.host&&e.pathname,S=w,D=r.pathname&&r.pathname.split("/")||[],E=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===D[0]?D[0]=r.host:D.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),w=w&&(""===p[0]||""===D[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,D=p;else if(p.length)D||(D=[]),D.pop(),D=D.concat(p),r.search=e.search,r.query=e.query;else if(null!=e.search){if(E)r.host=D.shift(),r.hostname=r.host,(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname);return r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!D.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var O=D.slice(-1)[0],A=(r.host||e.host||D.length>1)&&("."===O||".."===O)||""===O,_=0,R=D.length;R>=0;R--)"."===(O=D[R])?D.splice(R,1):".."===O?(D.splice(R,1),_++):_&&(D.splice(R,1),_--);if(!w&&!S)for(;_--;_)D.unshift("..");!w||""===D[0]||D[0]&&"/"===D[0].charAt(0)||D.unshift(""),A&&"/"!==D.join("/").substr(-1)&&D.push("");var C,q=""===D[0]||D[0]&&"/"===D[0].charAt(0);E&&(r.hostname=q?"":D.length?D.shift():"",r.host=r.hostname,(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.hostname=C.shift(),r.host=r.hostname));return(w=w||r.host&&D.length)&&!q&&D.unshift(""),D.length>0?r.pathname=D.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},r.parse=m,r.resolve=function(e,t){return m(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?m(e,!1,!0).resolveObject(t):t},r.format=function(e){return"string"==typeof e&&(e=m(e)),e instanceof o?e.format():o.prototype.format.call(e)},r.Url=o},{"punycode/":161,qs:163}],218:[function(e,t,r){(function(e){(function(){function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var r=e.localStorage[t];return null!=r&&"true"===String(r).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],219:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],220:[function(e,t,r){var n=e("is-arguments"),o=e("is-generator-function"),a=e("which-typed-array"),i=e("is-typed-array");function u(e){return e.call.bind(e)}var s="undefined"!=typeof BigInt,l="undefined"!=typeof Symbol,c=u(Object.prototype.toString),f=u(Number.prototype.valueOf),d=u(String.prototype.valueOf),p=u(Boolean.prototype.valueOf);if(s)var h=u(BigInt.prototype.valueOf);if(l)var y=u(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function b(e){return"[object Map]"===c(e)}function m(e){return"[object Set]"===c(e)}function v(e){return"[object WeakMap]"===c(e)}function w(e){return"[object WeakSet]"===c(e)}function S(e){return"[object ArrayBuffer]"===c(e)}function D(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===c(e)}function O(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}r.isArgumentsObject=n,r.isGeneratorFunction=o,r.isTypedArray=i,r.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},r.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||O(e)},r.isUint8Array=function(e){return"Uint8Array"===a(e)},r.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===a(e)},r.isUint16Array=function(e){return"Uint16Array"===a(e)},r.isUint32Array=function(e){return"Uint32Array"===a(e)},r.isInt8Array=function(e){return"Int8Array"===a(e)},r.isInt16Array=function(e){return"Int16Array"===a(e)},r.isInt32Array=function(e){return"Int32Array"===a(e)},r.isFloat32Array=function(e){return"Float32Array"===a(e)},r.isFloat64Array=function(e){return"Float64Array"===a(e)},r.isBigInt64Array=function(e){return"BigInt64Array"===a(e)},r.isBigUint64Array=function(e){return"BigUint64Array"===a(e)},b.working="undefined"!=typeof Map&&b(new Map),r.isMap=function(e){return"undefined"!=typeof Map&&(b.working?b(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),r.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),r.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(v.working?v(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),r.isWeakSet=function(e){return w(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),r.isArrayBuffer=D,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=O;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(e){return"[object SharedArrayBuffer]"===c(e)}function R(e){return void 0!==A&&(void 0===_.working&&(_.working=_(new A)),_.working?_(e):e instanceof A)}function C(e){return g(e,f)}function q(e){return g(e,d)}function T(e){return g(e,p)}function j(e){return s&&g(e,h)}function x(e){return l&&g(e,y)}r.isSharedArrayBuffer=R,r.isAsyncFunction=function(e){return"[object AsyncFunction]"===c(e)},r.isMapIterator=function(e){return"[object Map Iterator]"===c(e)},r.isSetIterator=function(e){return"[object Set Iterator]"===c(e)},r.isGeneratorObject=function(e){return"[object Generator]"===c(e)},r.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===c(e)},r.isNumberObject=C,r.isStringObject=q,r.isBooleanObject=T,r.isBigIntObject=j,r.isSymbolObject=x,r.isBoxedPrimitive=function(e){return C(e)||q(e)||T(e)||j(e)||x(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(D(e)||R(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(r,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},{"is-arguments":112,"is-generator-function":114,"is-typed-array":120,"which-typed-array":222}],221:[function(e,t,r){(function(t){(function(){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;r.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,a=n.length,i=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<a;u=n[++r])g(u)||!S(u)?i+=" "+u:i+=" "+s(u);return i},r.deprecate=function(e,n){if(void 0!==t&&!0===t.noDeprecation)return e;if(void 0===t)return function(){return r.deprecate(e,n).apply(this,arguments)};var o=!1;return function(){if(!o){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),o=!0}return e.apply(this,arguments)}};var a={},i=/^$/;if(t.env.NODE_DEBUG){var u=t.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),i=new RegExp("^"+u+"$","i")}function s(e,t){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),f(n,e,n.depth)}function l(e,t){var r=s.styles[t];return r?"["+s.colors[r][0]+"m"+e+"["+s.colors[r][1]+"m":e}function c(e,t){return e}function f(e,t,n){if(e.customInspect&&t&&O(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(n,e);return m(o)||(o=f(e,o,n)),o}var a=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(b(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,t);if(a)return a;var i=Object.keys(t),u=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),E(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return d(t);if(0===i.length){if(O(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(D(t))return e.stylize(Date.prototype.toString.call(t),"date");if(E(t))return d(t)}var l,c="",S=!1,A=["{","}"];(h(t)&&(S=!0,A=["[","]"]),O(t))&&(c=" [Function"+(t.name?": "+t.name:"")+"]");return w(t)&&(c=" "+RegExp.prototype.toString.call(t)),D(t)&&(c=" "+Date.prototype.toUTCString.call(t)),E(t)&&(c=" "+d(t)),0!==i.length||S&&0!=t.length?n<0?w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=S?function(e,t,r,n,o){for(var a=[],i=0,u=t.length;i<u;++i)C(t,String(i))?a.push(p(e,t,r,n,String(i),!0)):a.push("");return o.forEach(function(o){o.match(/^\d+$/)||a.push(p(e,t,r,n,o,!0))}),a}(e,t,n,u,i):i.map(function(r){return p(e,t,n,u,r,S)}),e.seen.pop(),function(e,t,r){var n=e.reduce(function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(n>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,c,A)):A[0]+c+A[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,o,a){var i,u,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?u=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(u=e.stylize("[Setter]","special")),C(n,o)||(i="["+o+"]"),u||(e.seen.indexOf(s.value)<0?(u=g(r)?f(e,s.value,null):f(e,s.value,r-1)).indexOf("\n")>-1&&(u=a?u.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),v(i)){if(a&&o.match(/^\d+$/))return u;(i=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.slice(1,-1),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+u}function h(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function b(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return void 0===e}function w(e){return S(e)&&"[object RegExp]"===A(e)}function S(e){return"object"==typeof e&&null!==e}function D(e){return S(e)&&"[object Date]"===A(e)}function E(e){return S(e)&&("[object Error]"===A(e)||e instanceof Error)}function O(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function _(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(i.test(e)){var n=t.pid;a[e]=function(){var t=r.format.apply(r,arguments);console.error("%s %d: %s",e,n,t)}}else a[e]=function(){};return a[e]},r.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.types=e("./support/types"),r.isArray=h,r.isBoolean=y,r.isNull=g,r.isNullOrUndefined=function(e){return null==e},r.isNumber=b,r.isString=m,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=v,r.isRegExp=w,r.types.isRegExp=w,r.isObject=S,r.isDate=D,r.types.isDate=D,r.isError=E,r.types.isNativeError=E,r.isFunction=O,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var q="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function T(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(q&&e[q]){var t;if("function"!=typeof(t=e[q]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,q,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);o.push(function(e,n){e?r(e):t(n)});try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),q&&Object.defineProperty(t,q,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},r.promisify.custom=q,r.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 o=r.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var a=this,i=function(){return o.apply(a,arguments)};e.apply(this,r).then(function(e){t.nextTick(i.bind(null,null,e))},function(e){t.nextTick(T.bind(null,e,i))})}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,n(e)),r}}).call(this)}).call(this,e("_process"))},{"./support/isBuffer":219,"./support/types":220,_process:160,inherits:111}],222:[function(e,t,r){(function(r){(function(){var n=e("for-each"),o=e("available-typed-arrays"),a=e("call-bind"),i=e("call-bound"),u=e("gopd"),s=e("get-proto"),l=i("Object.prototype.toString"),c=e("has-tostringtag/shams")(),f="undefined"==typeof globalThis?r:globalThis,d=o(),p=i("String.prototype.slice"),h=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};n(d,c&&u&&s?function(e){var t=new f[e];if(Symbol.toStringTag in t&&s){var r=s(t),n=u(r,Symbol.toStringTag);if(!n&&r){var o=s(r);n=u(o,Symbol.toStringTag)}if(n&&n.get){var i=a(n.get);y["$"+e]=i}}}:function(e){var t=new f[e],r=t.slice||t.set;if(r){var n=a(r);y["$"+e]=n}});t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!c){var t=p(l(e),8,-1);return h(d,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(y,function(r,n){if(!t)try{r(e),t=p(n,1)}catch(e){}}),t}(e)}return u?function(e){var t=!1;return n(y,function(r,n){if(!t)try{"$"+r(e)===n&&(t=p(n,1))}catch(e){}}),t}(e):null}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":53,"call-bind":65,"call-bound":66,"for-each":79,"get-proto":101,gopd:103,"has-tostringtag/shams":107}],223:[function(e,t,r){t.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),o=e[e.length-1];return"function"==typeof n&&n!==o&&Object.keys(o).forEach(function(e){n[e]=o[e]}),n}}},{}],224:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var o in r)n.call(r,o)&&(e[o]=r[o])}return e};var n=Object.prototype.hasOwnProperty},{}]},{},[1])(1)});
|
|
92
|
+
const{parse:n}=e("meadow-filter");t.exports=class{constructor(e){this._Controller=e}parseFilter(e,t){return n(e,t)}}},{"meadow-filter":211}],364:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getSessionData(e){let t,r=Object.assign({},this._Controller.settings.MeadowEndpointsDefaultSessionObject);switch(this._Controller.settings.MeadowEndpointsSessionDataSource||"Request"){default:this._Controller.log.warn(`Unknown session source configured: ${this._Controller.settings.MeadowEndpointsSessionDataSource} - defaulting to Request for backward compatibility`);case"Request":r=this._Controller.extend(r,e.UserSession);break;case"None":break;case"Header":try{if(t=e.headers["x-trusted-session"],!t)break;const n=JSON.parse(t);r=this._Controller.extend(r,n)}catch(e){this._Controller.log.error(`Meadow Endpoints attempted to process a Header Session String with value [${t}] and failed -- likely culprit is bad JSON.`)}}return e.UserSession=r,r}}},{}],365:[function(e,t,r){const n=e("async/eachSeries"),i=e("JSONStream");t.exports=class{constructor(e){this._Controller=e}chunk(e,t,r){let n=[...e],i="number"==typeof t?t:0,a=void 0!==r?r:[];if(i<=0)return a;for(;n.length;)a.push(n.splice(0,i));return a}streamRecordArray(e,t,r){if(!e.writeHead||!Array.isArray(t)||t.length<2500)return e.send(t),r();e.writeHead(200,{"content-type":"application/json"});const a=i.stringify();a.pipe(e),n(this.chunk(t,1e3),(e,t)=>{e.forEach(a.write),setTimeout(t,0)},e=>{a.end(),r(e)})}}},{JSONStream:1,"async/eachSeries":19}],366:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Count");this.waterfall([t=>(n.Query=this.DAL.query,"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Count-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,(t,r,i)=>(n.Result={Count:i},e(t)))},r=>(t.send(n.Result),this.log.requestCompletedSuccessfully(e,n,`Delivered recordset count of ${n.Result.Count} for ${this.DAL.scope}.`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],367:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"CountBy");this.waterfall([t=>(n.Query=this.DAL.query,n.Query.addFilter(e.params.ByField,e.params.ByValue,"=","AND","RequestByField"),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("CountBy-QueryConfiguration"),e=>{this.DAL.doCount(n.Query,(t,r,i)=>(n.Result={Count:i},e(t)))},r=>(this.log.requestCompletedSuccessfully(e,n,"Delivered recordset count of "+n.Result.Count+"."),t.send(n.Result),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],368:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"CreateBulk"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)};i.CreatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(e.RecordsToBulkCreate=e.body,t()):t(this.ErrorHandler.getError("Bulk record create failure - a valid array of records to create is required.",500)),a("CreateBulk-PreRequest"),a("CreateBulk-PreOperation"),r=>{this.eachLimit(e.RecordsToBulkCreate,1,(r,a)=>{n.call(this,r,e,i,t,a)},r)},a("CreateBulk-PostOperation"),e=>this.doStreamRecordArray(t,i.CreatedRecords,e),t=>(this.log.requestCompletedSuccessfully(e,i,`Bulk created ${i.CreatedRecords.length} records`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Operation-Create.js":370}],369:[function(e,t,r){const n=e("./Meadow-Operation-Create.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Create");this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record create failure - a valid record is required.",500)):t(),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)})("Create-PreRequest"),r=>{n.call(this,e.body,e,i,t,r)},e=>i.RecordCreateError?e(i.RecordCreateErrorObject):i.CreatedRecords.length<1?e(this.ErrorHandler.getError("Unknown record create failure - no created records returned.",500)):(i.Record=i.CreatedRecords[0],e()),e=>(t.send(i.Record),e()),t=>(this.log.requestCompletedSuccessfully(e,i,`Created a ${this.DAL.scope} record ID ${i.Record[this.DAL.defaultIdentifier]}`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Operation-Create.js":370}],370:[function(e,t,r){t.exports=function(e,t,r,n,i){let a=this.cloneAsyncSafeRequestState(r,"doCreate");Array.isArray(a.ParentRequestState.CreatedRecords)||(a.ParentRequestState.CreatedRecords=[]),this.waterfall([t=>(a.RecordToCreate=e,!a.RecordToCreate.hasOwnProperty("IDCustomer")&&this.DAL.jsonSchema&&this.DAL.jsonSchema.properties&&this.DAL.jsonSchema.properties.hasOwnProperty("IDCustomer")&&(a.RecordToCreate.IDCustomer=a.SessionData.CustomerID||0),t()),e=>{this.BehaviorInjection.runBehavior("Create-PreOperation",this,t,a,e)},e=>(a.Query=this.DAL.query,a.Query.setIDUser(a.SessionData.UserID),a.Query.addRecord(a.RecordToCreate),e()),e=>{this.BehaviorInjection.runBehavior("Create-QueryConfiguration",this,t,a,e)},e=>{this.DAL.doCreate(a.Query,(t,r,n,i)=>t?e(t):i?(a.Record=i,e()):e(this.ErrorHandler.getError("Error in DAL Create: No record returned from persistence engine.",500)))},e=>this.BehaviorInjection.runBehavior("Create-PostOperation",this,t,a,e),e=>(a.ParentRequestState.CreatedRecords.push(a.Record),this.log.requestCompletedSuccessfully(t,a,`Created a record with ${this.DAL.defaultIdentifier} = ${a.Record[this.DAL.defaultIdentifier]}`),e())],e=>(e&&(a.RecordToCreate.Error=e,a.ParentRequestState.RecordCreateError=!0,a.ParentRequestState.RecordCreateErrorObject=e,a.ParentRequestState.CreatedRecords.push(a.RecordToCreate)),i()))}},{}],371:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Delete");n.IDRecord=0,n.RecordCount={Count:0},this.waterfall([t=>("string"==typeof e.params.IDRecord?n.IDRecord=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(n.IDRecord=e.body[this.DAL.defaultIdentifier]),n.IDRecord<1?t(this.ErrorHandler.getError("Record delete failure - a valid record ID is required in the passed-in record.",500)):t()),e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,n.IDRecord),n.Query.setIDUser(n.SessionData.UserID),e()),t=>this.BehaviorInjection.runBehavior("Delete-QueryConfiguration",this,e,n,t),e=>{this.DAL.doRead(n.Query,(t,r,i)=>i?(n.Record=i,n.OriginalRecord=i,e()):e(this.ErrorHandler.getError("Record not found.",404)))},t=>this.BehaviorInjection.runBehavior("Delete-PreOperation",this,e,n,t),e=>{this.DAL.doDelete(n.Query,(t,r,i)=>(n.RecordCount.Count=i,e(t)))},t=>this.BehaviorInjection.runBehavior("Delete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,`Deleted ${n.RecordCount.Count} ${this.DAL.scope} records with ID ${n.IDRecord}`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],372:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Undelete");var i=0;if("string"==typeof e.params.IDRecord?i=e.params.IDRecord:("number"==typeof e.body[this.DAL.defaultIdentifier]||"string"==typeof e.body[this.DAL.defaultIdentifier])&&(i=e.body[this.DAL.defaultIdentifier]),i<1)return r(this.ErrorHandler.getError("Record undelete failure - a valid record ID is required.",500));n.RecordCount={Count:0},this.waterfall([e=>{var t=this.DAL.schema,r=!1;for(let e=0;e<t.length;e++)"Deleted"==t[e].Type&&(r=!0);return r?e():e(this.ErrorHandler.getError("No undelete bit on record.",500))},e=>(n.Query=this.DAL.query,n.Query.addFilter(this.DAL.defaultIdentifier,i),n.Query.addFilter("Deleted",1),n.Query.setIDUser(n.SessionData.UserID),e()),e=>{this.DAL.doRead(n.Query,(t,r,i)=>i?(n.Record=i,n.OriginalRecord=i,e()):e(this.ErrorHandler.getError("Record not found.",404)))},t=>this.BehaviorInjection.runBehavior("Undelete-PreOperation",this,e,n,t),e=>{this.DAL.doUndelete(n.Query,(t,r,i)=>(n.RecordCount={Count:i},e(t)))},t=>this.BehaviorInjection.runBehavior("Undelete-PostOperation",this,e,n,t),r=>(t.send(n.RecordCount),this.log.requestCompletedSuccessfully(e,n,"Undeleted "+n.RecordCount.Count+" records with ID "+i+"."),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],373:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Read"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([e=>(n.Query=this.DAL.query,e()),i("Read-PreOperation"),t=>{if(!e.params.IDRecord&&e.params.GUIDRecord)n.RecordSearchCriteria=`${this.DAL.defaultGUIdentifier} = ${e.params.GUIDRecord}`,n.Query.addFilter(this.DAL.defaultGUIdentifier,e.params.GUIDRecord,"=","AND","RequestDefaultIdentifier");else{if(!e.params.IDRecord)return t(this.ErrorHandler.getError("No ID Provided",400));n.RecordSearchCriteria=`${this.DAL.defaultIdentifier} = ${e.params.IDRecord}`,n.Query.addFilter(this.DAL.defaultIdentifier,e.params.IDRecord,"=","AND","RequestDefaultIdentifier")}return t()},i("Read-QueryConfiguration"),e=>{try{this.DAL.doRead(n.Query,(t,r,i)=>i?(n.Record=i,e()):e(this.ErrorHandler.getError("Record not Found",404)))}catch(t){return e(t)}},i("Read-PostOperation"),r=>(t.send(n.Record),this.log.requestCompletedSuccessfully(e,n,`Read Record Where ${n.RecordSearchCriteria}`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],374:[function(e,t,r){const n=e("./Meadow-Marshal-DistinctList.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"ReadDistinct"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)};i.DistinctColumns,this.waterfall([t=>{i.Query=this.DAL.query.setDistinct(!0);let r=!1,n=!1;if("string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,i.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,i.Query):e.params.Filter&&i.Query.setFilter(e.params.Filter),"string"==typeof e.params.Columns){if(i.DistinctColumns=e.params.Columns.split(","),!i.DistinctColumns)return t({Code:400,Message:"Columns to distinct on must be provided."});i.Query.setDataElements(i.DistinctColumns)}return t()},a("Reads-QueryConfiguration"),e=>{this.DAL.doReads(i.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),i.Records=t,r()),a("ReadDistinct-PostOperation"),t=>(i.ResultRecords=n.call(this,i.Records,e,i.DistinctColumns),t()),e=>this.doStreamRecordArray(t,i.ResultRecords,e),t=>(this.log.requestCompletedSuccessfully(e,i,`Read a recordset distinct lite list with ${i.ResultRecords.length} results.`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Marshal-DistinctList.js":380}],375:[function(e,t,r){const n=e("./Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"ReadsLite"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)};this.waterfall([t=>{i.Query=this.DAL.query;var r=!1,n=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(n=parseInt(e.params.Begin,10)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap,10):this.settings.MeadowDefaultMaxCap||250,i.Query.setCap(r).setBegin(n),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,i.Query):e.params.Filter&&i.Query.setFilter(e.params.Filter),t()},a("Reads-QueryConfiguration"),e=>{this.DAL.doReads(i.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),i.RawRecords=t,i.Records=t,r()),a("ReadsLite-PostOperation"),t=>(i.Records=n.call(this,i.RawRecords,e,"string"==typeof e.params.ExtraColumns?e.params.ExtraColumns.split(","):[]),t()),e=>this.doStreamRecordArray(t,i.Records,r),t=>(this.log.requestCompletedSuccessfully(e,i,`Read a recordset lite list with ${i.Records.length} results`),t())],(n,a)=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Marshal-LiteList.js":381}],376:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadMax");this.waterfall([e=>(n.Query=this.DAL.query,e()),t=>(n.ColumnName=e.params.ColumnName,n.Query.setSort({Column:n.ColumnName,Direction:"Descending"}),n.Query.setCap(1),t()),(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("ReadMax-QueryConfiguration"),e=>{this.DAL.doRead(n.Query,e)},(e,t,r)=>t?(n.Record=t,r()):r(this.ErrorHandler.getError("Record not Found",404)),t=>{this.BehaviorInjection.runBehavior("ReadMax-PostOperation",this,e,n,t)},r=>{this.log.requestCompletedSuccessfully(e,n,`Read max record of ${this.DAL.scope} on ${n.ColumnName}`),t.send(n.Record)}],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],377:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),"string"==typeof e.params.Filter&&this.parseFilter(e.params.Filter,n.Query),t()},i("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),n.Records=t,r()),i("ReadSelectList-PostOperation"),e=>{n.SelectList=[];for(var t=0;t<n.Records.length;t++)n.SelectList.push({Hash:n.Records[t][this.DAL.defaultIdentifier],Value:this.BehaviorInjection.processTemplate("SelectList",{Record:n.Records[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")});return e()},e=>this.doStreamRecordArray(t,n.SelectList,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a recordset lite list with ${n.SelectList.length} results.`),t())],(i,a)=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],378:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Reads"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),"string"==typeof e.params.Filter?this.parseFilter(e.params.Filter,n.Query):e.params.Filter&&n.Query.setFilter(e.params.Filter),t()},i("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>t?(n.Records=t,r()):r(this.ErrorHandler.getError("No records found.",404)),i("Reads-PostOperation"),e=>{this.doStreamRecordArray(t,n.Records,e)},t=>(this.log.requestCompletedSuccessfully(e,n,"Read a list of records."),t())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],379:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([t=>{n.Query=this.DAL.query;var r=!1,i=!1;return"string"!=typeof e.params.Begin&&"number"!=typeof e.params.Begin||(i=parseInt(e.params.Begin)),r="string"==typeof e.params.Cap||"number"==typeof e.params.Cap?parseInt(e.params.Cap):this.settings.MeadowDefaultMaxCap||250,n.Query.setCap(r).setBegin(i),t()},t=>{function r(e,t){t.constructor===Array?n.Query.addFilter(e,t,"IN","AND","RequestByField"):n.Query.addFilter(e,t,"=","AND","RequestByField")}var i=e.params.Filters;return i&&i.constructor===Array?i.forEach(function(e){r(e.ByField,e.ByValue)}):r(e.params.ByField,e.params.ByValue),t()},i("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,(t,r,i)=>i?(n.Records=i,e()):e(this.ErrorHandler.getError("No records found.",404)))},i("Reads-PostOperation"),e=>this.doStreamRecordArray(t,n.Records,e),t=>(this.log.requestCompletedSuccessfully(e,n,`Read a list of records by ${e.params.ByField} = ${e.params.ByValue}`),t())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],380:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],i=void 0!==r?r:[],a=(!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,e[0].hasOwnProperty("UpdateDate"),Object.keys(e[0]),0);for(;a<i.length;)e[0].hasOwnProperty(i[0])?a++:i.splice(a,1);for(let t=0;t<e.length;t++){let r={};i.forEach(n=>{r[n]=e[t][n]}),n.push(r)}return n}},{}],381:[function(e,t,r){t.exports=function(e,t,r){if(e.length<1)return[];let n=[],i=void 0!==r?r:[],a=!!(this.DAL.defaultGUIdentifier&&this.DAL.defaultGUIdentifier.length>0)&&this.DAL.defaultGUIdentifier,o=!!e[0].hasOwnProperty("UpdateDate");Object.keys(e[0]).forEach(e=>{0!==e.indexOf("ID")&&0!==e.indexOf("GUID")&&"CreatingIDUser"!=e||i.push(e)});let s=0;for(;s<i.length;)e[0].hasOwnProperty(i[0])?s++:i.splice(s,1);for(let t=0;t<e.length;t++){let r={Value:this.BehaviorInjection.processTemplate("SelectList",{Record:e[t]},this.DAL.scope+" #<%= Record."+this.DAL.defaultIdentifier+"%>")};r[this.DAL.defaultIdentifier]=e[t][this.DAL.defaultIdentifier],a&&(r[a]=e[t][a]),o&&(r.UpdateDate=e[t].UpdateDate),i.forEach(n=>{r[n]=e[t][n]}),n.push(r)}return n}},{}],382:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"New"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("New-PreOperation"),e=>(n.EmptyEntityRecord||(n.EmptyEntityRecord=this.extend({},this.DAL.schemaFull.defaultObject)),e()),i("New-PostOperation"),r=>(t.send(n.EmptyEntityRecord),this.log.requestCompletedSuccessfully(e,n,`Delivered New ${this.DAL.scope} Record`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],383:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Schema"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("Schema-PreOperation"),t=>(e.JSONSchema||(n.JSONSchema=this.extend({},this.DAL.jsonSchema)),t()),i("Schema-PostOperation"),r=>(t.send(n.JSONSchema),this.log.requestCompletedSuccessfully(e,n,`Delivered JSONSchema for ${this.DAL.scope}`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],384:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"Validate"),i=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)};this.waterfall([i("Validate-PreOperation"),t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record validate failure - a valid JSON object is required.",500)):(n.Record=e.body,t()),e=>(n.RecordValidation=this.DAL.schemaFull.validateObject(n.Record),e()),i("Validate-PostOperation"),r=>(t.send(n.RecordValidation),this.log.requestCompletedSuccessfully(e,n,`Validated Record for ${this.DAL.scope} - ${JSON.stringify(n.RecordValidation)}`),r())],i=>this.ErrorHandler.handleErrorIfSet(e,n,t,i,r))}},{}],385:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"UpdateBulk"),a=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,i,r)};i.UpdatedRecords=[],this.waterfall([t=>Array.isArray(e.body)?(i.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record update failure - a valid record is required.",500)),a("UpdateBulk-PreOperation"),r=>{this.eachLimit(i.BulkRecords,1,(r,a)=>{n.call(this,r,e,i,t,a)},r)},a("UpdateBulk-PostOperation"),e=>this.doStreamRecordArray(t,i.UpdatedRecords,e),t=>(this.log.requestCompletedSuccessfully(e,i,`Bulk updated ${i.UpdatedRecords.length} records`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Operation-Update.js":387}],386:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Update");this.waterfall([t=>{if("object"!=typeof e.body||null===e.body)return t(this.ErrorHandler.getError("Record update failure - a valid record is required.",400));if(e.params&&e.params.IDRecord){let t=e.params.IDRecord;"string"==typeof t&&/^-?\d+$/.test(t)&&(t=Number(t)),e.body[this.DAL.defaultIdentifier]=t}return e.body[this.DAL.defaultIdentifier]<1?t(this.ErrorHandler.getError("Record update failure - a valid record ID is required in the passed-in record.",400)):(i.Record=e.body,t())},r=>{n.call(this,e.body,e,i,t,r)},e=>i.RecordUpdateError?e(i.RecordUpdateErrorObject):i.UpdatedRecords.length<1?e(this.ErrorHandler.getError("Unknown record update failure - no updated records returned.",500)):(i.Record=i.UpdatedRecords[0],e()),e=>(t.send(i.Record),e())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Operation-Update.js":387}],387:[function(e,t,r){t.exports=function(e,t,r,n,i,a){let o=this.cloneAsyncSafeRequestState(r,"doUpdate"),s=e=>r=>{this.BehaviorInjection.runBehavior(e,this,t,o,r)};if(e[this.DAL.defaultIdentifier]<1&&void 0===a)return i("Record update failure - a valid record ID is required in the passed-in record.");Array.isArray(o.ParentRequestState.UpdatedRecords)||(o.ParentRequestState.UpdatedRecords=[]),this.waterfall([t=>{if(o.RecordToModify=e,void 0!==a)return o.OriginalRecord=a,t();o.Query=this.DAL.query,o.Query.addFilter(this.DAL.defaultIdentifier,o.RecordToModify[this.DAL.defaultIdentifier]),this.DAL.doRead(o.Query,(e,r,n)=>e?t(e):n?(o.Record=n,o.OriginalRecord=n,t()):t(this.ErrorHandler.getError("Record not Found",404)))},e=>(o.Query=this.DAL.query,e()),s("Update-PreOperation"),e=>(o.Query.setIDUser(o.SessionData.UserID),o.Query.addRecord(o.RecordToModify),e()),s("Update-QueryConfiguration"),e=>{this.DAL.doUpdate(o.Query,(t,r,n,i)=>t?e("string"==typeof t?this.ErrorHandler.getError(t,500):t):i?(o.Record=i,e()):e(this.ErrorHandler.getError("Error in DAL Update: No record returned from persistence engine.",500)))},e=>this.BehaviorInjection.runBehavior("Update-PostOperation",this,t,o,e),e=>(o.ParentRequestState.UpdatedRecords.push(o.Record),this.log.requestCompletedSuccessfully(t,o,`Updated record with ID ${o.Record[this.DAL.defaultIdentifier]}`),e())],e=>(e&&(o.Record?o.Record.Error=e:o.Record={Error:e},o.ParentRequestState.RecordUpdateError=!0,o.ParentRequestState.RecordUpdateErrorObject=e,o.ParentRequestState.UpdatedRecords.push(o.Record)),i()))}},{}],388:[function(e,t,r){const n=e("./Meadow-Operation-Upsert.js"),i=e("../read/Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let a=this.initializeRequestState(e,"UpsertBulk"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,a,r)};a.CreatedRecords=[],a.UpdatedRecords=[],a.UpsertedRecords=[],a.ErrorRecords=[],this.waterfall([t=>Array.isArray(e.body)?(a.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record bulk upsert failure - a valid array of records is required.",500)),o("UpsertBulk-PreOperation"),r=>{this.eachLimit(a.BulkRecords,1,(r,i)=>{n.call(this,r,e,a,t,i)},r)},o("UpsertBulk-PostOperation"),r=>{let n=a.BulkRecords&&a.BulkRecords.length||0,o=a.ErrorRecords&&a.ErrorRecords.length||0,s=a.UpsertedRecords&&a.UpsertedRecords.length||0;try{t.header("X-Meadow-Upsert-Total",String(n)),t.header("X-Meadow-Upsert-Succeeded",String(s)),t.header("X-Meadow-Upsert-Errored",String(o))}catch(e){}return this.doStreamRecordArray(t,i.call(this,a.UpsertedRecords,e),r)},t=>{let r=a.UpsertedRecords&&a.UpsertedRecords.length||0,n=a.ErrorRecords&&a.ErrorRecords.length||0,i=n>0?`Bulk upsert complete -- ${r} records succeeded, ${n} errored`:`Bulk upsert complete -- ${r} records processed`;return this.log.requestCompletedSuccessfully(e,a,i),t()}],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":381,"./Meadow-Operation-Upsert.js":391}],389:[function(e,t,r){const n=e("./Meadow-Operation-Upsert.js"),i=e("../read/Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let a=this.initializeRequestState(e,"UpsertBulkDetailed"),o=t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,a,r)};a.CreatedRecords=[],a.UpdatedRecords=[],a.UpsertedRecords=[],a.ErrorRecords=[],this.waterfall([t=>Array.isArray(e.body)?(a.BulkRecords=e.body,t()):t(this.ErrorHandler.getError("Record bulk upsert (detailed) failure - a valid array of records is required.",500)),o("UpsertBulk-PreOperation"),r=>{this.eachLimit(a.BulkRecords,1,(r,i)=>{n.call(this,r,e,a,t,i)},r)},o("UpsertBulk-PostOperation"),r=>{let n=a.BulkRecords&&a.BulkRecords.length||0,o=a.ErrorRecords&&a.ErrorRecords.length||0,s=a.UpsertedRecords&&a.UpsertedRecords.length||0;try{t.header("X-Meadow-Upsert-Total",String(n)),t.header("X-Meadow-Upsert-Succeeded",String(s)),t.header("X-Meadow-Upsert-Errored",String(o))}catch(e){}let u={Counts:{Total:n,Succeeded:s,Errored:o},UpsertedRecords:i.call(this,a.UpsertedRecords,e),ErrorRecords:a.ErrorRecords||[]};return t.send(u),r()},t=>{let r=a.UpsertedRecords&&a.UpsertedRecords.length||0,n=a.ErrorRecords&&a.ErrorRecords.length||0,i=n>0?`Bulk upsert (detailed) complete -- ${r} records succeeded, ${n} errored`:`Bulk upsert (detailed) complete -- ${r} records processed`;return this.log.requestCompletedSuccessfully(e,a,i),t()}],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":381,"./Meadow-Operation-Upsert.js":391}],390:[function(e,t,r){var n=e("./Meadow-Operation-Upsert.js");t.exports=function(e,t,r){let i=this.initializeRequestState(e,"Upsert");i.CreatedRecords=[],i.UpdatedRecords=[],i.UpsertedRecords=[],i.ErrorRecords=[],this.waterfall([t=>"object"!=typeof e.body?t(this.ErrorHandler.getError("Record upsert failure - a valid record is required.",500)):(i.RecordToUpsert=e.body,t()),r=>{n.call(this,i.RecordToUpsert,e,i,t,r)},e=>i.RecordUpsertError?e(i.RecordUpsertErrorMessage):i.UpsertedRecords.length<1?e(this.ErrorHandler.getError("Record upsert unknown failure - no record back from Upsert operation.",500)):(i.Record=i.UpsertedRecords[0],t.send(i.Record),e())],n=>this.ErrorHandler.handleErrorIfSet(e,i,t,n,r))}},{"./Meadow-Operation-Upsert.js":391}],391:[function(e,t,r){const n=e("../create/Meadow-Operation-Create.js"),i=e("../update/Meadow-Operation-Update.js");t.exports=function(e,t,r,a,o){let s=this.cloneAsyncSafeRequestState(r,"Upsert");this.waterfall([t=>(s.Query=this.DAL.query,s.Record=e,s.UpsertCreateOnly=!0,void 0!==s.Record[this.DAL.defaultGUIdentifier]&&s.Record[this.DAL.defaultGUIdentifier].length>0&&(s.Query.addFilter(this.DAL.defaultGUIdentifier,s.Record[this.DAL.defaultGUIdentifier]),s.UpsertCreateOnly=!1),void 0!==s.Record[this.DAL.defaultIdentifier]&&s.Record[this.DAL.defaultIdentifier]>0&&(s.Query.addFilter(this.DAL.defaultIdentifier,s.Record[this.DAL.defaultIdentifier]),s.UpsertCreateOnly=!1),t()),e=>{s.UpsertCreateOnly?(s.Operation="Create",n.call(this,s.Record,t,s,a,e)):this.DAL.doRead(s.Query,(r,o,u)=>{if(r)return e("string"==typeof r?this.ErrorHandler.getError(r,500):r);if(u){if(s.Record.hasOwnProperty(this.DAL.defaultIdentifier)&&s.Record[this.DAL.defaultIdentifier]||(s.Record[this.DAL.defaultIdentifier]=u[this.DAL.defaultIdentifier]),s.Record[this.DAL.defaultIdentifier]!=u[this.DAL.defaultIdentifier])return e(this.ErrorHandler.getError("Record IDs do not match",500));s.Operation="Update",i.call(this,s.Record,t,s,a,e,u)}else s.Operation="Create",n.call(this,s.Record,t,s,a,e)})},e=>{if("Update"==s.Operation){if(s.RecordUpdateError)return e(s.RecordUpdateErrorObject);if(s.UpdatedRecords.length<1)return e(this.ErrorHandler.getError("Unknown record update failure - no updated records returned.",500));s.Record=s.UpdatedRecords[0]}else{if("Create"!=s.Operation)return e(this.ErrorHandler.getError("Unkknown record upsert failure = no records returned from doUpsert.",500));if(s.RecordCreateError)return e(s.RecordCreateErrorObject);if(s.CreatedRecords.length<1)return e(this.ErrorHandler.getError("Unknown record create failure - no created records returned.",500));s.Record=s.CreatedRecords[0]}return s.ParentRequestState.UpsertedRecords.push(s.Record),e()}],e=>{if(e&&(s.Record.Error=e,s.ParentRequestState&&Array.isArray(s.ParentRequestState.ErrorRecords))){let t=e&&(e.message||e.Error)?e.message||e.Error:String(e);s.ParentRequestState.ErrorRecords.push({Record:s.Record,Operation:s.Operation||"Unknown",Error:t})}return o()})}},{"../create/Meadow-Operation-Create.js":370,"../update/Meadow-Operation-Update.js":387}]},{},[358])(358)});
|
|
88
93
|
//# sourceMappingURL=meadow-endpoints.min.js.map
|