meadow-endpoints 4.0.14 → 4.0.16

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.
Files changed (27) hide show
  1. package/dist/indoctrinate_content_staging/Indoctrinate-Catalog-AppData.json +1286 -1065
  2. package/dist/meadow-endpoints.js +253 -164
  3. package/dist/meadow-endpoints.js.map +1 -1
  4. package/dist/meadow-endpoints.min.js +7 -7
  5. package/dist/meadow-endpoints.min.js.map +1 -1
  6. package/docs/_version.json +7 -0
  7. package/docs/css/docuserve.css +277 -23
  8. package/docs/index.html +2 -2
  9. package/docs/retold-catalog.json +13 -1
  10. package/docs/retold-keyword-index.json +1 -1
  11. package/package.json +9 -8
  12. package/source/Meadow-Endpoints-Browser-Shim.js +4 -1
  13. package/source/Meadow-Endpoints.js +6 -6
  14. package/source/controller/Meadow-Endpoints-Controller-Base.js +6 -6
  15. package/source/controller/components/Meadow-Endpoints-Controller-BehaviorInjection.js +11 -11
  16. package/source/controller/components/Meadow-Endpoints-Controller-Error.js +23 -15
  17. package/source/controller/components/Meadow-Endpoints-Controller-Log.js +9 -9
  18. package/source/controller/utility/Meadow-Endpoints-Filter-Parser.js +16 -16
  19. package/source/controller/utility/Meadow-Endpoints-Session-Marshaler.js +42 -42
  20. package/source/controller/utility/Meadow-Endpoints-Stream-RecordArray.js +6 -6
  21. package/source/endpoints/create/Meadow-Operation-Create.js +1 -1
  22. package/source/endpoints/schema/Meadow-Endpoint-Validate.js +1 -1
  23. package/source/endpoints/update/Meadow-Endpoint-BulkUpdate.js +2 -0
  24. package/source/endpoints/update/Meadow-Operation-Update.js +2 -0
  25. package/source/endpoints/upsert/Meadow-Endpoint-BulkUpsert.js +3 -1
  26. package/source/endpoints/upsert/Meadow-Operation-Upsert.js +5 -3
  27. package/test/MeadowEndpoints_basic_tests.js +776 -0
@@ -1,10 +1,10 @@
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){(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:23,jsonparse:87,through:179}],2:[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":10,"./internal/setImmediate.js":15,"./internal/wrapAsync.js":17}],3:[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":6,"./internal/eachOfLimit.js":8,"./internal/withoutIndex.js":16,"./internal/wrapAsync.js":17}],4:[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":3,"./internal/awaitify.js":6}],5:[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":7}],6:[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},{}],7:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});r.default={},t.exports=r.default},{}],8:[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":5,"./breakLoop.js":7,"./iterator.js":12,"./once.js":13,"./onlyOnce.js":14,"./wrapAsync.js":17}],9:[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},{}],10:[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},{}],11:[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},{}],12:[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":9,"./isArrayLike.js":11}],13:[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},{}],14:[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},{}],15:[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:125,timers:180}],16:[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},{}],17:[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":2}],18:[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":6,"./internal/once.js":13,"./internal/onlyOnce.js":14,"./internal/wrapAsync.js":17}],19:[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":124}],20:[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},{}],21:[function(e,t,r){},{}],22:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],23:[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 R(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return A(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 A(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<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=E));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 E=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 C(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 R(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 I(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 L(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 I(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return L(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":20,buffer:23,ieee754:76}],24:[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"}},{}],25:[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":27,"./functionCall":28,"./reflectApply":30,"function-bind":60}],26:[function(e,t,r){var n=e("function-bind"),o=e("./functionApply"),a=e("./actualApply");t.exports=function(){return a(n,o,arguments)}},{"./actualApply":25,"./functionApply":27,"function-bind":60}],27:[function(e,t,r){t.exports=Function.prototype.apply},{}],28:[function(e,t,r){t.exports=Function.prototype.call},{}],29:[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":25,"./functionCall":28,"es-errors/type":41,"function-bind":60}],30:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],31:[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=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(t.exports,"apply",{value:i}):t.exports.apply=i},{"call-bind-apply-helpers":29,"call-bind-apply-helpers/applyBind":26,"es-define-property":35,"set-function-length":137}],32:[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":29,"get-intrinsic":64}],33:[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":35,"es-errors/syntax":40,"es-errors/type":41,gopd:69}],34:[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":29,gopd:69}],35:[function(e,t,r){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}t.exports=n},{}],36:[function(e,t,r){t.exports=EvalError},{}],37:[function(e,t,r){t.exports=Error},{}],38:[function(e,t,r){t.exports=RangeError},{}],39:[function(e,t,r){t.exports=ReferenceError},{}],40:[function(e,t,r){t.exports=SyntaxError},{}],41:[function(e,t,r){t.exports=TypeError},{}],42:[function(e,t,r){t.exports=URIError},{}],43:[function(e,t,r){t.exports=Object},{}],44:[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):[]}},{}],45:[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":79}],46:[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(){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){(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:23,jsonparse:87,through:180}],2:[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":10,"./internal/setImmediate.js":15,"./internal/wrapAsync.js":17}],3:[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":6,"./internal/eachOfLimit.js":8,"./internal/withoutIndex.js":16,"./internal/wrapAsync.js":17}],4:[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":3,"./internal/awaitify.js":6}],5:[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":7}],6:[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},{}],7:[function(e,t,r){Object.defineProperty(r,"__esModule",{value:!0});r.default={},t.exports=r.default},{}],8:[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":5,"./breakLoop.js":7,"./iterator.js":12,"./once.js":13,"./onlyOnce.js":14,"./wrapAsync.js":17}],9:[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},{}],10:[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},{}],11:[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},{}],12:[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":9,"./isArrayLike.js":11}],13:[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},{}],14:[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},{}],15:[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:126,timers:181}],16:[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},{}],17:[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":2}],18:[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":6,"./internal/once.js":13,"./internal/onlyOnce.js":14,"./internal/wrapAsync.js":17}],19:[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":125}],20:[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},{}],21:[function(e,t,r){},{}],22:[function(e,t,r){arguments[4][21][0].apply(r,arguments)},{dup:21}],23:[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 R(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return C(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 A(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<=O)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));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?A(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 O=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 C(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 R(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":20,buffer:23,ieee754:76}],24:[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"}},{}],25:[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":27,"./functionCall":28,"./reflectApply":30,"function-bind":60}],26:[function(e,t,r){var n=e("function-bind"),o=e("./functionApply"),a=e("./actualApply");t.exports=function(){return a(n,o,arguments)}},{"./actualApply":25,"./functionApply":27,"function-bind":60}],27:[function(e,t,r){t.exports=Function.prototype.apply},{}],28:[function(e,t,r){t.exports=Function.prototype.call},{}],29:[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":25,"./functionCall":28,"es-errors/type":41,"function-bind":60}],30:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],31:[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=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},o?o(t.exports,"apply",{value:i}):t.exports.apply=i},{"call-bind-apply-helpers":29,"call-bind-apply-helpers/applyBind":26,"es-define-property":35,"set-function-length":138}],32:[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":29,"get-intrinsic":64}],33:[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":35,"es-errors/syntax":40,"es-errors/type":41,gopd:69}],34:[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":29,gopd:69}],35:[function(e,t,r){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}t.exports=n},{}],36:[function(e,t,r){t.exports=EvalError},{}],37:[function(e,t,r){t.exports=Error},{}],38:[function(e,t,r){t.exports=RangeError},{}],39:[function(e,t,r){t.exports=ReferenceError},{}],40:[function(e,t,r){t.exports=SyntaxError},{}],41:[function(e,t,r){t.exports=TypeError},{}],42:[function(e,t,r){t.exports=URIError},{}],43:[function(e,t,r){t.exports=Object},{}],44:[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):[]}},{}],45:[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":79}],46:[function(e,t,r){
2
2
  /**
3
3
  * FoxHound Query Generation Library
4
4
  * @license MIT
5
5
  * @author Steven Velozo <steven@velozo.com>
6
6
  */
7
- 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":47,"./Parameters.js":48}],47:[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":49,"./dialects/DGraph/FoxHound-Dialect-DGraph.js":50,"./dialects/English/FoxHound-Dialect-English.js":51,"./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js":52,"./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js":53,"./dialects/MongoDB/FoxHound-Dialect-MongoDB.js":54,"./dialects/MySQL/FoxHound-Dialect-MySQL.js":55,"./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js":56,"./dialects/SQLite/FoxHound-Dialect-SQLite.js":57,"./dialects/Solr/FoxHound-Dialect-Solr.js":58}],48:[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}},{}],49:[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.disableAutoDateStamp&&"UpdateDate"===u.Type||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":o+=" "+n(i,e)+" = NOW()";break;case"UpdateIDUser":var 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}},{}],50:[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.disableAutoDateStamp&&"UpdateDate"===i.Type||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":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}},{}],51:[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}},{}],52:[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}},{}],53:[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){return!Array.isArray(e.indexHints)||e.indexHints.length<1?"":` WITH(INDEX(${e.indexHints.join(",")}))`},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),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),i=s(e),u=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+=" ["+t[n].Column+"]","Descending"==t[n].Direction&&(r+=" DESC");return r}(e),d=function(e){if(!e.cap)return"";var t=" OFFSET ";return!1!==e.begin?t+=e.begin:t+="0",t+` ROWS FETCH NEXT ${e.cap} ROWS ONLY`}(e),p=l(e);const h=e.distinct?" DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:t,TableName:o,Where:i,Join:u,OrderBy:f,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${o}${p}${u}${i}${f}${d};`},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=c(e),u=s(e),f=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 d=e.distinct&&t.length>0?"DISTINCT":"";if(e.queryOverride)try{return r.Utility.template(e.queryOverride)({FieldList:[],TableName:o,Where:u,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${o}${f}${i}${u};`}};return Object.defineProperty(f,"name",{get:function(){return"MSSQL"},enumerable:!0}),f}},{}],54:[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.disableAutoDateStamp&&"UpdateDate"===i.Type||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":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}},{}],55:[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.disableAutoDateStamp&&"UpdateDate"===u.Type||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":o+=" "+i+" = "+t;break;case"UpdateIDUser":var l=i+"_"+a;o+=" "+i+" = :"+l,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}},{}],56:[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.disableAutoDateStamp&&"UpdateDate"===s.Type||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":o+=" "+u(i)+" = "+t;break;case"UpdateIDUser":var 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}},{}],57:[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.disableAutoDateStamp&&"UpdateDate"===u.Type||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":o+=" "+n(i,e)+" = NOW()";break;case"UpdateIDUser":var 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}},{}],58:[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.disableAutoDateStamp&&"UpdateDate"===i.Type||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":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}},{}],59:[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}},{}],60:[function(e,t,r){var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":59}],61:[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":84,util:186}],62:[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":84}],63:[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}},{}],64:[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"),A=function(){throw new c},O=S?function(){try{return A}catch(e){try{return S(arguments,"callee").get}catch(e){return A}}}():A,E=e("has-symbols")(),_=e("get-proto"),C=e("get-proto/Object.getPrototypeOf"),R=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,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":E&&_?_([][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%":E&&_?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&_?_((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&&E&&_?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&_?_(""[Symbol.iterator]()):n,"%Symbol%":E?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%":C,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":h,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":R};if(_)try{null.error}catch(e){var L=_(_(e));I["%Error.prototype%"]=L}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 I[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(I,n)){var o=I[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(I,a="%"+(n+="."+p)+"%"))i=I[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&&(I[a]=i)}}return i}},{"call-bind-apply-helpers/functionApply":27,"call-bind-apply-helpers/functionCall":28,"es-define-property":35,"es-errors":37,"es-errors/eval":36,"es-errors/range":38,"es-errors/ref":39,"es-errors/syntax":40,"es-errors/type":41,"es-errors/uri":42,"es-object-atoms":43,"function-bind":60,"get-proto":67,"get-proto/Object.getPrototypeOf":65,"get-proto/Reflect.getPrototypeOf":66,gopd:69,"has-symbols":71,hasown:74,"math-intrinsics/abs":89,"math-intrinsics/floor":90,"math-intrinsics/max":92,"math-intrinsics/min":93,"math-intrinsics/pow":94,"math-intrinsics/round":95,"math-intrinsics/sign":96}],65:[function(e,t,r){var n=e("es-object-atoms");t.exports=n.getPrototypeOf||null},{"es-object-atoms":43}],66:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],67:[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":65,"./Reflect.getPrototypeOf":66,"dunder-proto/get":34}],68:[function(e,t,r){t.exports=Object.getOwnPropertyDescriptor},{}],69:[function(e,t,r){var n=e("./gOPD");if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"./gOPD":68}],70:[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":35}],71:[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":72}],72:[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}},{}],73:[function(e,t,r){var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":72}],74:[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":60}],75:[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:159,url:182}],76:[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}},{}],77:[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}}},{}],78:[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":32,"has-tostringtag/shams":73}],79:[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)}},{}],80:[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":32,"generator-function":63,"get-proto":67,"has-tostringtag/shams":73,"safe-regex-test":136}],81:[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]},{}],82:[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":81}],83:[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+' + "'}},A={},O=function(e){if(A[e])return A[e];var t=S("pattern");return g[t]=new RegExp(e),A[e]=t,t},E=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],_=function(){var e=E.shift();return E.push(e+e[0]),w.push(e),e},C=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,A=function(t,r,n){R("errors++"),!0===i&&(R("if (validate.errors === null) validate.errors = []"),b?R("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)):R("validate.errors.push({field:%s,message:%s})",D(r||e),JSON.stringify(t)))};!0===o.required?(w++,R("if (%s === undefined) {",e),A("is required"),R("} else {")):(w++,R("if (%s !== undefined) {",e));var E=[].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"!==E&&(w++,R("if (!(%s)) {",E),A("is the wrong type"),R("} else {")),v)if(!1===o.additionalItems)R("if (%s.length > %d) {",e,o.items.length),A("has additional items"),R("}");else if(o.additionalItems){var q=_();R("for (var %s = %d; %s < %s.length; %s++) {",q,o.items.length,q,e,q),C(e+"["+q+"]",o.additionalItems,i,l,c.concat("additionalItems")),R("}")}if(o.format&&y[o.format]){"string"!==p&&u[o.format]&&R("if (%s) {",s.string(e));var T=S("format");g[T]=y[o.format],"function"==typeof g[T]?R("if (!%s(%s)) {",T,e):R("if (!testLimitedRegex(%s, %s, %d)) {",T,e,void 0===o.maxLength?-1:o.maxLength),A("must be "+o.format+" format"),R("}"),"string"!==p&&u[o.format]&&R("}")}if(Array.isArray(o.required)){T=S("missing");R("var %s = 0",T);R("if ((%s)) {","object"!==p?s.object(e):"true"),o.required.map(function(t){var r=n(e,t);R("if (%s === undefined) {",r),A("is required",r),R("%s++",T),R("}")}),R("}"),m||(R("if (%s === 0) {",T),w++)}if(o.uniqueItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (!(unique(%s, %d))) {",e,o.maxItems||-1),A("must be unique"),R("}"),"array"!==p&&R("}")),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)};R("if (%s) {",o.enum.map(j).join(" && ")||"false"),A("must be an enum value"),R("}")}if(o.dependencies&&("object"!==p&&R("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)&&(R("if (%s !== undefined && !(%s)) {",n(e,t),r.map(function(t){return n(e,t)+" !== undefined"}).join(" && ")||"true"),A("dependencies not set"),R("}")),"object"==typeof r&&(R("if (%s !== undefined) {",n(e,t)),C(e,r,i,l,c.concat(["dependencies",t])),R("}"))}),"object"!==p&&R("}")),o.additionalProperties||!1===o.additionalProperties){"object"!==p&&R("if (%s) {",s.object(e));q=_();var x=S("keys"),I=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";R("var %s = Object.keys(%s)",x,e)("for (var %s = 0; %s < %s.length; %s++) {",q,q,x,q)("if (%s) {",I),!1===o.additionalProperties?(l&&R("delete %s",e+"["+x+"["+q+"]]"),A("has additional properties",null,JSON.stringify(e+".")+" + "+x+"["+q+"]")):C(e+"["+x+"["+q+"]]",o.additionalProperties,i,l,c.concat(["additionalProperties"])),R("}")("}"),"object"!==p&&R("}")}if(o.$ref){var L=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(L){var U=t[o.$ref];U||(t[o.$ref]=function(e){return U(e)},U=d(L,t,r,!1,h));T=S("ref");g[T]=U,R("if (!(%s(%s))) {",T,e),A("referenced schema does not match"),R("}")}}if(o.not){var k=S("prev");R("var %s = errors",k),C(e,o.not,!1,l,c.concat("not")),R("if (%s === errors) {",k),A("negative schema matches"),R("} else {")("errors = %s",k)("}")}if(o.items&&!v){"array"!==p&&R("if (%s) {",s.array(e));q=_();R("for (var %s = 0; %s < %s.length; %s++) {",q,q,e,q),C(e+"["+q+"]",o.items,i,l,c.concat("items")),R("}"),"array"!==p&&R("}")}if(o.patternProperties){"object"!==p&&R("if (%s) {",s.object(e));x=S("keys"),q=_();R("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);R("if (%s.test(%s)) {",r,x+"["+q+"]"),C(e+"["+x+"["+q+"]]",o.patternProperties[t],i,l,c.concat(["patternProperties",t])),R("}")}),R("}"),"object"!==p&&R("}")}if(o.pattern){var N=O(o.pattern);"string"!==p&&R("if (%s) {",s.string(e)),R("if (!(testLimitedRegex(%s, %s, %d))) {",N,e,void 0===o.maxLength?-1:o.maxLength),A("pattern mismatch"),R("}"),"string"!==p&&R("}")}if(o.allOf&&o.allOf.forEach(function(t,r){C(e,t,i,l,c.concat(["allOf",r]))}),o.anyOf&&o.anyOf.length){k=S("prev");o.anyOf.forEach(function(t,r){0===r?R("var %s = errors",k):R("if (errors !== %s) {",k)("errors = %s",k),C(e,t,!1,!1,c)}),o.anyOf.forEach(function(e,t){t&&R("}")}),R("if (%s !== errors) {",k),A("no schemas match"),R("}")}if(o.oneOf&&o.oneOf.length){k=S("prev");var M=S("passes");R("var %s = errors",k)("var %s = 0",M),o.oneOf.forEach(function(t,r){C(e,t,!1,!1,c),R("if (%s === errors) {",k)("%s++",M)("} else {")("errors = %s",k)("}")}),R("if (%s !== 1) {",M),A("no (or more than one) schemas match"),R("}")}for(void 0!==o.multipleOf&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (!isMultipleOf(%s, %d)) {",e,o.multipleOf),A("has a remainder"),R("}"),"number"!==p&&"integer"!==p&&R("}")),void 0!==o.maxProperties&&("object"!==p&&R("if (%s) {",s.object(e)),R("if (Object.keys(%s).length > %d) {",e,o.maxProperties),A("has more properties than allowed"),R("}"),"object"!==p&&R("}")),void 0!==o.minProperties&&("object"!==p&&R("if (%s) {",s.object(e)),R("if (Object.keys(%s).length < %d) {",e,o.minProperties),A("has less properties than allowed"),R("}"),"object"!==p&&R("}")),void 0!==o.maxItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (%s.length > %d) {",e,o.maxItems),A("has more items than allowed"),R("}"),"array"!==p&&R("}")),void 0!==o.minItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (%s.length < %d) {",e,o.minItems),A("has less items than allowed"),R("}"),"array"!==p&&R("}")),void 0!==o.maxLength&&("string"!==p&&R("if (%s) {",s.string(e)),R("if (%s.length > %d) {",e,o.maxLength),A("has longer length than allowed"),R("}"),"string"!==p&&R("}")),void 0!==o.minLength&&("string"!==p&&R("if (%s) {",s.string(e)),R("if (%s.length < %d) {",e,o.minLength),A("has less length than allowed"),R("}"),"string"!==p&&R("}")),void 0!==o.minimum&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (%s %s %d) {",e,o.exclusiveMinimum?"<=":"<",o.minimum),A("is less than minimum"),R("}"),"number"!==p&&"integer"!==p&&R("}")),void 0!==o.maximum&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (%s %s %d) {",e,o.exclusiveMaximum?">=":">",o.maximum),A("is more than maximum"),R("}"),"number"!==p&&"integer"!==p&&R("}")),f&&Object.keys(f).forEach(function(t){Array.isArray(p)&&-1!==p.indexOf("null")&&R("if (%s !== null) {",e),C(n(e,t),f[t],i,l,c.concat(v?t:["properties",t])),Array.isArray(p)&&-1!==p.indexOf("null")&&R("}")});w--;)R("}")},R=o("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return C("data",e,p,h&&h.filter,[]),R("return errors === 0")("}"),(R=R.toFunction(g)).errors=null,Object.defineProperty&&Object.defineProperty(R,"error",{get:function(){return R.errors?R.errors.map(function(e){return e.field+" "+e.message}).join("\n"):""}}),R.toJSON=function(){return e},R};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":82,"generate-function":61,"generate-object-property":62,jsonpointer:88,xtend:189}],84:[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)}},{}],85:[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":32,gopd:69,"has-tostringtag/shams":73,hasown:74}],86:[function(e,t,r){var n=e("which-typed-array");t.exports=function(e){return!!n(e)}},{"which-typed-array":187}],87:[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,A=r.NULL1=65,O=r.NULL2=66,E=r.NULL3=67,_=r.NUMBER1=81,C=r.NUMBER3=83,R=r.STRING1=97,q=r.STRING2=98,T=r.STRING3=99,j=r.STRING4=100,x=r.STRING5=101,I=r.STRING6=102,L=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=L,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,L=t.length;y<L;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=A;else if(34===r)this.string="",this.stringBufferOffset=0,this.tState=R;else if(45===r)this.string="-",this.tState=_;else if(r>=48&&r<64)this.string=String.fromCharCode(r),this.tState=C;else if(32!==r&&9!==r&&10!==r&&13!==r)return this.charError(t,y)}else if(this.tState===R)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=R;else if(92===r)this.appendStringChar(M),this.tState=R;else if(47===r)this.appendStringChar(P),this.tState=R;else if(98===r)this.appendStringChar(B),this.tState=R;else if(102===r)this.appendStringChar(F),this.tState=R;else if(110===r)this.appendStringChar(Q),this.tState=R;else if(114===r)this.appendStringChar($),this.tState=R;else if(116===r)this.appendStringChar(J),this.tState=R;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===I){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++===I){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=R}}else if(this.tState===_||this.tState===C)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=C;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===A){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=E}else if(this.tState===E){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=L)},G.emit=function(e){this.mode&&(this.state=s),this.onValue(e)},G.onValue=function(e){},G.onToken=function(e,t){if(this.state===L)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=L;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=L}else{if(this.state!==s)return this.parseError(e,t);if(e===s)this.mode===N?(this.key++,this.state=L):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:23}],88:[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)}}}},{}],89:[function(e,t,r){t.exports=Math.abs},{}],90:[function(e,t,r){t.exports=Math.floor},{}],91:[function(e,t,r){t.exports=Number.isNaN||function(e){return e!=e}},{}],92:[function(e,t,r){t.exports=Math.max},{}],93:[function(e,t,r){t.exports=Math.min},{}],94:[function(e,t,r){t.exports=Math.pow},{}],95:[function(e,t,r){t.exports=Math.round},{}],96:[function(e,t,r){var n=e("./isNaN");t.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},{"./isNaN":91}],97:[function(e,t,r){
7
+ 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":47,"./Parameters.js":48}],47:[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":49,"./dialects/DGraph/FoxHound-Dialect-DGraph.js":50,"./dialects/English/FoxHound-Dialect-English.js":51,"./dialects/MeadowEndpoints/FoxHound-Dialect-MeadowEndpoints.js":52,"./dialects/MicrosoftSQL/FoxHound-Dialect-MSSQL.js":53,"./dialects/MongoDB/FoxHound-Dialect-MongoDB.js":54,"./dialects/MySQL/FoxHound-Dialect-MySQL.js":55,"./dialects/PostgreSQL/FoxHound-Dialect-PostgreSQL.js":56,"./dialects/SQLite/FoxHound-Dialect-SQLite.js":57,"./dialects/Solr/FoxHound-Dialect-Solr.js":58}],48:[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}},{}],49:[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}},{}],50:[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}},{}],51:[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}},{}],52:[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}},{}],53:[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}},{}],54:[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}},{}],55:[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}},{}],56:[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}},{}],57:[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}},{}],58:[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}},{}],59:[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}},{}],60:[function(e,t,r){var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":59}],61:[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":84,util:187}],62:[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":84}],63:[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}},{}],64:[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},A=S?function(){try{return E}catch(e){try{return S(arguments,"callee").get}catch(e){return E}}}():E,O=e("has-symbols")(),_=e("get-proto"),C=e("get-proto/Object.getPrototypeOf"),R=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%":O&&_?_([][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%":O&&_?_(_([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&O&&_?_((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&&O&&_?_((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":O&&_?_(""[Symbol.iterator]()):n,"%Symbol%":O?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":A,"%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%":C,"%Math.abs%":d,"%Math.floor%":p,"%Math.max%":h,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":R};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":27,"call-bind-apply-helpers/functionCall":28,"es-define-property":35,"es-errors":37,"es-errors/eval":36,"es-errors/range":38,"es-errors/ref":39,"es-errors/syntax":40,"es-errors/type":41,"es-errors/uri":42,"es-object-atoms":43,"function-bind":60,"get-proto":67,"get-proto/Object.getPrototypeOf":65,"get-proto/Reflect.getPrototypeOf":66,gopd:69,"has-symbols":71,hasown:74,"math-intrinsics/abs":89,"math-intrinsics/floor":90,"math-intrinsics/max":92,"math-intrinsics/min":93,"math-intrinsics/pow":94,"math-intrinsics/round":95,"math-intrinsics/sign":96}],65:[function(e,t,r){var n=e("es-object-atoms");t.exports=n.getPrototypeOf||null},{"es-object-atoms":43}],66:[function(e,t,r){t.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],67:[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":65,"./Reflect.getPrototypeOf":66,"dunder-proto/get":34}],68:[function(e,t,r){t.exports=Object.getOwnPropertyDescriptor},{}],69:[function(e,t,r){var n=e("./gOPD");if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"./gOPD":68}],70:[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":35}],71:[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":72}],72:[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}},{}],73:[function(e,t,r){var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":72}],74:[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":60}],75:[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:160,url:183}],76:[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}},{}],77:[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}}},{}],78:[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":32,"has-tostringtag/shams":73}],79:[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)}},{}],80:[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":32,"generator-function":63,"get-proto":67,"has-tostringtag/shams":73,"safe-regex-test":137}],81:[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]},{}],82:[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":81}],83:[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={},A=function(e){if(E[e])return E[e];var t=S("pattern");return g[t]=new RegExp(e),E[e]=t,t},O=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],_=function(){var e=O.shift();return O.push(e+e[0]),w.push(e),e},C=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){R("errors++"),!0===i&&(R("if (validate.errors === null) validate.errors = []"),b?R("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)):R("validate.errors.push({field:%s,message:%s})",D(r||e),JSON.stringify(t)))};!0===o.required?(w++,R("if (%s === undefined) {",e),E("is required"),R("} else {")):(w++,R("if (%s !== undefined) {",e));var O=[].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"!==O&&(w++,R("if (!(%s)) {",O),E("is the wrong type"),R("} else {")),v)if(!1===o.additionalItems)R("if (%s.length > %d) {",e,o.items.length),E("has additional items"),R("}");else if(o.additionalItems){var q=_();R("for (var %s = %d; %s < %s.length; %s++) {",q,o.items.length,q,e,q),C(e+"["+q+"]",o.additionalItems,i,l,c.concat("additionalItems")),R("}")}if(o.format&&y[o.format]){"string"!==p&&u[o.format]&&R("if (%s) {",s.string(e));var T=S("format");g[T]=y[o.format],"function"==typeof g[T]?R("if (!%s(%s)) {",T,e):R("if (!testLimitedRegex(%s, %s, %d)) {",T,e,void 0===o.maxLength?-1:o.maxLength),E("must be "+o.format+" format"),R("}"),"string"!==p&&u[o.format]&&R("}")}if(Array.isArray(o.required)){T=S("missing");R("var %s = 0",T);R("if ((%s)) {","object"!==p?s.object(e):"true"),o.required.map(function(t){var r=n(e,t);R("if (%s === undefined) {",r),E("is required",r),R("%s++",T),R("}")}),R("}"),m||(R("if (%s === 0) {",T),w++)}if(o.uniqueItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (!(unique(%s, %d))) {",e,o.maxItems||-1),E("must be unique"),R("}"),"array"!==p&&R("}")),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)};R("if (%s) {",o.enum.map(j).join(" && ")||"false"),E("must be an enum value"),R("}")}if(o.dependencies&&("object"!==p&&R("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)&&(R("if (%s !== undefined && !(%s)) {",n(e,t),r.map(function(t){return n(e,t)+" !== undefined"}).join(" && ")||"true"),E("dependencies not set"),R("}")),"object"==typeof r&&(R("if (%s !== undefined) {",n(e,t)),C(e,r,i,l,c.concat(["dependencies",t])),R("}"))}),"object"!==p&&R("}")),o.additionalProperties||!1===o.additionalProperties){"object"!==p&&R("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"!"+A(e)+".test("+x+"["+q+"])"})).join(" && ")||"true";R("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&&R("delete %s",e+"["+x+"["+q+"]]"),E("has additional properties",null,JSON.stringify(e+".")+" + "+x+"["+q+"]")):C(e+"["+x+"["+q+"]]",o.additionalProperties,i,l,c.concat(["additionalProperties"])),R("}")("}"),"object"!==p&&R("}")}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,R("if (!(%s(%s))) {",T,e),E("referenced schema does not match"),R("}")}}if(o.not){var k=S("prev");R("var %s = errors",k),C(e,o.not,!1,l,c.concat("not")),R("if (%s === errors) {",k),E("negative schema matches"),R("} else {")("errors = %s",k)("}")}if(o.items&&!v){"array"!==p&&R("if (%s) {",s.array(e));q=_();R("for (var %s = 0; %s < %s.length; %s++) {",q,q,e,q),C(e+"["+q+"]",o.items,i,l,c.concat("items")),R("}"),"array"!==p&&R("}")}if(o.patternProperties){"object"!==p&&R("if (%s) {",s.object(e));x=S("keys"),q=_();R("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=A(t);R("if (%s.test(%s)) {",r,x+"["+q+"]"),C(e+"["+x+"["+q+"]]",o.patternProperties[t],i,l,c.concat(["patternProperties",t])),R("}")}),R("}"),"object"!==p&&R("}")}if(o.pattern){var N=A(o.pattern);"string"!==p&&R("if (%s) {",s.string(e)),R("if (!(testLimitedRegex(%s, %s, %d))) {",N,e,void 0===o.maxLength?-1:o.maxLength),E("pattern mismatch"),R("}"),"string"!==p&&R("}")}if(o.allOf&&o.allOf.forEach(function(t,r){C(e,t,i,l,c.concat(["allOf",r]))}),o.anyOf&&o.anyOf.length){k=S("prev");o.anyOf.forEach(function(t,r){0===r?R("var %s = errors",k):R("if (errors !== %s) {",k)("errors = %s",k),C(e,t,!1,!1,c)}),o.anyOf.forEach(function(e,t){t&&R("}")}),R("if (%s !== errors) {",k),E("no schemas match"),R("}")}if(o.oneOf&&o.oneOf.length){k=S("prev");var M=S("passes");R("var %s = errors",k)("var %s = 0",M),o.oneOf.forEach(function(t,r){C(e,t,!1,!1,c),R("if (%s === errors) {",k)("%s++",M)("} else {")("errors = %s",k)("}")}),R("if (%s !== 1) {",M),E("no (or more than one) schemas match"),R("}")}for(void 0!==o.multipleOf&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (!isMultipleOf(%s, %d)) {",e,o.multipleOf),E("has a remainder"),R("}"),"number"!==p&&"integer"!==p&&R("}")),void 0!==o.maxProperties&&("object"!==p&&R("if (%s) {",s.object(e)),R("if (Object.keys(%s).length > %d) {",e,o.maxProperties),E("has more properties than allowed"),R("}"),"object"!==p&&R("}")),void 0!==o.minProperties&&("object"!==p&&R("if (%s) {",s.object(e)),R("if (Object.keys(%s).length < %d) {",e,o.minProperties),E("has less properties than allowed"),R("}"),"object"!==p&&R("}")),void 0!==o.maxItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (%s.length > %d) {",e,o.maxItems),E("has more items than allowed"),R("}"),"array"!==p&&R("}")),void 0!==o.minItems&&("array"!==p&&R("if (%s) {",s.array(e)),R("if (%s.length < %d) {",e,o.minItems),E("has less items than allowed"),R("}"),"array"!==p&&R("}")),void 0!==o.maxLength&&("string"!==p&&R("if (%s) {",s.string(e)),R("if (%s.length > %d) {",e,o.maxLength),E("has longer length than allowed"),R("}"),"string"!==p&&R("}")),void 0!==o.minLength&&("string"!==p&&R("if (%s) {",s.string(e)),R("if (%s.length < %d) {",e,o.minLength),E("has less length than allowed"),R("}"),"string"!==p&&R("}")),void 0!==o.minimum&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (%s %s %d) {",e,o.exclusiveMinimum?"<=":"<",o.minimum),E("is less than minimum"),R("}"),"number"!==p&&"integer"!==p&&R("}")),void 0!==o.maximum&&("number"!==p&&"integer"!==p&&R("if (%s) {",s.number(e)),R("if (%s %s %d) {",e,o.exclusiveMaximum?">=":">",o.maximum),E("is more than maximum"),R("}"),"number"!==p&&"integer"!==p&&R("}")),f&&Object.keys(f).forEach(function(t){Array.isArray(p)&&-1!==p.indexOf("null")&&R("if (%s !== null) {",e),C(n(e,t),f[t],i,l,c.concat(v?t:["properties",t])),Array.isArray(p)&&-1!==p.indexOf("null")&&R("}")});w--;)R("}")},R=o("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return C("data",e,p,h&&h.filter,[]),R("return errors === 0")("}"),(R=R.toFunction(g)).errors=null,Object.defineProperty&&Object.defineProperty(R,"error",{get:function(){return R.errors?R.errors.map(function(e){return e.field+" "+e.message}).join("\n"):""}}),R.toJSON=function(){return e},R};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":82,"generate-function":61,"generate-object-property":62,jsonpointer:88,xtend:190}],84:[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)}},{}],85:[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":32,gopd:69,"has-tostringtag/shams":73,hasown:74}],86:[function(e,t,r){var n=e("which-typed-array");t.exports=function(e){return!!n(e)}},{"which-typed-array":188}],87:[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,A=r.NULL2=66,O=r.NULL3=67,_=r.NUMBER1=81,C=r.NUMBER3=83,R=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=R;else if(45===r)this.string="-",this.tState=_;else if(r>=48&&r<64)this.string=String.fromCharCode(r),this.tState=C;else if(32!==r&&9!==r&&10!==r&&13!==r)return this.charError(t,y)}else if(this.tState===R)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=R;else if(92===r)this.appendStringChar(M),this.tState=R;else if(47===r)this.appendStringChar(P),this.tState=R;else if(98===r)this.appendStringChar(B),this.tState=R;else if(102===r)this.appendStringChar(F),this.tState=R;else if(110===r)this.appendStringChar(Q),this.tState=R;else if(114===r)this.appendStringChar($),this.tState=R;else if(116===r)this.appendStringChar(J),this.tState=R;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=R}}else if(this.tState===_||this.tState===C)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=C;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=A}else if(this.tState===A){if(108!==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=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:23}],88:[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)}}}},{}],89:[function(e,t,r){t.exports=Math.abs},{}],90:[function(e,t,r){t.exports=Math.floor},{}],91:[function(e,t,r){t.exports=Number.isNaN||function(e){return e!=e}},{}],92:[function(e,t,r){t.exports=Math.max},{}],93:[function(e,t,r){t.exports=Math.min},{}],94:[function(e,t,r){t.exports=Math.pow},{}],95:[function(e,t,r){t.exports=Math.round},{}],96:[function(e,t,r){var n=e("./isNaN");t.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},{"./isNaN":91}],97:[function(e,t,r){
8
8
  /**
9
9
  * Meadow Endpoint Utility Function - Parse a Filter String and put it into a Query.
10
10
  *
@@ -28,7 +28,7 @@ var n=e("is-my-json-valid");t.exports=new function(){return function e(t,r){var
28
28
  * @license MIT
29
29
  * @author <steven@velozo.com>
30
30
  */
31
- var n=e("foxhound");t.exports=new function(){return function t(r,o,a,i){if("object"!=typeof r||!("fable"in r))return{new:t};var u=r;u.settingsManager.fill({MeadowProvider:"None"});var s=0,l="string"==typeof o?o:"Unknown",c=e("./Meadow-Schema.js").new(a,i),f=n.new(u).setScope(l),d=e("./Meadow-RawQuery.js").new(u),p=e("./behaviors/Meadow-Create.js"),h=e("./behaviors/Meadow-Read.js"),y=e("./behaviors/Meadow-Reads.js"),g=e("./behaviors/Meadow-Update.js"),b=e("./behaviors/Meadow-Delete.js"),m=e("./behaviors/Meadow-Undelete.js"),v=e("./behaviors/Meadow-Count.js"),w=!1,S=!1,D="ID"+l,A="GUID"+l,O=e("./Meadow-PackageFileLoader.js"),E=e("./Meadow-PackageObjectLoader.js"),_=()=>("function"==typeof w.setSchema&&w.setSchema(l,c.schema,D,A),this),C={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"),None:e("./providers/Meadow-Provider-None.js")},R=function(e){"string"!=typeof e&&(e="None");try{w=C[e].new(u),_(),S=e}catch(t){u.log.error("Provider not set - require load problem",{InvalidProvider:e,error:t}),R("None")}return this};let q;R(u.settings.MeadowProvider),q=Array.isArray(u.settings.MeadowRoleNames)?u.settings.MeadowRoleNames:["Unauthenticated","User","Manager","Director","Executive","Administrator"];var T={doCreate:function(e,t){return p(this,e,t)},doRead:function(e,t){return h(this,e,t)},doReads:function(e,t){return y(this,e,t)},doUpdate:function(e,t){return g(this,e,t)},doDelete:function(e,t){return b(this,e,t)},doUndelete:function(e,t){return m(this,e,t)},doCount:function(e,t){return v(this,e,t)},validateObject:c.validateObject,marshalRecordFromSourceToObject:function(e){var t=u.Utility.extend({},c.defaultObject);return w.marshalRecordFromSourceToObject(t,e,c.schema),t},setProvider:R,setIDUser:function(e){return s=e,this},loadFromPackage:function(e){return O(this,e)},loadFromPackageObject:function(e){return E(this,e)},setScope:function(e){return l=e,f.setScope(e),_(),this},setDomain:function(e){return this},setSchema:function(e){return c.setSchema(e),_(),this},setJsonSchema:function(e){return c.setJsonSchema(e),this},setDefault:function(e){return c.setDefault(e),this},setDefaultIdentifier:function(e){return D=e,A="GU"+e,_(),this},setAuthorizer:function(e){return c.setAuthorizer(e),this},getRoleName:function(e){return e<0||e>=q.length?"Unauthenticated":q[e]},logSlowQuery:function(e,t){var r=t.query||{body:"",parameters:{}},n=r.body;if(r.parameters.length)for(var o in r.parameters)n=n.replace(":"+o,r.parameters[o]);u.log.warn("Slow Read query took "+e+"ms",{Provider:S,Query:{Body:r.body,Parameters:r.parameters,FullQuery:n}})},new:t};return Object.defineProperty(T,"scope",{get:function(){return l},enumerable:!0}),Object.defineProperty(T,"schema",{get:function(){return c.schema},enumerable:!0}),Object.defineProperty(T,"schemaFull",{get:function(){return c},enumerable:!0}),Object.defineProperty(T,"defaultIdentifier",{get:function(){return D},enumerable:!0}),Object.defineProperty(T,"defaultGUIdentifier",{get:function(){return A},enumerable:!0}),Object.defineProperty(T,"jsonSchema",{get:function(){return c.jsonSchema},enumerable:!0}),Object.defineProperty(T,"userIdentifier",{get:function(){return s},enumerable:!0}),Object.defineProperty(T,"query",{get:function(){var e=f.clone();return e.query.schema=c.schema,e},enumerable:!0}),Object.defineProperty(T,"rawQueries",{get:function(){return d},enumerable:!0}),Object.defineProperty(T,"provider",{get:function(){return w},enumerable:!0}),Object.defineProperty(T,"providerName",{get:function(){return S},enumerable:!0}),"function"==typeof u.addServices?u.addServices(T):(Object.defineProperty(T,"fable",{get:function(){return u},enumerable:!1}),Object.defineProperty(T,"settings",{get:function(){return u.settings},enumerable:!1}),Object.defineProperty(T,"log",{get:function(){return u.log},enumerable:!1})),T}()}},{"./Meadow-PackageFileLoader.js":99,"./Meadow-PackageObjectLoader.js":100,"./Meadow-RawQuery.js":101,"./Meadow-Schema.js":102,"./behaviors/Meadow-Count.js":104,"./behaviors/Meadow-Create.js":105,"./behaviors/Meadow-Delete.js":106,"./behaviors/Meadow-Read.js":107,"./behaviors/Meadow-Reads.js":108,"./behaviors/Meadow-Undelete.js":109,"./behaviors/Meadow-Update.js":110,"./providers/Meadow-Provider-ALASQL.js":111,"./providers/Meadow-Provider-DGraph.js":112,"./providers/Meadow-Provider-MSSQL.js":113,"./providers/Meadow-Provider-MeadowEndpoints.js":114,"./providers/Meadow-Provider-MongoDB.js":115,"./providers/Meadow-Provider-MySQL.js":116,"./providers/Meadow-Provider-None.js":117,"./providers/Meadow-Provider-PostgreSQL.js":118,"./providers/Meadow-Provider-RocksDB.js":119,"./providers/Meadow-Provider-SQLite.js":120,"./providers/Meadow-Provider-Solr.js":121,foxhound:46}],104:[function(e,t,r){
31
+ var n=e("foxhound");t.exports=new function(){return function t(r,o,a,i){if("object"!=typeof r||!("fable"in r))return{new:t};var u=r;u.settingsManager.fill({MeadowProvider:"None"});var s=0,l="string"==typeof o?o:"Unknown",c=e("./Meadow-Schema.js").new(a,i),f=n.new(u).setScope(l),d=e("./Meadow-RawQuery.js").new(u),p=e("./behaviors/Meadow-Create.js"),h=e("./behaviors/Meadow-Read.js"),y=e("./behaviors/Meadow-Reads.js"),g=e("./behaviors/Meadow-Update.js"),b=e("./behaviors/Meadow-Delete.js"),m=e("./behaviors/Meadow-Undelete.js"),v=e("./behaviors/Meadow-Count.js"),w=!1,S=!1,D="ID"+l,E="GUID"+l,A=e("./Meadow-PackageFileLoader.js"),O=e("./Meadow-PackageObjectLoader.js"),_=()=>("function"==typeof w.setSchema&&w.setSchema(l,c.schema,D,E),this),C={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")},R=function(e){"string"!=typeof e&&(e="None");try{w=C[e].new(u),_(),S=e}catch(t){u.log.error("Provider not set - require load problem",{InvalidProvider:e,error:t}),R("None")}return this};let q;R(u.settings.MeadowProvider),q=Array.isArray(u.settings.MeadowRoleNames)?u.settings.MeadowRoleNames:["Unauthenticated","User","Manager","Director","Executive","Administrator"];var T={doCreate:function(e,t){return p(this,e,t)},doRead:function(e,t){return h(this,e,t)},doReads:function(e,t){return y(this,e,t)},doUpdate:function(e,t){return g(this,e,t)},doDelete:function(e,t){return b(this,e,t)},doUndelete:function(e,t){return m(this,e,t)},doCount:function(e,t){return v(this,e,t)},validateObject:c.validateObject,marshalRecordFromSourceToObject:function(e){var t=u.Utility.extend({},c.defaultObject);return w.marshalRecordFromSourceToObject(t,e,c.schema),t},setProvider:R,setIDUser:function(e){return s=e,this},loadFromPackage:function(e){return A(this,e)},loadFromPackageObject:function(e){return O(this,e)},setScope:function(e){return l=e,f.setScope(e),_(),this},setDomain:function(e){return this},setSchema:function(e){return c.setSchema(e),_(),this},setJsonSchema:function(e){return c.setJsonSchema(e),this},setDefault:function(e){return c.setDefault(e),this},setDefaultIdentifier:function(e){return D=e,E="GU"+e,_(),this},setAuthorizer:function(e){return c.setAuthorizer(e),this},getRoleName:function(e){return e<0||e>=q.length?"Unauthenticated":q[e]},logSlowQuery:function(e,t){var r=t.query||{body:"",parameters:{}},n=r.body;if(r.parameters.length)for(var o in r.parameters)n=n.replace(":"+o,r.parameters[o]);u.log.warn("Slow Read query took "+e+"ms",{Provider:S,Query:{Body:r.body,Parameters:r.parameters,FullQuery:n}})},new:t};return Object.defineProperty(T,"scope",{get:function(){return l},enumerable:!0}),Object.defineProperty(T,"schema",{get:function(){return c.schema},enumerable:!0}),Object.defineProperty(T,"schemaFull",{get:function(){return c},enumerable:!0}),Object.defineProperty(T,"defaultIdentifier",{get:function(){return D},enumerable:!0}),Object.defineProperty(T,"defaultGUIdentifier",{get:function(){return E},enumerable:!0}),Object.defineProperty(T,"jsonSchema",{get:function(){return c.jsonSchema},enumerable:!0}),Object.defineProperty(T,"userIdentifier",{get:function(){return s},enumerable:!0}),Object.defineProperty(T,"query",{get:function(){var e=f.clone();return e.query.schema=c.schema,e},enumerable:!0}),Object.defineProperty(T,"rawQueries",{get:function(){return d},enumerable:!0}),Object.defineProperty(T,"provider",{get:function(){return w},enumerable:!0}),Object.defineProperty(T,"providerName",{get:function(){return S},enumerable:!0}),"function"==typeof u.addServices?u.addServices(T):(Object.defineProperty(T,"fable",{get:function(){return u},enumerable:!1}),Object.defineProperty(T,"settings",{get:function(){return u.settings},enumerable:!1}),Object.defineProperty(T,"log",{get:function(){return u.log},enumerable:!1})),T}()}},{"./Meadow-PackageFileLoader.js":99,"./Meadow-PackageObjectLoader.js":100,"./Meadow-RawQuery.js":101,"./Meadow-Schema.js":102,"./behaviors/Meadow-Count.js":104,"./behaviors/Meadow-Create.js":105,"./behaviors/Meadow-Delete.js":106,"./behaviors/Meadow-Read.js":107,"./behaviors/Meadow-Reads.js":108,"./behaviors/Meadow-Undelete.js":109,"./behaviors/Meadow-Update.js":110,"./providers/Meadow-Provider-ALASQL.js":111,"./providers/Meadow-Provider-DGraph.js":112,"./providers/Meadow-Provider-MSSQL.js":113,"./providers/Meadow-Provider-MeadowEndpoints.js":114,"./providers/Meadow-Provider-MongoDB.js":115,"./providers/Meadow-Provider-MySQL.js":116,"./providers/Meadow-Provider-None.js":117,"./providers/Meadow-Provider-PostgreSQL.js":118,"./providers/Meadow-Provider-RetoldDataBeacon.js":119,"./providers/Meadow-Provider-RocksDB.js":120,"./providers/Meadow-Provider-SQLite.js":121,"./providers/Meadow-Provider-Solr.js":122,foxhound:46}],104:[function(e,t,r){
32
32
  /**
33
33
  * @license MIT
34
34
  * @author <steven@velozo.com>
@@ -63,19 +63,19 @@ var n=e("async/waterfall");t.exports=function(e,t,r){return n([function(r){e.raw
63
63
  * @license MIT
64
64
  * @author <steven@velozo.com>
65
65
  */
66
- 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":18}],111:[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}}()}},{}],112:[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}}()}},{}],113:[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=>{n&&r.log.error(`CREATE Error preparing prepared statement: ${n}`,n),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;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=>{n&&r.log.error(`READ Error preparing prepared statement: ${n}`,n),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=>{n&&r.log.error(`UPDATE Error preparing prepared statement: ${n}`,n),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=>{n&&r.log.error(`DELETE Error preparing prepared statement: ${n}`,n),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=>{n&&r.log.error(`UNDELETE Error preparing prepared statement: ${n}`,n),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=>{n&&r.log.error(`COUNT Error preparing prepared statement: ${n}`,n),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}}()}},{}],114:[function(e,t,r){
66
+ 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":18}],111:[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}}()}},{}],112:[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}}()}},{}],113:[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}}()}},{}],114:[function(e,t,r){
67
67
  /**
68
68
  * @license MIT
69
69
  * @author <steven@velozo.com>
70
70
  */
71
- 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":143}],115:[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}}()}},{}],116:[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),o().getConnection(function(n,o){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),o().getConnection(function(r,n){n.query(e.query.body,e.query.parameters,function(e,r){return n.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),o().getConnection(function(r,n){n.query(e.query.body,e.query.parameters,function(e,r){return n.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),o().getConnection(function(n,o){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),o().getConnection(function(n,o){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),o().getConnection(function(n,o){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}}()}},{}],117:[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}}()}},{}],118:[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}}()}},{}],119:[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}}()}},{}],120:[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})}return i.executed=!0,t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,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);return i.error=null,i.value=l,i.executed=!0,t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,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);return i.error=null,i.value=l,i.executed=!0,t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,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})}return i.executed=!0,t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,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})}return i.executed=!0,t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,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})}return t()}catch(e){return i.error=e,i.value=!1,i.executed=!0,t()}},getProvider:function(){return"object"==typeof r.MeadowSQLiteProvider&&r.MeadowSQLiteProvider},providerCreatesSupported:!0,new:e}}()}},{}],121:[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}}()}},{}],122:[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,A=Array.prototype.concat,O=Array.prototype.join,E=Array.prototype.slice,_=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=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,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function L(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,"&quot;")}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?L(t,D):D}if("bigint"==typeof t){var _=String(t)+"n";return w?L(t,_):_}var R=void 0===s.depth?5:s.depth;if(void 0===o&&(o=0),o>=R&&R>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=E.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(A.call("[cause]: "+P(t.cause),se),", ")+" }"}if("object"==typeof t&&y){if(N&&"function"==typeof t[N]&&U)return U(t,{depth:R-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||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return X(P(C.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=I?I(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(A.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 R?R(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 R)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":21}],123:[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:188}],124:[function(e,t,r){t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},{}],125:[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}},{}],126:[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 A(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 E(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(A(d+S%v,0))),s=y(S/v);D.push(g(A(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:E,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)?E(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:{})},{}],127:[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}},{}],128:[function(e,t,r){var n=e("./stringify"),o=e("./parse"),a=e("./formats");t.exports={formats:a,parse:o,stringify:n}},{"./formats":127,"./parse":129,"./stringify":130}],129:[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":131}],130:[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,A,O){for(var E,_=t,C=O,R=0,q=!1;void 0!==(C=C.get(h))&&!q;){var T=C.get(t);if(R+=1,void 0!==T){if(T===R)throw new RangeError("Cyclic object value");q=!0}void 0===C.get(h)&&(R=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,A,"key",w):r;_=""}if("string"==typeof(E=_)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||o.isBuffer(_))return y?[S(D?r:y(r,p.encoder,A,"key",w))+"="+S(y(_,p.encoder,A,"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 I=Object.keys(_);j=b?I.sort(b):I}var L=d?String(r).replace(/\./g,"%2E"):String(r),U=i&&s(_)&&1===_.length?L+"[]":L;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,R);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,A,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":127,"./utils":131,"side-channel":141}],131:[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":127,"side-channel":141}],132:[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)}},{}],133:[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}},{}],134:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":132,"./encode":133}],135:[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:23}],136:[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":32,"es-errors/type":41,"is-regex":85}],137:[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":33,"es-errors/type":41,"get-intrinsic":64,gopd:69,"has-property-descriptors":70}],138:[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":41,"object-inspect":122}],139:[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":32,"es-errors/type":41,"get-intrinsic":64,"object-inspect":122}],140:[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":32,"es-errors/type":41,"get-intrinsic":64,"object-inspect":122,"side-channel-map":139}],141:[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":41,"object-inspect":122,"side-channel-list":138,"side-channel-map":139,"side-channel-weakmap":140}],142:[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:23}],143:[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:23,"decompress-response":21,http:159,https:75,once:123,querystring:134,"simple-concat":142,url:182}],144:[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:44,inherits:77,"readable-stream/lib/_stream_duplex.js":146,"readable-stream/lib/_stream_passthrough.js":147,"readable-stream/lib/_stream_readable.js":148,"readable-stream/lib/_stream_transform.js":149,"readable-stream/lib/_stream_writable.js":150,"readable-stream/lib/internal/streams/end-of-stream.js":154,"readable-stream/lib/internal/streams/pipeline.js":156}],145:[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},{}],146:[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":148,"./_stream_writable":150,_process:125,inherits:77}],147:[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":149,inherits:77}],148:[function(e,t,r){(function(r,n){(function(){var o;t.exports=E,E.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")(E,i);var D=y.errorOrDestroy,A=["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 E(t){if(o=o||e("./_stream_duplex"),!(this instanceof E))return new E(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):C(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?C(e,i,t,!1):x(e,i)):C(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function C(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(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=y.destroy,E.prototype._undestroy=y.undestroy,E.prototype._destroy=function(e,t){t(e)},E.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)},E.prototype.unshift=function(e){return _(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.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 R=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>=R?e=R:(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(I,e,t))}function I(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 L(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}E.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},E.prototype._read=function(e){D(this,new w("_read()"))},E.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},E.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},E.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},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(L,this),n},E.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(L,this),t},E.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},E.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},E.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<A.length;a++)e.on(A[a],this.emit.bind(this,A[a]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=M,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(E,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":145,"./_stream_duplex":146,"./internal/streams/async_iterator":151,"./internal/streams/buffer_list":152,"./internal/streams/destroy":153,"./internal/streams/from":155,"./internal/streams/state":157,"./internal/streams/stream":158,_process:125,buffer:23,events:44,inherits:77,"string_decoder/":178,util:21}],149:[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":145,"./_stream_duplex":146,inherits:77}],150:[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=E,E.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 A(){}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||R(e,n),o?r.nextTick(C,e,n,i,a):C(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 E(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(E,this))return new E(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 C(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 R(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")(E,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(E,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===E&&(e&&e._writableState instanceof O)}})):c=function(e){return e instanceof this},E.prototype.pipe=function(){D(this,new b)},E.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=A),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},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},E.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(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new y("_write()"))},E.prototype._writev=null,E.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(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.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":145,"./_stream_duplex":146,"./internal/streams/destroy":153,"./internal/streams/state":157,"./internal/streams/stream":158,_process:125,buffer:23,inherits:77,"util-deprecate":183}],151:[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":154,_process:125}],152:[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:23,util:21}],153:[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:125}],154:[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":145}],155:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],156:[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":145,"./end-of-stream":154}],157:[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":145}],158:[function(e,t,r){t.exports=e("events").EventEmitter},{events:44}],159:[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":161,"./lib/response":162,"builtin-status-codes":24,url:182,xtend:189}],160:[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:{})},{}],161:[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":160,"./response":162,_process:125,buffer:23,inherits:77,"readable-stream":177}],162:[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":160,_process:125,buffer:23,inherits:77,"readable-stream":177}],163:[function(e,t,r){arguments[4][145][0].apply(r,arguments)},{dup:145}],164:[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":166,"./_stream_writable":168,_process:125,inherits:77}],165:[function(e,t,r){arguments[4][147][0].apply(r,arguments)},{"./_stream_transform":167,dup:147,inherits:77}],166:[function(e,t,r){(function(r,n){(function(){var o;t.exports=E,E.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")(E,i);var D=y.errorOrDestroy,A=["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 E(t){if(o=o||e("./_stream_duplex"),!(this instanceof E))return new E(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):C(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?C(e,i,t,!1):x(e,i)):C(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function C(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(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),E.prototype.destroy=y.destroy,E.prototype._undestroy=y.undestroy,E.prototype._destroy=function(e,t){t(e)},E.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)},E.prototype.unshift=function(e){return _(this,e,null,!0,!1)},E.prototype.isPaused=function(){return!1===this._readableState.flowing},E.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 R=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>=R?e=R:(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(I,e,t))}function I(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 L(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}E.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},E.prototype._read=function(e){D(this,new w("_read()"))},E.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},E.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},E.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},E.prototype.addListener=E.prototype.on,E.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(L,this),n},E.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(L,this),t},E.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},E.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},E.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<A.length;a++)e.on(A[a],this.emit.bind(this,A[a]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(E.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(E.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(E.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(E.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),E._fromList=M,Object.defineProperty(E.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(E.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(E,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":163,"./_stream_duplex":164,"./internal/streams/async_iterator":169,"./internal/streams/buffer_list":170,"./internal/streams/destroy":171,"./internal/streams/from":173,"./internal/streams/state":175,"./internal/streams/stream":176,_process:125,buffer:23,events:44,inherits:77,"string_decoder/":178,util:21}],167:[function(e,t,r){arguments[4][149][0].apply(r,arguments)},{"../errors":163,"./_stream_duplex":164,dup:149,inherits:77}],168:[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=E,E.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 A(){}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||R(e,n),o?r.nextTick(C,e,n,i,a):C(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 E(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(E,this))return new E(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 C(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 R(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")(E,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(E,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===E&&(e&&e._writableState instanceof O)}})):c=function(e){return e instanceof this},E.prototype.pipe=function(){D(this,new b)},E.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=A),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},E.prototype.cork=function(){this._writableState.corked++},E.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},E.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(E.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,r){r(new y("_write()"))},E.prototype._writev=null,E.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(E.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(E.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=f.destroy,E.prototype._undestroy=f.undestroy,E.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":163,"./_stream_duplex":164,"./internal/streams/destroy":171,"./internal/streams/state":175,"./internal/streams/stream":176,_process:125,buffer:23,inherits:77,"util-deprecate":183}],169:[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":172,_process:125}],170:[function(e,t,r){arguments[4][152][0].apply(r,arguments)},{buffer:23,dup:152,util:21}],171:[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:125}],172:[function(e,t,r){arguments[4][154][0].apply(r,arguments)},{"../../../errors":163,dup:154}],173:[function(e,t,r){arguments[4][155][0].apply(r,arguments)},{dup:155}],174:[function(e,t,r){arguments[4][156][0].apply(r,arguments)},{"../../../errors":163,"./end-of-stream":172,dup:156}],175:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{"../../../errors":163,dup:157}],176:[function(e,t,r){arguments[4][158][0].apply(r,arguments)},{dup:158,events:44}],177:[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":164,"./lib/_stream_passthrough.js":165,"./lib/_stream_readable.js":166,"./lib/_stream_transform.js":167,"./lib/_stream_writable.js":168,"./lib/internal/streams/end-of-stream.js":172,"./lib/internal/streams/pipeline.js":174}],178:[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":135}],179:[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:125,stream:144}],180:[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":125,timers:180}],181:[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 A(e){return void 0===e}function O(e){return!0===e||!1===e||"[object Boolean]"===s.call(e)}function E(e){var t="[object "+e+"]";return function(e){return s.call(e)===t}}var _=E("String"),C=E("Number"),R=E("Date"),q=E("RegExp"),T=E("Error"),j=E("Symbol"),x=E("ArrayBuffer"),I=E("Function"),L=r.document&&r.document.childNodes;"function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof L&&(I=function(e){return"function"==typeof e||!1});var U=I,k=E("Object"),N=f&&(!/\[native code\]/.test(String(DataView))||k(new DataView(new ArrayBuffer(8)))),M="undefined"!=typeof Map&&k(new Map),P=E("DataView");var B=N?function(e){return null!=e&&U(e.getInt8)&&x(e.buffer)}:P,F=d||E("Array");function Q(e,t){return null!=e&&l.call(e,t)}var $=E("Arguments");!function(){$(arguments)||($=function(e){return Q(e,"callee")})}();var J=$;function H(e){return C(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):E("Map"),ye=M?ue(de):E("WeakMap"),ge=M?ue(pe):E("Set"),be=E("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),Ae=Se(te),Oe=Se(ie,!0);function Ee(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 Ce(e){return ne.toPath(e)}function Re(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=Re(e,Ce(t));return A(n)?r:n}function Te(e){return e}function je(e){return e=Ae({},e),function(t){return re(t,e)}}function xe(e){return e=Ce(e),function(t){return Re(t,e)}}function Ie(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 Le(e,t,r){return null==e?Te:U(e)?Ie(e,t,r):D(e)&&!F(e)?je(e):xe(e)}function Ue(e,t){return Le(e,t,1/0)}function ke(e,t,r){return ne.iteratee!==Ue?ne.iteratee(e,t):Le(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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},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=Ee(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=Ie(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,Ie(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 At(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 Et(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=Ce(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=Re(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,r)})});function Ct(e,t){return mt(e,xe(t))}function Rt(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 It=xt(function(e,t,r){Q(e,r)?e[r].push(t):e[r]=[t]}),Lt=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=Ie(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!Et(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!Et(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?Et(a,l)||(a.push(l),o.push(s)):Et(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&&Rt(e,Z).length||0,r=Array(t),n=0;n<t;n++)r[n]=Ct(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:A,isBoolean:O,isElement:function(e){return!(!e||1!==e.nodeType)},isString:_,isNumber:C,isDate:R,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:Ae,assign:Ae,defaults:Oe,create:function(e,t){var r=Ee(e);return t&&Ae(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=Ce(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=Ie(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=Ce(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:At,all:At,some:Ot,any:Ot,contains:Et,includes:Et,include:Et,invoke:_t,pluck:Ct,where:function(e,t){return Dt(e,je(t))},max:Rt,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),Ct(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:It,indexBy:Lt,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(!Et(t,a)){var i;for(i=1;i<r&&Et(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:{})},{}],182:[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 A,O,E=-1,_=0;_<f.length;_++){-1!==(C=m.indexOf(f[_]))&&(-1===E||C<E)&&(E=C)}-1!==(O=-1===E?m.lastIndexOf("@"):m.lastIndexOf("@",E))&&(A=m.slice(0,O),m=m.slice(O+1),this.auth=decodeURIComponent(A)),E=-1;for(_=0;_<c.length;_++){var C;-1!==(C=m.indexOf(c[_]))&&(-1===E||C<E)&&(E=C)}-1===E&&(E=m.length),this.host=m.slice(0,E),m=m.slice(E),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var q=this.hostname.split(/\./),T=(_=0,q.length);_<T;_++){var j=q[_];if(j&&!j.match(d)){for(var x="",I=0,L=j.length;I<L;I++)j.charCodeAt(I)>127?x+="x":x+=j[I];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(),R||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+M,this.href+=this.host,R&&(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("/")||[],A=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(A&&(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(A)r.host=D.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.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],E=(r.host||e.host||D.length>1)&&("."===O||".."===O)||""===O,_=0,C=D.length;C>=0;C--)"."===(O=D[C])?D.splice(C,1):".."===O?(D.splice(C,1),_++):_&&(D.splice(C,1),_--);if(!w&&!S)for(;_--;_)D.unshift("..");!w||""===D[0]||D[0]&&"/"===D[0].charAt(0)||D.unshift(""),E&&"/"!==D.join("/").substr(-1)&&D.push("");var R,q=""===D[0]||D[0]&&"/"===D[0].charAt(0);A&&(r.hostname=q?"":D.length?D.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.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/":126,qs:128}],183:[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:{})},{}],184:[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}},{}],185:[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 A(e){return"[object DataView]"===c(e)}function O(e){return"undefined"!=typeof DataView&&(A.working?A(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,A.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&A(new DataView(new ArrayBuffer(1),0,1)),r.isDataView=O;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(e){return"[object SharedArrayBuffer]"===c(e)}function C(e){return void 0!==E&&(void 0===_.working&&(_.working=_(new E)),_.working?_(e):e instanceof E)}function R(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=C,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=R,r.isStringObject=q,r.isBooleanObject=T,r.isBigIntObject=j,r.isSymbolObject=x,r.isBoxedPrimitive=function(e){return R(e)||q(e)||T(e)||j(e)||x(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(D(e)||C(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":78,"is-generator-function":80,"is-typed-array":86,"which-typed-array":187}],186:[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)),A(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(A(t))return d(t)}var l,c="",S=!1,E=["{","}"];(h(t)&&(S=!0,E=["[","]"]),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)),A(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)R(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,E)):E[0]+c+E[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")),R(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]"===E(e)}function S(e){return"object"==typeof e&&null!==e}function D(e){return S(e)&&"[object Date]"===E(e)}function A(e){return S(e)&&("[object Error]"===E(e)||e instanceof Error)}function O(e){return"function"==typeof e}function E(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=A,r.types.isNativeError=A,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 C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(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(),C[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":184,"./support/types":185,_process:125,inherits:77}],187:[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":19,"call-bind":31,"call-bound":32,"for-each":45,"get-proto":67,gopd:69,"has-tostringtag/shams":73}],188:[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}}},{}],189:[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},{}],190:[function(e,t,r){
71
+ 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":144}],115:[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}}()}},{}],116:[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}}()}},{}],117:[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}}()}},{}],118:[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}}()}},{}],119:[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}}()}},{}],120:[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}}()}},{}],121:[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}}()}},{}],122:[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}}()}},{}],123:[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,A=Array.prototype.join,O=Array.prototype.slice,_=Math.floor,C="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=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,"&quot;")}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 R=void 0===s.depth?5:s.depth;if(void 0===o&&(o=0),o>=R&&R>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=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.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=O.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?" { "+A.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)+"]":"[ "+A.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)+"] "+A.call(se,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+P(t.cause),se),", ")+" }"}if("object"==typeof t&&y){if(N&&"function"==typeof t[N]&&U)return U(t,{depth:R-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||!C)return!1;try{return C.call(e),!0}catch(e){}return!1}(t))return X(P(C.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?"["+A.call(E.call([],he||[],pe||[]),": ")+"] ":"");return 0===fe.length?ye+"{}":k?ye+"{"+te(fe,k)+"}":ye+"{ "+A.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):A.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.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 R?R(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 R)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":21}],124:[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:189}],125:[function(e,t,r){t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},{}],126:[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}},{}],127:[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 A(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 O(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=A(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=A(r,m,n==o),r=0,++n}++r,++t}return D.join("")}if(u={version:"1.4.1",ucs2:{decode:w,encode:S},decode:O,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)?O(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:{})},{}],128:[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}},{}],129:[function(e,t,r){var n=e("./stringify"),o=e("./parse"),a=e("./formats");t.exports={formats:a,parse:o,stringify:n}},{"./formats":128,"./parse":130,"./stringify":131}],130:[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":132}],131:[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,A){for(var O,_=t,C=A,R=0,q=!1;void 0!==(C=C.get(h))&&!q;){var T=C.get(t);if(R+=1,void 0!==T){if(T===R)throw new RangeError("Cyclic object value");q=!0}void 0===C.get(h)&&(R=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(O=_)||"number"==typeof O||"boolean"==typeof O||"symbol"==typeof O||"bigint"==typeof O||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+"]");A.set(t,R);var F=n();F.set(h,A),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":128,"./utils":132,"side-channel":142}],132:[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":128,"side-channel":142}],133:[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)}},{}],134:[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}},{}],135:[function(e,t,r){r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":133,"./encode":134}],136:[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:23}],137:[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":32,"es-errors/type":41,"is-regex":85}],138:[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":33,"es-errors/type":41,"get-intrinsic":64,gopd:69,"has-property-descriptors":70}],139:[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":41,"object-inspect":123}],140:[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":32,"es-errors/type":41,"get-intrinsic":64,"object-inspect":123}],141:[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":32,"es-errors/type":41,"get-intrinsic":64,"object-inspect":123,"side-channel-map":140}],142:[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":41,"object-inspect":123,"side-channel-list":139,"side-channel-map":140,"side-channel-weakmap":141}],143:[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:23}],144:[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:23,"decompress-response":21,http:160,https:75,once:124,querystring:135,"simple-concat":143,url:183}],145:[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:44,inherits:77,"readable-stream/lib/_stream_duplex.js":147,"readable-stream/lib/_stream_passthrough.js":148,"readable-stream/lib/_stream_readable.js":149,"readable-stream/lib/_stream_transform.js":150,"readable-stream/lib/_stream_writable.js":151,"readable-stream/lib/internal/streams/end-of-stream.js":155,"readable-stream/lib/internal/streams/pipeline.js":157}],146:[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},{}],147:[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":149,"./_stream_writable":151,_process:126,inherits:77}],148:[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":150,inherits:77}],149:[function(e,t,r){(function(r,n){(function(){var o;t.exports=O,O.ReadableState=A;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")(O,i);var D=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(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 O(t){if(o=o||e("./_stream_duplex"),!(this instanceof O))return new O(t);var r=this instanceof o;this._readableState=new A(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):C(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?C(e,i,t,!1):x(e,i)):C(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function C(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(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=y.destroy,O.prototype._undestroy=y.undestroy,O.prototype._destroy=function(e,t){t(e)},O.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)},O.prototype.unshift=function(e){return _(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.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 R=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>=R?e=R:(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}O.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},O.prototype._read=function(e){D(this,new w("_read()"))},O.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},O.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},O.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},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},O.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},O.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},O.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},O.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&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=M,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(O,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":146,"./_stream_duplex":147,"./internal/streams/async_iterator":152,"./internal/streams/buffer_list":153,"./internal/streams/destroy":154,"./internal/streams/from":156,"./internal/streams/state":158,"./internal/streams/stream":159,_process:126,buffer:23,events:44,inherits:77,"string_decoder/":179,util:21}],150:[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":146,"./_stream_duplex":147,inherits:77}],151:[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=O,O.WritableState=A;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 A(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||R(e,n),o?r.nextTick(C,e,n,i,a):C(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 O(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(O,this))return new O(t);this._writableState=new A(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 C(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 R(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")(O,u),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.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(O,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===O&&(e&&e._writableState instanceof A)}})):c=function(e){return e instanceof this},O.prototype.pipe=function(){D(this,new b)},O.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},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},O.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(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new y("_write()"))},O.prototype._writev=null,O.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(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.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":146,"./_stream_duplex":147,"./internal/streams/destroy":154,"./internal/streams/state":158,"./internal/streams/stream":159,_process:126,buffer:23,inherits:77,"util-deprecate":184}],152:[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":155,_process:126}],153:[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:23,util:21}],154:[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:126}],155:[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":146}],156:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],157:[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":146,"./end-of-stream":155}],158:[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":146}],159:[function(e,t,r){t.exports=e("events").EventEmitter},{events:44}],160:[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":162,"./lib/response":163,"builtin-status-codes":24,url:183,xtend:190}],161:[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:{})},{}],162:[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":161,"./response":163,_process:126,buffer:23,inherits:77,"readable-stream":178}],163:[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":161,_process:126,buffer:23,inherits:77,"readable-stream":178}],164:[function(e,t,r){arguments[4][146][0].apply(r,arguments)},{dup:146}],165:[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":167,"./_stream_writable":169,_process:126,inherits:77}],166:[function(e,t,r){arguments[4][148][0].apply(r,arguments)},{"./_stream_transform":168,dup:148,inherits:77}],167:[function(e,t,r){(function(r,n){(function(){var o;t.exports=O,O.ReadableState=A;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")(O,i);var D=y.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(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 O(t){if(o=o||e("./_stream_duplex"),!(this instanceof O))return new O(t);var r=this instanceof o;this._readableState=new A(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):C(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?C(e,i,t,!1):x(e,i)):C(e,i,t,!1)}else n||(i.reading=!1,x(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function C(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(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),O.prototype.destroy=y.destroy,O.prototype._undestroy=y.undestroy,O.prototype._destroy=function(e,t){t(e)},O.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)},O.prototype.unshift=function(e){return _(this,e,null,!0,!1)},O.prototype.isPaused=function(){return!1===this._readableState.flowing},O.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 R=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>=R?e=R:(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}O.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},O.prototype._read=function(e){D(this,new w("_read()"))},O.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},O.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},O.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},O.prototype.addListener=O.prototype.on,O.prototype.removeListener=function(e,t){var n=i.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(I,this),n},O.prototype.removeAllListeners=function(e){var t=i.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(I,this),t},O.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},O.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},O.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&&(O.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(O.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(O.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(O.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),O._fromList=M,Object.defineProperty(O.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(O.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(O,t,r)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":164,"./_stream_duplex":165,"./internal/streams/async_iterator":170,"./internal/streams/buffer_list":171,"./internal/streams/destroy":172,"./internal/streams/from":174,"./internal/streams/state":176,"./internal/streams/stream":177,_process:126,buffer:23,events:44,inherits:77,"string_decoder/":179,util:21}],168:[function(e,t,r){arguments[4][150][0].apply(r,arguments)},{"../errors":164,"./_stream_duplex":165,dup:150,inherits:77}],169:[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=O,O.WritableState=A;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 A(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||R(e,n),o?r.nextTick(C,e,n,i,a):C(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 O(t){var r=this instanceof(a=a||e("./_stream_duplex"));if(!r&&!c.call(O,this))return new O(t);this._writableState=new A(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 C(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 R(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")(O,u),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.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(O,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===O&&(e&&e._writableState instanceof A)}})):c=function(e){return e instanceof this},O.prototype.pipe=function(){D(this,new b)},O.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},O.prototype.cork=function(){this._writableState.corked++},O.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},O.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(O.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(O.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),O.prototype._write=function(e,t,r){r(new y("_write()"))},O.prototype._writev=null,O.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(O.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(O.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),O.prototype.destroy=f.destroy,O.prototype._undestroy=f.undestroy,O.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":164,"./_stream_duplex":165,"./internal/streams/destroy":172,"./internal/streams/state":176,"./internal/streams/stream":177,_process:126,buffer:23,inherits:77,"util-deprecate":184}],170:[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":173,_process:126}],171:[function(e,t,r){arguments[4][153][0].apply(r,arguments)},{buffer:23,dup:153,util:21}],172:[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:126}],173:[function(e,t,r){arguments[4][155][0].apply(r,arguments)},{"../../../errors":164,dup:155}],174:[function(e,t,r){arguments[4][156][0].apply(r,arguments)},{dup:156}],175:[function(e,t,r){arguments[4][157][0].apply(r,arguments)},{"../../../errors":164,"./end-of-stream":173,dup:157}],176:[function(e,t,r){arguments[4][158][0].apply(r,arguments)},{"../../../errors":164,dup:158}],177:[function(e,t,r){arguments[4][159][0].apply(r,arguments)},{dup:159,events:44}],178:[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":165,"./lib/_stream_passthrough.js":166,"./lib/_stream_readable.js":167,"./lib/_stream_transform.js":168,"./lib/_stream_writable.js":169,"./lib/internal/streams/end-of-stream.js":173,"./lib/internal/streams/pipeline.js":175}],179:[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":136}],180:[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:126,stream:145}],181:[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":126,timers:181}],182:[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 A(e){return!0===e||!1===e||"[object Boolean]"===s.call(e)}function O(e){var t="[object "+e+"]";return function(e){return s.call(e)===t}}var _=O("String"),C=O("Number"),R=O("Date"),q=O("RegExp"),T=O("Error"),j=O("Symbol"),x=O("ArrayBuffer"),L=O("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=O("Object"),N=f&&(!/\[native code\]/.test(String(DataView))||k(new DataView(new ArrayBuffer(8)))),M="undefined"!=typeof Map&&k(new Map),P=O("DataView");var B=N?function(e){return null!=e&&U(e.getInt8)&&x(e.buffer)}:P,F=d||O("Array");function Q(e,t){return null!=e&&l.call(e,t)}var $=O("Arguments");!function(){$(arguments)||($=function(e){return Q(e,"callee")})}();var J=$;function H(e){return C(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):O("Map"),ye=M?ue(de):O("WeakMap"),ge=M?ue(pe):O("Set"),be=O("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),Ae=Se(ie,!0);function Oe(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 Ce(e){return ne.toPath(e)}function Re(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=Re(e,Ce(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=Ce(e),function(t){return Re(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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},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=Oe(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 At(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 Ot(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=Ce(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=Re(e,n)),null==e)return;a=e[t]}return null==a?a:a.apply(e,r)})});function Ct(e,t){return mt(e,xe(t))}function Rt(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!Ot(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!Ot(t,e)})}),Jt=S(function(e,t){return $t(e,t)});function Ht(e,t,r,n){A(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?Ot(a,l)||(a.push(l),o.push(s)):Ot(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&&Rt(e,Z).length||0,r=Array(t),n=0;n<t;n++)r[n]=Ct(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:A,isElement:function(e){return!(!e||1!==e.nodeType)},isString:_,isNumber:C,isDate:R,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:Ae,create:function(e,t){var r=Oe(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=Ce(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=Ae({},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=Ce(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:At,any:At,contains:Ot,includes:Ot,include:Ot,invoke:_t,pluck:Ct,where:function(e,t){return Dt(e,je(t))},max:Rt,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),Ct(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(!Ot(t,a)){var i;for(i=1;i<r&&Ot(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:{})},{}],183:[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,A,O=-1,_=0;_<f.length;_++){-1!==(C=m.indexOf(f[_]))&&(-1===O||C<O)&&(O=C)}-1!==(A=-1===O?m.lastIndexOf("@"):m.lastIndexOf("@",O))&&(E=m.slice(0,A),m=m.slice(A+1),this.auth=decodeURIComponent(E)),O=-1;for(_=0;_<c.length;_++){var C;-1!==(C=m.indexOf(c[_]))&&(-1===O||C<O)&&(O=C)}-1===O&&(O=m.length),this.host=m.slice(0,O),m=m.slice(O),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)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(),R||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",P=this.hostname||"";this.host=P+M,this.href+=this.host,R&&(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,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.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 A=D.slice(-1)[0],O=(r.host||e.host||D.length>1)&&("."===A||".."===A)||""===A,_=0,C=D.length;C>=0;C--)"."===(A=D[C])?D.splice(C,1):".."===A?(D.splice(C,1),_++):_&&(D.splice(C,1),_--);if(!w&&!S)for(;_--;_)D.unshift("..");!w||""===D[0]||D[0]&&"/"===D[0].charAt(0)||D.unshift(""),O&&"/"!==D.join("/").substr(-1)&&D.push("");var R,q=""===D[0]||D[0]&&"/"===D[0].charAt(0);E&&(r.hostname=q?"":D.length?D.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.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/":127,qs:129}],184:[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:{})},{}],185:[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}},{}],186:[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 A(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)||A(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=A;var O="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function _(e){return"[object SharedArrayBuffer]"===c(e)}function C(e){return void 0!==O&&(void 0===_.working&&(_.working=_(new O)),_.working?_(e):e instanceof O)}function R(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=C,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=R,r.isStringObject=q,r.isBooleanObject=T,r.isBigIntObject=j,r.isSymbolObject=x,r.isBoxedPrimitive=function(e){return R(e)||q(e)||T(e)||j(e)||x(e)},r.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(D(e)||C(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":78,"is-generator-function":80,"is-typed-array":86,"which-typed-array":188}],187:[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&&A(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(A(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,O=["{","}"];(h(t)&&(S=!0,O=["[","]"]),A(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)R(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,O)):O[0]+c+O[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")),R(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]"===O(e)}function S(e){return"object"==typeof e&&null!==e}function D(e){return S(e)&&"[object Date]"===O(e)}function E(e){return S(e)&&("[object Error]"===O(e)||e instanceof Error)}function A(e){return"function"==typeof e}function O(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=A,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 C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(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(),C[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":185,"./support/types":186,_process:126,inherits:77}],188:[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":19,"call-bind":31,"call-bound":32,"for-each":45,"get-proto":67,gopd:69,"has-tostringtag/shams":73}],189:[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}}},{}],190:[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},{}],191:[function(e,t,r){
72
72
  /**
73
73
  * Meadow Endpoints Service Data Broker Library
74
74
  *
75
75
  * @license MIT
76
76
  * @author Steven Velozo <steven@velozo.com>
77
77
  */
78
- 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"),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._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":191,"./endpoints/count/Meadow-Endpoint-Count.js":198,"./endpoints/count/Meadow-Endpoint-CountBy.js":199,"./endpoints/create/Meadow-Endpoint-BulkCreate.js":200,"./endpoints/create/Meadow-Endpoint-Create.js":201,"./endpoints/delete/Meadow-Endpoint-Delete.js":203,"./endpoints/delete/Meadow-Endpoint-Undelete.js":204,"./endpoints/read/Meadow-Endpoint-Read.js":205,"./endpoints/read/Meadow-Endpoint-ReadDistinctList.js":206,"./endpoints/read/Meadow-Endpoint-ReadLiteList.js":207,"./endpoints/read/Meadow-Endpoint-ReadMax.js":208,"./endpoints/read/Meadow-Endpoint-ReadSelectList.js":209,"./endpoints/read/Meadow-Endpoint-Reads.js":210,"./endpoints/read/Meadow-Endpoint-ReadsBy.js":211,"./endpoints/schema/Meadow-Endpoint-New.js":214,"./endpoints/schema/Meadow-Endpoint-Schema.js":215,"./endpoints/schema/Meadow-Endpoint-Validate.js":216,"./endpoints/update/Meadow-Endpoint-BulkUpdate.js":217,"./endpoints/update/Meadow-Endpoint-Update.js":218,"./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js":220,"./endpoints/upsert/Meadow-Endpoint-Upsert.js":221,meadow:103}],191:[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":192,"./components/Meadow-Endpoints-Controller-Error.js":193,"./components/Meadow-Endpoints-Controller-Log.js":194,"./utility/Meadow-Endpoints-Filter-Parser.js":195,"./utility/Meadow-Endpoints-Session-Marshaler.js":196,"./utility/Meadow-Endpoints-Stream-RecordArray.js":197,"async/waterfall":18}],192:[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:181}],193:[function(e,t,r){t.exports=class{constructor(e){this._Controller=e}getError(e,t,r){let 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}}},{}],194:[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)}}},{}],195:[function(e,t,r){
78
+ 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"),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._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":192,"./endpoints/count/Meadow-Endpoint-Count.js":199,"./endpoints/count/Meadow-Endpoint-CountBy.js":200,"./endpoints/create/Meadow-Endpoint-BulkCreate.js":201,"./endpoints/create/Meadow-Endpoint-Create.js":202,"./endpoints/delete/Meadow-Endpoint-Delete.js":204,"./endpoints/delete/Meadow-Endpoint-Undelete.js":205,"./endpoints/read/Meadow-Endpoint-Read.js":206,"./endpoints/read/Meadow-Endpoint-ReadDistinctList.js":207,"./endpoints/read/Meadow-Endpoint-ReadLiteList.js":208,"./endpoints/read/Meadow-Endpoint-ReadMax.js":209,"./endpoints/read/Meadow-Endpoint-ReadSelectList.js":210,"./endpoints/read/Meadow-Endpoint-Reads.js":211,"./endpoints/read/Meadow-Endpoint-ReadsBy.js":212,"./endpoints/schema/Meadow-Endpoint-New.js":215,"./endpoints/schema/Meadow-Endpoint-Schema.js":216,"./endpoints/schema/Meadow-Endpoint-Validate.js":217,"./endpoints/update/Meadow-Endpoint-BulkUpdate.js":218,"./endpoints/update/Meadow-Endpoint-Update.js":219,"./endpoints/upsert/Meadow-Endpoint-BulkUpsert.js":221,"./endpoints/upsert/Meadow-Endpoint-Upsert.js":222,meadow:103}],192:[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":193,"./components/Meadow-Endpoints-Controller-Error.js":194,"./components/Meadow-Endpoints-Controller-Log.js":195,"./utility/Meadow-Endpoints-Filter-Parser.js":196,"./utility/Meadow-Endpoints-Session-Marshaler.js":197,"./utility/Meadow-Endpoints-Stream-RecordArray.js":198,"async/waterfall":18}],193:[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:182}],194:[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}}},{}],195:[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)}}},{}],196:[function(e,t,r){
79
79
  /**
80
80
  * Meadow Endpoint Utility Class - Parse a Filter String and put it into a Query.
81
81
  *
@@ -84,5 +84,5 @@ const n=e("./controller/Meadow-Endpoints-Controller-Base.js"),o=e("meadow");clas
84
84
  * @author Steven Velozo <steven@velozo.com>
85
85
  * @module Meadow
86
86
  */
87
- const{parse:n}=e("meadow-filter");t.exports=class{constructor(e){this._Controller=e}parseFilter(e,t){return n(e,t)}}},{"meadow-filter":98}],196:[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}}},{}],197:[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:1,"async/eachSeries":4}],198:[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))}},{}],199:[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))}},{}],200:[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-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":202}],201:[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(),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":202}],202:[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.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()))}},{}],203:[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,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))}},{}],204:[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,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))}},{}],205:[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))}},{}],206:[function(e,t,r){const n=e("./Meadow-Marshal-DistinctList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadDistinct");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.Records=t,r()),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":212}],207:[function(e,t,r){const n=e("./Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadsLite");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.RawRecords=t,r()),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":213}],208:[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))}},{}],209:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),n.Records=t,r()),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))}},{}],210:[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))}},{}],211:[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))}},{}],212:[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}},{}],213:[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}},{}],214:[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))}},{}],215:[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))}},{}],216:[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} - ${n.RecordValidation}`),r())],o=>this.ErrorHandler.handleErrorIfSet(e,n,t,o,r))}},{}],217:[function(e,t,r){const n=e("./Meadow-Operation-Update.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"UpdateBulk");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)),r=>{this.eachLimit(o.BulkRecords,1,(r,a)=>{n.call(this,r,e,o,t,a)},r)},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":219}],218:[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":219}],219:[function(e,t,r){t.exports=function(e,t,r,n,o,a){let i=this.cloneAsyncSafeRequestState(r,"doUpdate");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,t()):t(this.ErrorHandler.getError("Record not Found",404)))},e=>(i.Query=this.DAL.query,e()),e=>(i.Query.setIDUser(i.SessionData.UserID),i.Query.addRecord(i.RecordToModify),e()),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()))}},{}],220:[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");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)),r=>{this.eachLimit(a.BulkRecords,1,(r,o)=>{n.call(this,r,e,a,t,o)},r)},r=>this.doStreamRecordArray(t,o.call(this,a.UpsertedRecords,e),r),t=>(this.log.requestCompletedSuccessfully(e,a,`Bulk upsert complete -- ${a.UpsertedRecords} records processed`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":213,"./Meadow-Operation-Upsert.js":222}],221:[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":222}],222:[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]=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=>(e&&(u.Record.Error=e),i()))}},{"../create/Meadow-Operation-Create.js":202,"../update/Meadow-Operation-Update.js":219}]},{},[190])(190)});
87
+ const{parse:n}=e("meadow-filter");t.exports=class{constructor(e){this._Controller=e}parseFilter(e,t){return n(e,t)}}},{"meadow-filter":98}],197:[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}}},{}],198:[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:1,"async/eachSeries":4}],199:[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))}},{}],200:[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))}},{}],201:[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-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":203}],202:[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(),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":203}],203:[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()))}},{}],204:[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,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))}},{}],205:[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,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))}},{}],206:[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))}},{}],207:[function(e,t,r){const n=e("./Meadow-Marshal-DistinctList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadDistinct");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.Records=t,r()),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":213}],208:[function(e,t,r){const n=e("./Meadow-Marshal-LiteList.js");t.exports=function(e,t,r){let o=this.initializeRequestState(e,"ReadsLite");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,o,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(o.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),o.RawRecords=t,r()),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":214}],209:[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))}},{}],210:[function(e,t,r){t.exports=function(e,t,r){let n=this.initializeRequestState(e,"ReadsBy");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()},(t=>r=>{this.BehaviorInjection.runBehavior(t,this,e,n,r)})("Reads-QueryConfiguration"),e=>{this.DAL.doReads(n.Query,e)},(e,t,r)=>(t.length<1&&(t=[]),n.Records=t,r()),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))}},{}],211:[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))}},{}],212:[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))}},{}],213:[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}},{}],214:[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}},{}],215:[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))}},{}],216:[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))}},{}],217:[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))}},{}],218:[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":220}],219:[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":220}],220:[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,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()))}},{}],221:[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=>this.doStreamRecordArray(t,o.call(this,a.UpsertedRecords,e),r),t=>(this.log.requestCompletedSuccessfully(e,a,`Bulk upsert complete -- ${a.UpsertedRecords.length} records processed`),t())],n=>this.ErrorHandler.handleErrorIfSet(e,a,t,n,r))}},{"../read/Meadow-Marshal-LiteList.js":214,"./Meadow-Operation-Upsert.js":223}],222:[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":223}],223:[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=>(e&&(u.Record.Error=e),i()))}},{"../create/Meadow-Operation-Create.js":203,"../update/Meadow-Operation-Update.js":220}]},{},[191])(191)});
88
88
  //# sourceMappingURL=meadow-endpoints.min.js.map