diff --git a/eng/targets/Npm.Common.targets b/eng/targets/Npm.Common.targets index a0eb3e3fa572f979d1506f665585360a557316b2..b8dadce6c51c9b4c5fbfddd72a6dfc1a099660e0 100644 --- a/eng/targets/Npm.Common.targets +++ b/eng/targets/Npm.Common.targets @@ -53,21 +53,6 @@ <Copy SourceFiles="$(PackageJson)" DestinationFiles="$(_BackupPackageJson)" /> - <ReadLinesFromFile File="$(PackageJson)" Condition="@(ReplacePackageContent->Count()) != 0 AND $([MSBuild]::IsOSPlatform('Windows'))"> - <Output TaskParameter="Lines" ItemName="PackageJsonContent" /> - </ReadLinesFromFile> - - <PropertyGroup Condition="@(PackageJsonContent->Count()) > 0"> - <_PackageJsonContent>@(PackageJsonContent->'%(Identity)', '%0a')</_PackageJsonContent> - <_PackageJsonContent>$(_PackageJsonContent.Replace('%(ReplacePackageContent.Identity)', '%(ReplacePackageContent.ReplaceWith)'))</_PackageJsonContent> - </PropertyGroup> - - <WriteLinesToFile - File="$(PackageJson)" - Lines="$(_PackageJsonContent)" - Condition="@(ReplacePackageContent->Count()) != 0 AND $([MSBuild]::IsOSPlatform('Windows'))" - Overwrite="true" /> - <Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" /> <Yarn Command="pack --filename $(PackageFileName)" /> diff --git a/src/Components/Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.npmproj b/src/Components/Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.npmproj index e201a0d04b2a35351969ef21691c0fdbd753cbcb..a2b3a46cbeb14408f48bd8859d2c28ca516ec737 100644 --- a/src/Components/Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.npmproj +++ b/src/Components/Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.npmproj @@ -7,11 +7,23 @@ </PropertyGroup> <ItemGroup> - <ProjectReference Include="..\..\SignalR\clients\ts\signalr-protocol-msgpack\signalr-protocol-msgpack.npmproj" /> + <WebpackInputs Include="src\**\*.ts" /> + <WebPackOutputs Include="dist\Debug\blazor.webassembly.js" /> + <WebPackOutputs Include="dist\Release\blazor.webassembly.js" /> + <WebPackOutputs Include="dist\Debug\blazor.server.js" /> + <WebPackOutputs Include="dist\Release\blazor.server.js" /> </ItemGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" /> - <Target Name="Restore" /> + <!-- Override the default 'Build' target from eng/targets/Npm.Common.targets. --> + <Target Name="Build" + Inputs="@(WebpackInputs)" + Outputs="@(WebPackOutputs)"> + <RemoveDir Directories="dist" /> + + <Yarn Command="run build:debug" /> + <Yarn Command="run build:production" /> + </Target> </Project> diff --git a/src/Components/Browser.JS/dist/.gitattributes b/src/Components/Browser.JS/dist/.gitattributes deleted file mode 100644 index f88096f7352535a6fefd9888b81f213f126c5190..0000000000000000000000000000000000000000 --- a/src/Components/Browser.JS/dist/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.js -diff -merge -*.js linguist-generated=true diff --git a/src/Components/Browser.JS/dist/Debug/blazor.server.js b/src/Components/Browser.JS/dist/Debug/blazor.server.js index 199f92764c2f2c28efc19ca2c93ec942342f85b6..24ca26079ad78b5e544da41f2500772eb96bf198 100644 --- a/src/Components/Browser.JS/dist/Debug/blazor.server.js +++ b/src/Components/Browser.JS/dist/Debug/blazor.server.js @@ -177,9 +177,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MessagePackHubProtocol", function() { return MessagePackHubProtocol; }); /* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ "../node_modules/buffer/index.js"); /* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(buffer__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var msgpack5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! msgpack5 */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/index.js"); +/* harmony import */ var msgpack5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! msgpack5 */ "../node_modules/msgpack5/index.js"); /* harmony import */ var msgpack5__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(msgpack5__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aspnet/signalr */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/index.js"); +/* harmony import */ var _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @aspnet/signalr */ "../node_modules/@aspnet/signalr/dist/esm/index.js"); /* harmony import */ var _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BinaryMessageFormat */ "../node_modules/@aspnet/signalr-protocol-msgpack/dist/esm/BinaryMessageFormat.js"); /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. @@ -203,13 +203,10 @@ var MessagePackHubProtocol = /** @class */ (function () { this.version = 1; /** The TransferFormat of the protocol. */ this.transferFormat = _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Binary; - this.errorResult = 1; - this.voidResult = 2; - this.nonVoidResult = 3; } /** Creates an array of HubMessage objects from the specified serialized representation. * - * @param {ArrayBuffer | Buffer} input An ArrayBuffer or Buffer containing the serialized representation. + * @param {ArrayBuffer | Buffer} input An ArrayBuffer containing the serialized representation. * @param {ILogger} logger A logger that will be used to log messages that occur during parsing. */ MessagePackHubProtocol.prototype.parseMessages = function (input, logger) { @@ -244,13 +241,10 @@ var MessagePackHubProtocol = /** @class */ (function () { case _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].StreamInvocation: return this.writeStreamInvocation(message); case _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].StreamItem: - return this.writeStreamItem(message); case _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Completion: - return this.writeCompletion(message); + throw new Error("Writing messages of type '" + message.type + "' is not supported."); case _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Ping: return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(SERIALIZED_PING_MESSAGE); - case _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].CancelInvocation: - return this.writeCancelInvocation(message); default: throw new Error("Invalid message type."); } @@ -314,7 +308,6 @@ var MessagePackHubProtocol = /** @class */ (function () { arguments: properties[4], headers: headers, invocationId: invocationId, - streamIds: [], target: properties[3], type: _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Invocation, }; @@ -323,7 +316,6 @@ var MessagePackHubProtocol = /** @class */ (function () { return { arguments: properties[4], headers: headers, - streamIds: [], target: properties[3], type: _aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Invocation, }; @@ -346,17 +338,20 @@ var MessagePackHubProtocol = /** @class */ (function () { if (properties.length < 4) { throw new Error("Invalid payload for Completion message."); } + var errorResult = 1; + var voidResult = 2; + var nonVoidResult = 3; var resultKind = properties[3]; - if (resultKind !== this.voidResult && properties.length < 5) { + if (resultKind !== voidResult && properties.length < 5) { throw new Error("Invalid payload for Completion message."); } var error; var result; switch (resultKind) { - case this.errorResult: + case errorResult: error = properties[4]; break; - case this.nonVoidResult: + case nonVoidResult: result = properties[4]; break; } @@ -372,41 +367,13 @@ var MessagePackHubProtocol = /** @class */ (function () { MessagePackHubProtocol.prototype.writeInvocation = function (invocationMessage) { var msgpack = msgpack5__WEBPACK_IMPORTED_MODULE_1__(); var payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Invocation, invocationMessage.headers || {}, invocationMessage.invocationId || null, - invocationMessage.target, invocationMessage.arguments, invocationMessage.streamIds]); + invocationMessage.target, invocationMessage.arguments]); return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(payload.slice()); }; MessagePackHubProtocol.prototype.writeStreamInvocation = function (streamInvocationMessage) { var msgpack = msgpack5__WEBPACK_IMPORTED_MODULE_1__(); var payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].StreamInvocation, streamInvocationMessage.headers || {}, streamInvocationMessage.invocationId, - streamInvocationMessage.target, streamInvocationMessage.arguments, streamInvocationMessage.streamIds]); - return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(payload.slice()); - }; - MessagePackHubProtocol.prototype.writeStreamItem = function (streamItemMessage) { - var msgpack = msgpack5__WEBPACK_IMPORTED_MODULE_1__(); - var payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].StreamItem, streamItemMessage.headers || {}, streamItemMessage.invocationId, - streamItemMessage.item]); - return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(payload.slice()); - }; - MessagePackHubProtocol.prototype.writeCompletion = function (completionMessage) { - var msgpack = msgpack5__WEBPACK_IMPORTED_MODULE_1__(); - var resultKind = completionMessage.error ? this.errorResult : completionMessage.result ? this.nonVoidResult : this.voidResult; - var payload; - switch (resultKind) { - case this.errorResult: - payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Completion, completionMessage.headers || {}, completionMessage.invocationId, resultKind, completionMessage.error]); - break; - case this.voidResult: - payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Completion, completionMessage.headers || {}, completionMessage.invocationId, resultKind]); - break; - case this.nonVoidResult: - payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].Completion, completionMessage.headers || {}, completionMessage.invocationId, resultKind, completionMessage.result]); - break; - } - return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(payload.slice()); - }; - MessagePackHubProtocol.prototype.writeCancelInvocation = function (cancelInvocationMessage) { - var msgpack = msgpack5__WEBPACK_IMPORTED_MODULE_1__(); - var payload = msgpack.encode([_aspnet_signalr__WEBPACK_IMPORTED_MODULE_2__["MessageType"].CancelInvocation, cancelInvocationMessage.headers || {}, cancelInvocationMessage.invocationId]); + streamInvocationMessage.target, streamInvocationMessage.arguments]); return _BinaryMessageFormat__WEBPACK_IMPORTED_MODULE_3__["BinaryMessageFormat"].write(payload.slice()); }; MessagePackHubProtocol.prototype.readHeaders = function (properties) { @@ -464,16 +431,16 @@ __webpack_require__.r(__webpack_exports__); // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Version token that will be replaced by the prepack command /** The version of the SignalR Message Pack protocol library. */ -var VERSION = "0.0.0-DEV_BUILD"; +var VERSION = "1.1.0"; //# sourceMappingURL=index.js.map /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/AbortController.js": -/*!*****************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/AbortController.js ***! - \*****************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/AbortController.js": +/*!*******************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/AbortController.js ***! + \*******************************************************************/ /*! exports provided: AbortController */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -521,20 +488,19 @@ var AbortController = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js": -/*!*******************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js ***! - \*******************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js": +/*!*********************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js ***! + \*********************************************************************/ /*! exports provided: DefaultHttpClient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function() { return DefaultHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./NodeHttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js"); -/* harmony import */ var _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./XhrHttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js"); +/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); +/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); +/* harmony import */ var _XhrHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./XhrHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __extends = (undefined && undefined.__extends) || (function () { @@ -550,7 +516,13 @@ var __extends = (undefined && undefined.__extends) || (function () { - +var nodeHttpClientModule; +if (typeof XMLHttpRequest === "undefined") { + // In order to ignore the dynamic require in webpack builds we need to do this magic + // @ts-ignore: TS doesn't know about these names + var requireFunc = true ? require : undefined; + nodeHttpClientModule = requireFunc("./NodeHttpClient"); +} /** Default implementation of {@link @aspnet/signalr.HttpClient}. */ var DefaultHttpClient = /** @class */ (function (_super) { __extends(DefaultHttpClient, _super); @@ -558,10 +530,13 @@ var DefaultHttpClient = /** @class */ (function (_super) { function DefaultHttpClient(logger) { var _this = _super.call(this) || this; if (typeof XMLHttpRequest !== "undefined") { - _this.httpClient = new _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__["XhrHttpClient"](logger); + _this.httpClient = new _XhrHttpClient__WEBPACK_IMPORTED_MODULE_2__["XhrHttpClient"](logger); + } + else if (typeof nodeHttpClientModule !== "undefined") { + _this.httpClient = new nodeHttpClientModule.NodeHttpClient(logger); } else { - _this.httpClient = new _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__["NodeHttpClient"](logger); + throw new Error("No HttpClient could be created."); } return _this; } @@ -589,39 +564,10 @@ var DefaultHttpClient = /** @class */ (function (_super) { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js": -/*!************************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js ***! - \************************************************************************************************************************/ -/*! exports provided: DefaultReconnectPolicy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultReconnectPolicy", function() { return DefaultReconnectPolicy; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// 0, 2, 10, 30 second delays before reconnect attempts. -var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null]; -/** @private */ -var DefaultReconnectPolicy = /** @class */ (function () { - function DefaultReconnectPolicy(retryDelays) { - this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS; - } - DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (previousRetryCount) { - return this.retryDelays[previousRetryCount]; - }; - return DefaultReconnectPolicy; -}()); - -//# sourceMappingURL=DefaultReconnectPolicy.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js": -/*!********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js ***! - \********************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/Errors.js": +/*!**********************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/Errors.js ***! + \**********************************************************/ /*! exports provided: HttpError, TimeoutError, AbortError */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -710,18 +656,18 @@ var AbortError = /** @class */ (function (_super) { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js": -/*!*******************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js ***! - \*******************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js": +/*!*********************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js ***! + \*********************************************************************/ /*! exports provided: HandshakeProtocol */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HandshakeProtocol", function() { return HandshakeProtocol; }); -/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. @@ -778,14 +724,14 @@ var HandshakeProtocol = /** @class */ (function () { }()); //# sourceMappingURL=HandshakeProtocol.js.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js": -/*!************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js ***! - \************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js": +/*!**************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/HttpClient.js ***! + \**************************************************************/ /*! exports provided: HttpResponse, HttpClient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -845,24 +791,23 @@ var HttpClient = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpConnection.js": -/*!****************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpConnection.js ***! - \****************************************************************************************************************/ -/*! exports provided: HttpConnection, TransportSendQueue */ +/***/ "../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js": +/*!******************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js ***! + \******************************************************************/ +/*! exports provided: HttpConnection */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpConnection", function() { return HttpConnection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransportSendQueue", function() { return TransportSendQueue; }); -/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LongPollingTransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js"); -/* harmony import */ var _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ServerSentEventsTransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); -/* harmony import */ var _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./WebSocketTransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js"); +/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LongPollingTransport */ "../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js"); +/* harmony import */ var _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ServerSentEventsTransport */ "../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./WebSocketTransport */ "../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -910,7 +855,7 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod var MAX_REDIRECTS = 100; var WebSocketModule = null; var EventSourceModule = null; -if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && "function" !== "undefined") { +if (typeof window === "undefined" && "function" !== "undefined") { // In order to ignore the dynamic require in webpack builds we need to do this magic // @ts-ignore: TS doesn't know about these names var requireFunc = true ? require : undefined; @@ -927,117 +872,54 @@ var HttpConnection = /** @class */ (function () { this.baseUrl = this.resolveUrl(url); options = options || {}; options.logMessageContent = options.logMessageContent || false; - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof WebSocket !== "undefined" && !options.WebSocket) { + var isNode = typeof window === "undefined"; + if (!isNode && typeof WebSocket !== "undefined" && !options.WebSocket) { options.WebSocket = WebSocket; } - else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.WebSocket) { + else if (isNode && !options.WebSocket) { if (WebSocketModule) { options.WebSocket = WebSocketModule; } } - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof EventSource !== "undefined" && !options.EventSource) { + if (!isNode && typeof EventSource !== "undefined" && !options.EventSource) { options.EventSource = EventSource; } - else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.EventSource) { + else if (isNode && !options.EventSource) { if (typeof EventSourceModule !== "undefined") { options.EventSource = EventSourceModule; } } this.httpClient = options.httpClient || new _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__["DefaultHttpClient"](this.logger); - this.connectionState = "Disconnected" /* Disconnected */; - this.connectionStarted = false; + this.connectionState = 2 /* Disconnected */; this.options = options; this.onreceive = null; this.onclose = null; } HttpConnection.prototype.start = function (transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var message, message; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - transferFormat = transferFormat || _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Binary; - _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"], "transferFormat"); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Starting connection with transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][transferFormat] + "'."); - if (this.connectionState !== "Disconnected" /* Disconnected */) { - return [2 /*return*/, Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))]; - } - this.connectionState = "Connecting " /* Connecting */; - this.startInternalPromise = this.startInternal(transferFormat); - return [4 /*yield*/, this.startInternalPromise]; - case 1: - _a.sent(); - if (!(this.connectionState === "Disconnecting" /* Disconnecting */)) return [3 /*break*/, 3]; - message = "Failed to start the HttpConnection before stop() was called."; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); - // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise. - return [4 /*yield*/, this.stopPromise]; - case 2: - // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise. - _a.sent(); - return [2 /*return*/, Promise.reject(new Error(message))]; - case 3: - if (this.connectionState !== "Connected" /* Connected */) { - message = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!"; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); - return [2 /*return*/, Promise.reject(new Error(message))]; - } - _a.label = 4; - case 4: - this.connectionStarted = true; - return [2 /*return*/]; - } - }); - }); + transferFormat = transferFormat || _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Binary; + _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"], "transferFormat"); + this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Starting connection with transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][transferFormat] + "'."); + if (this.connectionState !== 2 /* Disconnected */) { + return Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")); + } + this.connectionState = 0 /* Connecting */; + this.startPromise = this.startInternal(transferFormat); + return this.startPromise; }; HttpConnection.prototype.send = function (data) { - if (this.connectionState !== "Connected" /* Connected */) { - return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")); - } - if (!this.sendQueue) { - this.sendQueue = new TransportSendQueue(this.transport); + if (this.connectionState !== 1 /* Connected */) { + throw new Error("Cannot send data if the connection is not in the 'Connected' State."); } // Transport will not be null if state is connected - return this.sendQueue.send(data); + return this.transport.send(data); }; HttpConnection.prototype.stop = function (error) { return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.connectionState === "Disconnected" /* Disconnected */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnected state."); - return [2 /*return*/, Promise.resolve()]; - } - if (this.connectionState === "Disconnecting" /* Disconnecting */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); - return [2 /*return*/, this.stopPromise]; - } - this.connectionState = "Disconnecting" /* Disconnecting */; - this.stopPromise = new Promise(function (resolve) { - // Don't complete stop() until stopConnection() completes. - _this.stopPromiseResolver = resolve; - }); - // stopInternal should never throw so just observe it. - return [4 /*yield*/, this.stopInternal(error)]; - case 1: - // stopInternal should never throw so just observe it. - _a.sent(); - return [4 /*yield*/, this.stopPromise]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.stopInternal = function (error) { - return __awaiter(this, void 0, void 0, function () { - var e_1, e_2; + var e_1; return __generator(this, function (_a) { switch (_a.label) { case 0: + this.connectionState = 2 /* Disconnected */; // Set error as soon as possible otherwise there is a race between // the transport closing and providing an error and the error from a close message // We would prefer the close message error. @@ -1045,7 +927,7 @@ var HttpConnection = /** @class */ (function () { _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.startInternalPromise]; + return [4 /*yield*/, this.startPromise]; case 2: _a.sent(); return [3 /*break*/, 4]; @@ -1053,38 +935,20 @@ var HttpConnection = /** @class */ (function () { e_1 = _a.sent(); return [3 /*break*/, 4]; case 4: - if (!this.transport) return [3 /*break*/, 9]; - if (this.sendQueue) { - this.sendQueue.stop(); - this.sendQueue = undefined; - } - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); + if (!this.transport) return [3 /*break*/, 6]; return [4 /*yield*/, this.transport.stop()]; - case 6: + case 5: _a.sent(); - return [3 /*break*/, 8]; - case 7: - e_2 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.transport.stop() threw error '" + e_2 + "'."); - this.stopConnection(); - return [3 /*break*/, 8]; - case 8: this.transport = undefined; - return [3 /*break*/, 10]; - case 9: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."); - this.stopConnection(); - _a.label = 10; - case 10: return [2 /*return*/]; + _a.label = 6; + case 6: return [2 /*return*/]; } }); }); }; HttpConnection.prototype.startInternal = function (transferFormat) { return __awaiter(this, void 0, void 0, function () { - var url, negotiateResponse, redirects, _loop_1, this_1, e_3; + var url, negotiateResponse, redirects, _loop_1, this_1, state_1, e_2; var _this = this; return __generator(this, function (_a) { switch (_a.label) { @@ -1106,7 +970,7 @@ var HttpConnection = /** @class */ (function () { // No fallback or negotiate in this case. _a.sent(); return [3 /*break*/, 4]; - case 3: throw new Error("Negotiation can only be skipped when using the WebSocket transport directly."); + case 3: throw Error("Negotiation can only be skipped when using the WebSocket transport directly."); case 4: return [3 /*break*/, 11]; case 5: negotiateResponse = null; @@ -1119,14 +983,14 @@ var HttpConnection = /** @class */ (function () { case 1: negotiateResponse = _a.sent(); // the user tries to stop the connection when it is being started - if (this_1.connectionState === "Disconnecting" /* Disconnecting */ || this_1.connectionState === "Disconnected" /* Disconnected */) { - throw new Error("The connection was stopped during negotiation."); + if (this_1.connectionState === 2 /* Disconnected */) { + return [2 /*return*/, { value: void 0 }]; } if (negotiateResponse.error) { - throw new Error(negotiateResponse.error); + throw Error(negotiateResponse.error); } if (negotiateResponse.ProtocolVersion) { - throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details."); + throw Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details."); } if (negotiateResponse.url) { url = negotiateResponse.url; @@ -1144,16 +1008,17 @@ var HttpConnection = /** @class */ (function () { _a.label = 6; case 6: return [5 /*yield**/, _loop_1()]; case 7: - _a.sent(); + state_1 = _a.sent(); + if (typeof state_1 === "object") + return [2 /*return*/, state_1.value]; _a.label = 8; case 8: if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3 /*break*/, 6]; _a.label = 9; case 9: if (redirects === MAX_REDIRECTS && negotiateResponse.url) { - throw new Error("Negotiate redirection limit exceeded."); + throw Error("Negotiate redirection limit exceeded."); } - this.connectionId = negotiateResponse.connectionId; return [4 /*yield*/, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)]; case 10: _a.sent(); @@ -1164,19 +1029,16 @@ var HttpConnection = /** @class */ (function () { } this.transport.onreceive = this.onreceive; this.transport.onclose = function (e) { return _this.stopConnection(e); }; - if (this.connectionState === "Connecting " /* Connecting */) { - // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise. - // start() will handle the case when stop was called and startInternal exits still in the disconnecting state. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "The HttpConnection connected successfully."); - this.connectionState = "Connected" /* Connected */; - } + // only change the state if we were connecting to not overwrite + // the state if the connection is already marked as Disconnected + this.changeState(0 /* Connecting */, 1 /* Connected */); return [3 /*break*/, 13]; case 12: - e_3 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the connection: " + e_3); - this.connectionState = "Disconnected" /* Disconnected */; + e_2 = _a.sent(); + this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the connection: " + e_2); + this.connectionState = 2 /* Disconnected */; this.transport = undefined; - return [2 /*return*/, Promise.reject(e_3)]; + throw e_2; case 13: return [2 /*return*/]; } }); @@ -1184,7 +1046,7 @@ var HttpConnection = /** @class */ (function () { }; HttpConnection.prototype.getNegotiationResponse = function (url) { return __awaiter(this, void 0, void 0, function () { - var _a, headers, token, negotiateUrl, response, e_4; + var _a, headers, token, negotiateUrl, response, e_3; return __generator(this, function (_b) { switch (_b.label) { case 0: @@ -1211,13 +1073,13 @@ var HttpConnection = /** @class */ (function () { case 4: response = _b.sent(); if (response.statusCode !== 200) { - return [2 /*return*/, Promise.reject(new Error("Unexpected status code returned from negotiate " + response.statusCode))]; + throw Error("Unexpected status code returned from negotiate " + response.statusCode); } return [2 /*return*/, JSON.parse(response.content)]; case 5: - e_4 = _b.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to complete negotiation with the server: " + e_4); - return [2 /*return*/, Promise.reject(e_4)]; + e_3 = _b.sent(); + this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to complete negotiation with the server: " + e_3); + throw e_3; case 6: return [2 /*return*/]; } }); @@ -1231,7 +1093,7 @@ var HttpConnection = /** @class */ (function () { }; HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) { return __awaiter(this, void 0, void 0, function () { - var connectUrl, transportExceptions, transports, _i, transports_1, endpoint, transport, ex_1, message; + var connectUrl, transports, _i, transports_1, endpoint, transport, ex_1; return __generator(this, function (_a) { switch (_a.label) { case 0: @@ -1242,51 +1104,44 @@ var HttpConnection = /** @class */ (function () { return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; case 1: _a.sent(); + // only change the state if we were connecting to not overwrite + // the state if the connection is already marked as Disconnected + this.changeState(0 /* Connecting */, 1 /* Connected */); return [2 /*return*/]; case 2: - transportExceptions = []; transports = negotiateResponse.availableTransports || []; _i = 0, transports_1 = transports; _a.label = 3; case 3: - if (!(_i < transports_1.length)) return [3 /*break*/, 11]; + if (!(_i < transports_1.length)) return [3 /*break*/, 9]; endpoint = transports_1[_i]; - _a.label = 4; - case 4: - _a.trys.push([4, 9, , 10]); + this.connectionState = 0 /* Connecting */; transport = this.resolveTransport(endpoint, requestedTransport, requestedTransferFormat); if (!(typeof transport === "number")) return [3 /*break*/, 8]; this.transport = this.constructTransport(transport); - if (!!negotiateResponse.connectionId) return [3 /*break*/, 6]; + if (!!negotiateResponse.connectionId) return [3 /*break*/, 5]; return [4 /*yield*/, this.getNegotiationResponse(url)]; - case 5: + case 4: negotiateResponse = _a.sent(); connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId); - _a.label = 6; - case 6: return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; - case 7: + _a.label = 5; + case 5: + _a.trys.push([5, 7, , 8]); + return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; + case 6: _a.sent(); + this.changeState(0 /* Connecting */, 1 /* Connected */); return [2 /*return*/]; - case 8: return [3 /*break*/, 10]; - case 9: + case 7: ex_1 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the transport '" + endpoint.transport + "': " + ex_1); + this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "': " + ex_1); + this.connectionState = 2 /* Disconnected */; negotiateResponse.connectionId = undefined; - transportExceptions.push(endpoint.transport + " failed: " + ex_1); - if (this.connectionState !== "Connecting " /* Connecting */) { - message = "Failed to select transport before stop() was called."; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, message); - return [2 /*return*/, Promise.reject(new Error(message))]; - } - return [3 /*break*/, 10]; - case 10: + return [3 /*break*/, 8]; + case 8: _i++; return [3 /*break*/, 3]; - case 11: - if (transportExceptions.length > 0) { - return [2 /*return*/, Promise.reject(new Error("Unable to connect to the server with any of the available transports. " + transportExceptions.join(" ")))]; - } - return [2 /*return*/, Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]; + case 9: throw new Error("Unable to initialize any of the available transports."); } }); }); @@ -1321,7 +1176,6 @@ var HttpConnection = /** @class */ (function () { if ((transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets && !this.options.WebSocket) || (transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents && !this.options.EventSource)) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it is not supported in your environment.'"); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is not supported in your environment."); } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Selecting transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "'."); @@ -1330,12 +1184,10 @@ var HttpConnection = /** @class */ (function () { } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it does not support the requested transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + "'."); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' does not support " + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + "."); } } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it was disabled by the client."); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is disabled by the client."); } } return null; @@ -1343,41 +1195,26 @@ var HttpConnection = /** @class */ (function () { HttpConnection.prototype.isITransport = function (transport) { return transport && typeof (transport) === "object" && "connect" in transport; }; + HttpConnection.prototype.changeState = function (from, to) { + if (this.connectionState === from) { + this.connectionState = to; + return true; + } + return false; + }; HttpConnection.prototype.stopConnection = function (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.stopConnection(" + error + ") called while in state " + this.connectionState + "."); this.transport = undefined; // If we have a stopError, it takes precedence over the error from the transport error = this.stopError || error; - this.stopError = undefined; - if (this.connectionState === "Disconnected" /* Disconnected */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection is already in the disconnected state."); - return; - } - if (this.connectionState === "Connecting " /* Connecting */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Warning, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection hasn't yet left the in the connecting state."); - return; - } - if (this.connectionState === "Disconnecting" /* Disconnecting */) { - // A call to stop() induced this call to stopConnection and needs to be completed. - // Any stop() awaiters will be scheduled to continue after the onclose callback fires. - this.stopPromiseResolver(); - } if (error) { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Connection disconnected with error '" + error + "'."); } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Connection disconnected."); } - this.connectionId = undefined; - this.connectionState = "Disconnected" /* Disconnected */; - if (this.onclose && this.connectionStarted) { - this.connectionStarted = false; - try { - this.onclose(error); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.onclose(" + error + ") threw error '" + e + "'."); - } + this.connectionState = 2 /* Disconnected */; + if (this.onclose) { + this.onclose(error); } }; HttpConnection.prototype.resolveUrl = function (url) { @@ -1385,7 +1222,7 @@ var HttpConnection = /** @class */ (function () { if (url.lastIndexOf("https://", 0) === 0 || url.lastIndexOf("http://", 0) === 0) { return url; } - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isBrowser || !window.document) { + if (typeof window === "undefined" || !window || !window.document) { throw new Error("Cannot resolve '" + url + "'."); } // Setting the url to the href propery of an anchor tag handles normalization @@ -1414,108 +1251,14 @@ var HttpConnection = /** @class */ (function () { function transportMatches(requestedTransport, actualTransport) { return !requestedTransport || ((actualTransport & requestedTransport) !== 0); } -var TransportSendQueue = /** @class */ (function () { - function TransportSendQueue(transport) { - this.transport = transport; - this.buffer = []; - this.executing = true; - this.sendBufferedData = new PromiseSource(); - this.transportResult = new PromiseSource(); - // Suppress typescript error about handling Promises. The sendLoop doesn't need to be observed - this.sendLoop().then(function () { }, function (_) { }); - } - TransportSendQueue.prototype.send = function (data) { - this.bufferData(data); - return this.transportResult.promise; - }; - TransportSendQueue.prototype.stop = function () { - this.executing = false; - this.sendBufferedData.resolve(); - }; - TransportSendQueue.prototype.bufferData = function (data) { - if (this.buffer.length && typeof (this.buffer[0]) !== typeof (data)) { - throw new Error("Expected data to be of type " + typeof (this.buffer) + " but was of type " + typeof (data)); - } - this.buffer.push(data); - this.sendBufferedData.resolve(); - }; - TransportSendQueue.prototype.sendLoop = function () { - return __awaiter(this, void 0, void 0, function () { - var transportResult, data, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (false) {} - return [4 /*yield*/, this.sendBufferedData.promise]; - case 1: - _a.sent(); - if (!this.executing) { - // Did we stop? - return [3 /*break*/, 6]; - } - this.sendBufferedData = new PromiseSource(); - transportResult = this.transportResult; - this.transportResult = new PromiseSource(); - data = typeof (this.buffer[0]) === "string" ? - this.buffer.join("") : - TransportSendQueue.concatBuffers(this.buffer); - this.buffer.length = 0; - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - return [4 /*yield*/, this.transport.send(data)]; - case 3: - _a.sent(); - transportResult.resolve(); - return [3 /*break*/, 5]; - case 4: - error_1 = _a.sent(); - transportResult.reject(error_1); - return [3 /*break*/, 5]; - case 5: return [3 /*break*/, 0]; - case 6: return [2 /*return*/]; - } - }); - }); - }; - TransportSendQueue.concatBuffers = function (arrayBuffers) { - var totalLength = arrayBuffers.map(function (b) { return b.byteLength; }).reduce(function (a, b) { return a + b; }); - var result = new Uint8Array(totalLength); - var offset = 0; - for (var _i = 0, arrayBuffers_1 = arrayBuffers; _i < arrayBuffers_1.length; _i++) { - var item = arrayBuffers_1[_i]; - result.set(new Uint8Array(item), offset); - offset += item.byteLength; - } - return result; - }; - return TransportSendQueue; -}()); - -var PromiseSource = /** @class */ (function () { - function PromiseSource() { - var _this = this; - this.promise = new Promise(function (resolve, reject) { - var _a; - return _a = [resolve, reject], _this.resolver = _a[0], _this.rejecter = _a[1], _a; - }); - } - PromiseSource.prototype.resolve = function () { - this.resolver(); - }; - PromiseSource.prototype.reject = function (reason) { - this.rejecter(reason); - }; - return PromiseSource; -}()); //# sourceMappingURL=HttpConnection.js.map /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnection.js": -/*!***************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnection.js ***! - \***************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js": +/*!*****************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/HubConnection.js ***! + \*****************************************************************/ /*! exports provided: HubConnectionState, HubConnection */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -1523,11 +1266,10 @@ var PromiseSource = /** @class */ (function () { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnectionState", function() { return HubConnectionState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnection", function() { return HubConnection; }); -/* harmony import */ var _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HandshakeProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js"); -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subject */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Subject.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HandshakeProtocol */ "../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js"); +/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -1569,48 +1311,37 @@ var __generator = (undefined && undefined.__generator) || function (thisArg, bod - var DEFAULT_TIMEOUT_IN_MS = 30 * 1000; var DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000; /** Describes the current state of the {@link HubConnection} to the server. */ var HubConnectionState; (function (HubConnectionState) { /** The hub connection is disconnected. */ - HubConnectionState["Disconnected"] = "Disconnected"; - /** The hub connection is connecting. */ - HubConnectionState["Connecting"] = "Connecting"; + HubConnectionState[HubConnectionState["Disconnected"] = 0] = "Disconnected"; /** The hub connection is connected. */ - HubConnectionState["Connected"] = "Connected"; - /** The hub connection is disconnecting. */ - HubConnectionState["Disconnecting"] = "Disconnecting"; - /** The hub connection is reconnecting. */ - HubConnectionState["Reconnecting"] = "Reconnecting"; + HubConnectionState[HubConnectionState["Connected"] = 1] = "Connected"; })(HubConnectionState || (HubConnectionState = {})); /** Represents a connection to a SignalR Hub. */ var HubConnection = /** @class */ (function () { - function HubConnection(connection, logger, protocol, reconnectPolicy) { + function HubConnection(connection, logger, protocol) { var _this = this; - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(connection, "connection"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(logger, "logger"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(protocol, "protocol"); + _Utils__WEBPACK_IMPORTED_MODULE_3__["Arg"].isRequired(connection, "connection"); + _Utils__WEBPACK_IMPORTED_MODULE_3__["Arg"].isRequired(logger, "logger"); + _Utils__WEBPACK_IMPORTED_MODULE_3__["Arg"].isRequired(protocol, "protocol"); this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS; this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS; this.logger = logger; this.protocol = protocol; this.connection = connection; - this.reconnectPolicy = reconnectPolicy; this.handshakeProtocol = new _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__["HandshakeProtocol"](); this.connection.onreceive = function (data) { return _this.processIncomingData(data); }; this.connection.onclose = function (error) { return _this.connectionClosed(error); }; this.callbacks = {}; this.methods = {}; this.closedCallbacks = []; - this.reconnectingCallbacks = []; - this.reconnectedCallbacks = []; - this.invocationId = 0; + this.id = 0; this.receivedHandshakeResponse = false; this.connectionState = HubConnectionState.Disconnected; - this.connectionStarted = false; this.cachedPingMessage = this.protocol.writeMessage({ type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Ping }); } /** @internal */ @@ -1618,8 +1349,8 @@ var HubConnection = /** @class */ (function () { // create method that can be used by HubConnectionBuilder. An "internal" constructor would just // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a // public parameter-less constructor. - HubConnection.create = function (connection, logger, protocol, reconnectPolicy) { - return new HubConnection(connection, logger, protocol, reconnectPolicy); + HubConnection.create = function (connection, logger, protocol) { + return new HubConnection(connection, logger, protocol); }; Object.defineProperty(HubConnection.prototype, "state", { /** Indicates the state of the {@link HubConnection} to the server. */ @@ -1629,63 +1360,22 @@ var HubConnection = /** @class */ (function () { enumerable: true, configurable: true }); - Object.defineProperty(HubConnection.prototype, "connectionId", { - /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either - * in the disconnected state or if the negotiation step was skipped. - */ - get: function () { - return this.connection ? (this.connection.connectionId || null) : null; - }, - enumerable: true, - configurable: true - }); /** Starts the connection. * * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error. */ HubConnection.prototype.start = function () { - this.startPromise = this.startWithStateTransitions(); - return this.startPromise; - }; - HubConnection.prototype.startWithStateTransitions = function () { - return __awaiter(this, void 0, void 0, function () { - var e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.connectionState !== HubConnectionState.Disconnected) { - return [2 /*return*/, Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))]; - } - this.connectionState = HubConnectionState.Connecting; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Starting HubConnection."); - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.startInternal()]; - case 2: - _a.sent(); - this.connectionState = HubConnectionState.Connected; - this.connectionStarted = true; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection connected successfully."); - return [3 /*break*/, 4]; - case 3: - e_1 = _a.sent(); - this.connectionState = HubConnectionState.Disconnected; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection failed to start successfully because of error '" + e_1 + "'."); - return [2 /*return*/, Promise.reject(e_1)]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.startInternal = function () { return __awaiter(this, void 0, void 0, function () { - var handshakePromise, handshakeRequest, e_2; + var handshakeRequest, handshakePromise; var _this = this; return __generator(this, function (_a) { switch (_a.label) { case 0: - this.stopDuringStartError = undefined; + handshakeRequest = { + protocol: this.protocol.name, + version: this.protocol.version, + }; + this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Starting HubConnection."); this.receivedHandshakeResponse = false; handshakePromise = new Promise(function (resolve, reject) { _this.handshakeResolver = resolve; @@ -1694,49 +1384,22 @@ var HubConnection = /** @class */ (function () { return [4 /*yield*/, this.connection.start(this.protocol.transferFormat)]; case 1: _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 5, , 7]); - handshakeRequest = { - protocol: this.protocol.name, - version: this.protocol.version, - }; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Sending handshake request."); return [4 /*yield*/, this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))]; - case 3: + case 2: _a.sent(); this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Using HubProtocol '" + this.protocol.name + "'."); // defensively cleanup timeout in case we receive a message from the server before we finish start this.cleanupTimeout(); this.resetTimeoutPeriod(); this.resetKeepAliveInterval(); + // Wait for the handshake to complete before marking connection as connected return [4 /*yield*/, handshakePromise]; - case 4: - _a.sent(); - // It's important to check the stopDuringStartError instead of just relying on the handshakePromise - // being rejected on close, because this continuation can run after both the handshake completed successfully - // and the connection was closed. - if (this.stopDuringStartError) { - // It's important to throw instead of returning a rejected promise, because we don't want to allow any state - // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise - // will cause the calling continuation to get scheduled to run later. - throw this.stopDuringStartError; - } - return [3 /*break*/, 7]; - case 5: - e_2 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Hub handshake failed with error '" + e_2 + "' during start(). Stopping HubConnection."); - this.cleanupTimeout(); - this.cleanupPingTimer(); - // HttpConnection.stop() should not complete until after the onclose callback is invoked. - // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes. - return [4 /*yield*/, this.connection.stop(e_2)]; - case 6: - // HttpConnection.stop() should not complete until after the onclose callback is invoked. - // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes. + case 3: + // Wait for the handshake to complete before marking connection as connected _a.sent(); - throw e_2; - case 7: return [2 /*return*/]; + this.connectionState = HubConnectionState.Connected; + return [2 /*return*/]; } }); }); @@ -1746,61 +1409,10 @@ var HubConnection = /** @class */ (function () { * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error. */ HubConnection.prototype.stop = function () { - return __awaiter(this, void 0, void 0, function () { - var startPromise, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - startPromise = this.startPromise; - this.stopPromise = this.stopInternal(); - return [4 /*yield*/, this.stopPromise]; - case 1: - _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - // Awaiting undefined continues immediately - return [4 /*yield*/, startPromise]; - case 3: - // Awaiting undefined continues immediately - _a.sent(); - return [3 /*break*/, 5]; - case 4: - e_3 = _a.sent(); - return [3 /*break*/, 5]; - case 5: return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.stopInternal = function (error) { - if (this.connectionState === HubConnectionState.Disconnected) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HubConnection.stop(" + error + ") ignored because it is already in the disconnected state."); - return Promise.resolve(); - } - if (this.connectionState === HubConnectionState.Disconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); - return this.stopPromise; - } - this.connectionState = HubConnectionState.Disconnecting; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Stopping HubConnection."); - if (this.reconnectDelayHandle) { - // We're in a reconnect delay which means the underlying connection is currently already stopped. - // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and - // fire the onclose callbacks. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection stopped during reconnect delay. Done reconnecting."); - clearTimeout(this.reconnectDelayHandle); - this.reconnectDelayHandle = undefined; - this.completeClose(); - return Promise.resolve(); - } this.cleanupTimeout(); this.cleanupPingTimer(); - this.stopDuringStartError = error || new Error("The connection was stopped before the hub handshake could complete."); - // HttpConnection.stop() should not complete until after either HttpConnection.start() fails - // or the onclose callback is invoked. The onclose callback will transition the HubConnection - // to the disconnected state if need be before HttpConnection.stop() completes. - return this.connection.stop(error); + return this.connection.stop(); }; /** Invokes a streaming hub method on the server using the specified name and arguments. * @@ -1815,17 +1427,13 @@ var HubConnection = /** @class */ (function () { for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var invocationDescriptor = this.createStreamInvocation(methodName, args, streamIds); - var promiseQueue; - var subject = new _Subject__WEBPACK_IMPORTED_MODULE_3__["Subject"](); - subject.cancelCallback = function () { + var invocationDescriptor = this.createStreamInvocation(methodName, args); + var subject = new _Utils__WEBPACK_IMPORTED_MODULE_3__["Subject"](function () { var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId); + var cancelMessage = _this.protocol.writeMessage(cancelInvocation); delete _this.callbacks[invocationDescriptor.invocationId]; - return promiseQueue.then(function () { - return _this.sendWithProtocol(cancelInvocation); - }); - }; + return _this.sendMessage(cancelMessage); + }); this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { if (error) { subject.error(error); @@ -1846,25 +1454,18 @@ var HubConnection = /** @class */ (function () { } } }; - promiseQueue = this.sendWithProtocol(invocationDescriptor) + var message = this.protocol.writeMessage(invocationDescriptor); + this.sendMessage(message) .catch(function (e) { subject.error(e); delete _this.callbacks[invocationDescriptor.invocationId]; }); - this.launchStreams(streams, promiseQueue); return subject; }; HubConnection.prototype.sendMessage = function (message) { this.resetKeepAliveInterval(); return this.connection.send(message); }; - /** - * Sends a js object to the server. - * @param message The js object to serialize and send. - */ - HubConnection.prototype.sendWithProtocol = function (message) { - return this.sendMessage(this.protocol.writeMessage(message)); - }; /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver. * * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still @@ -1879,10 +1480,9 @@ var HubConnection = /** @class */ (function () { for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var sendPromise = this.sendWithProtocol(this.createInvocation(methodName, args, true, streamIds)); - this.launchStreams(streams, sendPromise); - return sendPromise; + var invocationDescriptor = this.createInvocation(methodName, args, true); + var message = this.protocol.writeMessage(invocationDescriptor); + return this.sendMessage(message); }; /** Invokes a hub method on the server using the specified name and arguments. * @@ -1901,8 +1501,7 @@ var HubConnection = /** @class */ (function () { for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var invocationDescriptor = this.createInvocation(methodName, args, false, streamIds); + var invocationDescriptor = this.createInvocation(methodName, args, false); var p = new Promise(function (resolve, reject) { // invocationId will always have a value for a non-blocking invocation _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { @@ -1925,13 +1524,13 @@ var HubConnection = /** @class */ (function () { } } }; - var promiseQueue = _this.sendWithProtocol(invocationDescriptor) + var message = _this.protocol.writeMessage(invocationDescriptor); + _this.sendMessage(message) .catch(function (e) { reject(e); // invocationId will always have a value for a non-blocking invocation delete _this.callbacks[invocationDescriptor.invocationId]; }); - _this.launchStreams(streams, promiseQueue); }); return p; }; @@ -1985,24 +1584,6 @@ var HubConnection = /** @class */ (function () { this.closedCallbacks.push(callback); } }; - /** Registers a handler that will be invoked when the connection starts reconnecting. - * - * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any). - */ - HubConnection.prototype.onreconnecting = function (callback) { - if (callback) { - this.reconnectingCallbacks.push(callback); - } - }; - /** Registers a handler that will be invoked when the connection successfully reconnects. - * - * @param {Function} callback The handler that will be invoked when the connection successfully reconnects. - */ - HubConnection.prototype.onreconnected = function (callback) { - if (callback) { - this.reconnectedCallbacks.push(callback); - } - }; HubConnection.prototype.processIncomingData = function (data) { this.cleanupTimeout(); if (!this.receivedHandshakeResponse) { @@ -2022,7 +1603,7 @@ var HubConnection = /** @class */ (function () { case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem: case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion: var callback = this.callbacks[message.invocationId]; - if (callback) { + if (callback != null) { if (message.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { delete this.callbacks[message.invocationId]; } @@ -2035,7 +1616,8 @@ var HubConnection = /** @class */ (function () { case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Close: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Close message received from server."); // We don't want to wait on the stop itself. - this.stopPromise = this.stopInternal(message.error ? new Error("Server returned an error on close: " + message.error) : undefined); + // tslint:disable-next-line:no-floating-promises + this.connection.stop(message.error ? new Error("Server returned an error on close: " + message.error) : undefined); break; default: this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Invalid message type: " + message.type + "."); @@ -2056,15 +1638,20 @@ var HubConnection = /** @class */ (function () { var message = "Error parsing handshake response: " + e; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); var error = new Error(message); + // We don't want to wait on the stop itself. + // tslint:disable-next-line:no-floating-promises + this.connection.stop(error); this.handshakeRejecter(error); throw error; } if (responseMessage.error) { var message = "Server returned handshake error: " + responseMessage.error; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); - var error = new Error(message); - this.handshakeRejecter(error); - throw error; + this.handshakeRejecter(message); + // We don't want to wait on the stop itself. + // tslint:disable-next-line:no-floating-promises + this.connection.stop(new Error(message)); + throw new Error(message); } else { this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Server handshake complete."); @@ -2108,7 +1695,7 @@ var HubConnection = /** @class */ (function () { }; HubConnection.prototype.serverTimeout = function () { // The server hasn't talked to us in a while. It doesn't like us anymore ... :( - // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting. + // Terminate the connection, but we don't need to wait on the promise. // tslint:disable-next-line:no-floating-promises this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server.")); }; @@ -2116,18 +1703,14 @@ var HubConnection = /** @class */ (function () { var _this = this; var methods = this.methods[invocationMessage.target.toLowerCase()]; if (methods) { - try { - methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "A callback for the method " + invocationMessage.target.toLowerCase() + " threw error '" + e + "'."); - } + methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); }); if (invocationMessage.invocationId) { // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response. var message = "Server requested a response, which is not supported in this version of the client."; this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); - // We don't want to wait on the stop itself. - this.stopPromise = this.stopInternal(new Error(message)); + // We don't need to wait on this Promise. + // tslint:disable-next-line:no-floating-promises + this.connection.stop(new Error(message)); } } else { @@ -2135,148 +1718,23 @@ var HubConnection = /** @class */ (function () { } }; HubConnection.prototype.connectionClosed = function (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection.connectionClosed(" + error + ") called while in state " + this.connectionState + "."); - // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet. - this.stopDuringStartError = this.stopDuringStartError || error || new Error("The underlying connection was closed before the hub handshake could complete."); - // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it. - // If it has already completed, this should just noop. - if (this.handshakeResolver) { - this.handshakeResolver(); - } - this.cancelCallbacksWithError(error || new Error("Invocation canceled due to the underlying connection being closed.")); - this.cleanupTimeout(); - this.cleanupPingTimer(); - if (this.connectionState === HubConnectionState.Disconnecting) { - this.completeClose(error); - } - else if (this.connectionState === HubConnectionState.Connected && this.reconnectPolicy) { - // tslint:disable-next-line:no-floating-promises - this.reconnect(error); - } - else if (this.connectionState === HubConnectionState.Connected) { - this.completeClose(error); - } - // If none of the above if conditions were true were called the HubConnection must be in either: - // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it. - // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt - // and potentially continue the reconnect() loop. - // 3. The Disconnected state in which case we're already done. - }; - HubConnection.prototype.completeClose = function (error) { var _this = this; - if (this.connectionStarted) { - this.connectionState = HubConnectionState.Disconnected; - this.connectionStarted = false; - try { - this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onclose callback called with error '" + error + "' threw error '" + e + "'."); - } - } - }; - HubConnection.prototype.reconnect = function (error) { - return __awaiter(this, void 0, void 0, function () { - var reconnectStartTime, previousReconnectAttempts, nextRetryDelay, e_4; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - reconnectStartTime = Date.now(); - previousReconnectAttempts = 0; - nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, 0); - if (nextRetryDelay === null) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection not reconnecting because the IReconnectPolicy returned null on the first reconnect attempt."); - this.completeClose(error); - return [2 /*return*/]; - } - this.connectionState = HubConnectionState.Reconnecting; - if (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting because of error '" + error + "'."); - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting."); - } - if (this.onreconnecting) { - try { - this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnecting callback called with error '" + error + "' threw error '" + e + "'."); - } - // Exit early if an onreconnecting callback called connection.stop(). - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state in onreconnecting callback. Done reconnecting."); - return [2 /*return*/]; - } - } - _a.label = 1; - case 1: - if (!(nextRetryDelay !== null)) return [3 /*break*/, 7]; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt number " + previousReconnectAttempts + " will start in " + nextRetryDelay + " ms."); - return [4 /*yield*/, new Promise(function (resolve) { - _this.reconnectDelayHandle = setTimeout(resolve, nextRetryDelay); - })]; - case 2: - _a.sent(); - this.reconnectDelayHandle = undefined; - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect delay. Done reconnecting."); - return [2 /*return*/]; - } - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); - return [4 /*yield*/, this.startInternal()]; - case 4: - _a.sent(); - this.connectionState = HubConnectionState.Connected; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "HubConnection reconnected successfully."); - if (this.onreconnected) { - try { - this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnected callback called with connectionId '" + this.connection.connectionId + "; threw error '" + e + "'."); - } - } - return [2 /*return*/]; - case 5: - e_4 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt failed because of error '" + e_4 + "'."); - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect attempt. Done reconnecting."); - return [2 /*return*/]; - } - return [3 /*break*/, 6]; - case 6: - nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime); - return [3 /*break*/, 1]; - case 7: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect retries have been exhausted after " + (Date.now() - reconnectStartTime) + " ms and " + previousReconnectAttempts + " failed attempts. Connection disconnecting."); - this.completeClose(); - return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.getNextRetryDelay = function (previousRetryCount, elapsedMilliseconds) { - try { - return this.reconnectPolicy.nextRetryDelayInMilliseconds(previousRetryCount, elapsedMilliseconds); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "IReconnectPolicy.nextRetryDelayInMilliseconds(" + previousRetryCount + ", " + elapsedMilliseconds + ") threw error '" + e + "'."); - return null; - } - }; - HubConnection.prototype.cancelCallbacksWithError = function (error) { var callbacks = this.callbacks; this.callbacks = {}; + this.connectionState = HubConnectionState.Disconnected; + // if handshake is in progress start will be waiting for the handshake promise, so we complete it + // if it has already completed this should just noop + if (this.handshakeRejecter) { + this.handshakeRejecter(error); + } Object.keys(callbacks) .forEach(function (key) { var callback = callbacks[key]; - callback(null, error); + callback(null, error ? error : new Error("Invocation canceled due to connection being closed.")); }); + this.cleanupTimeout(); + this.cleanupPingTimer(); + this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); }; HubConnection.prototype.cleanupPingTimer = function () { if (this.pingServerHandle) { @@ -2288,93 +1746,31 @@ var HubConnection = /** @class */ (function () { clearTimeout(this.timeoutHandle); } }; - HubConnection.prototype.createInvocation = function (methodName, args, nonblocking, streamIds) { + HubConnection.prototype.createInvocation = function (methodName, args, nonblocking) { if (nonblocking) { return { arguments: args, - streamIds: streamIds, target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation, }; } else { - var invocationId = this.invocationId; - this.invocationId++; + var id = this.id; + this.id++; return { arguments: args, - invocationId: invocationId.toString(), - streamIds: streamIds, + invocationId: id.toString(), target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation, }; } }; - HubConnection.prototype.launchStreams = function (streams, promiseQueue) { - var _this = this; - if (streams.length === 0) { - return; - } - // Synchronize stream data so they arrive in-order on the server - if (!promiseQueue) { - promiseQueue = Promise.resolve(); - } - var _loop_1 = function (streamId) { - streams[streamId].subscribe({ - complete: function () { - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId)); }); - }, - error: function (err) { - var message; - if (err instanceof Error) { - message = err.message; - } - else if (err && err.toString) { - message = err.toString(); - } - else { - message = "Unknown error"; - } - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId, message)); }); - }, - next: function (item) { - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createStreamItemMessage(streamId, item)); }); - }, - }); - }; - // We want to iterate over the keys, since the keys are the stream ids - // tslint:disable-next-line:forin - for (var streamId in streams) { - _loop_1(streamId); - } - }; - HubConnection.prototype.replaceStreamingParams = function (args) { - var streams = []; - var streamIds = []; - for (var i = 0; i < args.length; i++) { - var argument = args[i]; - if (this.isObservable(argument)) { - var streamId = this.invocationId; - this.invocationId++; - // Store the stream for later use - streams[streamId] = argument; - streamIds.push(streamId.toString()); - // remove stream from args - args.splice(i, 1); - } - } - return [streams, streamIds]; - }; - HubConnection.prototype.isObservable = function (arg) { - // This allows other stream implementations to just work (like rxjs) - return arg && arg.subscribe && typeof arg.subscribe === "function"; - }; - HubConnection.prototype.createStreamInvocation = function (methodName, args, streamIds) { - var invocationId = this.invocationId; - this.invocationId++; + HubConnection.prototype.createStreamInvocation = function (methodName, args) { + var id = this.id; + this.id++; return { arguments: args, - invocationId: invocationId.toString(), - streamIds: streamIds, + invocationId: id.toString(), target: methodName, type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamInvocation, }; @@ -2385,27 +1781,6 @@ var HubConnection = /** @class */ (function () { type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].CancelInvocation, }; }; - HubConnection.prototype.createStreamItemMessage = function (id, item) { - return { - invocationId: id, - item: item, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem, - }; - }; - HubConnection.prototype.createCompletionMessage = function (id, error, result) { - if (error) { - return { - error: error, - invocationId: id, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion, - }; - } - return { - invocationId: id, - result: result, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion, - }; - }; return HubConnection; }()); @@ -2413,92 +1788,54 @@ var HubConnection = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js": -/*!**********************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js ***! - \**********************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js": +/*!************************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js ***! + \************************************************************************/ /*! exports provided: HubConnectionBuilder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function() { return HubConnectionBuilder; }); -/* harmony import */ var _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultReconnectPolicy */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js"); -/* harmony import */ var _HttpConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpConnection */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpConnection.js"); -/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _HttpConnection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HttpConnection */ "../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js"); +/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); +/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); +/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; - - -// tslint:disable:object-literal-sort-keys -var LogLevelNameMapping = { - trace: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Trace, - debug: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Debug, - info: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, - information: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, - warn: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, - warning: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, - error: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Error, - critical: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Critical, - none: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].None, -}; -function parseLogLevel(name) { - // Case-insensitive matching via lower-casing - // Yes, I know case-folding is a complicated problem in Unicode, but we only support - // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse. - var mapping = LogLevelNameMapping[name.toLowerCase()]; - if (typeof mapping !== "undefined") { - return mapping; - } - else { - throw new Error("Unknown log level: " + name); - } -} /** A builder for configuring {@link @aspnet/signalr.HubConnection} instances. */ var HubConnectionBuilder = /** @class */ (function () { function HubConnectionBuilder() { } HubConnectionBuilder.prototype.configureLogging = function (logging) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(logging, "logging"); + _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(logging, "logging"); if (isLogger(logging)) { this.logger = logging; } - else if (typeof logging === "string") { - var logLevel = parseLogLevel(logging); - this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logLevel); - } else { - this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logging); + this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_4__["ConsoleLogger"](logging); } return this; }; HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(url, "url"); + _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(url, "url"); this.url = url; // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called. if (typeof transportTypeOrOptions === "object") { - this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions); + this.httpConnectionOptions = transportTypeOrOptions; } else { - this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions }); + this.httpConnectionOptions = { + transport: transportTypeOrOptions, + }; } return this; }; @@ -2507,25 +1844,10 @@ var HubConnectionBuilder = /** @class */ (function () { * @param {IHubProtocol} protocol The {@link @aspnet/signalr.IHubProtocol} implementation to use. */ HubConnectionBuilder.prototype.withHubProtocol = function (protocol) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(protocol, "protocol"); + _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(protocol, "protocol"); this.protocol = protocol; return this; }; - HubConnectionBuilder.prototype.withAutomaticReconnect = function (retryDelaysOrReconnectPolicy) { - if (this.reconnectPolicy) { - throw new Error("A reconnectPolicy has already been set."); - } - if (!retryDelaysOrReconnectPolicy) { - this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"](); - } - else if (Array.isArray(retryDelaysOrReconnectPolicy)) { - this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"](retryDelaysOrReconnectPolicy); - } - else { - this.reconnectPolicy = retryDelaysOrReconnectPolicy; - } - return this; - }; /** Creates a {@link @aspnet/signalr.HubConnection} from the configuration options specified in this builder. * * @returns {HubConnection} The configured {@link @aspnet/signalr.HubConnection}. @@ -2543,8 +1865,8 @@ var HubConnectionBuilder = /** @class */ (function () { if (!this.url) { throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection."); } - var connection = new _HttpConnection__WEBPACK_IMPORTED_MODULE_1__["HttpConnection"](this.url, httpConnectionOptions); - return _HubConnection__WEBPACK_IMPORTED_MODULE_2__["HubConnection"].create(connection, this.logger || _Loggers__WEBPACK_IMPORTED_MODULE_5__["NullLogger"].instance, this.protocol || new _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__["JsonHubProtocol"](), this.reconnectPolicy); + var connection = new _HttpConnection__WEBPACK_IMPORTED_MODULE_0__["HttpConnection"](this.url, httpConnectionOptions); + return _HubConnection__WEBPACK_IMPORTED_MODULE_1__["HubConnection"].create(connection, this.logger || _Loggers__WEBPACK_IMPORTED_MODULE_3__["NullLogger"].instance, this.protocol || new _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_2__["JsonHubProtocol"]()); }; return HubConnectionBuilder; }()); @@ -2556,10 +1878,10 @@ function isLogger(logger) { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js": -/*!**************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js ***! - \**************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js": +/*!****************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js ***! + \****************************************************************/ /*! exports provided: MessageType */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2590,10 +1912,10 @@ var MessageType; /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js": -/*!*********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js ***! - \*********************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js": +/*!***********************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/ILogger.js ***! + \***********************************************************/ /*! exports provided: LogLevel */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2628,10 +1950,10 @@ var LogLevel; /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js": -/*!************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js ***! - \************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js": +/*!**************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/ITransport.js ***! + \**************************************************************/ /*! exports provided: HttpTransportType, TransferFormat */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2666,21 +1988,21 @@ var TransferFormat; /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js": -/*!*****************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js ***! - \*****************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js": +/*!*******************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js ***! + \*******************************************************************/ /*! exports provided: JsonHubProtocol */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function() { return JsonHubProtocol; }); -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); +/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); +/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. @@ -2790,10 +2112,10 @@ var JsonHubProtocol = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js": -/*!*********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js ***! - \*********************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js": +/*!***********************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/Loggers.js ***! + \***********************************************************/ /*! exports provided: NullLogger */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2819,21 +2141,21 @@ var NullLogger = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js": -/*!**********************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js ***! - \**********************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js": +/*!************************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js ***! + \************************************************************************/ /*! exports provided: LongPollingTransport */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LongPollingTransport", function() { return LongPollingTransport; }); -/* harmony import */ var _AbortController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AbortController */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/AbortController.js"); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _AbortController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AbortController */ "../node_modules/@aspnet/signalr/dist/esm/AbortController.js"); +/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -3120,143 +2442,28 @@ var LongPollingTransport = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js": -/*!****************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js ***! - \****************************************************************************************************************/ -/*! exports provided: NodeHttpClient */ +/***/ "../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js": +/*!*****************************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js ***! + \*****************************************************************************/ +/*! exports provided: ServerSentEventsTransport */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NodeHttpClient", function() { return NodeHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerSentEventsTransport", function() { return ServerSentEventsTransport; }); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; - - - - -var requestModule; -if (typeof XMLHttpRequest === "undefined") { - // In order to ignore the dynamic require in webpack builds we need to do this magic - // @ts-ignore: TS doesn't know about these names - var requireFunc = true ? require : undefined; - requestModule = requireFunc("request"); -} -var NodeHttpClient = /** @class */ (function (_super) { - __extends(NodeHttpClient, _super); - function NodeHttpClient(logger) { - var _this = _super.call(this) || this; - if (typeof requestModule === "undefined") { - throw new Error("The 'request' module could not be loaded."); - } - _this.logger = logger; - _this.cookieJar = requestModule.jar(); - _this.request = requestModule.defaults({ jar: _this.cookieJar }); - return _this; - } - NodeHttpClient.prototype.send = function (httpRequest) { - var _this = this; - return new Promise(function (resolve, reject) { - var requestBody; - if (Object(_Utils__WEBPACK_IMPORTED_MODULE_3__["isArrayBuffer"])(httpRequest.content)) { - requestBody = Buffer.from(httpRequest.content); - } - else { - requestBody = httpRequest.content || ""; - } - var currentRequest = _this.request(httpRequest.url, { - body: requestBody, - // If binary is expected 'null' should be used, otherwise for text 'utf8' - encoding: httpRequest.responseType === "arraybuffer" ? null : "utf8", - headers: __assign({ - // Tell auth middleware to 401 instead of redirecting - "X-Requested-With": "XMLHttpRequest" }, httpRequest.headers), - method: httpRequest.method, - timeout: httpRequest.timeout, - }, function (error, response, body) { - if (httpRequest.abortSignal) { - httpRequest.abortSignal.onabort = null; - } - if (error) { - if (error.code === "ETIMEDOUT") { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Timeout from HTTP request."); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]()); - } - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Error from HTTP request. " + error); - reject(error); - return; - } - if (response.statusCode >= 200 && response.statusCode < 300) { - resolve(new _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"](response.statusCode, response.statusMessage || "", body)); - } - else { - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](response.statusMessage || "", response.statusCode || 0)); - } - }); - if (httpRequest.abortSignal) { - httpRequest.abortSignal.onabort = function () { - currentRequest.abort(); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]()); - }; - } - }); - }; - NodeHttpClient.prototype.getCookieString = function (url) { - return this.cookieJar.getCookieString(url); - }; - return NodeHttpClient; -}(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])); - -//# sourceMappingURL=NodeHttpClient.js.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js": -/*!***************************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js ***! - \***************************************************************************************************************************/ -/*! exports provided: ServerSentEventsTransport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerSentEventsTransport", function() { return ServerSentEventsTransport; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); +var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; var __generator = (undefined && undefined.__generator) || function (thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; @@ -3327,7 +2534,7 @@ var ServerSentEventsTransport = /** @class */ (function () { return; } var eventSource; - if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isBrowser || _Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isWebWorker) { + if (typeof window !== "undefined") { eventSource = new _this.eventSourceConstructor(url, { withCredentials: true }); } else { @@ -3403,62 +2610,10 @@ var ServerSentEventsTransport = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Subject.js": -/*!*********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Subject.js ***! - \*********************************************************************************************************/ -/*! exports provided: Subject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -/** Stream implementation to stream items to the server. */ -var Subject = /** @class */ (function () { - function Subject() { - this.observers = []; - } - Subject.prototype.next = function (item) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - observer.next(item); - } - }; - Subject.prototype.error = function (err) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.error) { - observer.error(err); - } - } - }; - Subject.prototype.complete = function () { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.complete) { - observer.complete(); - } - } - }; - Subject.prototype.subscribe = function (observer) { - this.observers.push(observer); - return new _Utils__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscription"](this, observer); - }; - return Subject; -}()); - -//# sourceMappingURL=Subject.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js": -/*!*******************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js ***! - \*******************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js": +/*!*********************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js ***! + \*********************************************************************/ /*! exports provided: TextMessageFormat */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -3492,26 +2647,26 @@ var TextMessageFormat = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js": -/*!*******************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js ***! - \*******************************************************************************************************/ -/*! exports provided: Arg, Platform, getDataDetail, formatArrayBuffer, isArrayBuffer, sendMessage, createLogger, SubjectSubscription, ConsoleLogger */ +/***/ "../node_modules/@aspnet/signalr/dist/esm/Utils.js": +/*!*********************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/Utils.js ***! + \*********************************************************/ +/*! exports provided: Arg, getDataDetail, formatArrayBuffer, isArrayBuffer, sendMessage, createLogger, Subject, SubjectSubscription, ConsoleLogger */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Arg", function() { return Arg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataDetail", function() { return getDataDetail; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatArrayBuffer", function() { return formatArrayBuffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return isArrayBuffer; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sendMessage", function() { return sendMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogger", function() { return createLogger; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return ConsoleLogger; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -3569,34 +2724,6 @@ var Arg = /** @class */ (function () { return Arg; }()); -/** @private */ -var Platform = /** @class */ (function () { - function Platform() { - } - Object.defineProperty(Platform, "isBrowser", { - get: function () { - return typeof window === "object"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Platform, "isWebWorker", { - get: function () { - return typeof self === "object" && "importScripts" in self; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Platform, "isNode", { - get: function () { - return !this.isBrowser && !this.isWebWorker; - }, - enumerable: true, - configurable: true - }); - return Platform; -}()); - /** @private */ function getDataDetail(data, includeContent) { var detail = ""; @@ -3680,6 +2807,41 @@ function createLogger(logger) { } return new ConsoleLogger(logger); } +/** @private */ +var Subject = /** @class */ (function () { + function Subject(cancelCallback) { + this.observers = []; + this.cancelCallback = cancelCallback; + } + Subject.prototype.next = function (item) { + for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { + var observer = _a[_i]; + observer.next(item); + } + }; + Subject.prototype.error = function (err) { + for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { + var observer = _a[_i]; + if (observer.error) { + observer.error(err); + } + } + }; + Subject.prototype.complete = function () { + for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { + var observer = _a[_i]; + if (observer.complete) { + observer.complete(); + } + } + }; + Subject.prototype.subscribe = function (observer) { + this.observers.push(observer); + return new SubjectSubscription(this, observer); + }; + return Subject; +}()); + /** @private */ var SubjectSubscription = /** @class */ (function () { function SubjectSubscription(subject, observer) { @@ -3691,7 +2853,7 @@ var SubjectSubscription = /** @class */ (function () { if (index > -1) { this.subject.observers.splice(index, 1); } - if (this.subject.observers.length === 0 && this.subject.cancelCallback) { + if (this.subject.observers.length === 0) { this.subject.cancelCallback().catch(function (_) { }); } }; @@ -3702,24 +2864,23 @@ var SubjectSubscription = /** @class */ (function () { var ConsoleLogger = /** @class */ (function () { function ConsoleLogger(minimumLogLevel) { this.minimumLogLevel = minimumLogLevel; - this.outputConsole = console; } ConsoleLogger.prototype.log = function (logLevel, message) { if (logLevel >= this.minimumLogLevel) { switch (logLevel) { case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Critical: case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Error: - this.outputConsole.error("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); + console.error("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Warning: - this.outputConsole.warn("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); + console.warn("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information: - this.outputConsole.info("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); + console.info("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; default: // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug - this.outputConsole.log("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); + console.log("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); break; } } @@ -3731,19 +2892,19 @@ var ConsoleLogger = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js": -/*!********************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js ***! - \********************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js": +/*!**********************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js ***! + \**********************************************************************/ /*! exports provided: WebSocketTransport */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebSocketTransport", function() { return WebSocketTransport; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Utils.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { @@ -3818,7 +2979,7 @@ var WebSocketTransport = /** @class */ (function () { url = url.replace(/^http/, "ws"); var webSocket; var cookies = _this.httpClient.getCookieString(url); - if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isNode && cookies) { + if (typeof window === "undefined" && cookies) { // Only pass cookies when in non-browser environments webSocket = new _this.webSocketConstructor(url, undefined, { headers: { @@ -3900,19 +3061,19 @@ var WebSocketTransport = /** @class */ (function () { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js": -/*!***************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js ***! - \***************************************************************************************************************/ +/***/ "../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js": +/*!*****************************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js ***! + \*****************************************************************/ /*! exports provided: XhrHttpClient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XhrHttpClient", function() { return XhrHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); +/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. var __extends = (undefined && undefined.__extends) || (function () { @@ -4003,65 +3164,61 @@ var XhrHttpClient = /** @class */ (function (_super) { /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/index.js": -/*!*******************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/index.js ***! - \*******************************************************************************************************/ -/*! exports provided: VERSION, AbortError, HttpError, TimeoutError, HttpClient, HttpResponse, DefaultHttpClient, HubConnection, HubConnectionState, HubConnectionBuilder, MessageType, LogLevel, HttpTransportType, TransferFormat, NullLogger, JsonHubProtocol, Subject */ +/***/ "../node_modules/@aspnet/signalr/dist/esm/index.js": +/*!*********************************************************!*\ + !*** ../node_modules/@aspnet/signalr/dist/esm/index.js ***! + \*********************************************************/ +/*! exports provided: VERSION, AbortError, HttpError, TimeoutError, HttpClient, HttpResponse, DefaultHttpClient, HubConnection, HubConnectionState, HubConnectionBuilder, MessageType, LogLevel, HttpTransportType, TransferFormat, NullLogger, JsonHubProtocol */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Errors.js"); +/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbortError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]; }); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); +/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpClient", function() { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpResponse", function() { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"]; }); -/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); +/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function() { return _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__["DefaultHttpClient"]; }); -/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); +/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnection", function() { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnection"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnectionState", function() { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnectionState"]; }); -/* harmony import */ var _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./HubConnectionBuilder */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js"); +/* harmony import */ var _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./HubConnectionBuilder */ "../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function() { return _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__["HubConnectionBuilder"]; }); -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); +/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MessageType", function() { return _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__["MessageType"]; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ILogger.js"); +/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogLevel", function() { return _ILogger__WEBPACK_IMPORTED_MODULE_6__["LogLevel"]; }); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/ITransport.js"); +/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpTransportType", function() { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["HttpTransportType"]; }); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransferFormat", function() { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["TransferFormat"]; }); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Loggers.js"); +/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NullLogger", function() { return _Loggers__WEBPACK_IMPORTED_MODULE_8__["NullLogger"]; }); -/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); +/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function() { return _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__["JsonHubProtocol"]; }); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Subject */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/@aspnet/signalr/dist/esm/Subject.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _Subject__WEBPACK_IMPORTED_MODULE_10__["Subject"]; }); - // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Version token that will be replaced by the prepack command /** The version of the SignalR client. */ -var VERSION = "0.0.0-DEV_BUILD"; - +var VERSION = "1.1.2"; @@ -4076,10348 +3233,6562 @@ var VERSION = "0.0.0-DEV_BUILD"; /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js": -/*!******************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js ***! - \******************************************************************************/ +/***/ "../node_modules/@dotnet/jsinterop/dist/Microsoft.JSInterop.js": +/*!*********************************************************************!*\ + !*** ../node_modules/@dotnet/jsinterop/dist/Microsoft.JSInterop.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -var DuplexStream = __webpack_require__(/*! readable-stream/duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/duplex-browser.js") - , util = __webpack_require__(/*! util */ "../node_modules/util/util.js") - , Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer - - -function BufferList (callback) { - if (!(this instanceof BufferList)) - return new BufferList(callback) - - this._bufs = [] - this.length = 0 - - if (typeof callback == 'function') { - this._callback = callback - - var piper = function piper (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function onPipe (src) { - src.on('error', piper) - }) - this.on('unpipe', function onUnpipe (src) { - src.removeListener('error', piper) - }) - } else { - this.append(callback) - } - - DuplexStream.call(this) -} - - -util.inherits(BufferList, DuplexStream) - - -BufferList.prototype._offset = function _offset (offset) { - var tot = 0, i = 0, _t - if (offset === 0) return [ 0, 0 ] - for (; i < this._bufs.length; i++) { - _t = tot + this._bufs[i].length - if (offset < _t || i == this._bufs.length - 1) - return [ i, offset - tot ] - tot = _t - } -} - - -BufferList.prototype.append = function append (buf) { - var i = 0 - - if (Buffer.isBuffer(buf)) { - this._appendBuffer(buf); - } else if (Array.isArray(buf)) { - for (; i < buf.length; i++) - this.append(buf[i]) - } else if (buf instanceof BufferList) { - // unwrap argument into individual BufferLists - for (; i < buf._bufs.length; i++) - this.append(buf._bufs[i]) - } else if (buf != null) { - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf == 'number') - buf = buf.toString() - - this._appendBuffer(Buffer.from(buf)); - } - - return this -} - - -BufferList.prototype._appendBuffer = function appendBuffer (buf) { - this._bufs.push(buf) - this.length += buf.length -} - - -BufferList.prototype._write = function _write (buf, encoding, callback) { - this._appendBuffer(buf) +"use strict"; - if (typeof callback == 'function') - callback() -} - - -BufferList.prototype._read = function _read (size) { - if (!this.length) - return this.push(null) - - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - - -BufferList.prototype.end = function end (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - - -BufferList.prototype.get = function get (index) { - return this.slice(index, index + 1)[0] -} - - -BufferList.prototype.slice = function slice (start, end) { - if (typeof start == 'number' && start < 0) - start += this.length - if (typeof end == 'number' && end < 0) - end += this.length - return this.copy(null, 0, start, end) -} - - -BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart != 'number' || srcStart < 0) - srcStart = 0 - if (typeof srcEnd != 'number' || srcEnd > this.length) - srcEnd = this.length - if (srcStart >= this.length) - return dst || Buffer.alloc(0) - if (srcEnd <= 0) - return dst || Buffer.alloc(0) - - var copy = !!dst - , off = this._offset(srcStart) - , len = srcEnd - srcStart - , bytes = len - , bufoff = (copy && dstStart) || 0 - , start = off[1] - , l - , i - - // copy/slice everything - if (srcStart === 0 && srcEnd == this.length) { - if (!copy) { // slice, but full concat if multiple buffers - return this._bufs.length === 1 - ? this._bufs[0] - : Buffer.concat(this._bufs, this.length) +// This is a single-file self-contained module to avoid the need for a Webpack build +var DotNet; +(function (DotNet) { + window.DotNet = DotNet; // Ensure reachable from anywhere + var jsonRevivers = []; + var pendingAsyncCalls = {}; + var cachedJSFunctions = {}; + var nextAsyncCallId = 1; // Start at 1 because zero signals "no response needed" + var dotNetDispatcher = null; + /** + * Sets the specified .NET call dispatcher as the current instance so that it will be used + * for future invocations. + * + * @param dispatcher An object that can dispatch calls from JavaScript to a .NET runtime. + */ + function attachDispatcher(dispatcher) { + dotNetDispatcher = dispatcher; } - - // copy, need to copy individual buffers - for (i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length + DotNet.attachDispatcher = attachDispatcher; + /** + * Adds a JSON reviver callback that will be used when parsing arguments received from .NET. + * @param reviver The reviver to add. + */ + function attachReviver(reviver) { + jsonRevivers.push(reviver); } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) // a slice, we need something to copy in to - dst = Buffer.allocUnsafe(len) - - for (i = off[0]; i < this._bufs.length; i++) { - l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - break + DotNet.attachReviver = attachReviver; + /** + * Invokes the specified .NET public method synchronously. Not all hosting scenarios support + * synchronous invocation, so if possible use invokeMethodAsync instead. + * + * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. + * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. + * @param args Arguments to pass to the method, each of which must be JSON-serializable. + * @returns The result of the operation. + */ + function invokeMethod(assemblyName, methodIdentifier) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return invokePossibleInstanceMethod(assemblyName, methodIdentifier, null, args); } - - bufoff += l - bytes -= l - - if (start) - start = 0 - } - - return dst -} - -BufferList.prototype.shallowSlice = function shallowSlice (start, end) { - start = start || 0 - end = end || this.length - - if (start < 0) - start += this.length - if (end < 0) - end += this.length - - var startOffset = this._offset(start) - , endOffset = this._offset(end) - , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) - - if (endOffset[1] == 0) - buffers.pop() - else - buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) - - if (startOffset[1] != 0) - buffers[0] = buffers[0].slice(startOffset[1]) - - return new BufferList(buffers) -} - -BufferList.prototype.toString = function toString (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function consume (bytes) { - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break + DotNet.invokeMethod = invokeMethod; + /** + * Invokes the specified .NET public method asynchronously. + * + * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. + * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. + * @param args Arguments to pass to the method, each of which must be JSON-serializable. + * @returns A promise representing the result of the operation. + */ + function invokeMethodAsync(assemblyName, methodIdentifier) { + var args = []; + for (var _i = 2; _i < arguments.length; _i++) { + args[_i - 2] = arguments[_i]; + } + return invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, null, args); } - } - return this -} - - -BufferList.prototype.duplicate = function duplicate () { - var i = 0 - , copy = new BufferList() - - for (; i < this._bufs.length; i++) - copy.append(this._bufs[i]) - - return copy -} - - -BufferList.prototype.destroy = function destroy () { - this._bufs.length = 0 - this.length = 0 - this.push(null) -} - - -;(function () { - var methods = { - 'readDoubleBE' : 8 - , 'readDoubleLE' : 8 - , 'readFloatBE' : 4 - , 'readFloatLE' : 4 - , 'readInt32BE' : 4 - , 'readInt32LE' : 4 - , 'readUInt32BE' : 4 - , 'readUInt32LE' : 4 - , 'readInt16BE' : 2 - , 'readInt16LE' : 2 - , 'readUInt16BE' : 2 - , 'readUInt16LE' : 2 - , 'readInt8' : 1 - , 'readUInt8' : 1 - } - - for (var m in methods) { - (function (m) { - BufferList.prototype[m] = function (offset) { - return this.slice(offset, offset + methods[m])[m](0) - } - }(m)) - } -}()) - - -module.exports = BufferList - - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js": -/*!**********************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js ***! - \**********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. + DotNet.invokeMethodAsync = invokeMethodAsync; + function invokePossibleInstanceMethod(assemblyName, methodIdentifier, dotNetObjectId, args) { + var dispatcher = getRequiredDispatcher(); + if (dispatcher.invokeDotNetFromJS) { + var argsJson = JSON.stringify(args, argReplacer); + var resultJson = dispatcher.invokeDotNetFromJS(assemblyName, methodIdentifier, dotNetObjectId, argsJson); + return resultJson ? parseJsonWithRevivers(resultJson) : null; + } + else { + throw new Error('The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.'); + } + } + function invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, dotNetObjectId, args) { + var asyncCallId = nextAsyncCallId++; + var resultPromise = new Promise(function (resolve, reject) { + pendingAsyncCalls[asyncCallId] = { resolve: resolve, reject: reject }; + }); + try { + var argsJson = JSON.stringify(args, argReplacer); + getRequiredDispatcher().beginInvokeDotNetFromJS(asyncCallId, assemblyName, methodIdentifier, dotNetObjectId, argsJson); + } + catch (ex) { + // Synchronous failure + completePendingCall(asyncCallId, false, ex); + } + return resultPromise; + } + function getRequiredDispatcher() { + if (dotNetDispatcher !== null) { + return dotNetDispatcher; + } + throw new Error('No .NET call dispatcher has been set.'); + } + function completePendingCall(asyncCallId, success, resultOrError) { + if (!pendingAsyncCalls.hasOwnProperty(asyncCallId)) { + throw new Error("There is no pending async call with ID " + asyncCallId + "."); + } + var asyncCall = pendingAsyncCalls[asyncCallId]; + delete pendingAsyncCalls[asyncCallId]; + if (success) { + asyncCall.resolve(resultOrError); + } + else { + asyncCall.reject(resultOrError); + } + } + /** + * Receives incoming calls from .NET and dispatches them to JavaScript. + */ + DotNet.jsCallDispatcher = { + /** + * Finds the JavaScript function matching the specified identifier. + * + * @param identifier Identifies the globally-reachable function to be returned. + * @returns A Function instance. + */ + findJSFunction: findJSFunction, + /** + * Invokes the specified synchronous JavaScript function. + * + * @param identifier Identifies the globally-reachable function to invoke. + * @param argsJson JSON representation of arguments to be passed to the function. + * @returns JSON representation of the invocation result. + */ + invokeJSFromDotNet: function (identifier, argsJson) { + var result = findJSFunction(identifier).apply(null, parseJsonWithRevivers(argsJson)); + return result === null || result === undefined + ? null + : JSON.stringify(result, argReplacer); + }, + /** + * Invokes the specified synchronous or asynchronous JavaScript function. + * + * @param asyncHandle A value identifying the asynchronous operation. This value will be passed back in a later call to endInvokeJSFromDotNet. + * @param identifier Identifies the globally-reachable function to invoke. + * @param argsJson JSON representation of arguments to be passed to the function. + */ + beginInvokeJSFromDotNet: function (asyncHandle, identifier, argsJson) { + // Coerce synchronous functions into async ones, plus treat + // synchronous exceptions the same as async ones + var promise = new Promise(function (resolve) { + var synchronousResultOrPromise = findJSFunction(identifier).apply(null, parseJsonWithRevivers(argsJson)); + resolve(synchronousResultOrPromise); + }); + // We only listen for a result if the caller wants to be notified about it + if (asyncHandle) { + // On completion, dispatch result back to .NET + // Not using "await" because it codegens a lot of boilerplate + promise.then(function (result) { return getRequiredDispatcher().beginInvokeDotNetFromJS(0, 'Microsoft.JSInterop', 'DotNetDispatcher.EndInvoke', null, JSON.stringify([asyncHandle, true, result], argReplacer)); }, function (error) { return getRequiredDispatcher().beginInvokeDotNetFromJS(0, 'Microsoft.JSInterop', 'DotNetDispatcher.EndInvoke', null, JSON.stringify([asyncHandle, false, formatError(error)])); }); + } + }, + /** + * Receives notification that an async call from JS to .NET has completed. + * @param asyncCallId The identifier supplied in an earlier call to beginInvokeDotNetFromJS. + * @param success A flag to indicate whether the operation completed successfully. + * @param resultOrExceptionMessage Either the operation result or an error message. + */ + endInvokeDotNetFromJS: function (asyncCallId, success, resultOrExceptionMessage) { + var resultOrError = success ? resultOrExceptionMessage : new Error(resultOrExceptionMessage); + completePendingCall(parseInt(asyncCallId), success, resultOrError); + } + }; + function parseJsonWithRevivers(json) { + return json ? JSON.parse(json, function (key, initialValue) { + // Invoke each reviver in order, passing the output from the previous reviver, + // so that each one gets a chance to transform the value + return jsonRevivers.reduce(function (latestValue, reviver) { return reviver(key, latestValue); }, initialValue); + }) : null; + } + function formatError(error) { + if (error instanceof Error) { + return error.message + "\n" + error.stack; + } + else { + return error ? error.toString() : 'null'; + } + } + function findJSFunction(identifier) { + if (cachedJSFunctions.hasOwnProperty(identifier)) { + return cachedJSFunctions[identifier]; + } + var result = window; + var resultIdentifier = 'window'; + identifier.split('.').forEach(function (segment) { + if (segment in result) { + result = result[segment]; + resultIdentifier += '.' + segment; + } + else { + throw new Error("Could not find '" + segment + "' in '" + resultIdentifier + "'."); + } + }); + if (result instanceof Function) { + return result; + } + else { + throw new Error("The value '" + resultIdentifier + "' is not a function."); + } + } + var DotNetObject = /** @class */ (function () { + function DotNetObject(_id) { + this._id = _id; + } + DotNetObject.prototype.invokeMethod = function (methodIdentifier) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return invokePossibleInstanceMethod(null, methodIdentifier, this._id, args); + }; + DotNetObject.prototype.invokeMethodAsync = function (methodIdentifier) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return invokePossibleInstanceMethodAsync(null, methodIdentifier, this._id, args); + }; + DotNetObject.prototype.dispose = function () { + var promise = invokeMethodAsync('Microsoft.JSInterop', 'DotNetDispatcher.ReleaseDotNetObject', this._id); + promise.catch(function (error) { return console.error(error); }); + }; + DotNetObject.prototype.serializeAsArg = function () { + return { __dotNetObject: this._id }; + }; + return DotNetObject; + }()); + var dotNetObjectRefKey = '__dotNetObject'; + attachReviver(function reviveDotNetObject(key, value) { + if (value && typeof value === 'object' && value.hasOwnProperty(dotNetObjectRefKey)) { + return new DotNetObject(value.__dotNetObject); + } + // Unrecognized - let another reviver handle it + return value; + }); + function argReplacer(key, value) { + return value instanceof DotNetObject ? value.serializeAsArg() : value; + } +})(DotNet || (DotNet = {})); +//# sourceMappingURL=Microsoft.JSInterop.js.map -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; +/***/ }), -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; +/***/ "../node_modules/assert/assert.js": +/*!****************************************!*\ + !*** ../node_modules/assert/assert.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; +// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js +// original notice: -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> + * @license MIT + */ +function compare(a, b) { + if (a === b) { + return 0; + } -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; + var x = a.length; + var y = b.length; -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } -function isUndefined(arg) { - return arg === void 0; + if (x < y) { + return -1; + } + if (y < x) { + return 1; + } + return 0; } -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; +function isBuffer(b) { + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { + return global.Buffer.isBuffer(b); + } + return !!(b != null && b._isBuffer); } -exports.isRegExp = isRegExp; -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; +// based on node assert, original notice: -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 +// +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! +// +// Originally from narwhal.js (http://narwhaljs.org) +// Copyright (c) 2009 Thomas Robinson <280north.com> +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the 'Software'), to +// deal in the Software without restriction, including without limitation the +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +// sell copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); +var util = __webpack_require__(/*! util/ */ "../node_modules/util/util.js"); +var hasOwn = Object.prototype.hasOwnProperty; +var pSlice = Array.prototype.slice; +var functionsHaveNames = (function () { + return function foo() {}.name === 'foo'; +}()); +function pToString (obj) { + return Object.prototype.toString.call(obj); } -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; +function isView(arrbuf) { + if (isBuffer(arrbuf)) { + return false; + } + if (typeof global.ArrayBuffer !== 'function') { + return false; + } + if (typeof ArrayBuffer.isView === 'function') { + return ArrayBuffer.isView(arrbuf); + } + if (!arrbuf) { + return false; + } + if (arrbuf instanceof DataView) { + return true; + } + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { + return true; + } + return false; } -exports.isFunction = isFunction; +// 1. The assert module provides functions that throw +// AssertionError's when particular conditions are not met. The +// assert module must conform to the following interface. -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; +var assert = module.exports = ok; -exports.isBuffer = Buffer.isBuffer; +// 2. The AssertionError is defined in assert. +// new assert.AssertionError({ message: message, +// actual: actual, +// expected: expected }) -function objectToString(o) { - return Object.prototype.toString.call(o); +var regex = /\s*function\s+([^\(\s]*)\s*/; +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js +function getName(func) { + if (!util.isFunction(func)) { + return; + } + if (functionsHaveNames) { + return func.name; + } + var str = func.toString(); + var match = str.match(regex); + return match && match[1]; } +assert.AssertionError = function AssertionError(options) { + this.name = 'AssertionError'; + this.actual = options.actual; + this.expected = options.expected; + this.operator = options.operator; + if (options.message) { + this.message = options.message; + this.generatedMessage = false; + } else { + this.message = getMessage(this); + this.generatedMessage = true; + } + var stackStartFunction = options.stackStartFunction || fail; + if (Error.captureStackTrace) { + Error.captureStackTrace(this, stackStartFunction); + } else { + // non v8 browsers so we can have a stacktrace + var err = new Error(); + if (err.stack) { + var out = err.stack; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) + // try to strip useless frames + var fn_name = getName(stackStartFunction); + var idx = out.indexOf('\n' + fn_name); + if (idx >= 0) { + // once we have located the function frame + // we need to strip out everything before it (and its line) + var next_line = out.indexOf('\n', idx + 1); + out = out.substring(next_line + 1); + } -/***/ }), + this.stack = out; + } + } +}; -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js": -/*!**************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js ***! - \**************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +// assert.AssertionError instanceof Error +util.inherits(assert.AssertionError, Error); -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor +function truncate(s, n) { + if (typeof s === 'string') { + return s.length < n ? s : s.slice(0, n); + } else { + return s; } } +function inspect(something) { + if (functionsHaveNames || !util.isFunction(something)) { + return util.inspect(something); + } + var rawname = getName(something); + var name = rawname ? ': ' + rawname : ''; + return '[Function' + name + ']'; +} +function getMessage(self) { + return truncate(inspect(self.actual), 128) + ' ' + + self.operator + ' ' + + truncate(inspect(self.expected), 128); +} +// At present only the three keys mentioned above are used and +// understood by the spec. Implementations or sub modules can pass +// other keys to the AssertionError's constructor - they will be +// ignored. -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/isarray/index.js": -/*!**************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/isarray/index.js ***! - \**************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +// 3. All of the following functions must throw an AssertionError +// when a corresponding condition is not met, with a message that +// may be undefined if not provided. All assertion methods provide +// both the actual and expected values to the assertion error for +// display purposes. -var toString = {}.toString; +function fail(actual, expected, message, operator, stackStartFunction) { + throw new assert.AssertionError({ + message: message, + actual: actual, + expected: expected, + operator: operator, + stackStartFunction: stackStartFunction + }); +} -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; +// EXTENSION! allows for well behaved errors defined elsewhere. +assert.fail = fail; +// 4. Pure assertion tests whether a value is truthy, as determined +// by !!guard. +// assert.ok(guard, message_opt); +// This statement is equivalent to assert.equal(true, !!guard, +// message_opt);. To test strictly for the value true, use +// assert.strictEqual(true, guard, message_opt);. -/***/ }), +function ok(value, message) { + if (!value) fail(value, true, message, '==', assert.ok); +} +assert.ok = ok; -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/index.js": -/*!***************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/index.js ***! - \***************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +// 5. The equality assertion tests shallow, coercive equality with +// ==. +// assert.equal(actual, expected, message_opt); -"use strict"; +assert.equal = function equal(actual, expected, message) { + if (actual != expected) fail(actual, expected, message, '==', assert.equal); +}; +// 6. The non-equality assertion tests for whether two objects are not equal +// with != assert.notEqual(actual, expected, message_opt); -var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer -var assert = __webpack_require__(/*! assert */ "../node_modules/assert/assert.js") -var bl = __webpack_require__(/*! bl */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js") -var streams = __webpack_require__(/*! ./lib/streams */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/streams.js") -var buildDecode = __webpack_require__(/*! ./lib/decoder */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/decoder.js") -var buildEncode = __webpack_require__(/*! ./lib/encoder */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/encoder.js") +assert.notEqual = function notEqual(actual, expected, message) { + if (actual == expected) { + fail(actual, expected, message, '!=', assert.notEqual); + } +}; -function msgpack (options) { - var encodingTypes = [] - var decodingTypes = [] +// 7. The equivalence assertion tests a deep equality relation. +// assert.deepEqual(actual, expected, message_opt); - options = options || { - forceFloat64: false, - compatibilityMode: false, - disableTimestampEncoding: false // if true, skips encoding Dates using the msgpack timestamp ext format (-1) +assert.deepEqual = function deepEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'deepEqual', assert.deepEqual); } +}; - function registerEncoder (check, encode) { - assert(check, 'must have an encode function') - assert(encode, 'must have an encode function') +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { + if (!_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + } +}; - encodingTypes.push({ - check: check, encode: encode - }) +function _deepEqual(actual, expected, strict, memos) { + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + } else if (isBuffer(actual) && isBuffer(expected)) { + return compare(actual, expected) === 0; - return this - } + // 7.2. If the expected value is a Date object, the actual value is + // equivalent if it is also a Date object that refers to the same time. + } else if (util.isDate(actual) && util.isDate(expected)) { + return actual.getTime() === expected.getTime(); - function registerDecoder (type, decode) { - assert(type >= 0, 'must have a non-negative type') - assert(decode, 'must have a decode function') + // 7.3 If the expected value is a RegExp object, the actual value is + // equivalent if it is also a RegExp object with the same source and + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). + } else if (util.isRegExp(actual) && util.isRegExp(expected)) { + return actual.source === expected.source && + actual.global === expected.global && + actual.multiline === expected.multiline && + actual.lastIndex === expected.lastIndex && + actual.ignoreCase === expected.ignoreCase; - decodingTypes.push({ - type: type, decode: decode - }) + // 7.4. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if ((actual === null || typeof actual !== 'object') && + (expected === null || typeof expected !== 'object')) { + return strict ? actual === expected : actual == expected; - return this - } + // If both values are instances of typed arrays, wrap their underlying + // ArrayBuffers in a Buffer each to increase performance + // This optimization requires the arrays to have the same type as checked by + // Object.prototype.toString (aka pToString). Never perform binary + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their + // bit patterns are not identical. + } else if (isView(actual) && isView(expected) && + pToString(actual) === pToString(expected) && + !(actual instanceof Float32Array || + actual instanceof Float64Array)) { + return compare(new Uint8Array(actual.buffer), + new Uint8Array(expected.buffer)) === 0; - function register (type, constructor, encode, decode) { - assert(constructor, 'must have a constructor') - assert(encode, 'must have an encode function') - assert(type >= 0, 'must have a non-negative type') - assert(decode, 'must have a decode function') + // 7.5 For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else if (isBuffer(actual) !== isBuffer(expected)) { + return false; + } else { + memos = memos || {actual: [], expected: []}; - function check (obj) { - return (obj instanceof constructor) + var actualIndex = memos.actual.indexOf(actual); + if (actualIndex !== -1) { + if (actualIndex === memos.expected.indexOf(expected)) { + return true; + } } - function reEncode (obj) { - var buf = bl() - var header = Buffer.allocUnsafe(1) + memos.actual.push(actual); + memos.expected.push(expected); - header.writeInt8(type, 0) + return objEquiv(actual, expected, strict, memos); + } +} - buf.append(header) - buf.append(encode(obj)) +function isArguments(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +} - return buf - } +function objEquiv(a, b, strict, actualVisitedObjects) { + if (a === null || a === undefined || b === null || b === undefined) + return false; + // if one is a primitive, the other must be same + if (util.isPrimitive(a) || util.isPrimitive(b)) + return a === b; + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) + return false; + var aIsArgs = isArguments(a); + var bIsArgs = isArguments(b); + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) + return false; + if (aIsArgs) { + a = pSlice.call(a); + b = pSlice.call(b); + return _deepEqual(a, b, strict); + } + var ka = objectKeys(a); + var kb = objectKeys(b); + var key, i; + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length !== kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] !== kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) + return false; + } + return true; +} - this.registerEncoder(check, reEncode) - this.registerDecoder(type, decode) +// 8. The non-equivalence assertion tests for any deep inequality. +// assert.notDeepEqual(actual, expected, message_opt); - return this +assert.notDeepEqual = function notDeepEqual(actual, expected, message) { + if (_deepEqual(actual, expected, false)) { + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); } +}; - return { - encode: buildEncode(encodingTypes, options.forceFloat64, options.compatibilityMode, options.disableTimestampEncoding), - decode: buildDecode(decodingTypes), - register: register, - registerEncoder: registerEncoder, - registerDecoder: registerDecoder, - encoder: streams.encoder, - decoder: streams.decoder, - // needed for levelup support - buffer: true, - type: 'msgpack5', - IncompleteBufferError: buildDecode.IncompleteBufferError +assert.notDeepStrictEqual = notDeepStrictEqual; +function notDeepStrictEqual(actual, expected, message) { + if (_deepEqual(actual, expected, true)) { + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); } } -module.exports = msgpack +// 9. The strict equality assertion tests strict equality, as determined by ===. +// assert.strictEqual(actual, expected, message_opt); -/***/ }), +assert.strictEqual = function strictEqual(actual, expected, message) { + if (actual !== expected) { + fail(actual, expected, message, '===', assert.strictEqual); + } +}; -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/decoder.js": -/*!*********************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/decoder.js ***! - \*********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +// 10. The strict non-equality assertion tests for strict inequality, as +// determined by !==. assert.notStrictEqual(actual, expected, message_opt); -var bl = __webpack_require__(/*! bl */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js") -var util = __webpack_require__(/*! util */ "../node_modules/util/util.js") +assert.notStrictEqual = function notStrictEqual(actual, expected, message) { + if (actual === expected) { + fail(actual, expected, message, '!==', assert.notStrictEqual); + } +}; -function IncompleteBufferError (message) { - Error.call(this) // super constructor - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor) // super helper method to include stack trace in error object +function expectedException(actual, expected) { + if (!actual || !expected) { + return false; } - this.name = this.constructor.name - this.message = message || 'unable to decode' + + if (Object.prototype.toString.call(expected) == '[object RegExp]') { + return expected.test(actual); + } + + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; } -util.inherits(IncompleteBufferError, Error) +function _tryBlock(block) { + var error; + try { + block(); + } catch (e) { + error = e; + } + return error; +} -module.exports = function buildDecode (decodingTypes) { - return decode +function _throws(shouldThrow, block, expected, message) { + var actual; - function getSize (first) { - switch (first) { - case 0xc4: - return 2 - case 0xc5: - return 3 - case 0xc6: - return 5 - case 0xc7: - return 3 - case 0xc8: - return 4 - case 0xc9: - return 6 - case 0xca: - return 5 - case 0xcb: - return 9 - case 0xcc: - return 2 - case 0xcd: - return 3 - case 0xce: - return 5 - case 0xcf: - return 9 - case 0xd0: - return 2 - case 0xd1: - return 3 - case 0xd2: - return 5 - case 0xd3: - return 9 - case 0xd4: - return 3 - case 0xd5: - return 4 - case 0xd6: - return 6 - case 0xd7: - return 10 - case 0xd8: - return 18 - case 0xd9: - return 2 - case 0xda: - return 3 - case 0xdb: - return 5 - case 0xde: - return 3 - default: - return -1 - } + if (typeof block !== 'function') { + throw new TypeError('"block" argument must be a function'); } - function hasMinBufferSize (first, length) { - var size = getSize(first) + if (typeof expected === 'string') { + message = expected; + expected = null; + } - if (size !== -1 && length < size) { - return false - } else { - return true - } + actual = _tryBlock(block); + + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + + (message ? ' ' + message : '.'); + + if (shouldThrow && !actual) { + fail(actual, expected, 'Missing expected exception' + message); } - function isValidDataSize (dataLength, bufLength, headerLength) { - return bufLength >= headerLength + dataLength + var userProvidedMessage = typeof message === 'string'; + var isUnwantedException = !shouldThrow && util.isError(actual); + var isUnexpectedException = !shouldThrow && actual && !expected; + + if ((isUnwantedException && + userProvidedMessage && + expectedException(actual, expected)) || + isUnexpectedException) { + fail(actual, expected, 'Got unwanted exception' + message); } - function buildDecodeResult (value, bytesConsumed) { - return { - value: value, - bytesConsumed: bytesConsumed - } + if ((shouldThrow && actual && expected && + !expectedException(actual, expected)) || (!shouldThrow && actual)) { + throw actual; } +} - function decode (buf) { - if (!(buf instanceof bl)) { - buf = bl().append(buf) - } +// 11. Expected to throw an error: +// assert.throws(block, Error_opt, message_opt); - var result = tryDecode(buf) - if (result) { - buf.consume(result.bytesConsumed) - return result.value - } else { - throw new IncompleteBufferError() - } +assert.throws = function(block, /*optional*/error, /*optional*/message) { + _throws(true, block, error, message); +}; + +// EXTENSION! This is annoying to write outside this module. +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { + _throws(false, block, error, message); +}; + +assert.ifError = function(err) { if (err) throw err; }; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + if (hasOwn.call(obj, key)) keys.push(key); } + return keys; +}; - function tryDecode (buf, offset) { - offset = offset === undefined ? 0 : offset - var bufLength = buf.length - offset - if (bufLength <= 0) { - return null - } +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - var first = buf.readUInt8(offset) - var length - var result = 0 - var type - var bytePos +/***/ }), - if (!hasMinBufferSize(first, bufLength)) { - return null - } +/***/ "../node_modules/base64-js/index.js": +/*!******************************************!*\ + !*** ../node_modules/base64-js/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - switch (first) { - case 0xc0: - return buildDecodeResult(null, 1) - case 0xc2: - return buildDecodeResult(false, 1) - case 0xc3: - return buildDecodeResult(true, 1) - case 0xcc: - // 1-byte unsigned int - result = buf.readUInt8(offset + 1) - return buildDecodeResult(result, 2) - case 0xcd: - // 2-bytes BE unsigned int - result = buf.readUInt16BE(offset + 1) - return buildDecodeResult(result, 3) - case 0xce: - // 4-bytes BE unsigned int - result = buf.readUInt32BE(offset + 1) - return buildDecodeResult(result, 5) - case 0xcf: - // 8-bytes BE unsigned int - // Read long byte by byte, big-endian - for (bytePos = 7; bytePos >= 0; bytePos--) { - result += (buf.readUInt8(offset + bytePos + 1) * Math.pow(2, (8 * (7 - bytePos)))) - } - return buildDecodeResult(result, 9) - case 0xd0: - // 1-byte signed int - result = buf.readInt8(offset + 1) - return buildDecodeResult(result, 2) - case 0xd1: - // 2-bytes signed int - result = buf.readInt16BE(offset + 1) - return buildDecodeResult(result, 3) - case 0xd2: - // 4-bytes signed int - result = buf.readInt32BE(offset + 1) - return buildDecodeResult(result, 5) - case 0xd3: - result = readInt64BE(buf.slice(offset + 1, offset + 9), 0) - return buildDecodeResult(result, 9) - case 0xca: - // 4-bytes float - result = buf.readFloatBE(offset + 1) - return buildDecodeResult(result, 5) - case 0xcb: - // 8-bytes double - result = buf.readDoubleBE(offset + 1) - return buildDecodeResult(result, 9) - case 0xd9: - // strings up to 2^8 - 1 bytes - length = buf.readUInt8(offset + 1) - if (!isValidDataSize(length, bufLength, 2)) { - return null - } - result = buf.toString('utf8', offset + 2, offset + 2 + length) - return buildDecodeResult(result, 2 + length) - case 0xda: - // strings up to 2^16 - 2 bytes - length = buf.readUInt16BE(offset + 1) - if (!isValidDataSize(length, bufLength, 3)) { - return null - } - result = buf.toString('utf8', offset + 3, offset + 3 + length) - return buildDecodeResult(result, 3 + length) - case 0xdb: - // strings up to 2^32 - 4 bytes - length = buf.readUInt32BE(offset + 1) - if (!isValidDataSize(length, bufLength, 5)) { - return null - } - result = buf.toString('utf8', offset + 5, offset + 5 + length) - return buildDecodeResult(result, 5 + length) - case 0xc4: - // buffers up to 2^8 - 1 bytes - length = buf.readUInt8(offset + 1) - if (!isValidDataSize(length, bufLength, 2)) { - return null - } - result = buf.slice(offset + 2, offset + 2 + length) - return buildDecodeResult(result, 2 + length) - case 0xc5: - // buffers up to 2^16 - 1 bytes - length = buf.readUInt16BE(offset + 1) - if (!isValidDataSize(length, bufLength, 3)) { - return null - } - result = buf.slice(offset + 3, offset + 3 + length) - return buildDecodeResult(result, 3 + length) - case 0xc6: - // buffers up to 2^32 - 1 bytes - length = buf.readUInt32BE(offset + 1) - if (!isValidDataSize(length, bufLength, 5)) { - return null - } - result = buf.slice(offset + 5, offset + 5 + length) - return buildDecodeResult(result, 5 + length) - case 0xdc: - // array up to 2^16 elements - 2 bytes - if (bufLength < 3) { - return null - } +"use strict"; - length = buf.readUInt16BE(offset + 1) - return decodeArray(buf, offset, length, 3) - case 0xdd: - // array up to 2^32 elements - 4 bytes - if (bufLength < 5) { - return null - } - length = buf.readUInt32BE(offset + 1) - return decodeArray(buf, offset, length, 5) - case 0xde: - // maps up to 2^16 elements - 2 bytes - length = buf.readUInt16BE(offset + 1) - return decodeMap(buf, offset, length, 3) - case 0xdf: - throw new Error('map too big to decode in JS') - case 0xd4: - return decodeFixExt(buf, offset, 1) - case 0xd5: - return decodeFixExt(buf, offset, 2) - case 0xd6: - return decodeFixExt(buf, offset, 4) - case 0xd7: - return decodeFixExt(buf, offset, 8) - case 0xd8: - return decodeFixExt(buf, offset, 16) - case 0xc7: - // ext up to 2^8 - 1 bytes - length = buf.readUInt8(offset + 1) - type = buf.readUInt8(offset + 2) - if (!isValidDataSize(length, bufLength, 3)) { - return null - } - return decodeExt(buf, offset, type, length, 3) - case 0xc8: - // ext up to 2^16 - 1 bytes - length = buf.readUInt16BE(offset + 1) - type = buf.readUInt8(offset + 3) - if (!isValidDataSize(length, bufLength, 4)) { - return null - } - return decodeExt(buf, offset, type, length, 4) - case 0xc9: - // ext up to 2^32 - 1 bytes - length = buf.readUInt32BE(offset + 1) - type = buf.readUInt8(offset + 5) - if (!isValidDataSize(length, bufLength, 6)) { - return null - } - return decodeExt(buf, offset, type, length, 6) - } - - if ((first & 0xf0) === 0x90) { - // we have an array with less than 15 elements - length = first & 0x0f - return decodeArray(buf, offset, length, 1) - } else if ((first & 0xf0) === 0x80) { - // we have a map with less than 15 elements - length = first & 0x0f - return decodeMap(buf, offset, length, 1) - } else if ((first & 0xe0) === 0xa0) { - // fixstr up to 31 bytes - length = first & 0x1f - if (isValidDataSize(length, bufLength, 1)) { - result = buf.toString('utf8', offset + 1, offset + length + 1) - return buildDecodeResult(result, length + 1) - } else { - return null - } - } else if (first >= 0xe0) { - // 5 bits negative ints - result = first - 0x100 - return buildDecodeResult(result, 1) - } else if (first < 0x80) { - // 7-bits positive ints - return buildDecodeResult(first, 1) - } else { - throw new Error('not implemented yet') - } - } - - function readInt64BE (buf, offset) { - var negate = (buf[offset] & 0x80) == 0x80 // eslint-disable-line - - if (negate) { - var carry = 1 - for (var i = offset + 7; i >= offset; i--) { - var v = (buf[i] ^ 0xff) + carry - buf[i] = v & 0xff - carry = v >> 8 - } - } +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray - var hi = buf.readUInt32BE(offset + 0) - var lo = buf.readUInt32BE(offset + 4) - return (hi * 4294967296 + lo) * (negate ? -1 : +1) - } +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - function decodeArray (buf, offset, length, headerLength) { - var result = [] - var i - var totalBytesConsumed = 0 +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} - offset += headerLength - for (i = 0; i < length; i++) { - var decodeResult = tryDecode(buf, offset) - if (decodeResult) { - result.push(decodeResult.value) - offset += decodeResult.bytesConsumed - totalBytesConsumed += decodeResult.bytesConsumed - } else { - return null - } - } - return buildDecodeResult(result, headerLength + totalBytesConsumed) - } +// Support decoding URL-safe base64 strings, as Node.js does. +// See: https://en.wikipedia.org/wiki/Base64#URL_applications +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 - function decodeMap (buf, offset, length, headerLength) { - var result = {} - var key - var i - var totalBytesConsumed = 0 +function getLens (b64) { + var len = b64.length - offset += headerLength - for (i = 0; i < length; i++) { - var keyResult = tryDecode(buf, offset) - if (keyResult) { - offset += keyResult.bytesConsumed - var valueResult = tryDecode(buf, offset) - if (valueResult) { - key = keyResult.value - result[key] = valueResult.value - offset += valueResult.bytesConsumed - totalBytesConsumed += (keyResult.bytesConsumed + valueResult.bytesConsumed) - } else { - return null - } - } else { - return null - } - } - return buildDecodeResult(result, headerLength + totalBytesConsumed) + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') } - function decodeFixExt (buf, offset, size) { - var type = buf.readInt8(offset + 1) // Signed - return decodeExt(buf, offset, type, size, 2) - } - function decodeTimestamp (buf, size, headerSize) { - var seconds, nanoseconds - nanoseconds = 0 + // Trim off extra bytes after placeholder bytes are found + // See: https://github.com/beatgammit/base64-js/issues/42 + var validLen = b64.indexOf('=') + if (validLen === -1) validLen = len - switch (size) { - case 4: - // timestamp 32 stores the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in an 32-bit unsigned integer - seconds = buf.readUInt32BE(0) - break + var placeHoldersLen = validLen === len + ? 0 + : 4 - (validLen % 4) - case 8: // Timestamp 64 stores the number of seconds and nanoseconds that have elapsed - // since 1970-01-01 00:00:00 UTC in 32-bit unsigned integers, split 30/34 bits - var upper = buf.readUInt32BE(0) - var lower = buf.readUInt32BE(4) - nanoseconds = upper / 4 - seconds = ((upper & 0x03) * Math.pow(2, 32)) + lower // If we use bitwise operators, we get truncated to 32bits - break + return [validLen, placeHoldersLen] +} - case 12: - throw new Error('timestamp 96 is not yet implemented') - } +// base64 is 4/3 + up to two characters of the original data +function byteLength (b64) { + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} - var millis = (seconds * 1000) + Math.round(nanoseconds / 1E6) - return buildDecodeResult(new Date(millis), size + headerSize) - } +function _byteLength (b64, validLen, placeHoldersLen) { + return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen +} - function decodeExt (buf, offset, type, size, headerSize) { - var i, - toDecode +function toByteArray (b64) { + var tmp + var lens = getLens(b64) + var validLen = lens[0] + var placeHoldersLen = lens[1] - offset += headerSize + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) - // Pre-defined - if (type < 0) { // Reserved for future extensions - switch (type) { - case -1: // Tiemstamp https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type - toDecode = buf.slice(offset, offset + size) - return decodeTimestamp(toDecode, size, headerSize) - } - } + var curByte = 0 - for (i = 0; i < decodingTypes.length; i++) { - if (type === decodingTypes[i].type) { - toDecode = buf.slice(offset, offset + size) - var value = decodingTypes[i].decode(toDecode) - return buildDecodeResult(value, headerSize + size) - } - } + // if there are placeholders, only get up to the last complete 4 chars + var len = placeHoldersLen > 0 + ? validLen - 4 + : validLen - throw new Error('unable to find ext type ' + type) + for (var i = 0; i < len; i += 4) { + tmp = + (revLookup[b64.charCodeAt(i)] << 18) | + (revLookup[b64.charCodeAt(i + 1)] << 12) | + (revLookup[b64.charCodeAt(i + 2)] << 6) | + revLookup[b64.charCodeAt(i + 3)] + arr[curByte++] = (tmp >> 16) & 0xFF + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF } -} - -module.exports.IncompleteBufferError = IncompleteBufferError + if (placeHoldersLen === 2) { + tmp = + (revLookup[b64.charCodeAt(i)] << 2) | + (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[curByte++] = tmp & 0xFF + } -/***/ }), + if (placeHoldersLen === 1) { + tmp = + (revLookup[b64.charCodeAt(i)] << 10) | + (revLookup[b64.charCodeAt(i + 1)] << 4) | + (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[curByte++] = (tmp >> 8) & 0xFF + arr[curByte++] = tmp & 0xFF + } -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/encoder.js": -/*!*********************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/encoder.js ***! - \*********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + return arr +} -"use strict"; +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + + lookup[num >> 12 & 0x3F] + + lookup[num >> 6 & 0x3F] + + lookup[num & 0x3F] +} +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = + ((uint8[i] << 16) & 0xFF0000) + + ((uint8[i + 1] << 8) & 0xFF00) + + (uint8[i + 2] & 0xFF) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} -var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer -var bl = __webpack_require__(/*! bl */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js") -var TOLERANCE = 0.1 +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 -module.exports = function buildEncode (encodingTypes, forceFloat64, compatibilityMode, disableTimestampEncoding) { - function encode (obj, avoidSlice) { - var buf, - len + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk( + uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) + )) + } - if (obj === undefined) { - throw new Error('undefined is not encodable in msgpack!') - } else if (obj === null) { - buf = Buffer.allocUnsafe(1) - buf[0] = 0xc0 - } else if (obj === true) { - buf = Buffer.allocUnsafe(1) - buf[0] = 0xc3 - } else if (obj === false) { - buf = Buffer.allocUnsafe(1) - buf[0] = 0xc2 - } else if (typeof obj === 'string') { - len = Buffer.byteLength(obj) - if (len < 32) { - buf = Buffer.allocUnsafe(1 + len) - buf[0] = 0xa0 | len - if (len > 0) { - buf.write(obj, 1) - } - } else if (len <= 0xff && !compatibilityMode) { - // str8, but only when not in compatibility mode - buf = Buffer.allocUnsafe(2 + len) - buf[0] = 0xd9 - buf[1] = len - buf.write(obj, 2) - } else if (len <= 0xffff) { - buf = Buffer.allocUnsafe(3 + len) - buf[0] = 0xda - buf.writeUInt16BE(len, 1) - buf.write(obj, 3) - } else { - buf = Buffer.allocUnsafe(5 + len) - buf[0] = 0xdb - buf.writeUInt32BE(len, 1) - buf.write(obj, 5) - } - } else if (obj && (obj.readUInt32LE || obj instanceof Uint8Array)) { - if (obj instanceof Uint8Array) { - obj = Buffer.from(obj) - } - // weird hack to support Buffer - // and Buffer-like objects - if (obj.length <= 0xff) { - buf = Buffer.allocUnsafe(2) - buf[0] = 0xc4 - buf[1] = obj.length - } else if (obj.length <= 0xffff) { - buf = Buffer.allocUnsafe(3) - buf[0] = 0xc5 - buf.writeUInt16BE(obj.length, 1) - } else { - buf = Buffer.allocUnsafe(5) - buf[0] = 0xc6 - buf.writeUInt32BE(obj.length, 1) - } + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + parts.push( + lookup[tmp >> 2] + + lookup[(tmp << 4) & 0x3F] + + '==' + ) + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1] + parts.push( + lookup[tmp >> 10] + + lookup[(tmp >> 4) & 0x3F] + + lookup[(tmp << 2) & 0x3F] + + '=' + ) + } - buf = bl([buf, obj]) - } else if (Array.isArray(obj)) { - if (obj.length < 16) { - buf = Buffer.allocUnsafe(1) - buf[0] = 0x90 | obj.length - } else if (obj.length < 65536) { - buf = Buffer.allocUnsafe(3) - buf[0] = 0xdc - buf.writeUInt16BE(obj.length, 1) - } else { - buf = Buffer.allocUnsafe(5) - buf[0] = 0xdd - buf.writeUInt32BE(obj.length, 1) - } + return parts.join('') +} - buf = obj.reduce(function (acc, obj) { - acc.append(encode(obj, true)) - return acc - }, bl().append(buf)) - } else if (!disableTimestampEncoding && typeof obj.getDate === 'function') { - return encodeDate(obj) - } else if (typeof obj === 'object') { - buf = encodeExt(obj) || encodeObject(obj) - } else if (typeof obj === 'number') { - if (isFloat(obj)) { - return encodeFloat(obj, forceFloat64) - } else if (obj >= 0) { - if (obj < 128) { - buf = Buffer.allocUnsafe(1) - buf[0] = obj - } else if (obj < 256) { - buf = Buffer.allocUnsafe(2) - buf[0] = 0xcc - buf[1] = obj - } else if (obj < 65536) { - buf = Buffer.allocUnsafe(3) - buf[0] = 0xcd - buf.writeUInt16BE(obj, 1) - } else if (obj <= 0xffffffff) { - buf = Buffer.allocUnsafe(5) - buf[0] = 0xce - buf.writeUInt32BE(obj, 1) - } else if (obj <= 9007199254740991) { - buf = Buffer.allocUnsafe(9) - buf[0] = 0xcf - write64BitUint(buf, obj) - } else { - return encodeFloat(obj, true) - } - } else { - if (obj >= -32) { - buf = Buffer.allocUnsafe(1) - buf[0] = 0x100 + obj - } else if (obj >= -128) { - buf = Buffer.allocUnsafe(2) - buf[0] = 0xd0 - buf.writeInt8(obj, 1) - } else if (obj >= -32768) { - buf = Buffer.allocUnsafe(3) - buf[0] = 0xd1 - buf.writeInt16BE(obj, 1) - } else if (obj > -214748365) { - buf = Buffer.allocUnsafe(5) - buf[0] = 0xd2 - buf.writeInt32BE(obj, 1) - } else if (obj >= -9007199254740991) { - buf = Buffer.allocUnsafe(9) - buf[0] = 0xd3 - write64BitInt(buf, 1, obj) - } else { - return encodeFloat(obj, true) - } - } - } - if (!buf) { - throw new Error('not implemented yet') - } +/***/ }), - if (avoidSlice) { - return buf - } else { - return buf.slice() - } - } +/***/ "../node_modules/bl/bl.js": +/*!********************************!*\ + !*** ../node_modules/bl/bl.js ***! + \********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - function encodeDate (dt) { - var encoded - var millis = dt * 1 - var seconds = Math.floor(millis / 1000) - var nanos = (millis - (seconds * 1000)) * 1E6 +"use strict"; - if (nanos || seconds > 0xFFFFFFFF) { - // Timestamp64 - encoded = new Buffer(10) - encoded[0] = 0xd7 - encoded[1] = -1 +var DuplexStream = __webpack_require__(/*! readable-stream */ "../node_modules/readable-stream/readable-browser.js").Duplex + , util = __webpack_require__(/*! util */ "../node_modules/util/util.js") + , Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer - var upperNanos = ((nanos * 4)) - var upperSeconds = seconds / Math.pow(2, 32) - var upper = (upperNanos + upperSeconds) & 0xFFFFFFFF - var lower = seconds & 0xFFFFFFFF +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) - encoded.writeInt32BE(upper, 2) - encoded.writeInt32BE(lower, 6) - } else { - // Timestamp32 - encoded = new Buffer(6) - encoded[0] = 0xd6 - encoded[1] = -1 - encoded.writeUInt32BE(Math.floor(millis / 1000), 2) - } - return bl().append(encoded) - } + this._bufs = [] + this.length = 0 - function encodeExt (obj) { - var i - var encoded - var length = -1 - var headers = [] + if (typeof callback == 'function') { + this._callback = callback - for (i = 0; i < encodingTypes.length; i++) { - if (encodingTypes[i].check(obj)) { - encoded = encodingTypes[i].encode(obj) - break + var piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null } - } + }.bind(this) - if (!encoded) { - return null - } + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + } else { + this.append(callback) + } - // we subtract 1 because the length does not - // include the type - length = encoded.length - 1 + DuplexStream.call(this) +} - if (length === 1) { - headers.push(0xd4) - } else if (length === 2) { - headers.push(0xd5) - } else if (length === 4) { - headers.push(0xd6) - } else if (length === 8) { - headers.push(0xd7) - } else if (length === 16) { - headers.push(0xd8) - } else if (length < 256) { - headers.push(0xc7) - headers.push(length) - } else if (length < 0x10000) { - headers.push(0xc8) - headers.push(length >> 8) - headers.push(length & 0x00ff) - } else { - headers.push(0xc9) - headers.push(length >> 24) - headers.push((length >> 16) & 0x000000ff) - headers.push((length >> 8) & 0x000000ff) - headers.push(length & 0x000000ff) - } - return bl().append(Buffer.from(headers)).append(encoded) - } +util.inherits(BufferList, DuplexStream) - function encodeObject (obj) { - var acc = [] - var length = 0 - var key - var header - for (key in obj) { - if (obj.hasOwnProperty(key) && - obj[key] !== undefined && - typeof obj[key] !== 'function') { - ++length - acc.push(encode(key, true)) - acc.push(encode(obj[key], true)) - } +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + if (offset === 0) return [ 0, 0 ] + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t || i == this._bufs.length - 1) { + return [ i, offset - tot ] } + tot = _t + } +} - if (length < 16) { - header = Buffer.allocUnsafe(1) - header[0] = 0x80 | length - } else { - header = Buffer.allocUnsafe(3) - header[0] = 0xde - header.writeUInt16BE(length, 1) - } +BufferList.prototype._reverseOffset = function (blOffset) { + var bufferId = blOffset[0] + var offset = blOffset[1] + for (var i = 0; i < bufferId; i++) { + offset += this._bufs[i].length + } + return offset +} - acc.unshift(header) +BufferList.prototype.append = function append (buf) { + var i = 0 - var result = acc.reduce(function (list, buf) { - return list.append(buf) - }, bl()) + if (Buffer.isBuffer(buf)) { + this._appendBuffer(buf) + } else if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() - return result + this._appendBuffer(Buffer.from(buf)) } - return encode + return this } -function write64BitUint (buf, obj) { - // Write long byte by byte, in big-endian order - for (var currByte = 7; currByte >= 0; currByte--) { - buf[currByte + 1] = (obj & 0xff) - obj = obj / 256 - } -} -function write64BitInt (buf, offset, num) { - var negate = num < 0 +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length +} - if (negate) { - num = Math.abs(num) - } - var lo = num % 4294967296 - var hi = num / 4294967296 - buf.writeUInt32BE(Math.floor(hi), offset + 0) - buf.writeUInt32BE(lo, offset + 4) +BufferList.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) - if (negate) { - var carry = 1 - for (var i = offset + 7; i >= offset; i--) { - var v = (buf[i] ^ 0xff) + carry - buf[i] = v & 0xff - carry = v >> 8 - } - } + if (typeof callback == 'function') + callback() } -function isFloat (n) { - return n !== Math.floor(n) + +BufferList.prototype._read = function _read (size) { + if (!this.length) + return this.push(null) + + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) } -function encodeFloat (obj, forceFloat64) { - var buf - buf = Buffer.allocUnsafe(5) - buf[0] = 0xca - buf.writeFloatBE(obj, 1) +BufferList.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) - // FIXME is there a way to check if a - // value fits in a float? - if (forceFloat64 || Math.abs(obj - buf.readFloatBE(1)) > TOLERANCE) { - buf = Buffer.allocUnsafe(9) - buf[0] = 0xcb - buf.writeDoubleBE(obj, 1) + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null } - - return buf } -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/streams.js": -/*!*********************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/msgpack5/lib/streams.js ***! - \*********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +BufferList.prototype.get = function get (index) { + if (index > this.length || index < 0) { + return undefined + } + var offset = this._offset(index) + return this._bufs[offset[0]][offset[1]] +} -"use strict"; +BufferList.prototype.slice = function slice (start, end) { + if (typeof start == 'number' && start < 0) + start += this.length + if (typeof end == 'number' && end < 0) + end += this.length + return this.copy(null, 0, start, end) +} -var Transform = __webpack_require__(/*! readable-stream */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/readable-browser.js").Transform -var inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js") -var bl = __webpack_require__(/*! bl */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/bl/bl.js") -function Base (opts) { - opts = opts || {} +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || Buffer.alloc(0) + if (srcEnd <= 0) + return dst || Buffer.alloc(0) - opts.objectMode = true - opts.highWaterMark = 16 + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i - Transform.call(this, opts) + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) { // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } - this._msgpack = opts.msgpack -} + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } -inherits(Base, Transform) + return dst + } -function Encoder (opts) { - if (!(this instanceof Encoder)) { - opts = opts || {} - opts.msgpack = this - return new Encoder(opts) + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) } - Base.call(this, opts) -} + if (!copy) // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) -inherits(Encoder, Base) + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start -Encoder.prototype._transform = function (obj, enc, done) { - var buf = null + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } - try { - buf = this._msgpack.encode(obj).slice(0) - } catch (err) { - this.emit('error', err) - return done() + bufoff += l + bytes -= l + + if (start) + start = 0 } - this.push(buf) - done() + return dst } -function Decoder (opts) { - if (!(this instanceof Decoder)) { - opts = opts || {} - opts.msgpack = this - return new Decoder(opts) +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = typeof end !== 'number' ? this.length : end + + if (start < 0) + start += this.length + if (end < 0) + end += this.length + + if (start === end) { + return new BufferList() } + var startOffset = this._offset(start) + , endOffset = this._offset(end) + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) - Base.call(this, opts) + if (endOffset[1] == 0) + buffers.pop() + else + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) - this._chunks = bl() -} + if (startOffset[1] != 0) + buffers[0] = buffers[0].slice(startOffset[1]) -inherits(Decoder, Base) + return new BufferList(buffers) +} -Decoder.prototype._transform = function (buf, enc, done) { - if (buf) { - this._chunks.append(buf) - } +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} - try { - var result = this._msgpack.decode(this._chunks) - this.push(result) - } catch (err) { - if (err instanceof this._msgpack.IncompleteBufferError) { - done() +BufferList.prototype.consume = function consume (bytes) { + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() } else { - this.emit('error', err) + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break } - return - } - - if (this._chunks.length > 0) { - this._transform(null, enc, done) - } else { - done() } + return this } -module.exports.decoder = Decoder -module.exports.encoder = Encoder +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() -/***/ }), + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js": -/*!***************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js ***! - \***************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + return copy +} -"use strict"; -/* WEBPACK VAR INJECTION */(function(process) { -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = { nextTick: nextTick }; -} else { - module.exports = process +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) } -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); + +BufferList.prototype.indexOf = function (search, offset, encoding) { + if (encoding === undefined && typeof offset === 'string') { + encoding = offset + offset = undefined + } + if (typeof search === 'function' || Array.isArray(search)) { + throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.') + } else if (typeof search === 'number') { + search = Buffer.from([search]) + } else if (typeof search === 'string') { + search = Buffer.from(search, encoding) + } else if (search instanceof BufferList) { + search = search.slice() + } else if (!Buffer.isBuffer(search)) { + search = Buffer.from(search) + } + + offset = Number(offset || 0) + if (isNaN(offset)) { + offset = 0 } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; + + if (offset < 0) { + offset = this.length + offset + } + + if (offset < 0) { + offset = 0 + } + + if (search.length === 0) { + return offset > this.length ? this.length : offset + } + + var blOffset = this._offset(offset) + var blIndex = blOffset[0] // index of which internal buffer we're working on + var buffOffset = blOffset[1] // offset of the internal buffer we're working on + + // scan over each buffer + for (blIndex; blIndex < this._bufs.length; blIndex++) { + var buff = this._bufs[blIndex] + while(buffOffset < buff.length) { + var availableWindow = buff.length - buffOffset + if (availableWindow >= search.length) { + var nativeSearchResult = buff.indexOf(search, buffOffset) + if (nativeSearchResult !== -1) { + return this._reverseOffset([blIndex, nativeSearchResult]) + } + buffOffset = buff.length - search.length + 1 // end of native search window + } else { + var revOffset = this._reverseOffset([blIndex, buffOffset]) + if (this._match(revOffset, search)) { + return revOffset + } + buffOffset++ + } + } + buffOffset = 0 + } + return -1 +} + +BufferList.prototype._match = function(offset, search) { + if (this.length - offset < search.length) { + return false + } + for (var searchOffset = 0; searchOffset < search.length ; searchOffset++) { + if(this.get(offset + searchOffset) !== search[searchOffset]){ + return false } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); } + return true } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "../node_modules/process/browser.js"))) +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + , 'readIntBE' : null + , 'readIntLE' : null + , 'readUIntBE' : null + , 'readUIntLE' : null + } -/***/ }), + for (var m in methods) { + (function (m) { + if (methods[m] === null) { + BufferList.prototype[m] = function (offset, byteLength) { + return this.slice(offset, offset + byteLength)[m](0, byteLength) + } + } + else { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + } + }(m)) + } +}()) -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/duplex-browser.js": -/*!*******************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/duplex-browser.js ***! - \*******************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -module.exports = __webpack_require__(/*! ./lib/_stream_duplex.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); +module.exports = BufferList /***/ }), -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js": -/*!***********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js ***! - \***********************************************************************************************************/ +/***/ "../node_modules/buffer/index.js": +/*!***************************************!*\ + !*** ../node_modules/buffer/index.js ***! + \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - - +/* WEBPACK VAR INJECTION */(function(global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> + * @license MIT + */ +/* eslint-disable no-proto */ -/*<replacement>*/ -var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js"); -/*</replacement>*/ -/*<replacement>*/ -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/*</replacement>*/ +var base64 = __webpack_require__(/*! base64-js */ "../node_modules/base64-js/index.js") +var ieee754 = __webpack_require__(/*! ieee754 */ "../node_modules/ieee754/index.js") +var isArray = __webpack_require__(/*! isarray */ "../node_modules/isarray/index.js") -module.exports = Duplex; +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 -/*<replacement>*/ -var util = __webpack_require__(/*! core-util-is */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js"); -util.inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js"); -/*</replacement>*/ +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. + * + * Note: + * + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. -var Readable = __webpack_require__(/*! ./_stream_readable */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_readable.js"); -var Writable = __webpack_require__(/*! ./_stream_writable */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_writable.js"); + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() -util.inherits(Duplex, Readable); +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() -{ - // avoid scope creep, the keys array can then be collected - var keys = objectKeys(Writable.prototype); - for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false } } -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} - Readable.call(this, options); - Writable.call(this, options); +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } - if (options && options.readable === false) this.readable = false; + return that +} - if (options && options.writable === false) this.writable = false; +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } - this.once('end', onend); + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) } -Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; +Buffer.poolSize = 8192 // not used by this implementation - // no more data can be written. - // But allow more writes to happen in this tick. - pna.nextTick(onEndNT, this); +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr } -function onEndNT(self) { - self.end(); -} +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } -Object.defineProperty(Duplex.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined || this._writableState === undefined) { - return false; - } - return this._readableState.destroyed && this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (this._readableState === undefined || this._writableState === undefined) { - return; - } + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; - this._writableState.destroyed = value; + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) } -}); -Duplex.prototype._destroy = function (err, cb) { - this.push(null); - this.end(); + return fromObject(that, value) +} - pna.nextTick(cb, err); -}; +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) +} -/***/ }), +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_passthrough.js": -/*!****************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_passthrough.js ***! - \****************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) +} -module.exports = PassThrough; +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } -var Transform = __webpack_require__(/*! ./_stream_transform */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_transform.js"); + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } -/*<replacement>*/ -var util = __webpack_require__(/*! core-util-is */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js"); -util.inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js"); -/*</replacement>*/ + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) -util.inherits(PassThrough, Transform); + var actual = that.write(string, encoding) -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } - Transform.call(this, options); + return that } -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; - -/***/ }), +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_readable.js": -/*!*************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_readable.js ***! - \*************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer -"use strict"; -/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } -/*<replacement>*/ + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} -var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js"); -/*</replacement>*/ +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) -module.exports = Readable; + if (that.length === 0) { + return that + } -/*<replacement>*/ -var isArray = __webpack_require__(/*! isarray */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/isarray/index.js"); -/*</replacement>*/ - -/*<replacement>*/ -var Duplex; -/*</replacement>*/ - -Readable.ReadableState = ReadableState; + obj.copy(that, 0, 0, len) + return that + } -/*<replacement>*/ -var EE = __webpack_require__(/*! events */ "../node_modules/events/events.js").EventEmitter; + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/*</replacement>*/ + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } -/*<replacement>*/ -var Stream = __webpack_require__(/*! ./internal/streams/stream */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/stream-browser.js"); -/*</replacement>*/ + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} -/*<replacement>*/ +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 +} -var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) } -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; + +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) } -/*</replacement>*/ +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } -/*<replacement>*/ -var util = __webpack_require__(/*! core-util-is */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js"); -util.inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js"); -/*</replacement>*/ + if (a === b) return 0 -/*<replacement>*/ -var debugUtil = __webpack_require__(/*! util */ 0); -var debug = void 0; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; + var x = a.length + var y = b.length + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 } -/*</replacement>*/ -var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/BufferList.js"); -var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/destroy.js"); -var StringDecoder; +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).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 true + default: + return false + } +} -util.inherits(Readable, Stream); +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } -var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + if (list.length === 0) { + return Buffer.alloc(0) + } -function prependListener(emitter, event, fn) { - // Sadly this is not cacheable as some libraries bundle their own - // event emitter implementation with them. - if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } - // This is a hack to make sure that our error handler is attached before any - // userland ones. NEVER DO THIS. This is here only because this code needs - // to continue to work with older versions of Node.js that do not include - // the prependListener() method. The goal is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer } -function ReadableState(options, stream) { - Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } - options = options || {}; + var len = string.length + if (len === 0) return 0 - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; +function slowToString (encoding, start, end) { + var loweredCase = false - if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var readableHwm = options.readableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; + if (end === undefined || end > this.length) { + end = this.length + } - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); + if (end <= 0) { + return '' + } - // A linked list is used to store data chunks instead of an array because the - // linked list can remove elements from the beginning faster than - // array.shift() - this.buffer = new BufferList(); - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 - // a flag to be able to tell if the event 'readable'/'data' is emitted - // immediately, or on a later tick. We set this to true at first, because - // any actions that shouldn't happen until "later" should generally also - // not happen before the first read call. - this.sync = true; + if (end <= start) { + return '' + } - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; + if (!encoding) encoding = 'utf8' - // has it been destroyed - this.destroyed = false; + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; + case 'ascii': + return asciiSlice(this, start, end) - // if true, a maybeReadMore has been scheduled - this.readingMore = false; + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "../node_modules/string_decoder/lib/string_decoder.js").StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } } } -function Readable(options) { - Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); - - if (!(this instanceof Readable)) return new Readable(options); +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true - this._readableState = new ReadableState(options, this); +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} - // legacy - this.readable = true; +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} - if (options) { - if (typeof options.read === 'function') this._read = options.read; +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} - if (typeof options.destroy === 'function') this._destroy = options.destroy; +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) } + return this +} - Stream.call(this); +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) } -Object.defineProperty(Readable.prototype, 'destroyed', { - get: function () { - if (this._readableState === undefined) { - return false; - } - return this._readableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._readableState) { - return; - } +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} - // backward compatibility, the user is explicitly - // managing destroyed - this._readableState.destroyed = value; +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' } -}); - -Readable.prototype.destroy = destroyImpl.destroy; -Readable.prototype._undestroy = destroyImpl.undestroy; -Readable.prototype._destroy = function (err, cb) { - this.push(null); - cb(err); -}; + return '<Buffer ' + str + '>' +} -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - var skipChunkCheck; +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } - if (!state.objectMode) { - if (typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = Buffer.from(chunk, encoding); - encoding = ''; - } - skipChunkCheck = true; - } - } else { - skipChunkCheck = true; + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length } - return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); -}; + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - return readableAddChunk(this, chunk, null, true, false); -}; + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } -function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { - var state = stream._readableState; - if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else { - var er; - if (!skipChunkCheck) er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { - chunk = _uint8ArrayToBuffer(chunk); - } + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 - if (addToFront) { - if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); - } else if (state.ended) { - stream.emit('error', new Error('stream.push() after EOF')); - } else { - state.reading = false; - if (state.decoder && !encoding) { - chunk = state.decoder.write(chunk); - if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); - } else { - addChunk(stream, state, chunk, false); - } - } - } else if (!addToFront) { - state.reading = false; - } - } + if (this === target) return 0 - return needMoreData(state); -} + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) -function addChunk(stream, state, chunk, addToFront) { - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) - if (state.needReadable) emitReadable(stream); + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } } - maybeReadMore(stream, state); -} -function chunkInvalid(state, chunk) { - var er; - if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; + if (x < y) return -1 + if (y < x) return 1 + return 0 } -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "../node_modules/string_decoder/lib/string_decoder.js").StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 to prevent increasing hwm excessively in - // tiny amounts - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function howMuchToRead(n, state) { - if (n <= 0 || state.length === 0 && state.ended) return 0; - if (state.objectMode) return 1; - if (n !== n) { - // Only flow one buffer at a time - if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 } - // If we're asking for more than the current hwm, then raise the hwm. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - if (n <= state.length) return n; - // Don't have enough - if (!state.ended) { - state.needReadable = true; - return 0; + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) } - return state.length; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - n = parseInt(n, 10); - var state = this._readableState; - var nOrig = n; - - if (n !== 0) state.emittedReadable = false; - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 } - n = howMuchToRead(n, state); + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) } - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. + throw new TypeError('val must be string, number or Buffer') +} - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } } - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } else if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (!state.reading) n = howMuchToRead(nOrig, state); + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } } - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } } else { - state.length -= n; + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } } - if (state.length === 0) { - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (!state.ended) state.needReadable = true; + return -1 +} - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended) endReadable(this); - } +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} - if (ret !== null) this.emit('data', ret); +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} - return ret; -}; +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining } } - state.ended = true; - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed } + return i } -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - pna.nextTick(maybeReadMore_, stream, state); - } +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) } -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) } -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('_read() is not implemented')); -}; +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : unpipe; - if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining - dest.on('unpipe', onunpipe); - function onunpipe(readable, unpipeInfo) { - debug('onunpipe'); - if (readable === src) { - if (unpipeInfo && unpipeInfo.hasUnpiped === false) { - unpipeInfo.hasUnpiped = true; - cleanup(); - } - } + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') } - function onend() { - debug('onend'); - dest.end(); - } + if (!encoding) encoding = 'utf8' - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', unpipe); - src.removeListener('data', ondata); + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) - cleanedUp = true; + case 'ascii': + return asciiWrite(this, string, offset, length) - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) - // If the user pushes more data while we're writing to dest then we'll end up - // in ondata again. However, we only want to increase awaitDrain once because - // dest will only emit one 'drain' event for the multiple writes. - // => Introduce a guard on increasing awaitDrain. - var increasedAwaitDrain = false; - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - increasedAwaitDrain = false; - var ret = dest.write(chunk); - if (false === ret && !increasedAwaitDrain) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - // => Check whether `dest` is still a piping destination. - if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - increasedAwaitDrain = true; - } - src.pause(); + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true } } +} - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) } +} - // Make sure our error handler is attached before userland ones. - prependListener(dest, 'error', onerror); - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) } - dest.once('finish', onfinish); +} - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 - return dest; -}; + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } } - }; -} -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - var unpipeInfo = { hasUnpiped: false }; + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; + res.push(codePoint) + i += bytesPerSequence + } - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; + return decodeCodePointsArray(res) +} - if (!dest) dest = state.pipes; +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this, unpipeInfo); - return this; +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() } - // slow case. multiple pipe destinations. + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) - for (var i = 0; i < len; i++) { - dests[i].emit('unpipe', this, unpipeInfo); - }return this; + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) } + return ret +} - // try to find the right one. - var index = indexOf(state.pipes, dest); - if (index === -1) return this; - - state.pipes.splice(index, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) - dest.emit('unpipe', this, unpipeInfo); + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} - return this; -}; +function hexSlice (buf, start, end) { + var len = buf.length -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len - if (ev === 'data') { - // Start flowing on next tick if stream isn't explicitly paused - if (this._readableState.flowing !== false) this.resume(); - } else if (ev === 'readable') { - var state = this._readableState; - if (!state.endEmitted && !state.readableListening) { - state.readableListening = state.needReadable = true; - state.emittedReadable = false; - if (!state.reading) { - pna.nextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this); - } - } + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); + return out } -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } - return this; -}; + return res +} -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - pna.nextTick(resume_, stream, state); +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len } -} -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len } - state.resumeScheduled = false; - state.awaitDrain = 0; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} + if (end < start) end = start -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } } - return this; -}; -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - while (state.flowing && stream.read() !== null) {} -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var _this = this; - - var state = this._readableState; - var paused = false; - - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) _this.push(chunk); - } - - _this.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = _this.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - for (var n = 0; n < kProxyEvents.length; n++) { - stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); - } - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - this._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return this; -}; - -Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._readableState.highWaterMark; - } -}); - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromList(n, state) { - // nothing buffered - if (state.length === 0) return null; - - var ret; - if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { - // read it all, truncate the list - if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); - state.buffer.clear(); - } else { - // read part of list - ret = fromListPartial(n, state.buffer, state.decoder); - } - - return ret; -} - -// Extracts only enough buffered data to satisfy the amount requested. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function fromListPartial(n, list, hasStrings) { - var ret; - if (n < list.head.data.length) { - // slice is the same for buffers and strings - ret = list.head.data.slice(0, n); - list.head.data = list.head.data.slice(n); - } else if (n === list.head.data.length) { - // first chunk is a perfect match - ret = list.shift(); - } else { - // result spans more than one buffer - ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); - } - return ret; -} - -// Copies a specified amount of characters from the list of buffered data -// chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBufferString(n, list) { - var p = list.head; - var c = 1; - var ret = p.data; - n -= ret.length; - while (p = p.next) { - var str = p.data; - var nb = n > str.length ? str.length : n; - if (nb === str.length) ret += str;else ret += str.slice(0, n); - n -= nb; - if (n === 0) { - if (nb === str.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = str.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; + return newBuf } -// Copies a specified amount of bytes from the list of buffered data chunks. -// This function is designed to be inlinable, so please take care when making -// changes to the function body. -function copyFromBuffer(n, list) { - var ret = Buffer.allocUnsafe(n); - var p = list.head; - var c = 1; - p.data.copy(ret); - n -= p.data.length; - while (p = p.next) { - var buf = p.data; - var nb = n > buf.length ? buf.length : n; - buf.copy(ret, ret.length - n, 0, nb); - n -= nb; - if (n === 0) { - if (nb === buf.length) { - ++c; - if (p.next) list.head = p.next;else list.head = list.tail = null; - } else { - list.head = p; - p.data = buf.slice(nb); - } - break; - } - ++c; - } - list.length -= c; - return ret; +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - pna.nextTick(endReadableNT, state, stream); - } -} +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul } -} -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; + return val } -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../../../../process/browser.js */ "../node_modules/process/browser.js"))) - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_transform.js": -/*!**************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_transform.js ***! - \**************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - - - -module.exports = Transform; - -var Duplex = __webpack_require__(/*! ./_stream_duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); - -/*<replacement>*/ -var util = __webpack_require__(/*! core-util-is */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js"); -util.inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js"); -/*</replacement>*/ - -util.inherits(Transform, Duplex); - -function afterTransform(er, data) { - var ts = this._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) { - return this.emit('error', new Error('write callback called multiple times')); - } - - ts.writechunk = null; - ts.writecb = null; - - if (data != null) // single equals check for both `null` and `undefined` - this.push(data); - - cb(er); - - var rs = this._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - this._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = { - afterTransform: afterTransform.bind(this), - needTransform: false, - transforming: false, - writecb: null, - writechunk: null, - writeencoding: null - }; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - // When the writable side finishes, then flush out anything remaining. - this.on('prefinish', prefinish); -} - -function prefinish() { - var _this = this; - - if (typeof this._flush === 'function') { - this._flush(function (er, data) { - done(_this, er, data); - }); - } else { - done(this, null, null); - } -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('_transform() is not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -Transform.prototype._destroy = function (err, cb) { - var _this2 = this; - - Duplex.prototype._destroy.call(this, err, function (err2) { - cb(err2); - _this2.emit('close'); - }); -}; - -function done(stream, er, data) { - if (er) return stream.emit('error', er); - - if (data != null) // single equals check for both `null` and `undefined` - stream.push(data); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); - - if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); - - return stream.push(null); -} - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_writable.js": -/*!*************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_writable.js ***! - \*************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - - - -/*<replacement>*/ - -var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js"); -/*</replacement>*/ - -module.exports = Writable; - -/* <replacement> */ -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - this.finish = function () { - onCorkedFinish(_this, state); - }; -} -/* </replacement> */ - -/*<replacement>*/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; -/*</replacement>*/ - -/*<replacement>*/ -var Duplex; -/*</replacement>*/ - -Writable.WritableState = WritableState; - -/*<replacement>*/ -var util = __webpack_require__(/*! core-util-is */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/core-util-is/lib/util.js"); -util.inherits = __webpack_require__(/*! inherits */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/inherits/inherits_browser.js"); -/*</replacement>*/ - -/*<replacement>*/ -var internalUtil = { - deprecate: __webpack_require__(/*! util-deprecate */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/util-deprecate/browser.js") -}; -/*</replacement>*/ - -/*<replacement>*/ -var Stream = __webpack_require__(/*! ./internal/streams/stream */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/stream-browser.js"); -/*</replacement>*/ - -/*<replacement>*/ - -var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer; -var OurUint8Array = global.Uint8Array || function () {}; -function _uint8ArrayToBuffer(chunk) { - return Buffer.from(chunk); -} -function _isUint8Array(obj) { - return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; -} - -/*</replacement>*/ - -var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/destroy.js"); - -util.inherits(Writable, Stream); - -function nop() {} - -function WritableState(options, stream) { - Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); - - options = options || {}; - - // Duplex streams are both readable and writable, but share - // the same options object. - // However, some cases require setting options to different - // values for the readable and the writable sides of the duplex stream. - // These options can be provided separately as readableXXX and writableXXX. - var isDuplex = stream instanceof Duplex; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var writableHwm = options.writableHighWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - - if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; - - // cast to ints. - this.highWaterMark = Math.floor(this.highWaterMark); - - // if _final has been called - this.finalCalled = false; - - // drain event flag. - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // has it been destroyed - this.destroyed = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // allocate the first CorkedRequest, there is always - // one allocated and free to use, and we maintain at most two - this.corkedRequestsFree = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function getBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') - }); - } catch (_) {} -})(); - -// Test _writableState for inheritance to account for Duplex streams, -// whose prototype chain only points to Readable. -var realHasInstance; -if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { - realHasInstance = Function.prototype[Symbol.hasInstance]; - Object.defineProperty(Writable, Symbol.hasInstance, { - value: function (object) { - if (realHasInstance.call(this, object)) return true; - if (this !== Writable) return false; - - return object && object._writableState instanceof WritableState; - } - }); -} else { - realHasInstance = function (object) { - return object instanceof this; - }; -} - -function Writable(options) { - Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); - - // Writable ctor is applied to Duplexes, too. - // `realHasInstance` is necessary because using plain `instanceof` - // would return false, as no `_writableState` property is attached. - - // Trying to use the custom `instanceof` for Writable here will also break the - // Node.js LazyTransform implementation, which has a non-trivial getter for - // `_writableState` that would lead to infinite recursion. - if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { - return new Writable(options); - } - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - - if (typeof options.destroy === 'function') this._destroy = options.destroy; - - if (typeof options.final === 'function') this._final = options.final; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe, not readable')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - pna.nextTick(cb, er); -} - -// Checks that a user-supplied chunk is valid, especially for the particular -// mode the stream is in. Currently this means that `null` is never accepted -// and undefined/non-string values are only allowed in object mode. -function validChunk(stream, state, chunk, cb) { - var valid = true; - var er = false; - - if (chunk === null) { - er = new TypeError('May not write null values to stream'); - } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - if (er) { - stream.emit('error', er); - pna.nextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - var isBuf = !state.objectMode && _isUint8Array(chunk); - - if (isBuf && !Buffer.isBuffer(chunk)) { - chunk = _uint8ArrayToBuffer(chunk); - } - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; - return this; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = Buffer.from(chunk, encoding); - } - return chunk; -} - -Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { - // making it explicit this property is not enumerable - // because otherwise some prototype manipulation in - // userland will fail - enumerable: false, - get: function () { - return this._writableState.highWaterMark; - } -}); - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { - if (!isBuf) { - var newChunk = decodeChunk(state, chunk, encoding); - if (chunk !== newChunk) { - isBuf = true; - encoding = 'buffer'; - chunk = newChunk; - } - } - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = { - chunk: chunk, - encoding: encoding, - isBuf: isBuf, - callback: cb, - next: null - }; - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - - if (sync) { - // defer the callback if we are being called synchronously - // to avoid piling up things on the stack - pna.nextTick(cb, er); - // this can emit finish, and it will always happen - // after error - pna.nextTick(finishMaybe, stream, state); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - } else { - // the caller expect this to happen before if - // it is async - cb(er); - stream._writableState.errorEmitted = true; - stream.emit('error', er); - // this can emit finish, but finish must - // always follow error - finishMaybe(stream, state); - } -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /*<replacement>*/ - asyncWrite(afterWrite, stream, state, finished, cb); - /*</replacement>*/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - var allBuffers = true; - while (entry) { - buffer[count] = entry; - if (!entry.isBuf) allBuffers = false; - entry = entry.next; - count += 1; - } - buffer.allBuffers = allBuffers; - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is almost always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - if (holder.next) { - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - state.corkedRequestsFree = new CorkedRequest(state); - } - state.bufferedRequestCount = 0; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - state.bufferedRequestCount--; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('_write() is not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} -function callFinal(stream, state) { - stream._final(function (err) { - state.pendingcb--; - if (err) { - stream.emit('error', err); - } - state.prefinished = true; - stream.emit('prefinish'); - finishMaybe(stream, state); - }); -} -function prefinish(stream, state) { - if (!state.prefinished && !state.finalCalled) { - if (typeof stream._final === 'function') { - state.pendingcb++; - state.finalCalled = true; - pna.nextTick(callFinal, stream, state); - } else { - state.prefinished = true; - stream.emit('prefinish'); - } - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - prefinish(stream, state); - if (state.pendingcb === 0) { - state.finished = true; - stream.emit('finish'); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -function onCorkedFinish(corkReq, state, err) { - var entry = corkReq.entry; - corkReq.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = corkReq; - } else { - state.corkedRequestsFree = corkReq; - } -} - -Object.defineProperty(Writable.prototype, 'destroyed', { - get: function () { - if (this._writableState === undefined) { - return false; - } - return this._writableState.destroyed; - }, - set: function (value) { - // we ignore the value if the stream - // has not been initialized yet - if (!this._writableState) { - return; - } - - // backward compatibility, the user is explicitly - // managing destroyed - this._writableState.destroyed = value; - } -}); - -Writable.prototype.destroy = destroyImpl.destroy; -Writable.prototype._undestroy = destroyImpl.undestroy; -Writable.prototype._destroy = function (err, cb) { - this.end(); - cb(err); -}; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../process/browser.js */ "../node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../../timers-browserify/main.js */ "../node_modules/timers-browserify/main.js").setImmediate, __webpack_require__(/*! ./../../../../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/BufferList.js": -/*!************************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/BufferList.js ***! - \************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js").Buffer; -var util = __webpack_require__(/*! util */ 1); - -function copyBuffer(src, target, offset) { - src.copy(target, offset); -} - -module.exports = function () { - function BufferList() { - _classCallCheck(this, BufferList); - - this.head = null; - this.tail = null; - this.length = 0; - } - - BufferList.prototype.push = function push(v) { - var entry = { data: v, next: null }; - if (this.length > 0) this.tail.next = entry;else this.head = entry; - this.tail = entry; - ++this.length; - }; - - BufferList.prototype.unshift = function unshift(v) { - var entry = { data: v, next: this.head }; - if (this.length === 0) this.tail = entry; - this.head = entry; - ++this.length; - }; - - BufferList.prototype.shift = function shift() { - if (this.length === 0) return; - var ret = this.head.data; - if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; - --this.length; - return ret; - }; - - BufferList.prototype.clear = function clear() { - this.head = this.tail = null; - this.length = 0; - }; - - BufferList.prototype.join = function join(s) { - if (this.length === 0) return ''; - var p = this.head; - var ret = '' + p.data; - while (p = p.next) { - ret += s + p.data; - }return ret; - }; - - BufferList.prototype.concat = function concat(n) { - if (this.length === 0) return Buffer.alloc(0); - if (this.length === 1) return this.head.data; - var ret = Buffer.allocUnsafe(n >>> 0); - var p = this.head; - var i = 0; - while (p) { - copyBuffer(p.data, ret, i); - i += p.data.length; - p = p.next; - } - return ret; - }; - - return BufferList; -}(); - -if (util && util.inspect && util.inspect.custom) { - module.exports.prototype[util.inspect.custom] = function () { - var obj = util.inspect({ length: this.length }); - return this.constructor.name + ' ' + obj; - }; -} - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/destroy.js": -/*!*********************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/destroy.js ***! - \*********************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -/*<replacement>*/ - -var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/process-nextick-args/index.js"); -/*</replacement>*/ - -// undocumented cb() API, needed for core, not for public API -function destroy(err, cb) { - var _this = this; - - var readableDestroyed = this._readableState && this._readableState.destroyed; - var writableDestroyed = this._writableState && this._writableState.destroyed; - - if (readableDestroyed || writableDestroyed) { - if (cb) { - cb(err); - } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { - pna.nextTick(emitErrorNT, this, err); - } - return this; - } - - // we set destroyed to true before firing error callbacks in order - // to make it re-entrance safe in case destroy() is called within callbacks - - if (this._readableState) { - this._readableState.destroyed = true; - } - - // if this is a duplex stream mark the writable part as destroyed as well - if (this._writableState) { - this._writableState.destroyed = true; - } - - this._destroy(err || null, function (err) { - if (!cb && err) { - pna.nextTick(emitErrorNT, _this, err); - if (_this._writableState) { - _this._writableState.errorEmitted = true; - } - } else if (cb) { - cb(err); - } - }); - - return this; -} - -function undestroy() { - if (this._readableState) { - this._readableState.destroyed = false; - this._readableState.reading = false; - this._readableState.ended = false; - this._readableState.endEmitted = false; - } - - if (this._writableState) { - this._writableState.destroyed = false; - this._writableState.ended = false; - this._writableState.ending = false; - this._writableState.finished = false; - this._writableState.errorEmitted = false; - } -} - -function emitErrorNT(self, err) { - self.emit('error', err); -} - -module.exports = { - destroy: destroy, - undestroy: undestroy -}; - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/stream-browser.js": -/*!****************************************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! - \****************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(/*! events */ "../node_modules/events/events.js").EventEmitter; - - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/readable-browser.js": -/*!*********************************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/readable-browser.js ***! - \*********************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_readable.js"); -exports.Stream = exports; -exports.Readable = exports; -exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_writable.js"); -exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_duplex.js"); -exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_transform.js"); -exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/readable-stream/lib/_stream_passthrough.js"); - - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js": -/*!******************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/safe-buffer/index.js ***! - \******************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* eslint-disable node/no-deprecated-api */ -var buffer = __webpack_require__(/*! buffer */ "../node_modules/buffer/index.js") -var Buffer = buffer.Buffer - -// alternative to using Object.keys for old browsers -function copyProps (src, dst) { - for (var key in src) { - dst[key] = src[key] - } -} -if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { - module.exports = buffer -} else { - // Copy properties from require('buffer') - copyProps(buffer, exports) - exports.Buffer = SafeBuffer -} - -function SafeBuffer (arg, encodingOrOffset, length) { - return Buffer(arg, encodingOrOffset, length) -} - -// Copy static methods from Buffer -copyProps(Buffer, SafeBuffer) - -SafeBuffer.from = function (arg, encodingOrOffset, length) { - if (typeof arg === 'number') { - throw new TypeError('Argument must not be a number') - } - return Buffer(arg, encodingOrOffset, length) -} - -SafeBuffer.alloc = function (size, fill, encoding) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - var buf = Buffer(size) - if (fill !== undefined) { - if (typeof encoding === 'string') { - buf.fill(fill, encoding) - } else { - buf.fill(fill) - } - } else { - buf.fill(0) - } - return buf -} - -SafeBuffer.allocUnsafe = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return Buffer(size) -} - -SafeBuffer.allocUnsafeSlow = function (size) { - if (typeof size !== 'number') { - throw new TypeError('Argument must be a number') - } - return buffer.SlowBuffer(size) -} - - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/util-deprecate/browser.js": -/*!***********************************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr-protocol-msgpack/node_modules/util-deprecate/browser.js ***! - \***********************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(global) { -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/AbortController.js": -/*!*******************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/AbortController.js ***! - \*******************************************************************/ -/*! exports provided: AbortController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbortController", function() { return AbortController; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController -// We don't actually ever use the API being polyfilled, we always use the polyfill because -// it's a very new API right now. -// Not exported from index. -/** @private */ -var AbortController = /** @class */ (function () { - function AbortController() { - this.isAborted = false; - this.onabort = null; - } - AbortController.prototype.abort = function () { - if (!this.isAborted) { - this.isAborted = true; - if (this.onabort) { - this.onabort(); - } - } - }; - Object.defineProperty(AbortController.prototype, "signal", { - get: function () { - return this; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(AbortController.prototype, "aborted", { - get: function () { - return this.isAborted; - }, - enumerable: true, - configurable: true - }); - return AbortController; -}()); - -//# sourceMappingURL=AbortController.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js": -/*!*********************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js ***! - \*********************************************************************/ -/*! exports provided: DefaultHttpClient */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function() { return DefaultHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./NodeHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js"); -/* harmony import */ var _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./XhrHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); - - - - -/** Default implementation of {@link @aspnet/signalr.HttpClient}. */ -var DefaultHttpClient = /** @class */ (function (_super) { - __extends(DefaultHttpClient, _super); - /** Creates a new instance of the {@link @aspnet/signalr.DefaultHttpClient}, using the provided {@link @aspnet/signalr.ILogger} to log messages. */ - function DefaultHttpClient(logger) { - var _this = _super.call(this) || this; - if (typeof XMLHttpRequest !== "undefined") { - _this.httpClient = new _XhrHttpClient__WEBPACK_IMPORTED_MODULE_3__["XhrHttpClient"](logger); - } - else { - _this.httpClient = new _NodeHttpClient__WEBPACK_IMPORTED_MODULE_2__["NodeHttpClient"](logger); - } - return _this; - } - /** @inheritDoc */ - DefaultHttpClient.prototype.send = function (request) { - // Check that abort was not signaled before calling send - if (request.abortSignal && request.abortSignal.aborted) { - return Promise.reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]()); - } - if (!request.method) { - return Promise.reject(new Error("No method defined.")); - } - if (!request.url) { - return Promise.reject(new Error("No url defined.")); - } - return this.httpClient.send(request); - }; - DefaultHttpClient.prototype.getCookieString = function (url) { - return this.httpClient.getCookieString(url); - }; - return DefaultHttpClient; -}(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])); - -//# sourceMappingURL=DefaultHttpClient.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js": -/*!**************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js ***! - \**************************************************************************/ -/*! exports provided: DefaultReconnectPolicy */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DefaultReconnectPolicy", function() { return DefaultReconnectPolicy; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// 0, 2, 10, 30 second delays before reconnect attempts. -var DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null]; -/** @private */ -var DefaultReconnectPolicy = /** @class */ (function () { - function DefaultReconnectPolicy(retryDelays) { - this.retryDelays = retryDelays !== undefined ? retryDelays.concat([null]) : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS; - } - DefaultReconnectPolicy.prototype.nextRetryDelayInMilliseconds = function (previousRetryCount) { - return this.retryDelays[previousRetryCount]; - }; - return DefaultReconnectPolicy; -}()); - -//# sourceMappingURL=DefaultReconnectPolicy.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/Errors.js": -/*!**********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/Errors.js ***! - \**********************************************************/ -/*! exports provided: HttpError, TimeoutError, AbortError */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpError", function() { return HttpError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return TimeoutError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AbortError", function() { return AbortError; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/** Error thrown when an HTTP request fails. */ -var HttpError = /** @class */ (function (_super) { - __extends(HttpError, _super); - /** Constructs a new instance of {@link @aspnet/signalr.HttpError}. - * - * @param {string} errorMessage A descriptive error message. - * @param {number} statusCode The HTTP status code represented by this error. - */ - function HttpError(errorMessage, statusCode) { - var _newTarget = this.constructor; - var _this = this; - var trueProto = _newTarget.prototype; - _this = _super.call(this, errorMessage) || this; - _this.statusCode = statusCode; - // Workaround issue in Typescript compiler - // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 - _this.__proto__ = trueProto; - return _this; - } - return HttpError; -}(Error)); - -/** Error thrown when a timeout elapses. */ -var TimeoutError = /** @class */ (function (_super) { - __extends(TimeoutError, _super); - /** Constructs a new instance of {@link @aspnet/signalr.TimeoutError}. - * - * @param {string} errorMessage A descriptive error message. - */ - function TimeoutError(errorMessage) { - var _newTarget = this.constructor; - if (errorMessage === void 0) { errorMessage = "A timeout occurred."; } - var _this = this; - var trueProto = _newTarget.prototype; - _this = _super.call(this, errorMessage) || this; - // Workaround issue in Typescript compiler - // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 - _this.__proto__ = trueProto; - return _this; - } - return TimeoutError; -}(Error)); - -/** Error thrown when an action is aborted. */ -var AbortError = /** @class */ (function (_super) { - __extends(AbortError, _super); - /** Constructs a new instance of {@link AbortError}. - * - * @param {string} errorMessage A descriptive error message. - */ - function AbortError(errorMessage) { - var _newTarget = this.constructor; - if (errorMessage === void 0) { errorMessage = "An abort occurred."; } - var _this = this; - var trueProto = _newTarget.prototype; - _this = _super.call(this, errorMessage) || this; - // Workaround issue in Typescript compiler - // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200 - _this.__proto__ = trueProto; - return _this; - } - return AbortError; -}(Error)); - -//# sourceMappingURL=Errors.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js": -/*!*********************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js ***! - \*********************************************************************/ -/*! exports provided: HandshakeProtocol */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HandshakeProtocol", function() { return HandshakeProtocol; }); -/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - - -/** @private */ -var HandshakeProtocol = /** @class */ (function () { - function HandshakeProtocol() { - } - // Handshake request is always JSON - HandshakeProtocol.prototype.writeHandshakeRequest = function (handshakeRequest) { - return _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].write(JSON.stringify(handshakeRequest)); - }; - HandshakeProtocol.prototype.parseHandshakeResponse = function (data) { - var responseMessage; - var messageData; - var remainingData; - if (Object(_Utils__WEBPACK_IMPORTED_MODULE_1__["isArrayBuffer"])(data) || (typeof Buffer !== "undefined" && data instanceof Buffer)) { - // Format is binary but still need to read JSON text from handshake response - var binaryData = new Uint8Array(data); - var separatorIndex = binaryData.indexOf(_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].RecordSeparatorCode); - if (separatorIndex === -1) { - throw new Error("Message is incomplete."); - } - // content before separator is handshake response - // optional content after is additional messages - var responseLength = separatorIndex + 1; - messageData = String.fromCharCode.apply(null, binaryData.slice(0, responseLength)); - remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null; - } - else { - var textData = data; - var separatorIndex = textData.indexOf(_TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].RecordSeparator); - if (separatorIndex === -1) { - throw new Error("Message is incomplete."); - } - // content before separator is handshake response - // optional content after is additional messages - var responseLength = separatorIndex + 1; - messageData = textData.substring(0, responseLength); - remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null; - } - // At this point we should have just the single handshake message - var messages = _TextMessageFormat__WEBPACK_IMPORTED_MODULE_0__["TextMessageFormat"].parse(messageData); - var response = JSON.parse(messages[0]); - if (response.type) { - throw new Error("Expected a handshake response from the server."); - } - responseMessage = response; - // multiple messages could have arrived with handshake - // return additional data to be parsed as usual, or null if all parsed - return [remainingData, responseMessage]; - }; - return HandshakeProtocol; -}()); - -//# sourceMappingURL=HandshakeProtocol.js.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js": -/*!**************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/HttpClient.js ***! - \**************************************************************/ -/*! exports provided: HttpResponse, HttpClient */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpResponse", function() { return HttpResponse; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpClient", function() { return HttpClient; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; -/** Represents an HTTP response. */ -var HttpResponse = /** @class */ (function () { - function HttpResponse(statusCode, statusText, content) { - this.statusCode = statusCode; - this.statusText = statusText; - this.content = content; - } - return HttpResponse; -}()); - -/** Abstraction over an HTTP client. - * - * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms. - */ -var HttpClient = /** @class */ (function () { - function HttpClient() { - } - HttpClient.prototype.get = function (url, options) { - return this.send(__assign({}, options, { method: "GET", url: url })); - }; - HttpClient.prototype.post = function (url, options) { - return this.send(__assign({}, options, { method: "POST", url: url })); - }; - HttpClient.prototype.delete = function (url, options) { - return this.send(__assign({}, options, { method: "DELETE", url: url })); - }; - /** Gets all cookies that apply to the specified URL. - * - * @param url The URL that the cookies are valid for. - * @returns {string} A string containing all the key-value cookie pairs for the specified URL. - */ - // @ts-ignore - HttpClient.prototype.getCookieString = function (url) { - return ""; - }; - return HttpClient; -}()); - -//# sourceMappingURL=HttpClient.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js": -/*!******************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js ***! - \******************************************************************/ -/*! exports provided: HttpConnection, TransportSendQueue */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpConnection", function() { return HttpConnection; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransportSendQueue", function() { return TransportSendQueue; }); -/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LongPollingTransport */ "../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js"); -/* harmony import */ var _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ServerSentEventsTransport */ "../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -/* harmony import */ var _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./WebSocketTransport */ "../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; - - - - - - - -var MAX_REDIRECTS = 100; -var WebSocketModule = null; -var EventSourceModule = null; -if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && "function" !== "undefined") { - // In order to ignore the dynamic require in webpack builds we need to do this magic - // @ts-ignore: TS doesn't know about these names - var requireFunc = true ? require : undefined; - WebSocketModule = requireFunc("ws"); - EventSourceModule = requireFunc("eventsource"); -} -/** @private */ -var HttpConnection = /** @class */ (function () { - function HttpConnection(url, options) { - if (options === void 0) { options = {}; } - this.features = {}; - _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isRequired(url, "url"); - this.logger = Object(_Utils__WEBPACK_IMPORTED_MODULE_5__["createLogger"])(options.logger); - this.baseUrl = this.resolveUrl(url); - options = options || {}; - options.logMessageContent = options.logMessageContent || false; - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof WebSocket !== "undefined" && !options.WebSocket) { - options.WebSocket = WebSocket; - } - else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.WebSocket) { - if (WebSocketModule) { - options.WebSocket = WebSocketModule; - } - } - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && typeof EventSource !== "undefined" && !options.EventSource) { - options.EventSource = EventSource; - } - else if (_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isNode && !options.EventSource) { - if (typeof EventSourceModule !== "undefined") { - options.EventSource = EventSourceModule; - } - } - this.httpClient = options.httpClient || new _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_0__["DefaultHttpClient"](this.logger); - this.connectionState = "Disconnected" /* Disconnected */; - this.connectionStarted = false; - this.options = options; - this.onreceive = null; - this.onclose = null; - } - HttpConnection.prototype.start = function (transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var message, message; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - transferFormat = transferFormat || _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Binary; - _Utils__WEBPACK_IMPORTED_MODULE_5__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"], "transferFormat"); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Starting connection with transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][transferFormat] + "'."); - if (this.connectionState !== "Disconnected" /* Disconnected */) { - return [2 /*return*/, Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))]; - } - this.connectionState = "Connecting " /* Connecting */; - this.startInternalPromise = this.startInternal(transferFormat); - return [4 /*yield*/, this.startInternalPromise]; - case 1: - _a.sent(); - if (!(this.connectionState === "Disconnecting" /* Disconnecting */)) return [3 /*break*/, 3]; - message = "Failed to start the HttpConnection before stop() was called."; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); - // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise. - return [4 /*yield*/, this.stopPromise]; - case 2: - // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise. - _a.sent(); - return [2 /*return*/, Promise.reject(new Error(message))]; - case 3: - if (this.connectionState !== "Connected" /* Connected */) { - message = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!"; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, message); - return [2 /*return*/, Promise.reject(new Error(message))]; - } - _a.label = 4; - case 4: - this.connectionStarted = true; - return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.send = function (data) { - if (this.connectionState !== "Connected" /* Connected */) { - return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")); - } - if (!this.sendQueue) { - this.sendQueue = new TransportSendQueue(this.transport); - } - // Transport will not be null if state is connected - return this.sendQueue.send(data); - }; - HttpConnection.prototype.stop = function (error) { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.connectionState === "Disconnected" /* Disconnected */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnected state."); - return [2 /*return*/, Promise.resolve()]; - } - if (this.connectionState === "Disconnecting" /* Disconnecting */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); - return [2 /*return*/, this.stopPromise]; - } - this.connectionState = "Disconnecting" /* Disconnecting */; - this.stopPromise = new Promise(function (resolve) { - // Don't complete stop() until stopConnection() completes. - _this.stopPromiseResolver = resolve; - }); - // stopInternal should never throw so just observe it. - return [4 /*yield*/, this.stopInternal(error)]; - case 1: - // stopInternal should never throw so just observe it. - _a.sent(); - return [4 /*yield*/, this.stopPromise]; - case 2: - _a.sent(); - return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.stopInternal = function (error) { - return __awaiter(this, void 0, void 0, function () { - var e_1, e_2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // Set error as soon as possible otherwise there is a race between - // the transport closing and providing an error and the error from a close message - // We would prefer the close message error. - this.stopError = error; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.startInternalPromise]; - case 2: - _a.sent(); - return [3 /*break*/, 4]; - case 3: - e_1 = _a.sent(); - return [3 /*break*/, 4]; - case 4: - if (!this.transport) return [3 /*break*/, 9]; - if (this.sendQueue) { - this.sendQueue.stop(); - this.sendQueue = undefined; - } - _a.label = 5; - case 5: - _a.trys.push([5, 7, , 8]); - return [4 /*yield*/, this.transport.stop()]; - case 6: - _a.sent(); - return [3 /*break*/, 8]; - case 7: - e_2 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.transport.stop() threw error '" + e_2 + "'."); - this.stopConnection(); - return [3 /*break*/, 8]; - case 8: - this.transport = undefined; - return [3 /*break*/, 10]; - case 9: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."); - this.stopConnection(); - _a.label = 10; - case 10: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.startInternal = function (transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var url, negotiateResponse, redirects, _loop_1, this_1, e_3; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - url = this.baseUrl; - this.accessTokenFactory = this.options.accessTokenFactory; - _a.label = 1; - case 1: - _a.trys.push([1, 12, , 13]); - if (!this.options.skipNegotiation) return [3 /*break*/, 5]; - if (!(this.options.transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets)) return [3 /*break*/, 3]; - // No need to add a connection ID in this case - this.transport = this.constructTransport(_ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets); - // We should just call connect directly in this case. - // No fallback or negotiate in this case. - return [4 /*yield*/, this.transport.connect(url, transferFormat)]; - case 2: - // We should just call connect directly in this case. - // No fallback or negotiate in this case. - _a.sent(); - return [3 /*break*/, 4]; - case 3: throw new Error("Negotiation can only be skipped when using the WebSocket transport directly."); - case 4: return [3 /*break*/, 11]; - case 5: - negotiateResponse = null; - redirects = 0; - _loop_1 = function () { - var accessToken_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this_1.getNegotiationResponse(url)]; - case 1: - negotiateResponse = _a.sent(); - // the user tries to stop the connection when it is being started - if (this_1.connectionState === "Disconnecting" /* Disconnecting */ || this_1.connectionState === "Disconnected" /* Disconnected */) { - throw new Error("The connection was stopped during negotiation."); - } - if (negotiateResponse.error) { - throw new Error(negotiateResponse.error); - } - if (negotiateResponse.ProtocolVersion) { - throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details."); - } - if (negotiateResponse.url) { - url = negotiateResponse.url; - } - if (negotiateResponse.accessToken) { - accessToken_1 = negotiateResponse.accessToken; - this_1.accessTokenFactory = function () { return accessToken_1; }; - } - redirects++; - return [2 /*return*/]; - } - }); - }; - this_1 = this; - _a.label = 6; - case 6: return [5 /*yield**/, _loop_1()]; - case 7: - _a.sent(); - _a.label = 8; - case 8: - if (negotiateResponse.url && redirects < MAX_REDIRECTS) return [3 /*break*/, 6]; - _a.label = 9; - case 9: - if (redirects === MAX_REDIRECTS && negotiateResponse.url) { - throw new Error("Negotiate redirection limit exceeded."); - } - this.connectionId = negotiateResponse.connectionId; - return [4 /*yield*/, this.createTransport(url, this.options.transport, negotiateResponse, transferFormat)]; - case 10: - _a.sent(); - _a.label = 11; - case 11: - if (this.transport instanceof _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__["LongPollingTransport"]) { - this.features.inherentKeepAlive = true; - } - this.transport.onreceive = this.onreceive; - this.transport.onclose = function (e) { return _this.stopConnection(e); }; - if (this.connectionState === "Connecting " /* Connecting */) { - // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise. - // start() will handle the case when stop was called and startInternal exits still in the disconnecting state. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "The HttpConnection connected successfully."); - this.connectionState = "Connected" /* Connected */; - } - return [3 /*break*/, 13]; - case 12: - e_3 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the connection: " + e_3); - this.connectionState = "Disconnected" /* Disconnected */; - this.transport = undefined; - return [2 /*return*/, Promise.reject(e_3)]; - case 13: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.getNegotiationResponse = function (url) { - return __awaiter(this, void 0, void 0, function () { - var _a, headers, token, negotiateUrl, response, e_4; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!this.accessTokenFactory) return [3 /*break*/, 2]; - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _b.sent(); - if (token) { - headers = (_a = {}, - _a["Authorization"] = "Bearer " + token, - _a); - } - _b.label = 2; - case 2: - negotiateUrl = this.resolveNegotiateUrl(url); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Sending negotiation request: " + negotiateUrl + "."); - _b.label = 3; - case 3: - _b.trys.push([3, 5, , 6]); - return [4 /*yield*/, this.httpClient.post(negotiateUrl, { - content: "", - headers: headers, - })]; - case 4: - response = _b.sent(); - if (response.statusCode !== 200) { - return [2 /*return*/, Promise.reject(new Error("Unexpected status code returned from negotiate " + response.statusCode))]; - } - return [2 /*return*/, JSON.parse(response.content)]; - case 5: - e_4 = _b.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to complete negotiation with the server: " + e_4); - return [2 /*return*/, Promise.reject(e_4)]; - case 6: return [2 /*return*/]; - } - }); - }); - }; - HttpConnection.prototype.createConnectUrl = function (url, connectionId) { - if (!connectionId) { - return url; - } - return url + (url.indexOf("?") === -1 ? "?" : "&") + ("id=" + connectionId); - }; - HttpConnection.prototype.createTransport = function (url, requestedTransport, negotiateResponse, requestedTransferFormat) { - return __awaiter(this, void 0, void 0, function () { - var connectUrl, transportExceptions, transports, _i, transports_1, endpoint, transport, ex_1, message; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId); - if (!this.isITransport(requestedTransport)) return [3 /*break*/, 2]; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Connection was provided an instance of ITransport, using that directly."); - this.transport = requestedTransport; - return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; - case 1: - _a.sent(); - return [2 /*return*/]; - case 2: - transportExceptions = []; - transports = negotiateResponse.availableTransports || []; - _i = 0, transports_1 = transports; - _a.label = 3; - case 3: - if (!(_i < transports_1.length)) return [3 /*break*/, 11]; - endpoint = transports_1[_i]; - _a.label = 4; - case 4: - _a.trys.push([4, 9, , 10]); - transport = this.resolveTransport(endpoint, requestedTransport, requestedTransferFormat); - if (!(typeof transport === "number")) return [3 /*break*/, 8]; - this.transport = this.constructTransport(transport); - if (!!negotiateResponse.connectionId) return [3 /*break*/, 6]; - return [4 /*yield*/, this.getNegotiationResponse(url)]; - case 5: - negotiateResponse = _a.sent(); - connectUrl = this.createConnectUrl(url, negotiateResponse.connectionId); - _a.label = 6; - case 6: return [4 /*yield*/, this.transport.connect(connectUrl, requestedTransferFormat)]; - case 7: - _a.sent(); - return [2 /*return*/]; - case 8: return [3 /*break*/, 10]; - case 9: - ex_1 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Failed to start the transport '" + endpoint.transport + "': " + ex_1); - negotiateResponse.connectionId = undefined; - transportExceptions.push(endpoint.transport + " failed: " + ex_1); - if (this.connectionState !== "Connecting " /* Connecting */) { - message = "Failed to select transport before stop() was called."; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, message); - return [2 /*return*/, Promise.reject(new Error(message))]; - } - return [3 /*break*/, 10]; - case 10: - _i++; - return [3 /*break*/, 3]; - case 11: - if (transportExceptions.length > 0) { - return [2 /*return*/, Promise.reject(new Error("Unable to connect to the server with any of the available transports. " + transportExceptions.join(" ")))]; - } - return [2 /*return*/, Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]; - } - }); - }); - }; - HttpConnection.prototype.constructTransport = function (transport) { - switch (transport) { - case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets: - if (!this.options.WebSocket) { - throw new Error("'WebSocket' is not supported in your environment."); - } - return new _WebSocketTransport__WEBPACK_IMPORTED_MODULE_6__["WebSocketTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.WebSocket); - case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents: - if (!this.options.EventSource) { - throw new Error("'EventSource' is not supported in your environment."); - } - return new _ServerSentEventsTransport__WEBPACK_IMPORTED_MODULE_4__["ServerSentEventsTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false, this.options.EventSource); - case _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].LongPolling: - return new _LongPollingTransport__WEBPACK_IMPORTED_MODULE_3__["LongPollingTransport"](this.httpClient, this.accessTokenFactory, this.logger, this.options.logMessageContent || false); - default: - throw new Error("Unknown transport: " + transport + "."); - } - }; - HttpConnection.prototype.resolveTransport = function (endpoint, requestedTransport, requestedTransferFormat) { - var transport = _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][endpoint.transport]; - if (transport === null || transport === undefined) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + endpoint.transport + "' because it is not supported by this client."); - } - else { - var transferFormats = endpoint.transferFormats.map(function (s) { return _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][s]; }); - if (transportMatches(requestedTransport, transport)) { - if (transferFormats.indexOf(requestedTransferFormat) >= 0) { - if ((transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].WebSockets && !this.options.WebSocket) || - (transport === _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"].ServerSentEvents && !this.options.EventSource)) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it is not supported in your environment.'"); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is not supported in your environment."); - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Selecting transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "'."); - return transport; - } - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it does not support the requested transfer format '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + "'."); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' does not support " + _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"][requestedTransferFormat] + "."); - } - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Skipping transport '" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' because it was disabled by the client."); - throw new Error("'" + _ITransport__WEBPACK_IMPORTED_MODULE_2__["HttpTransportType"][transport] + "' is disabled by the client."); - } - } - return null; - }; - HttpConnection.prototype.isITransport = function (transport) { - return transport && typeof (transport) === "object" && "connect" in transport; - }; - HttpConnection.prototype.stopConnection = function (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "HttpConnection.stopConnection(" + error + ") called while in state " + this.connectionState + "."); - this.transport = undefined; - // If we have a stopError, it takes precedence over the error from the transport - error = this.stopError || error; - this.stopError = undefined; - if (this.connectionState === "Disconnected" /* Disconnected */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Debug, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection is already in the disconnected state."); - return; - } - if (this.connectionState === "Connecting " /* Connecting */) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Warning, "Call to HttpConnection.stopConnection(" + error + ") was ignored because the connection hasn't yet left the in the connecting state."); - return; - } - if (this.connectionState === "Disconnecting" /* Disconnecting */) { - // A call to stop() induced this call to stopConnection and needs to be completed. - // Any stop() awaiters will be scheduled to continue after the onclose callback fires. - this.stopPromiseResolver(); - } - if (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "Connection disconnected with error '" + error + "'."); - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Connection disconnected."); - } - this.connectionId = undefined; - this.connectionState = "Disconnected" /* Disconnected */; - if (this.onclose && this.connectionStarted) { - this.connectionStarted = false; - try { - this.onclose(error); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Error, "HttpConnection.onclose(" + error + ") threw error '" + e + "'."); - } - } - }; - HttpConnection.prototype.resolveUrl = function (url) { - // startsWith is not supported in IE - if (url.lastIndexOf("https://", 0) === 0 || url.lastIndexOf("http://", 0) === 0) { - return url; - } - if (!_Utils__WEBPACK_IMPORTED_MODULE_5__["Platform"].isBrowser || !window.document) { - throw new Error("Cannot resolve '" + url + "'."); - } - // Setting the url to the href propery of an anchor tag handles normalization - // for us. There are 3 main cases. - // 1. Relative path normalization e.g "b" -> "http://localhost:5000/a/b" - // 2. Absolute path normalization e.g "/a/b" -> "http://localhost:5000/a/b" - // 3. Networkpath reference normalization e.g "//localhost:5000/a/b" -> "http://localhost:5000/a/b" - var aTag = window.document.createElement("a"); - aTag.href = url; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Normalizing '" + url + "' to '" + aTag.href + "'."); - return aTag.href; - }; - HttpConnection.prototype.resolveNegotiateUrl = function (url) { - var index = url.indexOf("?"); - var negotiateUrl = url.substring(0, index === -1 ? url.length : index); - if (negotiateUrl[negotiateUrl.length - 1] !== "/") { - negotiateUrl += "/"; - } - negotiateUrl += "negotiate"; - negotiateUrl += index === -1 ? "" : url.substring(index); - return negotiateUrl; - }; - return HttpConnection; -}()); - -function transportMatches(requestedTransport, actualTransport) { - return !requestedTransport || ((actualTransport & requestedTransport) !== 0); -} -var TransportSendQueue = /** @class */ (function () { - function TransportSendQueue(transport) { - this.transport = transport; - this.buffer = []; - this.executing = true; - this.sendBufferedData = new PromiseSource(); - this.transportResult = new PromiseSource(); - // Suppress typescript error about handling Promises. The sendLoop doesn't need to be observed - this.sendLoop().then(function () { }, function (_) { }); - } - TransportSendQueue.prototype.send = function (data) { - this.bufferData(data); - return this.transportResult.promise; - }; - TransportSendQueue.prototype.stop = function () { - this.executing = false; - this.sendBufferedData.resolve(); - }; - TransportSendQueue.prototype.bufferData = function (data) { - if (this.buffer.length && typeof (this.buffer[0]) !== typeof (data)) { - throw new Error("Expected data to be of type " + typeof (this.buffer) + " but was of type " + typeof (data)); - } - this.buffer.push(data); - this.sendBufferedData.resolve(); - }; - TransportSendQueue.prototype.sendLoop = function () { - return __awaiter(this, void 0, void 0, function () { - var transportResult, data, error_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (false) {} - return [4 /*yield*/, this.sendBufferedData.promise]; - case 1: - _a.sent(); - if (!this.executing) { - // Did we stop? - return [3 /*break*/, 6]; - } - this.sendBufferedData = new PromiseSource(); - transportResult = this.transportResult; - this.transportResult = new PromiseSource(); - data = typeof (this.buffer[0]) === "string" ? - this.buffer.join("") : - TransportSendQueue.concatBuffers(this.buffer); - this.buffer.length = 0; - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - return [4 /*yield*/, this.transport.send(data)]; - case 3: - _a.sent(); - transportResult.resolve(); - return [3 /*break*/, 5]; - case 4: - error_1 = _a.sent(); - transportResult.reject(error_1); - return [3 /*break*/, 5]; - case 5: return [3 /*break*/, 0]; - case 6: return [2 /*return*/]; - } - }); - }); - }; - TransportSendQueue.concatBuffers = function (arrayBuffers) { - var totalLength = arrayBuffers.map(function (b) { return b.byteLength; }).reduce(function (a, b) { return a + b; }); - var result = new Uint8Array(totalLength); - var offset = 0; - for (var _i = 0, arrayBuffers_1 = arrayBuffers; _i < arrayBuffers_1.length; _i++) { - var item = arrayBuffers_1[_i]; - result.set(new Uint8Array(item), offset); - offset += item.byteLength; - } - return result; - }; - return TransportSendQueue; -}()); - -var PromiseSource = /** @class */ (function () { - function PromiseSource() { - var _this = this; - this.promise = new Promise(function (resolve, reject) { - var _a; - return _a = [resolve, reject], _this.resolver = _a[0], _this.rejecter = _a[1], _a; - }); - } - PromiseSource.prototype.resolve = function () { - this.resolver(); - }; - PromiseSource.prototype.reject = function (reason) { - this.rejecter(reason); - }; - return PromiseSource; -}()); -//# sourceMappingURL=HttpConnection.js.map - -/***/ }), - -/***/ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js": -/*!*****************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/HubConnection.js ***! - \*****************************************************************/ -/*! exports provided: HubConnectionState, HubConnection */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnectionState", function() { return HubConnectionState; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnection", function() { return HubConnection; }); -/* harmony import */ var _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./HandshakeProtocol */ "../node_modules/@aspnet/signalr/dist/esm/HandshakeProtocol.js"); -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Subject */ "../node_modules/@aspnet/signalr/dist/esm/Subject.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; - - - - - -var DEFAULT_TIMEOUT_IN_MS = 30 * 1000; -var DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000; -/** Describes the current state of the {@link HubConnection} to the server. */ -var HubConnectionState; -(function (HubConnectionState) { - /** The hub connection is disconnected. */ - HubConnectionState["Disconnected"] = "Disconnected"; - /** The hub connection is connecting. */ - HubConnectionState["Connecting"] = "Connecting"; - /** The hub connection is connected. */ - HubConnectionState["Connected"] = "Connected"; - /** The hub connection is disconnecting. */ - HubConnectionState["Disconnecting"] = "Disconnecting"; - /** The hub connection is reconnecting. */ - HubConnectionState["Reconnecting"] = "Reconnecting"; -})(HubConnectionState || (HubConnectionState = {})); -/** Represents a connection to a SignalR Hub. */ -var HubConnection = /** @class */ (function () { - function HubConnection(connection, logger, protocol, reconnectPolicy) { - var _this = this; - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(connection, "connection"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(logger, "logger"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(protocol, "protocol"); - this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS; - this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS; - this.logger = logger; - this.protocol = protocol; - this.connection = connection; - this.reconnectPolicy = reconnectPolicy; - this.handshakeProtocol = new _HandshakeProtocol__WEBPACK_IMPORTED_MODULE_0__["HandshakeProtocol"](); - this.connection.onreceive = function (data) { return _this.processIncomingData(data); }; - this.connection.onclose = function (error) { return _this.connectionClosed(error); }; - this.callbacks = {}; - this.methods = {}; - this.closedCallbacks = []; - this.reconnectingCallbacks = []; - this.reconnectedCallbacks = []; - this.invocationId = 0; - this.receivedHandshakeResponse = false; - this.connectionState = HubConnectionState.Disconnected; - this.connectionStarted = false; - this.cachedPingMessage = this.protocol.writeMessage({ type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Ping }); - } - /** @internal */ - // Using a public static factory method means we can have a private constructor and an _internal_ - // create method that can be used by HubConnectionBuilder. An "internal" constructor would just - // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a - // public parameter-less constructor. - HubConnection.create = function (connection, logger, protocol, reconnectPolicy) { - return new HubConnection(connection, logger, protocol, reconnectPolicy); - }; - Object.defineProperty(HubConnection.prototype, "state", { - /** Indicates the state of the {@link HubConnection} to the server. */ - get: function () { - return this.connectionState; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(HubConnection.prototype, "connectionId", { - /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either - * in the disconnected state or if the negotiation step was skipped. - */ - get: function () { - return this.connection ? (this.connection.connectionId || null) : null; - }, - enumerable: true, - configurable: true - }); - /** Starts the connection. - * - * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error. - */ - HubConnection.prototype.start = function () { - this.startPromise = this.startWithStateTransitions(); - return this.startPromise; - }; - HubConnection.prototype.startWithStateTransitions = function () { - return __awaiter(this, void 0, void 0, function () { - var e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.connectionState !== HubConnectionState.Disconnected) { - return [2 /*return*/, Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))]; - } - this.connectionState = HubConnectionState.Connecting; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Starting HubConnection."); - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.startInternal()]; - case 2: - _a.sent(); - this.connectionState = HubConnectionState.Connected; - this.connectionStarted = true; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection connected successfully."); - return [3 /*break*/, 4]; - case 3: - e_1 = _a.sent(); - this.connectionState = HubConnectionState.Disconnected; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection failed to start successfully because of error '" + e_1 + "'."); - return [2 /*return*/, Promise.reject(e_1)]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.startInternal = function () { - return __awaiter(this, void 0, void 0, function () { - var handshakePromise, handshakeRequest, e_2; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.stopDuringStartError = undefined; - this.receivedHandshakeResponse = false; - handshakePromise = new Promise(function (resolve, reject) { - _this.handshakeResolver = resolve; - _this.handshakeRejecter = reject; - }); - return [4 /*yield*/, this.connection.start(this.protocol.transferFormat)]; - case 1: - _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 5, , 7]); - handshakeRequest = { - protocol: this.protocol.name, - version: this.protocol.version, - }; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Sending handshake request."); - return [4 /*yield*/, this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(handshakeRequest))]; - case 3: - _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Using HubProtocol '" + this.protocol.name + "'."); - // defensively cleanup timeout in case we receive a message from the server before we finish start - this.cleanupTimeout(); - this.resetTimeoutPeriod(); - this.resetKeepAliveInterval(); - return [4 /*yield*/, handshakePromise]; - case 4: - _a.sent(); - // It's important to check the stopDuringStartError instead of just relying on the handshakePromise - // being rejected on close, because this continuation can run after both the handshake completed successfully - // and the connection was closed. - if (this.stopDuringStartError) { - // It's important to throw instead of returning a rejected promise, because we don't want to allow any state - // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise - // will cause the calling continuation to get scheduled to run later. - throw this.stopDuringStartError; - } - return [3 /*break*/, 7]; - case 5: - e_2 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Hub handshake failed with error '" + e_2 + "' during start(). Stopping HubConnection."); - this.cleanupTimeout(); - this.cleanupPingTimer(); - // HttpConnection.stop() should not complete until after the onclose callback is invoked. - // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes. - return [4 /*yield*/, this.connection.stop(e_2)]; - case 6: - // HttpConnection.stop() should not complete until after the onclose callback is invoked. - // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes. - _a.sent(); - throw e_2; - case 7: return [2 /*return*/]; - } - }); - }); - }; - /** Stops the connection. - * - * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error. - */ - HubConnection.prototype.stop = function () { - return __awaiter(this, void 0, void 0, function () { - var startPromise, e_3; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - startPromise = this.startPromise; - this.stopPromise = this.stopInternal(); - return [4 /*yield*/, this.stopPromise]; - case 1: - _a.sent(); - _a.label = 2; - case 2: - _a.trys.push([2, 4, , 5]); - // Awaiting undefined continues immediately - return [4 /*yield*/, startPromise]; - case 3: - // Awaiting undefined continues immediately - _a.sent(); - return [3 /*break*/, 5]; - case 4: - e_3 = _a.sent(); - return [3 /*break*/, 5]; - case 5: return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.stopInternal = function (error) { - if (this.connectionState === HubConnectionState.Disconnected) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HubConnection.stop(" + error + ") ignored because it is already in the disconnected state."); - return Promise.resolve(); - } - if (this.connectionState === HubConnectionState.Disconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Call to HttpConnection.stop(" + error + ") ignored because the connection is already in the disconnecting state."); - return this.stopPromise; - } - this.connectionState = HubConnectionState.Disconnecting; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Stopping HubConnection."); - if (this.reconnectDelayHandle) { - // We're in a reconnect delay which means the underlying connection is currently already stopped. - // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and - // fire the onclose callbacks. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection stopped during reconnect delay. Done reconnecting."); - clearTimeout(this.reconnectDelayHandle); - this.reconnectDelayHandle = undefined; - this.completeClose(); - return Promise.resolve(); - } - this.cleanupTimeout(); - this.cleanupPingTimer(); - this.stopDuringStartError = error || new Error("The connection was stopped before the hub handshake could complete."); - // HttpConnection.stop() should not complete until after either HttpConnection.start() fails - // or the onclose callback is invoked. The onclose callback will transition the HubConnection - // to the disconnected state if need be before HttpConnection.stop() completes. - return this.connection.stop(error); - }; - /** Invokes a streaming hub method on the server using the specified name and arguments. - * - * @typeparam T The type of the items returned by the server. - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {IStreamResult<T>} An object that yields results from the server as they are received. - */ - HubConnection.prototype.stream = function (methodName) { - var _this = this; - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var invocationDescriptor = this.createStreamInvocation(methodName, args, streamIds); - var promiseQueue; - var subject = new _Subject__WEBPACK_IMPORTED_MODULE_3__["Subject"](); - subject.cancelCallback = function () { - var cancelInvocation = _this.createCancelInvocation(invocationDescriptor.invocationId); - delete _this.callbacks[invocationDescriptor.invocationId]; - return promiseQueue.then(function () { - return _this.sendWithProtocol(cancelInvocation); - }); - }; - this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { - if (error) { - subject.error(error); - return; - } - else if (invocationEvent) { - // invocationEvent will not be null when an error is not passed to the callback - if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { - if (invocationEvent.error) { - subject.error(new Error(invocationEvent.error)); - } - else { - subject.complete(); - } - } - else { - subject.next((invocationEvent.item)); - } - } - }; - promiseQueue = this.sendWithProtocol(invocationDescriptor) - .catch(function (e) { - subject.error(e); - delete _this.callbacks[invocationDescriptor.invocationId]; - }); - this.launchStreams(streams, promiseQueue); - return subject; - }; - HubConnection.prototype.sendMessage = function (message) { - this.resetKeepAliveInterval(); - return this.connection.send(message); - }; - /** - * Sends a js object to the server. - * @param message The js object to serialize and send. - */ - HubConnection.prototype.sendWithProtocol = function (message) { - return this.sendMessage(this.protocol.writeMessage(message)); - }; - /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver. - * - * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still - * be processing the invocation. - * - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error. - */ - HubConnection.prototype.send = function (methodName) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var sendPromise = this.sendWithProtocol(this.createInvocation(methodName, args, true, streamIds)); - this.launchStreams(streams, sendPromise); - return sendPromise; - }; - /** Invokes a hub method on the server using the specified name and arguments. - * - * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise - * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of - * resolving the Promise. - * - * @typeparam T The expected return type. - * @param {string} methodName The name of the server method to invoke. - * @param {any[]} args The arguments used to invoke the server method. - * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error. - */ - HubConnection.prototype.invoke = function (methodName) { - var _this = this; - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - var _a = this.replaceStreamingParams(args), streams = _a[0], streamIds = _a[1]; - var invocationDescriptor = this.createInvocation(methodName, args, false, streamIds); - var p = new Promise(function (resolve, reject) { - // invocationId will always have a value for a non-blocking invocation - _this.callbacks[invocationDescriptor.invocationId] = function (invocationEvent, error) { - if (error) { - reject(error); - return; - } - else if (invocationEvent) { - // invocationEvent will not be null when an error is not passed to the callback - if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { - if (invocationEvent.error) { - reject(new Error(invocationEvent.error)); - } - else { - resolve(invocationEvent.result); - } - } - else { - reject(new Error("Unexpected message type: " + invocationEvent.type)); - } - } - }; - var promiseQueue = _this.sendWithProtocol(invocationDescriptor) - .catch(function (e) { - reject(e); - // invocationId will always have a value for a non-blocking invocation - delete _this.callbacks[invocationDescriptor.invocationId]; - }); - _this.launchStreams(streams, promiseQueue); - }); - return p; - }; - /** Registers a handler that will be invoked when the hub method with the specified method name is invoked. - * - * @param {string} methodName The name of the hub method to define. - * @param {Function} newMethod The handler that will be raised when the hub method is invoked. - */ - HubConnection.prototype.on = function (methodName, newMethod) { - if (!methodName || !newMethod) { - return; - } - methodName = methodName.toLowerCase(); - if (!this.methods[methodName]) { - this.methods[methodName] = []; - } - // Preventing adding the same handler multiple times. - if (this.methods[methodName].indexOf(newMethod) !== -1) { - return; - } - this.methods[methodName].push(newMethod); - }; - HubConnection.prototype.off = function (methodName, method) { - if (!methodName) { - return; - } - methodName = methodName.toLowerCase(); - var handlers = this.methods[methodName]; - if (!handlers) { - return; - } - if (method) { - var removeIdx = handlers.indexOf(method); - if (removeIdx !== -1) { - handlers.splice(removeIdx, 1); - if (handlers.length === 0) { - delete this.methods[methodName]; - } - } - } - else { - delete this.methods[methodName]; - } - }; - /** Registers a handler that will be invoked when the connection is closed. - * - * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any). - */ - HubConnection.prototype.onclose = function (callback) { - if (callback) { - this.closedCallbacks.push(callback); - } - }; - /** Registers a handler that will be invoked when the connection starts reconnecting. - * - * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any). - */ - HubConnection.prototype.onreconnecting = function (callback) { - if (callback) { - this.reconnectingCallbacks.push(callback); - } - }; - /** Registers a handler that will be invoked when the connection successfully reconnects. - * - * @param {Function} callback The handler that will be invoked when the connection successfully reconnects. - */ - HubConnection.prototype.onreconnected = function (callback) { - if (callback) { - this.reconnectedCallbacks.push(callback); - } - }; - HubConnection.prototype.processIncomingData = function (data) { - this.cleanupTimeout(); - if (!this.receivedHandshakeResponse) { - data = this.processHandshakeResponse(data); - this.receivedHandshakeResponse = true; - } - // Data may have all been read when processing handshake response - if (data) { - // Parse the messages - var messages = this.protocol.parseMessages(data, this.logger); - for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { - var message = messages_1[_i]; - switch (message.type) { - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation: - this.invokeClientMethod(message); - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem: - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion: - var callback = this.callbacks[message.invocationId]; - if (callback) { - if (message.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion) { - delete this.callbacks[message.invocationId]; - } - callback(message); - } - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Ping: - // Don't care about pings - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Close: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Close message received from server."); - // We don't want to wait on the stop itself. - this.stopPromise = this.stopInternal(message.error ? new Error("Server returned an error on close: " + message.error) : undefined); - break; - default: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Invalid message type: " + message.type + "."); - break; - } - } - } - this.resetTimeoutPeriod(); - }; - HubConnection.prototype.processHandshakeResponse = function (data) { - var _a; - var responseMessage; - var remainingData; - try { - _a = this.handshakeProtocol.parseHandshakeResponse(data), remainingData = _a[0], responseMessage = _a[1]; - } - catch (e) { - var message = "Error parsing handshake response: " + e; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); - var error = new Error(message); - this.handshakeRejecter(error); - throw error; - } - if (responseMessage.error) { - var message = "Server returned handshake error: " + responseMessage.error; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); - var error = new Error(message); - this.handshakeRejecter(error); - throw error; - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Server handshake complete."); - } - this.handshakeResolver(); - return remainingData; - }; - HubConnection.prototype.resetKeepAliveInterval = function () { - var _this = this; - this.cleanupPingTimer(); - this.pingServerHandle = setTimeout(function () { return __awaiter(_this, void 0, void 0, function () { - var _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!(this.connectionState === HubConnectionState.Connected)) return [3 /*break*/, 4]; - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.sendMessage(this.cachedPingMessage)]; - case 2: - _b.sent(); - return [3 /*break*/, 4]; - case 3: - _a = _b.sent(); - // We don't care about the error. It should be seen elsewhere in the client. - // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering - this.cleanupPingTimer(); - return [3 /*break*/, 4]; - case 4: return [2 /*return*/]; - } - }); - }); }, this.keepAliveIntervalInMilliseconds); - }; - HubConnection.prototype.resetTimeoutPeriod = function () { - var _this = this; - if (!this.connection.features || !this.connection.features.inherentKeepAlive) { - // Set the timeout timer - this.timeoutHandle = setTimeout(function () { return _this.serverTimeout(); }, this.serverTimeoutInMilliseconds); - } - }; - HubConnection.prototype.serverTimeout = function () { - // The server hasn't talked to us in a while. It doesn't like us anymore ... :( - // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting. - // tslint:disable-next-line:no-floating-promises - this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server.")); - }; - HubConnection.prototype.invokeClientMethod = function (invocationMessage) { - var _this = this; - var methods = this.methods[invocationMessage.target.toLowerCase()]; - if (methods) { - try { - methods.forEach(function (m) { return m.apply(_this, invocationMessage.arguments); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "A callback for the method " + invocationMessage.target.toLowerCase() + " threw error '" + e + "'."); - } - if (invocationMessage.invocationId) { - // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response. - var message = "Server requested a response, which is not supported in this version of the client."; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, message); - // We don't want to wait on the stop itself. - this.stopPromise = this.stopInternal(new Error(message)); - } - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "No client method with the name '" + invocationMessage.target + "' found."); - } - }; - HubConnection.prototype.connectionClosed = function (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "HubConnection.connectionClosed(" + error + ") called while in state " + this.connectionState + "."); - // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet. - this.stopDuringStartError = this.stopDuringStartError || error || new Error("The underlying connection was closed before the hub handshake could complete."); - // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it. - // If it has already completed, this should just noop. - if (this.handshakeResolver) { - this.handshakeResolver(); - } - this.cancelCallbacksWithError(error || new Error("Invocation canceled due to the underlying connection being closed.")); - this.cleanupTimeout(); - this.cleanupPingTimer(); - if (this.connectionState === HubConnectionState.Disconnecting) { - this.completeClose(error); - } - else if (this.connectionState === HubConnectionState.Connected && this.reconnectPolicy) { - // tslint:disable-next-line:no-floating-promises - this.reconnect(error); - } - else if (this.connectionState === HubConnectionState.Connected) { - this.completeClose(error); - } - // If none of the above if conditions were true were called the HubConnection must be in either: - // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it. - // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt - // and potentially continue the reconnect() loop. - // 3. The Disconnected state in which case we're already done. - }; - HubConnection.prototype.completeClose = function (error) { - var _this = this; - if (this.connectionStarted) { - this.connectionState = HubConnectionState.Disconnected; - this.connectionStarted = false; - try { - this.closedCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onclose callback called with error '" + error + "' threw error '" + e + "'."); - } - } - }; - HubConnection.prototype.reconnect = function (error) { - return __awaiter(this, void 0, void 0, function () { - var reconnectStartTime, previousReconnectAttempts, nextRetryDelay, e_4; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - reconnectStartTime = Date.now(); - previousReconnectAttempts = 0; - nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, 0); - if (nextRetryDelay === null) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection not reconnecting because the IReconnectPolicy returned null on the first reconnect attempt."); - this.completeClose(error); - return [2 /*return*/]; - } - this.connectionState = HubConnectionState.Reconnecting; - if (error) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting because of error '" + error + "'."); - } - else { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Connection reconnecting."); - } - if (this.onreconnecting) { - try { - this.reconnectingCallbacks.forEach(function (c) { return c.apply(_this, [error]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnecting callback called with error '" + error + "' threw error '" + e + "'."); - } - // Exit early if an onreconnecting callback called connection.stop(). - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state in onreconnecting callback. Done reconnecting."); - return [2 /*return*/]; - } - } - _a.label = 1; - case 1: - if (!(nextRetryDelay !== null)) return [3 /*break*/, 7]; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt number " + previousReconnectAttempts + " will start in " + nextRetryDelay + " ms."); - return [4 /*yield*/, new Promise(function (resolve) { - _this.reconnectDelayHandle = setTimeout(resolve, nextRetryDelay); - })]; - case 2: - _a.sent(); - this.reconnectDelayHandle = undefined; - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect delay. Done reconnecting."); - return [2 /*return*/]; - } - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); - return [4 /*yield*/, this.startInternal()]; - case 4: - _a.sent(); - this.connectionState = HubConnectionState.Connected; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "HubConnection reconnected successfully."); - if (this.onreconnected) { - try { - this.reconnectedCallbacks.forEach(function (c) { return c.apply(_this, [_this.connection.connectionId]); }); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "An onreconnected callback called with connectionId '" + this.connection.connectionId + "; threw error '" + e + "'."); - } - } - return [2 /*return*/]; - case 5: - e_4 = _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect attempt failed because of error '" + e_4 + "'."); - if (this.connectionState !== HubConnectionState.Reconnecting) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Debug, "Connection left the reconnecting state during reconnect attempt. Done reconnecting."); - return [2 /*return*/]; - } - return [3 /*break*/, 6]; - case 6: - nextRetryDelay = this.getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime); - return [3 /*break*/, 1]; - case 7: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "Reconnect retries have been exhausted after " + (Date.now() - reconnectStartTime) + " ms and " + previousReconnectAttempts + " failed attempts. Connection disconnecting."); - this.completeClose(); - return [2 /*return*/]; - } - }); - }); - }; - HubConnection.prototype.getNextRetryDelay = function (previousRetryCount, elapsedMilliseconds) { - try { - return this.reconnectPolicy.nextRetryDelayInMilliseconds(previousRetryCount, elapsedMilliseconds); - } - catch (e) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "IReconnectPolicy.nextRetryDelayInMilliseconds(" + previousRetryCount + ", " + elapsedMilliseconds + ") threw error '" + e + "'."); - return null; - } - }; - HubConnection.prototype.cancelCallbacksWithError = function (error) { - var callbacks = this.callbacks; - this.callbacks = {}; - Object.keys(callbacks) - .forEach(function (key) { - var callback = callbacks[key]; - callback(null, error); - }); - }; - HubConnection.prototype.cleanupPingTimer = function () { - if (this.pingServerHandle) { - clearTimeout(this.pingServerHandle); - } - }; - HubConnection.prototype.cleanupTimeout = function () { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - } - }; - HubConnection.prototype.createInvocation = function (methodName, args, nonblocking, streamIds) { - if (nonblocking) { - return { - arguments: args, - streamIds: streamIds, - target: methodName, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation, - }; - } - else { - var invocationId = this.invocationId; - this.invocationId++; - return { - arguments: args, - invocationId: invocationId.toString(), - streamIds: streamIds, - target: methodName, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Invocation, - }; - } - }; - HubConnection.prototype.launchStreams = function (streams, promiseQueue) { - var _this = this; - if (streams.length === 0) { - return; - } - // Synchronize stream data so they arrive in-order on the server - if (!promiseQueue) { - promiseQueue = Promise.resolve(); - } - var _loop_1 = function (streamId) { - streams[streamId].subscribe({ - complete: function () { - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId)); }); - }, - error: function (err) { - var message; - if (err instanceof Error) { - message = err.message; - } - else if (err && err.toString) { - message = err.toString(); - } - else { - message = "Unknown error"; - } - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createCompletionMessage(streamId, message)); }); - }, - next: function (item) { - promiseQueue = promiseQueue.then(function () { return _this.sendWithProtocol(_this.createStreamItemMessage(streamId, item)); }); - }, - }); - }; - // We want to iterate over the keys, since the keys are the stream ids - // tslint:disable-next-line:forin - for (var streamId in streams) { - _loop_1(streamId); - } - }; - HubConnection.prototype.replaceStreamingParams = function (args) { - var streams = []; - var streamIds = []; - for (var i = 0; i < args.length; i++) { - var argument = args[i]; - if (this.isObservable(argument)) { - var streamId = this.invocationId; - this.invocationId++; - // Store the stream for later use - streams[streamId] = argument; - streamIds.push(streamId.toString()); - // remove stream from args - args.splice(i, 1); - } - } - return [streams, streamIds]; - }; - HubConnection.prototype.isObservable = function (arg) { - // This allows other stream implementations to just work (like rxjs) - return arg && arg.subscribe && typeof arg.subscribe === "function"; - }; - HubConnection.prototype.createStreamInvocation = function (methodName, args, streamIds) { - var invocationId = this.invocationId; - this.invocationId++; - return { - arguments: args, - invocationId: invocationId.toString(), - streamIds: streamIds, - target: methodName, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamInvocation, - }; - }; - HubConnection.prototype.createCancelInvocation = function (id) { - return { - invocationId: id, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].CancelInvocation, - }; - }; - HubConnection.prototype.createStreamItemMessage = function (id, item) { - return { - invocationId: id, - item: item, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].StreamItem, - }; - }; - HubConnection.prototype.createCompletionMessage = function (id, error, result) { - if (error) { - return { - error: error, - invocationId: id, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion, - }; - } - return { - invocationId: id, - result: result, - type: _IHubProtocol__WEBPACK_IMPORTED_MODULE_1__["MessageType"].Completion, - }; - }; - return HubConnection; -}()); -//# sourceMappingURL=HubConnection.js.map +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } -/***/ }), + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } -/***/ "../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js": -/*!************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js ***! - \************************************************************************/ -/*! exports provided: HubConnectionBuilder */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + return val +} -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function() { return HubConnectionBuilder; }); -/* harmony import */ var _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultReconnectPolicy */ "../node_modules/@aspnet/signalr/dist/esm/DefaultReconnectPolicy.js"); -/* harmony import */ var _HttpConnection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpConnection */ "../node_modules/@aspnet/signalr/dist/esm/HttpConnection.js"); -/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; -}; +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} -// tslint:disable:object-literal-sort-keys -var LogLevelNameMapping = { - trace: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Trace, - debug: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Debug, - info: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, - information: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Information, - warn: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, - warning: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Warning, - error: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Error, - critical: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].Critical, - none: _ILogger__WEBPACK_IMPORTED_MODULE_3__["LogLevel"].None, -}; -function parseLogLevel(name) { - // Case-insensitive matching via lower-casing - // Yes, I know case-folding is a complicated problem in Unicode, but we only support - // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse. - var mapping = LogLevelNameMapping[name.toLowerCase()]; - if (typeof mapping !== "undefined") { - return mapping; - } - else { - throw new Error("Unknown log level: " + name); - } +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val } -/** A builder for configuring {@link @aspnet/signalr.HubConnection} instances. */ -var HubConnectionBuilder = /** @class */ (function () { - function HubConnectionBuilder() { - } - HubConnectionBuilder.prototype.configureLogging = function (logging) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(logging, "logging"); - if (isLogger(logging)) { - this.logger = logging; - } - else if (typeof logging === "string") { - var logLevel = parseLogLevel(logging); - this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logLevel); - } - else { - this.logger = new _Utils__WEBPACK_IMPORTED_MODULE_6__["ConsoleLogger"](logging); - } - return this; - }; - HubConnectionBuilder.prototype.withUrl = function (url, transportTypeOrOptions) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(url, "url"); - this.url = url; - // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed - // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called. - if (typeof transportTypeOrOptions === "object") { - this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, transportTypeOrOptions); - } - else { - this.httpConnectionOptions = __assign({}, this.httpConnectionOptions, { transport: transportTypeOrOptions }); - } - return this; - }; - /** Configures the {@link @aspnet/signalr.HubConnection} to use the specified Hub Protocol. - * - * @param {IHubProtocol} protocol The {@link @aspnet/signalr.IHubProtocol} implementation to use. - */ - HubConnectionBuilder.prototype.withHubProtocol = function (protocol) { - _Utils__WEBPACK_IMPORTED_MODULE_6__["Arg"].isRequired(protocol, "protocol"); - this.protocol = protocol; - return this; - }; - HubConnectionBuilder.prototype.withAutomaticReconnect = function (retryDelaysOrReconnectPolicy) { - if (this.reconnectPolicy) { - throw new Error("A reconnectPolicy has already been set."); - } - if (!retryDelaysOrReconnectPolicy) { - this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"](); - } - else if (Array.isArray(retryDelaysOrReconnectPolicy)) { - this.reconnectPolicy = new _DefaultReconnectPolicy__WEBPACK_IMPORTED_MODULE_0__["DefaultReconnectPolicy"](retryDelaysOrReconnectPolicy); - } - else { - this.reconnectPolicy = retryDelaysOrReconnectPolicy; - } - return this; - }; - /** Creates a {@link @aspnet/signalr.HubConnection} from the configuration options specified in this builder. - * - * @returns {HubConnection} The configured {@link @aspnet/signalr.HubConnection}. - */ - HubConnectionBuilder.prototype.build = function () { - // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one - // provided to configureLogger - var httpConnectionOptions = this.httpConnectionOptions || {}; - // If it's 'null', the user **explicitly** asked for null, don't mess with it. - if (httpConnectionOptions.logger === undefined) { - // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it. - httpConnectionOptions.logger = this.logger; - } - // Now create the connection - if (!this.url) { - throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection."); - } - var connection = new _HttpConnection__WEBPACK_IMPORTED_MODULE_1__["HttpConnection"](this.url, httpConnectionOptions); - return _HubConnection__WEBPACK_IMPORTED_MODULE_2__["HubConnection"].create(connection, this.logger || _Loggers__WEBPACK_IMPORTED_MODULE_5__["NullLogger"].instance, this.protocol || new _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_4__["JsonHubProtocol"](), this.reconnectPolicy); - }; - return HubConnectionBuilder; -}()); -function isLogger(logger) { - return logger.log !== undefined; +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val } -//# sourceMappingURL=HubConnectionBuilder.js.map -/***/ }), +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} -/***/ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js": -/*!****************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js ***! - \****************************************************************/ -/*! exports provided: MessageType */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MessageType", function() { return MessageType; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -/** Defines the type of a Hub Message. */ -var MessageType; -(function (MessageType) { - /** Indicates the message is an Invocation message and implements the {@link @aspnet/signalr.InvocationMessage} interface. */ - MessageType[MessageType["Invocation"] = 1] = "Invocation"; - /** Indicates the message is a StreamItem message and implements the {@link @aspnet/signalr.StreamItemMessage} interface. */ - MessageType[MessageType["StreamItem"] = 2] = "StreamItem"; - /** Indicates the message is a Completion message and implements the {@link @aspnet/signalr.CompletionMessage} interface. */ - MessageType[MessageType["Completion"] = 3] = "Completion"; - /** Indicates the message is a Stream Invocation message and implements the {@link @aspnet/signalr.StreamInvocationMessage} interface. */ - MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation"; - /** Indicates the message is a Cancel Invocation message and implements the {@link @aspnet/signalr.CancelInvocationMessage} interface. */ - MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation"; - /** Indicates the message is a Ping message and implements the {@link @aspnet/signalr.PingMessage} interface. */ - MessageType[MessageType["Ping"] = 6] = "Ping"; - /** Indicates the message is a Close message and implements the {@link @aspnet/signalr.CloseMessage} interface. */ - MessageType[MessageType["Close"] = 7] = "Close"; -})(MessageType || (MessageType = {})); -//# sourceMappingURL=IHubProtocol.js.map +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} -/***/ }), +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -/***/ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js": -/*!***********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/ILogger.js ***! - \***********************************************************/ -/*! exports provided: LogLevel */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LogLevel", function() { return LogLevel; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here. -/** Indicates the severity of a log message. - * - * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc. - */ -var LogLevel; -(function (LogLevel) { - /** Log level for very low severity diagnostic messages. */ - LogLevel[LogLevel["Trace"] = 0] = "Trace"; - /** Log level for low severity diagnostic messages. */ - LogLevel[LogLevel["Debug"] = 1] = "Debug"; - /** Log level for informational diagnostic messages. */ - LogLevel[LogLevel["Information"] = 2] = "Information"; - /** Log level for diagnostic messages that indicate a non-fatal problem. */ - LogLevel[LogLevel["Warning"] = 3] = "Warning"; - /** Log level for diagnostic messages that indicate a failure in the current operation. */ - LogLevel[LogLevel["Error"] = 4] = "Error"; - /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */ - LogLevel[LogLevel["Critical"] = 5] = "Critical"; - /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */ - LogLevel[LogLevel["None"] = 6] = "None"; -})(LogLevel || (LogLevel = {})); -//# sourceMappingURL=ILogger.js.map +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} -/***/ }), +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} -/***/ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js": -/*!**************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/ITransport.js ***! - \**************************************************************/ -/*! exports provided: HttpTransportType, TransferFormat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HttpTransportType", function() { return HttpTransportType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TransferFormat", function() { return TransferFormat; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// This will be treated as a bit flag in the future, so we keep it using power-of-two values. -/** Specifies a specific HTTP transport type. */ -var HttpTransportType; -(function (HttpTransportType) { - /** Specifies no transport preference. */ - HttpTransportType[HttpTransportType["None"] = 0] = "None"; - /** Specifies the WebSockets transport. */ - HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets"; - /** Specifies the Server-Sent Events transport. */ - HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents"; - /** Specifies the Long Polling transport. */ - HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling"; -})(HttpTransportType || (HttpTransportType = {})); -/** Specifies the transfer format for a connection. */ -var TransferFormat; -(function (TransferFormat) { - /** Specifies that only text data will be transmitted over the connection. */ - TransferFormat[TransferFormat["Text"] = 1] = "Text"; - /** Specifies that binary data will be transmitted over the connection. */ - TransferFormat[TransferFormat["Binary"] = 2] = "Binary"; -})(TransferFormat || (TransferFormat = {})); -//# sourceMappingURL=ITransport.js.map +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} -/***/ }), +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} -/***/ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js": -/*!*******************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js ***! - \*******************************************************************/ -/*! exports provided: JsonHubProtocol */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function() { return JsonHubProtocol; }); -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -/* harmony import */ var _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TextMessageFormat */ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + return offset + byteLength +} +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + return offset + byteLength +} -var JSON_HUB_PROTOCOL_NAME = "json"; -/** Implements the JSON Hub Protocol. */ -var JsonHubProtocol = /** @class */ (function () { - function JsonHubProtocol() { - /** @inheritDoc */ - this.name = JSON_HUB_PROTOCOL_NAME; - /** @inheritDoc */ - this.version = 1; - /** @inheritDoc */ - this.transferFormat = _ITransport__WEBPACK_IMPORTED_MODULE_2__["TransferFormat"].Text; - } - /** Creates an array of {@link @aspnet/signalr.HubMessage} objects from the specified serialized representation. - * - * @param {string} input A string containing the serialized representation. - * @param {ILogger} logger A logger that will be used to log messages that occur during parsing. - */ - JsonHubProtocol.prototype.parseMessages = function (input, logger) { - // The interface does allow "ArrayBuffer" to be passed in, but this implementation does not. So let's throw a useful error. - if (typeof input !== "string") { - throw new Error("Invalid input for JSON hub protocol. Expected a string."); - } - if (!input) { - return []; - } - if (logger === null) { - logger = _Loggers__WEBPACK_IMPORTED_MODULE_3__["NullLogger"].instance; - } - // Parse the messages - var messages = _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__["TextMessageFormat"].parse(input); - var hubMessages = []; - for (var _i = 0, messages_1 = messages; _i < messages_1.length; _i++) { - var message = messages_1[_i]; - var parsedMessage = JSON.parse(message); - if (typeof parsedMessage.type !== "number") { - throw new Error("Invalid payload."); - } - switch (parsedMessage.type) { - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Invocation: - this.isInvocationMessage(parsedMessage); - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].StreamItem: - this.isStreamItemMessage(parsedMessage); - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Completion: - this.isCompletionMessage(parsedMessage); - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Ping: - // Single value, no need to validate - break; - case _IHubProtocol__WEBPACK_IMPORTED_MODULE_0__["MessageType"].Close: - // All optional values, no need to validate - break; - default: - // Future protocol changes can add message types, old clients can ignore them - logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_1__["LogLevel"].Information, "Unknown message type '" + parsedMessage.type + "' ignored."); - continue; - } - hubMessages.push(parsedMessage); - } - return hubMessages; - }; - /** Writes the specified {@link @aspnet/signalr.HubMessage} to a string and returns it. - * - * @param {HubMessage} message The message to write. - * @returns {string} A string containing the serialized representation of the message. - */ - JsonHubProtocol.prototype.writeMessage = function (message) { - return _TextMessageFormat__WEBPACK_IMPORTED_MODULE_4__["TextMessageFormat"].write(JSON.stringify(message)); - }; - JsonHubProtocol.prototype.isInvocationMessage = function (message) { - this.assertNotEmptyString(message.target, "Invalid payload for Invocation message."); - if (message.invocationId !== undefined) { - this.assertNotEmptyString(message.invocationId, "Invalid payload for Invocation message."); - } - }; - JsonHubProtocol.prototype.isStreamItemMessage = function (message) { - this.assertNotEmptyString(message.invocationId, "Invalid payload for StreamItem message."); - if (message.item === undefined) { - throw new Error("Invalid payload for StreamItem message."); - } - }; - JsonHubProtocol.prototype.isCompletionMessage = function (message) { - if (message.result && message.error) { - throw new Error("Invalid payload for Completion message."); - } - if (!message.result && message.error) { - this.assertNotEmptyString(message.error, "Invalid payload for Completion message."); - } - this.assertNotEmptyString(message.invocationId, "Invalid payload for Completion message."); - }; - JsonHubProtocol.prototype.assertNotEmptyString = function (value, errorMessage) { - if (typeof value !== "string" || value === "") { - throw new Error(errorMessage); - } - }; - return JsonHubProtocol; -}()); +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} -//# sourceMappingURL=JsonHubProtocol.js.map +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} -/***/ }), +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) -/***/ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js": -/*!***********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/Loggers.js ***! - \***********************************************************/ -/*! exports provided: NullLogger */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NullLogger", function() { return NullLogger; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -/** A logger that does nothing when log messages are sent to it. */ -var NullLogger = /** @class */ (function () { - function NullLogger() { + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 } - /** @inheritDoc */ - // tslint:disable-next-line - NullLogger.prototype.log = function (_logLevel, _message) { - }; - /** The singleton instance of the {@link @aspnet/signalr.NullLogger}. */ - NullLogger.instance = new NullLogger(); - return NullLogger; -}()); + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } -//# sourceMappingURL=Loggers.js.map + return offset + byteLength +} -/***/ }), +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) -/***/ "../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js": -/*!************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/LongPollingTransport.js ***! - \************************************************************************/ -/*! exports provided: LongPollingTransport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LongPollingTransport", function() { return LongPollingTransport; }); -/* harmony import */ var _AbortController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AbortController */ "../node_modules/@aspnet/signalr/dist/esm/AbortController.js"); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 } -}; + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + var len = end - start + var i -// Not exported from 'index', this type is internal. -/** @private */ -var LongPollingTransport = /** @class */ (function () { - function LongPollingTransport(httpClient, accessTokenFactory, logger, logMessageContent) { - this.httpClient = httpClient; - this.accessTokenFactory = accessTokenFactory; - this.logger = logger; - this.pollAbort = new _AbortController__WEBPACK_IMPORTED_MODULE_0__["AbortController"](); - this.logMessageContent = logMessageContent; - this.running = false; - this.onreceive = null; - this.onclose = null; + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] } - Object.defineProperty(LongPollingTransport.prototype, "pollAborted", { - // This is an internal type, not exported from 'index' so this is really just internal. - get: function () { - return this.pollAbort.aborted; - }, - enumerable: true, - configurable: true - }); - LongPollingTransport.prototype.connect = function (url, transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var pollOptions, token, pollUrl, response; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(url, "url"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isRequired(transferFormat, "transferFormat"); - _Utils__WEBPACK_IMPORTED_MODULE_4__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"], "transferFormat"); - this.url = url; - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Connecting."); - // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property) - if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"].Binary && - (typeof XMLHttpRequest !== "undefined" && typeof new XMLHttpRequest().responseType !== "string")) { - throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported."); - } - pollOptions = { - abortSignal: this.pollAbort.signal, - headers: {}, - timeout: 100000, - }; - if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_3__["TransferFormat"].Binary) { - pollOptions.responseType = "arraybuffer"; - } - return [4 /*yield*/, this.getAccessToken()]; - case 1: - token = _a.sent(); - this.updateHeaderToken(pollOptions, token); - pollUrl = url + "&_=" + Date.now(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) polling: " + pollUrl + "."); - return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)]; - case 2: - response = _a.sent(); - if (response.statusCode !== 200) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "(LongPolling transport) Unexpected response code: " + response.statusCode + "."); - // Mark running as false so that the poll immediately ends and runs the close logic - this.closeError = new _Errors__WEBPACK_IMPORTED_MODULE_1__["HttpError"](response.statusText || "", response.statusCode); - this.running = false; - } - else { - this.running = true; - } - this.receiving = this.poll(this.url, pollOptions); - return [2 /*return*/]; - } - }); - }); - }; - LongPollingTransport.prototype.getAccessToken = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.accessTokenFactory) return [3 /*break*/, 2]; - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: return [2 /*return*/, _a.sent()]; - case 2: return [2 /*return*/, null]; - } - }); - }); - }; - LongPollingTransport.prototype.updateHeaderToken = function (request, token) { - if (!request.headers) { - request.headers = {}; - } - if (token) { - // tslint:disable-next-line:no-string-literal - request.headers["Authorization"] = "Bearer " + token; - return; - } - // tslint:disable-next-line:no-string-literal - if (request.headers["Authorization"]) { - // tslint:disable-next-line:no-string-literal - delete request.headers["Authorization"]; - } - }; - LongPollingTransport.prototype.poll = function (url, pollOptions) { - return __awaiter(this, void 0, void 0, function () { - var token, pollUrl, response, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.trys.push([0, , 8, 9]); - _a.label = 1; - case 1: - if (!this.running) return [3 /*break*/, 7]; - return [4 /*yield*/, this.getAccessToken()]; - case 2: - token = _a.sent(); - this.updateHeaderToken(pollOptions, token); - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); - pollUrl = url + "&_=" + Date.now(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) polling: " + pollUrl + "."); - return [4 /*yield*/, this.httpClient.get(pollUrl, pollOptions)]; - case 4: - response = _a.sent(); - if (response.statusCode === 204) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Information, "(LongPolling transport) Poll terminated by server."); - this.running = false; - } - else if (response.statusCode !== 200) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Error, "(LongPolling transport) Unexpected response code: " + response.statusCode + "."); - // Unexpected status code - this.closeError = new _Errors__WEBPACK_IMPORTED_MODULE_1__["HttpError"](response.statusText || "", response.statusCode); - this.running = false; - } - else { - // Process the response - if (response.content) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_4__["getDataDetail"])(response.content, this.logMessageContent) + "."); - if (this.onreceive) { - this.onreceive(response.content); - } - } - else { - // This is another way timeout manifest. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll timed out, reissuing."); - } - } - return [3 /*break*/, 6]; - case 5: - e_1 = _a.sent(); - if (!this.running) { - // Log but disregard errors that occur after stopping - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll errored after shutdown: " + e_1.message); - } - else { - if (e_1 instanceof _Errors__WEBPACK_IMPORTED_MODULE_1__["TimeoutError"]) { - // Ignore timeouts and reissue the poll. - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Poll timed out, reissuing."); - } - else { - // Close the connection with the error as the result. - this.closeError = e_1; - this.running = false; - } - } - return [3 /*break*/, 6]; - case 6: return [3 /*break*/, 1]; - case 7: return [3 /*break*/, 9]; - case 8: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Polling complete."); - // We will reach here with pollAborted==false when the server returned a response causing the transport to stop. - // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent. - if (!this.pollAborted) { - this.raiseOnClose(); - } - return [7 /*endfinally*/]; - case 9: return [2 /*return*/]; - } - }); - }); - }; - LongPollingTransport.prototype.send = function (data) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.running) { - return [2 /*return*/, Promise.reject(new Error("Cannot send until the transport is connected"))]; - } - return [2 /*return*/, Object(_Utils__WEBPACK_IMPORTED_MODULE_4__["sendMessage"])(this.logger, "LongPolling", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)]; - }); - }); - }; - LongPollingTransport.prototype.stop = function () { - return __awaiter(this, void 0, void 0, function () { - var deleteOptions, token; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Stopping polling."); - // Tell receiving loop to stop, abort any current request, and then wait for it to finish - this.running = false; - this.pollAbort.abort(); - _a.label = 1; - case 1: - _a.trys.push([1, , 5, 6]); - return [4 /*yield*/, this.receiving]; - case 2: - _a.sent(); - // Send DELETE to clean up long polling on the server - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) sending DELETE request to " + this.url + "."); - deleteOptions = { - headers: {}, - }; - return [4 /*yield*/, this.getAccessToken()]; - case 3: - token = _a.sent(); - this.updateHeaderToken(deleteOptions, token); - return [4 /*yield*/, this.httpClient.delete(this.url, deleteOptions)]; - case 4: - _a.sent(); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) DELETE request sent."); - return [3 /*break*/, 6]; - case 5: - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, "(LongPolling transport) Stop finished."); - // Raise close event here instead of in polling - // It needs to happen after the DELETE request is sent - this.raiseOnClose(); - return [7 /*endfinally*/]; - case 6: return [2 /*return*/]; - } - }); - }); - }; - LongPollingTransport.prototype.raiseOnClose = function () { - if (this.onclose) { - var logMessage = "(LongPolling transport) Firing onclose event."; - if (this.closeError) { - logMessage += " Error: " + this.closeError; - } - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Trace, logMessage); - this.onclose(this.closeError); - } - }; - return LongPollingTransport; -}()); + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } -//# sourceMappingURL=LongPollingTransport.js.map + return len +} -/***/ }), +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 + } -/***/ "../node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js": -/*!******************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js ***! - \******************************************************************/ -/*! exports provided: NodeHttpClient */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(Buffer) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "NodeHttpClient", function() { return NodeHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (undefined && undefined.__assign) || Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val } - return t; -}; + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} +// HELPER FUNCTIONS +// ================ +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} -var requestModule; -if (typeof XMLHttpRequest === "undefined") { - // In order to ignore the dynamic require in webpack builds we need to do this magic - // @ts-ignore: TS doesn't know about these names - var requireFunc = true ? require : undefined; - requestModule = requireFunc("request"); +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') } -var NodeHttpClient = /** @class */ (function (_super) { - __extends(NodeHttpClient, _super); - function NodeHttpClient(logger) { - var _this = _super.call(this) || this; - if (typeof requestModule === "undefined") { - throw new Error("The 'request' module could not be loaded."); + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue } - _this.logger = logger; - _this.cookieJar = requestModule.jar(); - _this.request = requestModule.defaults({ jar: _this.cookieJar }); - return _this; - } - NodeHttpClient.prototype.send = function (httpRequest) { - var _this = this; - return new Promise(function (resolve, reject) { - var requestBody; - if (Object(_Utils__WEBPACK_IMPORTED_MODULE_3__["isArrayBuffer"])(httpRequest.content)) { - requestBody = Buffer.from(httpRequest.content); - } - else { - requestBody = httpRequest.content || ""; - } - var currentRequest = _this.request(httpRequest.url, { - body: requestBody, - // If binary is expected 'null' should be used, otherwise for text 'utf8' - encoding: httpRequest.responseType === "arraybuffer" ? null : "utf8", - headers: __assign({ - // Tell auth middleware to 401 instead of redirecting - "X-Requested-With": "XMLHttpRequest" }, httpRequest.headers), - method: httpRequest.method, - timeout: httpRequest.timeout, - }, function (error, response, body) { - if (httpRequest.abortSignal) { - httpRequest.abortSignal.onabort = null; - } - if (error) { - if (error.code === "ETIMEDOUT") { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Timeout from HTTP request."); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]()); - } - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Error from HTTP request. " + error); - reject(error); - return; - } - if (response.statusCode >= 200 && response.statusCode < 300) { - resolve(new _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"](response.statusCode, response.statusMessage || "", body)); - } - else { - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](response.statusMessage || "", response.statusCode || 0)); - } - }); - if (httpRequest.abortSignal) { - httpRequest.abortSignal.onabort = function () { - currentRequest.abort(); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]()); - }; - } - }); - }; - NodeHttpClient.prototype.getCookieString = function (url) { - return this.cookieJar.getCookieString(url); - }; - return NodeHttpClient; -}(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])); -//# sourceMappingURL=NodeHttpClient.js.map -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) + // valid lead + leadSurrogate = codePoint -/***/ }), + continue + } -/***/ "../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js": -/*!*****************************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/ServerSentEventsTransport.js ***! - \*****************************************************************************/ -/*! exports provided: ServerSentEventsTransport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ServerSentEventsTransport", function() { return ServerSentEventsTransport; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') } -}; + } + return bytes +} +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} -/** @private */ -var ServerSentEventsTransport = /** @class */ (function () { - function ServerSentEventsTransport(httpClient, accessTokenFactory, logger, logMessageContent, eventSourceConstructor) { - this.httpClient = httpClient; - this.accessTokenFactory = accessTokenFactory; - this.logger = logger; - this.logMessageContent = logMessageContent; - this.eventSourceConstructor = eventSourceConstructor; - this.onreceive = null; - this.onclose = null; - } - ServerSentEventsTransport.prototype.connect = function (url, transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var token; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(url, "url"); - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(transferFormat, "transferFormat"); - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"], "transferFormat"); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(SSE transport) Connecting."); - // set url before accessTokenFactory because this.url is only for send and we set the auth header instead of the query string for send - this.url = url; - if (!this.accessTokenFactory) return [3 /*break*/, 2]; - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - if (token) { - url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)); - } - _a.label = 2; - case 2: return [2 /*return*/, new Promise(function (resolve, reject) { - var opened = false; - if (transferFormat !== _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"].Text) { - reject(new Error("The Server-Sent Events transport only supports the 'Text' transfer format")); - return; - } - var eventSource; - if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isBrowser || _Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isWebWorker) { - eventSource = new _this.eventSourceConstructor(url, { withCredentials: true }); - } - else { - // Non-browser passes cookies via the dictionary - var cookies = _this.httpClient.getCookieString(url); - eventSource = new _this.eventSourceConstructor(url, { withCredentials: true, headers: { Cookie: cookies } }); - } - try { - eventSource.onmessage = function (e) { - if (_this.onreceive) { - try { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(SSE transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(e.data, _this.logMessageContent) + "."); - _this.onreceive(e.data); - } - catch (error) { - _this.close(error); - return; - } - } - }; - eventSource.onerror = function (e) { - var error = new Error(e.data || "Error occurred"); - if (opened) { - _this.close(error); - } - else { - reject(error); - } - }; - eventSource.onopen = function () { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information, "SSE connected to " + _this.url); - _this.eventSource = eventSource; - opened = true; - resolve(); - }; - } - catch (e) { - reject(e); - return; - } - })]; - } - }); - }); - }; - ServerSentEventsTransport.prototype.send = function (data) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (!this.eventSource) { - return [2 /*return*/, Promise.reject(new Error("Cannot send until the transport is connected"))]; - } - return [2 /*return*/, Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["sendMessage"])(this.logger, "SSE", this.httpClient, this.url, this.accessTokenFactory, data, this.logMessageContent)]; - }); - }); - }; - ServerSentEventsTransport.prototype.stop = function () { - this.close(); - return Promise.resolve(); - }; - ServerSentEventsTransport.prototype.close = function (e) { - if (this.eventSource) { - this.eventSource.close(); - this.eventSource = undefined; - if (this.onclose) { - this.onclose(e); - } - } - }; - return ServerSentEventsTransport; -}()); +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break -//# sourceMappingURL=ServerSentEventsTransport.js.map + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } -/***/ }), + return byteArray +} -/***/ "../node_modules/@aspnet/signalr/dist/esm/Subject.js": -/*!***********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/Subject.js ***! - \***********************************************************/ -/*! exports provided: Subject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return Subject; }); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} -/** Stream implementation to stream items to the server. */ -var Subject = /** @class */ (function () { - function Subject() { - this.observers = []; - } - Subject.prototype.next = function (item) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - observer.next(item); - } - }; - Subject.prototype.error = function (err) { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.error) { - observer.error(err); - } - } - }; - Subject.prototype.complete = function () { - for (var _i = 0, _a = this.observers; _i < _a.length; _i++) { - var observer = _a[_i]; - if (observer.complete) { - observer.complete(); - } - } - }; - Subject.prototype.subscribe = function (observer) { - this.observers.push(observer); - return new _Utils__WEBPACK_IMPORTED_MODULE_0__["SubjectSubscription"](this, observer); - }; - return Subject; -}()); +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} -//# sourceMappingURL=Subject.js.map +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) /***/ }), -/***/ "../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js": -/*!*********************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/TextMessageFormat.js ***! - \*********************************************************************/ -/*! exports provided: TextMessageFormat */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "../node_modules/core-util-is/lib/util.js": +/*!************************************************!*\ + !*** ../node_modules/core-util-is/lib/util.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TextMessageFormat", function() { return TextMessageFormat; }); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Not exported from index -/** @private */ -var TextMessageFormat = /** @class */ (function () { - function TextMessageFormat() { - } - TextMessageFormat.write = function (output) { - return "" + output + TextMessageFormat.RecordSeparator; - }; - TextMessageFormat.parse = function (input) { - if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) { - throw new Error("Message is incomplete."); - } - var messages = input.split(TextMessageFormat.RecordSeparator); - messages.pop(); - return messages; - }; - TextMessageFormat.RecordSeparatorCode = 0x1e; - TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode); - return TextMessageFormat; -}()); +/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -//# sourceMappingURL=TextMessageFormat.js.map +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. -/***/ }), +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; -/***/ "../node_modules/@aspnet/signalr/dist/esm/Utils.js": -/*!*********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/Utils.js ***! - \*********************************************************/ -/*! exports provided: Arg, Platform, getDataDetail, formatArrayBuffer, isArrayBuffer, sendMessage, createLogger, SubjectSubscription, ConsoleLogger */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Arg", function() { return Arg; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Platform", function() { return Platform; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDataDetail", function() { return getDataDetail; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formatArrayBuffer", function() { return formatArrayBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isArrayBuffer", function() { return isArrayBuffer; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sendMessage", function() { return sendMessage; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createLogger", function() { return createLogger; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SubjectSubscription", function() { return SubjectSubscription; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ConsoleLogger", function() { return ConsoleLogger; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; -/** @private */ -var Arg = /** @class */ (function () { - function Arg() { - } - Arg.isRequired = function (val, name) { - if (val === null || val === undefined) { - throw new Error("The '" + name + "' argument is required."); - } - }; - Arg.isIn = function (val, values, name) { - // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself. - if (!(val in values)) { - throw new Error("Unknown " + name + " value: " + val + "."); - } - }; - return Arg; -}()); +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; -/** @private */ -var Platform = /** @class */ (function () { - function Platform() { - } - Object.defineProperty(Platform, "isBrowser", { - get: function () { - return typeof window === "object"; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Platform, "isWebWorker", { - get: function () { - return typeof self === "object" && "importScripts" in self; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Platform, "isNode", { - get: function () { - return !this.isBrowser && !this.isWebWorker; - }, - enumerable: true, - configurable: true - }); - return Platform; -}()); +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; -/** @private */ -function getDataDetail(data, includeContent) { - var detail = ""; - if (isArrayBuffer(data)) { - detail = "Binary data of length " + data.byteLength; - if (includeContent) { - detail += ". Content: '" + formatArrayBuffer(data) + "'"; - } - } - else if (typeof data === "string") { - detail = "String data of length " + data.length; - if (includeContent) { - detail += ". Content: '" + data + "'"; - } - } - return detail; +function isSymbol(arg) { + return typeof arg === 'symbol'; } -/** @private */ -function formatArrayBuffer(data) { - var view = new Uint8Array(data); - // Uint8Array.map only supports returning another Uint8Array? - var str = ""; - view.forEach(function (num) { - var pad = num < 16 ? "0" : ""; - str += "0x" + pad + num.toString(16) + " "; - }); - // Trim of trailing space. - return str.substr(0, str.length - 1); +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; } -// Also in signalr-protocol-msgpack/Utils.ts -/** @private */ -function isArrayBuffer(val) { - return val && typeof ArrayBuffer !== "undefined" && - (val instanceof ArrayBuffer || - // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof - (val.constructor && val.constructor.name === "ArrayBuffer")); +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; } -/** @private */ -function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, logMessageContent) { - return __awaiter(this, void 0, void 0, function () { - var _a, headers, token, responseType, response; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (!accessTokenFactory) return [3 /*break*/, 2]; - return [4 /*yield*/, accessTokenFactory()]; - case 1: - token = _b.sent(); - if (token) { - headers = (_a = {}, - _a["Authorization"] = "Bearer " + token, - _a); - } - _b.label = 2; - case 2: - logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(" + transportName + " transport) sending data. " + getDataDetail(content, logMessageContent) + "."); - responseType = isArrayBuffer(content) ? "arraybuffer" : "text"; - return [4 /*yield*/, httpClient.post(url, { - content: content, - headers: headers, - responseType: responseType, - })]; - case 3: - response = _b.sent(); - logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(" + transportName + " transport) request complete. Response status: " + response.statusCode + "."); - return [2 /*return*/]; - } - }); - }); +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; } -/** @private */ -function createLogger(logger) { - if (logger === undefined) { - return new ConsoleLogger(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information); - } - if (logger === null) { - return _Loggers__WEBPACK_IMPORTED_MODULE_1__["NullLogger"].instance; - } - if (logger.log) { - return logger; - } - return new ConsoleLogger(logger); +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; } -/** @private */ -var SubjectSubscription = /** @class */ (function () { - function SubjectSubscription(subject, observer) { - this.subject = subject; - this.observer = observer; - } - SubjectSubscription.prototype.dispose = function () { - var index = this.subject.observers.indexOf(this.observer); - if (index > -1) { - this.subject.observers.splice(index, 1); - } - if (this.subject.observers.length === 0 && this.subject.cancelCallback) { - this.subject.cancelCallback().catch(function (_) { }); - } - }; - return SubjectSubscription; -}()); +exports.isDate = isDate; -/** @private */ -var ConsoleLogger = /** @class */ (function () { - function ConsoleLogger(minimumLogLevel) { - this.minimumLogLevel = minimumLogLevel; - this.outputConsole = console; - } - ConsoleLogger.prototype.log = function (logLevel, message) { - if (logLevel >= this.minimumLogLevel) { - switch (logLevel) { - case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Critical: - case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Error: - this.outputConsole.error("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); - break; - case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Warning: - this.outputConsole.warn("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); - break; - case _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information: - this.outputConsole.info("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); - break; - default: - // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug - this.outputConsole.log("[" + new Date().toISOString() + "] " + _ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"][logLevel] + ": " + message); - break; - } - } - }; - return ConsoleLogger; -}()); +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; -//# sourceMappingURL=Utils.js.map +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; -/***/ }), +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; -/***/ "../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js": -/*!**********************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/WebSocketTransport.js ***! - \**********************************************************************/ -/*! exports provided: WebSocketTransport */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +exports.isBuffer = Buffer.isBuffer; -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "WebSocketTransport", function() { return WebSocketTransport; }); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils */ "../node_modules/@aspnet/signalr/dist/esm/Utils.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (undefined && undefined.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; +function objectToString(o) { + return Object.prototype.toString.call(o); +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../buffer/index.js */ "../node_modules/buffer/index.js").Buffer)) +/***/ }), -/** @private */ -var WebSocketTransport = /** @class */ (function () { - function WebSocketTransport(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor) { - this.logger = logger; - this.accessTokenFactory = accessTokenFactory; - this.logMessageContent = logMessageContent; - this.webSocketConstructor = webSocketConstructor; - this.httpClient = httpClient; - this.onreceive = null; - this.onclose = null; - } - WebSocketTransport.prototype.connect = function (url, transferFormat) { - return __awaiter(this, void 0, void 0, function () { - var token; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(url, "url"); - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isRequired(transferFormat, "transferFormat"); - _Utils__WEBPACK_IMPORTED_MODULE_2__["Arg"].isIn(transferFormat, _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"], "transferFormat"); - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) Connecting."); - if (!this.accessTokenFactory) return [3 /*break*/, 2]; - return [4 /*yield*/, this.accessTokenFactory()]; - case 1: - token = _a.sent(); - if (token) { - url += (url.indexOf("?") < 0 ? "?" : "&") + ("access_token=" + encodeURIComponent(token)); - } - _a.label = 2; - case 2: return [2 /*return*/, new Promise(function (resolve, reject) { - url = url.replace(/^http/, "ws"); - var webSocket; - var cookies = _this.httpClient.getCookieString(url); - if (_Utils__WEBPACK_IMPORTED_MODULE_2__["Platform"].isNode && cookies) { - // Only pass cookies when in non-browser environments - webSocket = new _this.webSocketConstructor(url, undefined, { - headers: { - Cookie: "" + cookies, - }, - }); - } - if (!webSocket) { - // Chrome is not happy with passing 'undefined' as protocol - webSocket = new _this.webSocketConstructor(url); - } - if (transferFormat === _ITransport__WEBPACK_IMPORTED_MODULE_1__["TransferFormat"].Binary) { - webSocket.binaryType = "arraybuffer"; - } - // tslint:disable-next-line:variable-name - webSocket.onopen = function (_event) { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Information, "WebSocket connected to " + url + "."); - _this.webSocket = webSocket; - resolve(); - }; - webSocket.onerror = function (event) { - var error = null; - // ErrorEvent is a browser only type we need to check if the type exists before using it - if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) { - error = event.error; - } - reject(error); - }; - webSocket.onmessage = function (message) { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) data received. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(message.data, _this.logMessageContent) + "."); - if (_this.onreceive) { - _this.onreceive(message.data); - } - }; - webSocket.onclose = function (event) { return _this.close(event); }; - })]; - } - }); - }); - }; - WebSocketTransport.prototype.send = function (data) { - if (this.webSocket && this.webSocket.readyState === this.webSocketConstructor.OPEN) { - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) sending data. " + Object(_Utils__WEBPACK_IMPORTED_MODULE_2__["getDataDetail"])(data, this.logMessageContent) + "."); - this.webSocket.send(data); - return Promise.resolve(); - } - return Promise.reject("WebSocket is not in the OPEN state"); - }; - WebSocketTransport.prototype.stop = function () { - if (this.webSocket) { - // Clear websocket handlers because we are considering the socket closed now - this.webSocket.onclose = function () { }; - this.webSocket.onmessage = function () { }; - this.webSocket.onerror = function () { }; - this.webSocket.close(); - this.webSocket = undefined; - // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning - // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects - this.close(undefined); - } - return Promise.resolve(); - }; - WebSocketTransport.prototype.close = function (event) { - // webSocket will be null if the transport did not start successfully - this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_0__["LogLevel"].Trace, "(WebSockets transport) socket closed."); - if (this.onclose) { - if (event && (event.wasClean === false || event.code !== 1000)) { - this.onclose(new Error("WebSocket closed with status code: " + event.code + " (" + event.reason + ").")); - } - else { - this.onclose(); - } - } - }; - return WebSocketTransport; -}()); +/***/ "../node_modules/events/events.js": +/*!****************************************!*\ + !*** ../node_modules/events/events.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -//# sourceMappingURL=WebSocketTransport.js.map +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -/***/ }), -/***/ "../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js": -/*!*****************************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/XhrHttpClient.js ***! - \*****************************************************************/ -/*! exports provided: XhrHttpClient */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "XhrHttpClient", function() { return XhrHttpClient; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); +var R = typeof Reflect === 'object' ? Reflect : null +var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + } + +var ReflectOwnKeys +if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys +} else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; +} else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; +} + +function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); +} +var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; +} +function EventEmitter() { + EventEmitter.init.call(this); +} +module.exports = EventEmitter; -var XhrHttpClient = /** @class */ (function (_super) { - __extends(XhrHttpClient, _super); - function XhrHttpClient(logger) { - var _this = _super.call(this) || this; - _this.logger = logger; - return _this; - } - /** @inheritDoc */ - XhrHttpClient.prototype.send = function (request) { - var _this = this; - // Check that abort was not signaled before calling send - if (request.abortSignal && request.abortSignal.aborted) { - return Promise.reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]()); - } - if (!request.method) { - return Promise.reject(new Error("No method defined.")); - } - if (!request.url) { - return Promise.reject(new Error("No url defined.")); - } - return new Promise(function (resolve, reject) { - var xhr = new XMLHttpRequest(); - xhr.open(request.method, request.url, true); - xhr.withCredentials = true; - xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); - // Explicitly setting the Content-Type header for React Native on Android platform. - xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); - var headers = request.headers; - if (headers) { - Object.keys(headers) - .forEach(function (header) { - xhr.setRequestHeader(header, headers[header]); - }); - } - if (request.responseType) { - xhr.responseType = request.responseType; - } - if (request.abortSignal) { - request.abortSignal.onabort = function () { - xhr.abort(); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]()); - }; - } - if (request.timeout) { - xhr.timeout = request.timeout; - } - xhr.onload = function () { - if (request.abortSignal) { - request.abortSignal.onabort = null; - } - if (xhr.status >= 200 && xhr.status < 300) { - resolve(new _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"](xhr.status, xhr.statusText, xhr.response || xhr.responseText)); - } - else { - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText, xhr.status)); - } - }; - xhr.onerror = function () { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Error from HTTP request. " + xhr.status + ": " + xhr.statusText + "."); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"](xhr.statusText, xhr.status)); - }; - xhr.ontimeout = function () { - _this.logger.log(_ILogger__WEBPACK_IMPORTED_MODULE_2__["LogLevel"].Warning, "Timeout from HTTP request."); - reject(new _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]()); - }; - xhr.send(request.content || ""); - }); - }; - return XhrHttpClient; -}(_HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"])); +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; -//# sourceMappingURL=XhrHttpClient.js.map +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._eventsCount = 0; +EventEmitter.prototype._maxListeners = undefined; -/***/ }), +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +var defaultMaxListeners = 10; -/***/ "../node_modules/@aspnet/signalr/dist/esm/index.js": -/*!*********************************************************!*\ - !*** ../node_modules/@aspnet/signalr/dist/esm/index.js ***! - \*********************************************************/ -/*! exports provided: VERSION, AbortError, HttpError, TimeoutError, HttpClient, HttpResponse, DefaultHttpClient, HubConnection, HubConnectionState, HubConnectionBuilder, MessageType, LogLevel, HttpTransportType, TransferFormat, NullLogger, JsonHubProtocol, Subject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } +}); -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VERSION", function() { return VERSION; }); -/* harmony import */ var _Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Errors */ "../node_modules/@aspnet/signalr/dist/esm/Errors.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "AbortError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["AbortError"]; }); +EventEmitter.init = function() { -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["HttpError"]; }); + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return _Errors__WEBPACK_IMPORTED_MODULE_0__["TimeoutError"]; }); + this._maxListeners = this._maxListeners || undefined; +}; -/* harmony import */ var _HttpClient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./HttpClient */ "../node_modules/@aspnet/signalr/dist/esm/HttpClient.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpClient", function() { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpClient"]; }); +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; +}; -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpResponse", function() { return _HttpClient__WEBPACK_IMPORTED_MODULE_1__["HttpResponse"]; }); +function $getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; +} -/* harmony import */ var _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DefaultHttpClient */ "../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "DefaultHttpClient", function() { return _DefaultHttpClient__WEBPACK_IMPORTED_MODULE_2__["DefaultHttpClient"]; }); +EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); +}; -/* harmony import */ var _HubConnection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./HubConnection */ "../node_modules/@aspnet/signalr/dist/esm/HubConnection.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnection", function() { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnection"]; }); +EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnectionState", function() { return _HubConnection__WEBPACK_IMPORTED_MODULE_3__["HubConnectionState"]; }); + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; -/* harmony import */ var _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./HubConnectionBuilder */ "../node_modules/@aspnet/signalr/dist/esm/HubConnectionBuilder.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HubConnectionBuilder", function() { return _HubConnectionBuilder__WEBPACK_IMPORTED_MODULE_4__["HubConnectionBuilder"]; }); + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } -/* harmony import */ var _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/IHubProtocol.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "MessageType", function() { return _IHubProtocol__WEBPACK_IMPORTED_MODULE_5__["MessageType"]; }); + var handler = events[type]; -/* harmony import */ var _ILogger__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ILogger */ "../node_modules/@aspnet/signalr/dist/esm/ILogger.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "LogLevel", function() { return _ILogger__WEBPACK_IMPORTED_MODULE_6__["LogLevel"]; }); + if (handler === undefined) + return false; -/* harmony import */ var _ITransport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ITransport */ "../node_modules/@aspnet/signalr/dist/esm/ITransport.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "HttpTransportType", function() { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["HttpTransportType"]; }); + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "TransferFormat", function() { return _ITransport__WEBPACK_IMPORTED_MODULE_7__["TransferFormat"]; }); + return true; +}; -/* harmony import */ var _Loggers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loggers */ "../node_modules/@aspnet/signalr/dist/esm/Loggers.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "NullLogger", function() { return _Loggers__WEBPACK_IMPORTED_MODULE_8__["NullLogger"]; }); +function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; -/* harmony import */ var _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./JsonHubProtocol */ "../node_modules/@aspnet/signalr/dist/esm/JsonHubProtocol.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "JsonHubProtocol", function() { return _JsonHubProtocol__WEBPACK_IMPORTED_MODULE_9__["JsonHubProtocol"]; }); + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } -/* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Subject */ "../node_modules/@aspnet/signalr/dist/esm/Subject.js"); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return _Subject__WEBPACK_IMPORTED_MODULE_10__["Subject"]; }); + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -// Version token that will be replaced by the prepack command -/** The version of the SignalR client. */ -var VERSION = "0.0.0-DEV_BUILD"; + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + // Check for listener leak + m = $getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + return target; +} +EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); +}; +EventEmitter.prototype.on = EventEmitter.prototype.addListener; +EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; +function onceWrapper() { + var args = []; + for (var i = 0; i < arguments.length; i++) args.push(arguments[i]); + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + ReflectApply(this.listener, this.target, args); + } +} +function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; +} +EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + this.on(type, _onceWrap(this, type, listener)); + return this; +}; +EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; -//# sourceMappingURL=index.js.map +// Emits a 'removeListener' event if and only if the listener was removed. +EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; -/***/ }), + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } -/***/ "../node_modules/@dotnet/jsinterop/dist/Microsoft.JSInterop.js": -/*!*********************************************************************!*\ - !*** ../node_modules/@dotnet/jsinterop/dist/Microsoft.JSInterop.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + events = this._events; + if (events === undefined) + return this; -"use strict"; + list = events[type]; + if (list === undefined) + return this; -// This is a single-file self-contained module to avoid the need for a Webpack build -var DotNet; -(function (DotNet) { - window.DotNet = DotNet; // Ensure reachable from anywhere - var jsonRevivers = []; - var pendingAsyncCalls = {}; - var cachedJSFunctions = {}; - var nextAsyncCallId = 1; // Start at 1 because zero signals "no response needed" - var dotNetDispatcher = null; - /** - * Sets the specified .NET call dispatcher as the current instance so that it will be used - * for future invocations. - * - * @param dispatcher An object that can dispatch calls from JavaScript to a .NET runtime. - */ - function attachDispatcher(dispatcher) { - dotNetDispatcher = dispatcher; - } - DotNet.attachDispatcher = attachDispatcher; - /** - * Adds a JSON reviver callback that will be used when parsing arguments received from .NET. - * @param reviver The reviver to add. - */ - function attachReviver(reviver) { - jsonRevivers.push(reviver); - } - DotNet.attachReviver = attachReviver; - /** - * Invokes the specified .NET public method synchronously. Not all hosting scenarios support - * synchronous invocation, so if possible use invokeMethodAsync instead. - * - * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. - * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. - * @param args Arguments to pass to the method, each of which must be JSON-serializable. - * @returns The result of the operation. - */ - function invokeMethod(assemblyName, methodIdentifier) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return invokePossibleInstanceMethod(assemblyName, methodIdentifier, null, args); - } - DotNet.invokeMethod = invokeMethod; - /** - * Invokes the specified .NET public method asynchronously. - * - * @param assemblyName The short name (without key/version or .dll extension) of the .NET assembly containing the method. - * @param methodIdentifier The identifier of the method to invoke. The method must have a [JSInvokable] attribute specifying this identifier. - * @param args Arguments to pass to the method, each of which must be JSON-serializable. - * @returns A promise representing the result of the operation. - */ - function invokeMethodAsync(assemblyName, methodIdentifier) { - var args = []; - for (var _i = 2; _i < arguments.length; _i++) { - args[_i - 2] = arguments[_i]; - } - return invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, null, args); - } - DotNet.invokeMethodAsync = invokeMethodAsync; - function invokePossibleInstanceMethod(assemblyName, methodIdentifier, dotNetObjectId, args) { - var dispatcher = getRequiredDispatcher(); - if (dispatcher.invokeDotNetFromJS) { - var argsJson = JSON.stringify(args, argReplacer); - var resultJson = dispatcher.invokeDotNetFromJS(assemblyName, methodIdentifier, dotNetObjectId, argsJson); - return resultJson ? parseJsonWithRevivers(resultJson) : null; - } - else { - throw new Error('The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.'); - } - } - function invokePossibleInstanceMethodAsync(assemblyName, methodIdentifier, dotNetObjectId, args) { - var asyncCallId = nextAsyncCallId++; - var resultPromise = new Promise(function (resolve, reject) { - pendingAsyncCalls[asyncCallId] = { resolve: resolve, reject: reject }; - }); - try { - var argsJson = JSON.stringify(args, argReplacer); - getRequiredDispatcher().beginInvokeDotNetFromJS(asyncCallId, assemblyName, methodIdentifier, dotNetObjectId, argsJson); - } - catch (ex) { - // Synchronous failure - completePendingCall(asyncCallId, false, ex); - } - return resultPromise; - } - function getRequiredDispatcher() { - if (dotNetDispatcher !== null) { - return dotNetDispatcher; - } - throw new Error('No .NET call dispatcher has been set.'); - } - function completePendingCall(asyncCallId, success, resultOrError) { - if (!pendingAsyncCalls.hasOwnProperty(asyncCallId)) { - throw new Error("There is no pending async call with ID " + asyncCallId + "."); - } - var asyncCall = pendingAsyncCalls[asyncCallId]; - delete pendingAsyncCalls[asyncCallId]; - if (success) { - asyncCall.resolve(resultOrError); - } - else { - asyncCall.reject(resultOrError); - } - } - /** - * Receives incoming calls from .NET and dispatches them to JavaScript. - */ - DotNet.jsCallDispatcher = { - /** - * Finds the JavaScript function matching the specified identifier. - * - * @param identifier Identifies the globally-reachable function to be returned. - * @returns A Function instance. - */ - findJSFunction: findJSFunction, - /** - * Invokes the specified synchronous JavaScript function. - * - * @param identifier Identifies the globally-reachable function to invoke. - * @param argsJson JSON representation of arguments to be passed to the function. - * @returns JSON representation of the invocation result. - */ - invokeJSFromDotNet: function (identifier, argsJson) { - var result = findJSFunction(identifier).apply(null, parseJsonWithRevivers(argsJson)); - return result === null || result === undefined - ? null - : JSON.stringify(result, argReplacer); - }, - /** - * Invokes the specified synchronous or asynchronous JavaScript function. - * - * @param asyncHandle A value identifying the asynchronous operation. This value will be passed back in a later call to endInvokeJSFromDotNet. - * @param identifier Identifies the globally-reachable function to invoke. - * @param argsJson JSON representation of arguments to be passed to the function. - */ - beginInvokeJSFromDotNet: function (asyncHandle, identifier, argsJson) { - // Coerce synchronous functions into async ones, plus treat - // synchronous exceptions the same as async ones - var promise = new Promise(function (resolve) { - var synchronousResultOrPromise = findJSFunction(identifier).apply(null, parseJsonWithRevivers(argsJson)); - resolve(synchronousResultOrPromise); - }); - // We only listen for a result if the caller wants to be notified about it - if (asyncHandle) { - // On completion, dispatch result back to .NET - // Not using "await" because it codegens a lot of boilerplate - promise.then(function (result) { return getRequiredDispatcher().beginInvokeDotNetFromJS(0, 'Microsoft.JSInterop', 'DotNetDispatcher.EndInvoke', null, JSON.stringify([asyncHandle, true, result], argReplacer)); }, function (error) { return getRequiredDispatcher().beginInvokeDotNetFromJS(0, 'Microsoft.JSInterop', 'DotNetDispatcher.EndInvoke', null, JSON.stringify([asyncHandle, false, formatError(error)])); }); - } - }, - /** - * Receives notification that an async call from JS to .NET has completed. - * @param asyncCallId The identifier supplied in an earlier call to beginInvokeDotNetFromJS. - * @param success A flag to indicate whether the operation completed successfully. - * @param resultOrExceptionMessage Either the operation result or an error message. - */ - endInvokeDotNetFromJS: function (asyncCallId, success, resultOrExceptionMessage) { - var resultOrError = success ? resultOrExceptionMessage : new Error(resultOrExceptionMessage); - completePendingCall(parseInt(asyncCallId), success, resultOrError); - } - }; - function parseJsonWithRevivers(json) { - return json ? JSON.parse(json, function (key, initialValue) { - // Invoke each reviver in order, passing the output from the previous reviver, - // so that each one gets a chance to transform the value - return jsonRevivers.reduce(function (latestValue, reviver) { return reviver(key, latestValue); }, initialValue); - }) : null; - } - function formatError(error) { - if (error instanceof Error) { - return error.message + "\n" + error.stack; - } - else { - return error ? error.toString() : 'null'; - } - } - function findJSFunction(identifier) { - if (cachedJSFunctions.hasOwnProperty(identifier)) { - return cachedJSFunctions[identifier]; - } - var result = window; - var resultIdentifier = 'window'; - identifier.split('.').forEach(function (segment) { - if (segment in result) { - result = result[segment]; - resultIdentifier += '.' + segment; - } - else { - throw new Error("Could not find '" + segment + "' in '" + resultIdentifier + "'."); - } - }); - if (result instanceof Function) { - return result; - } + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); else { - throw new Error("The value '" + resultIdentifier + "' is not a function."); + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); } - } - var DotNetObject = /** @class */ (function () { - function DotNetObject(_id) { - this._id = _id; + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } } - DotNetObject.prototype.invokeMethod = function (methodIdentifier) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - return invokePossibleInstanceMethod(null, methodIdentifier, this._id, args); - }; - DotNetObject.prototype.invokeMethodAsync = function (methodIdentifier) { - var args = []; - for (var _i = 1; _i < arguments.length; _i++) { - args[_i - 1] = arguments[_i]; - } - return invokePossibleInstanceMethodAsync(null, methodIdentifier, this._id, args); - }; - DotNetObject.prototype.dispose = function () { - var promise = invokeMethodAsync('Microsoft.JSInterop', 'DotNetDispatcher.ReleaseDotNetObject', this._id); - promise.catch(function (error) { return console.error(error); }); - }; - DotNetObject.prototype.serializeAsArg = function () { - return { __dotNetObject: this._id }; - }; - return DotNetObject; - }()); - var dotNetObjectRefKey = '__dotNetObject'; - attachReviver(function reviveDotNetObject(key, value) { - if (value && typeof value === 'object' && value.hasOwnProperty(dotNetObjectRefKey)) { - return new DotNetObject(value.__dotNetObject); + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); } - // Unrecognized - let another reviver handle it - return value; - }); - function argReplacer(key, value) { - return value instanceof DotNetObject ? value.serializeAsArg() : value; - } -})(DotNet || (DotNet = {})); -//# sourceMappingURL=Microsoft.JSInterop.js.map -/***/ }), + if (list.length === 1) + events[type] = list[0]; -/***/ "../node_modules/assert/assert.js": -/*!****************************************!*\ - !*** ../node_modules/assert/assert.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) { + return this; + }; -// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js -// original notice: +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> - * @license MIT - */ -function compare(a, b) { - if (a === b) { - return 0; - } +EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; - var x = a.length; - var y = b.length; + events = this._events; + if (events === undefined) + return this; - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i]; - y = b[i]; - break; - } - } + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } - if (x < y) { - return -1; - } - if (y < x) { - return 1; - } - return 0; -} -function isBuffer(b) { - if (global.Buffer && typeof global.Buffer.isBuffer === 'function') { - return global.Buffer.isBuffer(b); - } - return !!(b != null && b._isBuffer); -} + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } -// based on node assert, original notice: + listeners = events[type]; -// http://wiki.commonjs.org/wiki/Unit_Testing/1.0 -// -// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! -// -// Originally from narwhal.js (http://narwhaljs.org) -// Copyright (c) 2009 Thomas Robinson <280north.com> -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } -var util = __webpack_require__(/*! util/ */ "../node_modules/util/util.js"); -var hasOwn = Object.prototype.hasOwnProperty; -var pSlice = Array.prototype.slice; -var functionsHaveNames = (function () { - return function foo() {}.name === 'foo'; -}()); -function pToString (obj) { - return Object.prototype.toString.call(obj); -} -function isView(arrbuf) { - if (isBuffer(arrbuf)) { - return false; - } - if (typeof global.ArrayBuffer !== 'function') { - return false; - } - if (typeof ArrayBuffer.isView === 'function') { - return ArrayBuffer.isView(arrbuf); - } - if (!arrbuf) { - return false; - } - if (arrbuf instanceof DataView) { - return true; - } - if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) { - return true; - } - return false; -} -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. + return this; + }; -var assert = module.exports = ok; +function _listeners(target, type, unwrap) { + var events = target._events; -// 2. The AssertionError is defined in assert. -// new assert.AssertionError({ message: message, -// actual: actual, -// expected: expected }) + if (events === undefined) + return []; -var regex = /\s*function\s+([^\(\s]*)\s*/; -// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js -function getName(func) { - if (!util.isFunction(func)) { - return; - } - if (functionsHaveNames) { - return func.name; - } - var str = func.toString(); - var match = str.match(regex); - return match && match[1]; + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); } -assert.AssertionError = function AssertionError(options) { - this.name = 'AssertionError'; - this.actual = options.actual; - this.expected = options.expected; - this.operator = options.operator; - if (options.message) { - this.message = options.message; - this.generatedMessage = false; + +EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); +}; + +EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); +}; + +EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); } else { - this.message = getMessage(this); - this.generatedMessage = true; + return listenerCount.call(emitter, type); } - var stackStartFunction = options.stackStartFunction || fail; - if (Error.captureStackTrace) { - Error.captureStackTrace(this, stackStartFunction); - } else { - // non v8 browsers so we can have a stacktrace - var err = new Error(); - if (err.stack) { - var out = err.stack; +}; - // try to strip useless frames - var fn_name = getName(stackStartFunction); - var idx = out.indexOf('\n' + fn_name); - if (idx >= 0) { - // once we have located the function frame - // we need to strip out everything before it (and its line) - var next_line = out.indexOf('\n', idx + 1); - out = out.substring(next_line + 1); - } +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { + var events = this._events; - this.stack = out; + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; } } + + return 0; +} + +EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; }; -// assert.AssertionError instanceof Error -util.inherits(assert.AssertionError, Error); +function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; +} -function truncate(s, n) { - if (typeof s === 'string') { - return s.length < n ? s : s.slice(0, n); - } else { - return s; - } +function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); } -function inspect(something) { - if (functionsHaveNames || !util.isFunction(something)) { - return util.inspect(something); + +function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; } - var rawname = getName(something); - var name = rawname ? ': ' + rawname : ''; - return '[Function' + name + ']'; + return ret; } -function getMessage(self) { - return truncate(inspect(self.actual), 128) + ' ' + - self.operator + ' ' + - truncate(inspect(self.expected), 128); + + +/***/ }), + +/***/ "../node_modules/ieee754/index.js": +/*!****************************************!*\ + !*** ../node_modules/ieee754/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } -// At present only the three keys mentioned above are used and -// understood by the spec. Implementations or sub modules can pass -// other keys to the AssertionError's constructor - they will be -// ignored. +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = (nBytes * 8) - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. + value = Math.abs(value) -function fail(actual, expected, message, operator, stackStartFunction) { - throw new assert.AssertionError({ - message: message, - actual: actual, - expected: expected, - operator: operator, - stackStartFunction: stackStartFunction - }); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = ((value * c) - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 } -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, !!guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. +/***/ }), -function ok(value, message) { - if (!value) fail(value, true, message, '==', assert.ok); +/***/ "../node_modules/inherits/inherits_browser.js": +/*!****************************************************!*\ + !*** ../node_modules/inherits/inherits_browser.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } } -assert.ok = ok; -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); +/***/ }), + +/***/ "../node_modules/isarray/index.js": +/*!****************************************!*\ + !*** ../node_modules/isarray/index.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; }; -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); +/***/ }), + +/***/ "../node_modules/msgpack5/index.js": +/*!*****************************************!*\ + !*** ../node_modules/msgpack5/index.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer +var assert = __webpack_require__(/*! assert */ "../node_modules/assert/assert.js") +var bl = __webpack_require__(/*! bl */ "../node_modules/bl/bl.js") +var streams = __webpack_require__(/*! ./lib/streams */ "../node_modules/msgpack5/lib/streams.js") +var buildDecode = __webpack_require__(/*! ./lib/decoder */ "../node_modules/msgpack5/lib/decoder.js") +var buildEncode = __webpack_require__(/*! ./lib/encoder */ "../node_modules/msgpack5/lib/encoder.js") + +function msgpack (options) { + var encodingTypes = [] + var decodingTypes = [] + + options = options || { + forceFloat64: false, + compatibilityMode: false, + disableTimestampEncoding: false // if true, skips encoding Dates using the msgpack timestamp ext format (-1) } -}; -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); + function registerEncoder (check, encode) { + assert(check, 'must have an encode function') + assert(encode, 'must have an encode function') -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected, false)) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; + encodingTypes.push({ + check: check, encode: encode + }) -assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { - if (!_deepEqual(actual, expected, true)) { - fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual); + return this } -}; -function _deepEqual(actual, expected, strict, memos) { - // 7.1. All identical values are equivalent, as determined by ===. - if (actual === expected) { - return true; - } else if (isBuffer(actual) && isBuffer(expected)) { - return compare(actual, expected) === 0; + function registerDecoder (type, decode) { + assert(type >= 0, 'must have a non-negative type') + assert(decode, 'must have a decode function') - // 7.2. If the expected value is a Date object, the actual value is - // equivalent if it is also a Date object that refers to the same time. - } else if (util.isDate(actual) && util.isDate(expected)) { - return actual.getTime() === expected.getTime(); + decodingTypes.push({ + type: type, decode: decode + }) - // 7.3 If the expected value is a RegExp object, the actual value is - // equivalent if it is also a RegExp object with the same source and - // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`). - } else if (util.isRegExp(actual) && util.isRegExp(expected)) { - return actual.source === expected.source && - actual.global === expected.global && - actual.multiline === expected.multiline && - actual.lastIndex === expected.lastIndex && - actual.ignoreCase === expected.ignoreCase; + return this + } - // 7.4. Other pairs that do not both pass typeof value == 'object', - // equivalence is determined by ==. - } else if ((actual === null || typeof actual !== 'object') && - (expected === null || typeof expected !== 'object')) { - return strict ? actual === expected : actual == expected; + function register (type, constructor, encode, decode) { + assert(constructor, 'must have a constructor') + assert(encode, 'must have an encode function') + assert(type >= 0, 'must have a non-negative type') + assert(decode, 'must have a decode function') - // If both values are instances of typed arrays, wrap their underlying - // ArrayBuffers in a Buffer each to increase performance - // This optimization requires the arrays to have the same type as checked by - // Object.prototype.toString (aka pToString). Never perform binary - // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their - // bit patterns are not identical. - } else if (isView(actual) && isView(expected) && - pToString(actual) === pToString(expected) && - !(actual instanceof Float32Array || - actual instanceof Float64Array)) { - return compare(new Uint8Array(actual.buffer), - new Uint8Array(expected.buffer)) === 0; + function check (obj) { + return (obj instanceof constructor) + } - // 7.5 For all other Object pairs, including Array objects, equivalence is - // determined by having the same number of owned properties (as verified - // with Object.prototype.hasOwnProperty.call), the same set of keys - // (although not necessarily the same order), equivalent values for every - // corresponding key, and an identical 'prototype' property. Note: this - // accounts for both named and indexed properties on Arrays. - } else if (isBuffer(actual) !== isBuffer(expected)) { - return false; - } else { - memos = memos || {actual: [], expected: []}; + function reEncode (obj) { + var buf = bl() + var header = Buffer.allocUnsafe(1) - var actualIndex = memos.actual.indexOf(actual); - if (actualIndex !== -1) { - if (actualIndex === memos.expected.indexOf(expected)) { - return true; - } + header.writeInt8(type, 0) + + buf.append(header) + buf.append(encode(obj)) + + return buf } - memos.actual.push(actual); - memos.expected.push(expected); + this.registerEncoder(check, reEncode) + this.registerDecoder(type, decode) - return objEquiv(actual, expected, strict, memos); + return this } -} -function isArguments(object) { - return Object.prototype.toString.call(object) == '[object Arguments]'; + return { + encode: buildEncode(encodingTypes, options.forceFloat64, options.compatibilityMode, options.disableTimestampEncoding), + decode: buildDecode(decodingTypes), + register: register, + registerEncoder: registerEncoder, + registerDecoder: registerDecoder, + encoder: streams.encoder, + decoder: streams.decoder, + // needed for levelup support + buffer: true, + type: 'msgpack5', + IncompleteBufferError: buildDecode.IncompleteBufferError + } } -function objEquiv(a, b, strict, actualVisitedObjects) { - if (a === null || a === undefined || b === null || b === undefined) - return false; - // if one is a primitive, the other must be same - if (util.isPrimitive(a) || util.isPrimitive(b)) - return a === b; - if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b)) - return false; - var aIsArgs = isArguments(a); - var bIsArgs = isArguments(b); - if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs)) - return false; - if (aIsArgs) { - a = pSlice.call(a); - b = pSlice.call(b); - return _deepEqual(a, b, strict); - } - var ka = objectKeys(a); - var kb = objectKeys(b); - var key, i; - // having the same number of owned properties (keys incorporates - // hasOwnProperty) - if (ka.length !== kb.length) - return false; - //the same set of keys (although not necessarily the same order), - ka.sort(); - kb.sort(); - //~~~cheap key test - for (i = ka.length - 1; i >= 0; i--) { - if (ka[i] !== kb[i]) - return false; - } - //equivalent values for every corresponding key, and - //~~~possibly expensive deep test - for (i = ka.length - 1; i >= 0; i--) { - key = ka[i]; - if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects)) - return false; +module.exports = msgpack + + +/***/ }), + +/***/ "../node_modules/msgpack5/lib/decoder.js": +/*!***********************************************!*\ + !*** ../node_modules/msgpack5/lib/decoder.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var bl = __webpack_require__(/*! bl */ "../node_modules/bl/bl.js") +var util = __webpack_require__(/*! util */ "../node_modules/util/util.js") + +function IncompleteBufferError (message) { + Error.call(this) // super constructor + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor) // super helper method to include stack trace in error object } - return true; + this.name = this.constructor.name + this.message = message || 'unable to decode' } -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); +util.inherits(IncompleteBufferError, Error) -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected, false)) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; +module.exports = function buildDecode (decodingTypes) { + return decode -assert.notDeepStrictEqual = notDeepStrictEqual; -function notDeepStrictEqual(actual, expected, message) { - if (_deepEqual(actual, expected, true)) { - fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual); + function getSize (first) { + switch (first) { + case 0xc4: + return 2 + case 0xc5: + return 3 + case 0xc6: + return 5 + case 0xc7: + return 3 + case 0xc8: + return 4 + case 0xc9: + return 6 + case 0xca: + return 5 + case 0xcb: + return 9 + case 0xcc: + return 2 + case 0xcd: + return 3 + case 0xce: + return 5 + case 0xcf: + return 9 + case 0xd0: + return 2 + case 0xd1: + return 3 + case 0xd2: + return 5 + case 0xd3: + return 9 + case 0xd4: + return 3 + case 0xd5: + return 4 + case 0xd6: + return 6 + case 0xd7: + return 10 + case 0xd8: + return 18 + case 0xd9: + return 2 + case 0xda: + return 3 + case 0xdb: + return 5 + case 0xde: + return 3 + default: + return -1 + } } -} + function hasMinBufferSize (first, length) { + var size = getSize(first) -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); - -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); + if (size !== -1 && length < size) { + return false + } else { + return true + } } -}; -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); - -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); + function isValidDataSize (dataLength, bufLength, headerLength) { + return bufLength >= headerLength + dataLength } -}; -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; + function buildDecodeResult (value, bytesConsumed) { + return { + value: value, + bytesConsumed: bytesConsumed + } } - if (Object.prototype.toString.call(expected) == '[object RegExp]') { - return expected.test(actual); - } + function decode (buf) { + if (!(buf instanceof bl)) { + buf = bl().append(buf) + } - try { - if (actual instanceof expected) { - return true; + var result = tryDecode(buf) + if (result) { + buf.consume(result.bytesConsumed) + return result.value + } else { + throw new IncompleteBufferError() } - } catch (e) { - // Ignore. The instanceof check doesn't work for arrow functions. } - if (Error.isPrototypeOf(expected)) { - return false; - } + function tryDecode (buf, offset) { + offset = offset === undefined ? 0 : offset + var bufLength = buf.length - offset + if (bufLength <= 0) { + return null + } - return expected.call({}, actual) === true; -} + var first = buf.readUInt8(offset) + var length + var result = 0 + var type + var bytePos -function _tryBlock(block) { - var error; - try { - block(); - } catch (e) { - error = e; + if (!hasMinBufferSize(first, bufLength)) { + return null + } + + switch (first) { + case 0xc0: + return buildDecodeResult(null, 1) + case 0xc2: + return buildDecodeResult(false, 1) + case 0xc3: + return buildDecodeResult(true, 1) + case 0xcc: + // 1-byte unsigned int + result = buf.readUInt8(offset + 1) + return buildDecodeResult(result, 2) + case 0xcd: + // 2-bytes BE unsigned int + result = buf.readUInt16BE(offset + 1) + return buildDecodeResult(result, 3) + case 0xce: + // 4-bytes BE unsigned int + result = buf.readUInt32BE(offset + 1) + return buildDecodeResult(result, 5) + case 0xcf: + // 8-bytes BE unsigned int + // Read long byte by byte, big-endian + for (bytePos = 7; bytePos >= 0; bytePos--) { + result += (buf.readUInt8(offset + bytePos + 1) * Math.pow(2, (8 * (7 - bytePos)))) + } + return buildDecodeResult(result, 9) + case 0xd0: + // 1-byte signed int + result = buf.readInt8(offset + 1) + return buildDecodeResult(result, 2) + case 0xd1: + // 2-bytes signed int + result = buf.readInt16BE(offset + 1) + return buildDecodeResult(result, 3) + case 0xd2: + // 4-bytes signed int + result = buf.readInt32BE(offset + 1) + return buildDecodeResult(result, 5) + case 0xd3: + result = readInt64BE(buf.slice(offset + 1, offset + 9), 0) + return buildDecodeResult(result, 9) + case 0xca: + // 4-bytes float + result = buf.readFloatBE(offset + 1) + return buildDecodeResult(result, 5) + case 0xcb: + // 8-bytes double + result = buf.readDoubleBE(offset + 1) + return buildDecodeResult(result, 9) + case 0xd9: + // strings up to 2^8 - 1 bytes + length = buf.readUInt8(offset + 1) + if (!isValidDataSize(length, bufLength, 2)) { + return null + } + result = buf.toString('utf8', offset + 2, offset + 2 + length) + return buildDecodeResult(result, 2 + length) + case 0xda: + // strings up to 2^16 - 2 bytes + length = buf.readUInt16BE(offset + 1) + if (!isValidDataSize(length, bufLength, 3)) { + return null + } + result = buf.toString('utf8', offset + 3, offset + 3 + length) + return buildDecodeResult(result, 3 + length) + case 0xdb: + // strings up to 2^32 - 4 bytes + length = buf.readUInt32BE(offset + 1) + if (!isValidDataSize(length, bufLength, 5)) { + return null + } + result = buf.toString('utf8', offset + 5, offset + 5 + length) + return buildDecodeResult(result, 5 + length) + case 0xc4: + // buffers up to 2^8 - 1 bytes + length = buf.readUInt8(offset + 1) + if (!isValidDataSize(length, bufLength, 2)) { + return null + } + result = buf.slice(offset + 2, offset + 2 + length) + return buildDecodeResult(result, 2 + length) + case 0xc5: + // buffers up to 2^16 - 1 bytes + length = buf.readUInt16BE(offset + 1) + if (!isValidDataSize(length, bufLength, 3)) { + return null + } + result = buf.slice(offset + 3, offset + 3 + length) + return buildDecodeResult(result, 3 + length) + case 0xc6: + // buffers up to 2^32 - 1 bytes + length = buf.readUInt32BE(offset + 1) + if (!isValidDataSize(length, bufLength, 5)) { + return null + } + result = buf.slice(offset + 5, offset + 5 + length) + return buildDecodeResult(result, 5 + length) + case 0xdc: + // array up to 2^16 elements - 2 bytes + if (bufLength < 3) { + return null + } + + length = buf.readUInt16BE(offset + 1) + return decodeArray(buf, offset, length, 3) + case 0xdd: + // array up to 2^32 elements - 4 bytes + if (bufLength < 5) { + return null + } + + length = buf.readUInt32BE(offset + 1) + return decodeArray(buf, offset, length, 5) + case 0xde: + // maps up to 2^16 elements - 2 bytes + length = buf.readUInt16BE(offset + 1) + return decodeMap(buf, offset, length, 3) + case 0xdf: + length = buf.readUInt32BE(offset + 1) + return decodeMap(buf, offset, length, 5) + case 0xd4: + return decodeFixExt(buf, offset, 1) + case 0xd5: + return decodeFixExt(buf, offset, 2) + case 0xd6: + return decodeFixExt(buf, offset, 4) + case 0xd7: + return decodeFixExt(buf, offset, 8) + case 0xd8: + return decodeFixExt(buf, offset, 16) + case 0xc7: + // ext up to 2^8 - 1 bytes + length = buf.readUInt8(offset + 1) + type = buf.readUInt8(offset + 2) + if (!isValidDataSize(length, bufLength, 3)) { + return null + } + return decodeExt(buf, offset, type, length, 3) + case 0xc8: + // ext up to 2^16 - 1 bytes + length = buf.readUInt16BE(offset + 1) + type = buf.readUInt8(offset + 3) + if (!isValidDataSize(length, bufLength, 4)) { + return null + } + return decodeExt(buf, offset, type, length, 4) + case 0xc9: + // ext up to 2^32 - 1 bytes + length = buf.readUInt32BE(offset + 1) + type = buf.readUInt8(offset + 5) + if (!isValidDataSize(length, bufLength, 6)) { + return null + } + return decodeExt(buf, offset, type, length, 6) + } + + if ((first & 0xf0) === 0x90) { + // we have an array with less than 15 elements + length = first & 0x0f + return decodeArray(buf, offset, length, 1) + } else if ((first & 0xf0) === 0x80) { + // we have a map with less than 15 elements + length = first & 0x0f + return decodeMap(buf, offset, length, 1) + } else if ((first & 0xe0) === 0xa0) { + // fixstr up to 31 bytes + length = first & 0x1f + if (isValidDataSize(length, bufLength, 1)) { + result = buf.toString('utf8', offset + 1, offset + length + 1) + return buildDecodeResult(result, length + 1) + } else { + return null + } + } else if (first >= 0xe0) { + // 5 bits negative ints + result = first - 0x100 + return buildDecodeResult(result, 1) + } else if (first < 0x80) { + // 7-bits positive ints + return buildDecodeResult(first, 1) + } else { + throw new Error('not implemented yet') + } } - return error; -} -function _throws(shouldThrow, block, expected, message) { - var actual; + function readInt64BE (buf, offset) { + var negate = (buf[offset] & 0x80) == 0x80 // eslint-disable-line - if (typeof block !== 'function') { - throw new TypeError('"block" argument must be a function'); - } + if (negate) { + var carry = 1 + for (var i = offset + 7; i >= offset; i--) { + var v = (buf[i] ^ 0xff) + carry + buf[i] = v & 0xff + carry = v >> 8 + } + } - if (typeof expected === 'string') { - message = expected; - expected = null; + var hi = buf.readUInt32BE(offset + 0) + var lo = buf.readUInt32BE(offset + 4) + return (hi * 4294967296 + lo) * (negate ? -1 : +1) } - actual = _tryBlock(block); - - message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + - (message ? ' ' + message : '.'); + function decodeArray (buf, offset, length, headerLength) { + var result = [] + var i + var totalBytesConsumed = 0 - if (shouldThrow && !actual) { - fail(actual, expected, 'Missing expected exception' + message); + offset += headerLength + for (i = 0; i < length; i++) { + var decodeResult = tryDecode(buf, offset) + if (decodeResult) { + result.push(decodeResult.value) + offset += decodeResult.bytesConsumed + totalBytesConsumed += decodeResult.bytesConsumed + } else { + return null + } + } + return buildDecodeResult(result, headerLength + totalBytesConsumed) } - var userProvidedMessage = typeof message === 'string'; - var isUnwantedException = !shouldThrow && util.isError(actual); - var isUnexpectedException = !shouldThrow && actual && !expected; + function decodeMap (buf, offset, length, headerLength) { + var result = {} + var key + var i + var totalBytesConsumed = 0 - if ((isUnwantedException && - userProvidedMessage && - expectedException(actual, expected)) || - isUnexpectedException) { - fail(actual, expected, 'Got unwanted exception' + message); + offset += headerLength + for (i = 0; i < length; i++) { + var keyResult = tryDecode(buf, offset) + if (keyResult) { + offset += keyResult.bytesConsumed + var valueResult = tryDecode(buf, offset) + if (valueResult) { + key = keyResult.value + result[key] = valueResult.value + offset += valueResult.bytesConsumed + totalBytesConsumed += (keyResult.bytesConsumed + valueResult.bytesConsumed) + } else { + return null + } + } else { + return null + } + } + return buildDecodeResult(result, headerLength + totalBytesConsumed) } - if ((shouldThrow && actual && expected && - !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; + function decodeFixExt (buf, offset, size) { + var type = buf.readInt8(offset + 1) // Signed + return decodeExt(buf, offset, type, size, 2) } -} -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); + function decodeTimestamp (buf, size, headerSize) { + var seconds + var nanoseconds = 0 -assert.throws = function(block, /*optional*/error, /*optional*/message) { - _throws(true, block, error, message); -}; + switch (size) { + case 4: + // timestamp 32 stores the number of seconds that have elapsed since 1970-01-01 00:00:00 UTC in an 32-bit unsigned integer + seconds = buf.readUInt32BE(0) + break -// EXTENSION! This is annoying to write outside this module. -assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) { - _throws(false, block, error, message); -}; + case 8: + // Timestamp 64 stores the number of seconds and nanoseconds that have elapsed + // since 1970-01-01 00:00:00 UTC in 32-bit unsigned integers, split 30/34 bits + var upper = buf.readUInt32BE(0) + var lower = buf.readUInt32BE(4) + nanoseconds = upper / 4 + seconds = ((upper & 0x03) * Math.pow(2, 32)) + lower // If we use bitwise operators, we get truncated to 32bits + break -assert.ifError = function(err) { if (err) throw err; }; + case 12: + throw new Error('timestamp 96 is not yet implemented') + } -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - if (hasOwn.call(obj, key)) keys.push(key); + var millis = (seconds * 1000) + Math.round(nanoseconds / 1E6) + return buildDecodeResult(new Date(millis), size + headerSize) } - return keys; -}; - -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - -/***/ }), - -/***/ "../node_modules/base64-js/index.js": -/*!******************************************!*\ - !*** ../node_modules/base64-js/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; + function decodeExt (buf, offset, type, size, headerSize) { + var i, + toDecode + offset += headerSize -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray + // Pre-defined + if (type < 0) { // Reserved for future extensions + switch (type) { + case -1: // Tiemstamp https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type + toDecode = buf.slice(offset, offset + size) + return decodeTimestamp(toDecode, size, headerSize) + } + } -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + for (i = 0; i < decodingTypes.length; i++) { + if (type === decodingTypes[i].type) { + toDecode = buf.slice(offset, offset + size) + var value = decodingTypes[i].decode(toDecode) + return buildDecodeResult(value, headerSize + size) + } + } -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i + throw new Error('unable to find ext type ' + type) + } } -// Support decoding URL-safe base64 strings, as Node.js does. -// See: https://en.wikipedia.org/wiki/Base64#URL_applications -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function getLens (b64) { - var len = b64.length - - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } +module.exports.IncompleteBufferError = IncompleteBufferError - // Trim off extra bytes after placeholder bytes are found - // See: https://github.com/beatgammit/base64-js/issues/42 - var validLen = b64.indexOf('=') - if (validLen === -1) validLen = len - var placeHoldersLen = validLen === len - ? 0 - : 4 - (validLen % 4) +/***/ }), - return [validLen, placeHoldersLen] -} +/***/ "../node_modules/msgpack5/lib/encoder.js": +/*!***********************************************!*\ + !*** ../node_modules/msgpack5/lib/encoder.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -// base64 is 4/3 + up to two characters of the original data -function byteLength (b64) { - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} +"use strict"; -function _byteLength (b64, validLen, placeHoldersLen) { - return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen -} -function toByteArray (b64) { - var tmp - var lens = getLens(b64) - var validLen = lens[0] - var placeHoldersLen = lens[1] +var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer +var bl = __webpack_require__(/*! bl */ "../node_modules/bl/bl.js") - var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)) +module.exports = function buildEncode (encodingTypes, forceFloat64, compatibilityMode, disableTimestampEncoding) { + function encode (obj, avoidSlice) { + var buf + var len - var curByte = 0 + if (obj === undefined) { + throw new Error('undefined is not encodable in msgpack!') + } else if (isNaN(obj)) { + throw new Error('NaN is not encodable in msgpack!') + } else if (obj === null) { + buf = Buffer.allocUnsafe(1) + buf[0] = 0xc0 + } else if (obj === true) { + buf = Buffer.allocUnsafe(1) + buf[0] = 0xc3 + } else if (obj === false) { + buf = Buffer.allocUnsafe(1) + buf[0] = 0xc2 + } else if (typeof obj === 'string') { + len = Buffer.byteLength(obj) + if (len < 32) { + buf = Buffer.allocUnsafe(1 + len) + buf[0] = 0xa0 | len + if (len > 0) { + buf.write(obj, 1) + } + } else if (len <= 0xff && !compatibilityMode) { + // str8, but only when not in compatibility mode + buf = Buffer.allocUnsafe(2 + len) + buf[0] = 0xd9 + buf[1] = len + buf.write(obj, 2) + } else if (len <= 0xffff) { + buf = Buffer.allocUnsafe(3 + len) + buf[0] = 0xda + buf.writeUInt16BE(len, 1) + buf.write(obj, 3) + } else { + buf = Buffer.allocUnsafe(5 + len) + buf[0] = 0xdb + buf.writeUInt32BE(len, 1) + buf.write(obj, 5) + } + } else if (obj && (obj.readUInt32LE || obj instanceof Uint8Array)) { + if (obj instanceof Uint8Array) { + obj = Buffer.from(obj) + } + // weird hack to support Buffer + // and Buffer-like objects + if (obj.length <= 0xff) { + buf = Buffer.allocUnsafe(2) + buf[0] = 0xc4 + buf[1] = obj.length + } else if (obj.length <= 0xffff) { + buf = Buffer.allocUnsafe(3) + buf[0] = 0xc5 + buf.writeUInt16BE(obj.length, 1) + } else { + buf = Buffer.allocUnsafe(5) + buf[0] = 0xc6 + buf.writeUInt32BE(obj.length, 1) + } - // if there are placeholders, only get up to the last complete 4 chars - var len = placeHoldersLen > 0 - ? validLen - 4 - : validLen + buf = bl([buf, obj]) + } else if (Array.isArray(obj)) { + if (obj.length < 16) { + buf = Buffer.allocUnsafe(1) + buf[0] = 0x90 | obj.length + } else if (obj.length < 65536) { + buf = Buffer.allocUnsafe(3) + buf[0] = 0xdc + buf.writeUInt16BE(obj.length, 1) + } else { + buf = Buffer.allocUnsafe(5) + buf[0] = 0xdd + buf.writeUInt32BE(obj.length, 1) + } - for (var i = 0; i < len; i += 4) { - tmp = - (revLookup[b64.charCodeAt(i)] << 18) | - (revLookup[b64.charCodeAt(i + 1)] << 12) | - (revLookup[b64.charCodeAt(i + 2)] << 6) | - revLookup[b64.charCodeAt(i + 3)] - arr[curByte++] = (tmp >> 16) & 0xFF - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF - } + buf = obj.reduce(function (acc, obj) { + acc.append(encode(obj, true)) + return acc + }, bl().append(buf)) + } else if (!disableTimestampEncoding && typeof obj.getDate === 'function') { + return encodeDate(obj) + } else if (typeof obj === 'object') { + buf = encodeExt(obj) || encodeObject(obj) + } else if (typeof obj === 'number') { + if (isFloat(obj)) { + return encodeFloat(obj, forceFloat64) + } else if (obj >= 0) { + if (obj < 128) { + buf = Buffer.allocUnsafe(1) + buf[0] = obj + } else if (obj < 256) { + buf = Buffer.allocUnsafe(2) + buf[0] = 0xcc + buf[1] = obj + } else if (obj < 65536) { + buf = Buffer.allocUnsafe(3) + buf[0] = 0xcd + buf.writeUInt16BE(obj, 1) + } else if (obj <= 0xffffffff) { + buf = Buffer.allocUnsafe(5) + buf[0] = 0xce + buf.writeUInt32BE(obj, 1) + } else if (obj <= 9007199254740991) { + buf = Buffer.allocUnsafe(9) + buf[0] = 0xcf + write64BitUint(buf, obj) + } else { + return encodeFloat(obj, true) + } + } else { + if (obj >= -32) { + buf = Buffer.allocUnsafe(1) + buf[0] = 0x100 + obj + } else if (obj >= -128) { + buf = Buffer.allocUnsafe(2) + buf[0] = 0xd0 + buf.writeInt8(obj, 1) + } else if (obj >= -32768) { + buf = Buffer.allocUnsafe(3) + buf[0] = 0xd1 + buf.writeInt16BE(obj, 1) + } else if (obj > -214748365) { + buf = Buffer.allocUnsafe(5) + buf[0] = 0xd2 + buf.writeInt32BE(obj, 1) + } else if (obj >= -9007199254740991) { + buf = Buffer.allocUnsafe(9) + buf[0] = 0xd3 + write64BitInt(buf, 1, obj) + } else { + return encodeFloat(obj, true) + } + } + } - if (placeHoldersLen === 2) { - tmp = - (revLookup[b64.charCodeAt(i)] << 2) | - (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[curByte++] = tmp & 0xFF - } + if (!buf) { + throw new Error('not implemented yet') + } - if (placeHoldersLen === 1) { - tmp = - (revLookup[b64.charCodeAt(i)] << 10) | - (revLookup[b64.charCodeAt(i + 1)] << 4) | - (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[curByte++] = (tmp >> 8) & 0xFF - arr[curByte++] = tmp & 0xFF + if (avoidSlice) { + return buf + } else { + return buf.slice() + } } - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + - lookup[num >> 12 & 0x3F] + - lookup[num >> 6 & 0x3F] + - lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = - ((uint8[i] << 16) & 0xFF0000) + - ((uint8[i + 1] << 8) & 0xFF00) + - (uint8[i + 2] & 0xFF) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} + function encodeDate (dt) { + var encoded + var millis = dt * 1 + var seconds = Math.floor(millis / 1000) + var nanos = (millis - (seconds * 1000)) * 1E6 -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 + if (nanos || seconds > 0xFFFFFFFF) { + // Timestamp64 + encoded = Buffer.allocUnsafe(10) + encoded[0] = 0xd7 + encoded[1] = -1 - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk( - uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength) - )) - } + var upperNanos = ((nanos * 4)) + var upperSeconds = seconds / Math.pow(2, 32) + var upper = (upperNanos + upperSeconds) & 0xFFFFFFFF + var lower = seconds & 0xFFFFFFFF - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - parts.push( - lookup[tmp >> 2] + - lookup[(tmp << 4) & 0x3F] + - '==' - ) - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + uint8[len - 1] - parts.push( - lookup[tmp >> 10] + - lookup[(tmp >> 4) & 0x3F] + - lookup[(tmp << 2) & 0x3F] + - '=' - ) + encoded.writeInt32BE(upper, 2) + encoded.writeInt32BE(lower, 6) + } else { + // Timestamp32 + encoded = Buffer.allocUnsafe(6) + encoded[0] = 0xd6 + encoded[1] = -1 + encoded.writeUInt32BE(Math.floor(millis / 1000), 2) + } + return bl().append(encoded) } - return parts.join('') -} - + function encodeExt (obj) { + var i + var encoded + var length = -1 + var headers = [] -/***/ }), + for (i = 0; i < encodingTypes.length; i++) { + if (encodingTypes[i].check(obj)) { + encoded = encodingTypes[i].encode(obj) + break + } + } -/***/ "../node_modules/buffer/index.js": -/*!***************************************!*\ - !*** ../node_modules/buffer/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { + if (!encoded) { + return null + } -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> - * @license MIT - */ -/* eslint-disable no-proto */ + // we subtract 1 because the length does not + // include the type + length = encoded.length - 1 + if (length === 1) { + headers.push(0xd4) + } else if (length === 2) { + headers.push(0xd5) + } else if (length === 4) { + headers.push(0xd6) + } else if (length === 8) { + headers.push(0xd7) + } else if (length === 16) { + headers.push(0xd8) + } else if (length < 256) { + headers.push(0xc7) + headers.push(length) + } else if (length < 0x10000) { + headers.push(0xc8) + headers.push(length >> 8) + headers.push(length & 0x00ff) + } else { + headers.push(0xc9) + headers.push(length >> 24) + headers.push((length >> 16) & 0x000000ff) + headers.push((length >> 8) & 0x000000ff) + headers.push(length & 0x000000ff) + } + return bl().append(Buffer.from(headers)).append(encoded) + } -var base64 = __webpack_require__(/*! base64-js */ "../node_modules/base64-js/index.js") -var ieee754 = __webpack_require__(/*! ieee754 */ "../node_modules/ieee754/index.js") -var isArray = __webpack_require__(/*! isarray */ "../node_modules/isarray/index.js") + function encodeObject (obj) { + var acc = [] + var length = 0 + var key + var header -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 + for (key in obj) { + if (obj.hasOwnProperty(key) && + obj[key] !== undefined && + typeof obj[key] !== 'function') { + ++length + acc.push(encode(key, true)) + acc.push(encode(obj[key], true)) + } + } -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. + if (length < 16) { + header = Buffer.allocUnsafe(1) + header[0] = 0x80 | length + } else if (length < 0xFFFF) { + header = Buffer.allocUnsafe(3) + header[0] = 0xde + header.writeUInt16BE(length, 1) + } else { + header = Buffer.allocUnsafe(5) + header[0] = 0xdf + header.writeUInt32BE(length, 1) + } - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined - ? global.TYPED_ARRAY_SUPPORT - : typedArraySupport() + acc.unshift(header) -/* - * Export kMaxLength after typed array support is determined. - */ -exports.kMaxLength = kMaxLength() + var result = acc.reduce(function (list, buf) { + return list.append(buf) + }, bl()) -function typedArraySupport () { - try { - var arr = new Uint8Array(1) - arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} - return arr.foo() === 42 && // typed array instances can be augmented - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false + return result } -} -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff + return encode } -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length) - } - that.length = length +function write64BitUint (buf, obj) { + // Write long byte by byte, in big-endian order + for (var currByte = 7; currByte >= 0; currByte--) { + buf[currByte + 1] = (obj & 0xff) + obj = obj / 256 } - - return that } -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ +function write64BitInt (buf, offset, num) { + var negate = num < 0 -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) + if (negate) { + num = Math.abs(num) } - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) + var lo = num % 4294967296 + var hi = num / 4294967296 + buf.writeUInt32BE(Math.floor(hi), offset + 0) + buf.writeUInt32BE(lo, offset + 4) + + if (negate) { + var carry = 1 + for (var i = offset + 7; i >= offset; i--) { + var v = (buf[i] ^ 0xff) + carry + buf[i] = v & 0xff + carry = v >> 8 } - return allocUnsafe(this, arg) } - return from(this, arg, encodingOrOffset, length) } -Buffer.poolSize = 8192 // not used by this implementation +function isFloat (n) { + return n % 1 !== 0 +} -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype - return arr +function isNaN (n) { + /* eslint-disable no-self-compare */ + return n !== n && typeof n === 'number' + /* eslint-enable no-self-compare */ } -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') +function encodeFloat (obj, forceFloat64) { + var useDoublePrecision = true + + // If `fround` is supported, we can check if a float + // is double or single precision by rounding the object + // to single precision and comparing the difference. + // If it's not supported, it's safer to use a 64 bit + // float so we don't lose precision without meaning to. + if (Math.fround) { + useDoublePrecision = Math.fround(obj) !== obj } - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) + if (forceFloat64) { + useDoublePrecision = true } - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) + var buf + + if (useDoublePrecision) { + buf = Buffer.allocUnsafe(9) + buf[0] = 0xcb + buf.writeDoubleBE(obj, 1) + } else { + buf = Buffer.allocUnsafe(5) + buf[0] = 0xca + buf.writeFloatBE(obj, 1) } - return fromObject(that, value) + return buf } -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -} -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array - if (typeof Symbol !== 'undefined' && Symbol.species && - Buffer[Symbol.species] === Buffer) { - // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true - }) - } -} +/***/ }), -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} +/***/ "../node_modules/msgpack5/lib/streams.js": +/*!***********************************************!*\ + !*** ../node_modules/msgpack5/lib/streams.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -function alloc (that, size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} +"use strict"; -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -} -function allocUnsafe (that, size) { - assertSize(size) - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0 - } - } - return that -} +var Transform = __webpack_require__(/*! readable-stream */ "../node_modules/readable-stream/readable-browser.js").Transform +var inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js") +var bl = __webpack_require__(/*! bl */ "../node_modules/bl/bl.js") -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) +function Base (opts) { + opts = opts || {} + + opts.objectMode = true + opts.highWaterMark = 16 + + Transform.call(this, opts) + + this._msgpack = opts.msgpack } -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } +inherits(Base, Transform) - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') +function Encoder (opts) { + if (!(this instanceof Encoder)) { + opts = opts || {} + opts.msgpack = this + return new Encoder(opts) } - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) + Base.call(this, opts) + this._wrap = ('wrap' in opts) && opts.wrap +} - var actual = that.write(string, encoding) +inherits(Encoder, Base) - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual) +Encoder.prototype._transform = function (obj, enc, done) { + var buf = null + + try { + buf = this._msgpack.encode(this._wrap ? obj.value : obj).slice(0) + } catch (err) { + this.emit('error', err) + return done() } - return that + this.push(buf) + done() } -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - that = createBuffer(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 +function Decoder (opts) { + if (!(this instanceof Decoder)) { + opts = opts || {} + opts.msgpack = this + return new Decoder(opts) } - return that -} -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength // this throws if `array` is not a valid ArrayBuffer + Base.call(this, opts) - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } + this._chunks = bl() + this._wrap = ('wrap' in opts) && opts.wrap +} - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') +inherits(Decoder, Base) + +Decoder.prototype._transform = function (buf, enc, done) { + if (buf) { + this._chunks.append(buf) } - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array) - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset) - } else { - array = new Uint8Array(array, byteOffset, length) + try { + var result = this._msgpack.decode(this._chunks) + if (this._wrap) { + result = {value: result} + } + this.push(result) + } catch (err) { + if (err instanceof this._msgpack.IncompleteBufferError) { + done() + } else { + this.emit('error', err) + } + return } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array - that.__proto__ = Buffer.prototype + if (this._chunks.length > 0) { + this._transform(null, enc, done) } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array) + done() } - return that } -function fromObject (that, obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - that = createBuffer(that, len) +module.exports.decoder = Decoder +module.exports.encoder = Encoder - if (that.length === 0) { - return that - } - obj.copy(that, 0, 0, len) - return that - } +/***/ }), - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } +/***/ "../node_modules/process-nextick-args/index.js": +/*!*****************************************************!*\ + !*** ../node_modules/process-nextick-args/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } +"use strict"; +/* WEBPACK VAR INJECTION */(function(process) { - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +if (!process.version || + process.version.indexOf('v0.') === 0 || + process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { + module.exports = { nextTick: nextTick }; +} else { + module.exports = process } -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) } -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - var x = a.length - var y = b.length +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../process/browser.js */ "../node_modules/process/browser.js"))) - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } +/***/ }), - if (x < y) return -1 - if (y < x) return 1 - return 0 -} +/***/ "../node_modules/process/browser.js": +/*!******************************************!*\ + !*** ../node_modules/process/browser.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).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 true - default: - return false - } -} +// shim for using process in browser +var process = module.exports = {}; -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. - if (list.length === 0) { - return Buffer.alloc(0) - } +var cachedSetTimeout; +var cachedClearTimeout; - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } } - } - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer + } +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string - } - var len = string.length - if (len === 0) return 0 - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } } -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} - if (end === undefined || end > this.length) { - end = this.length - } +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; - if (end <= 0) { - return '' - } + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; - if (end <= start) { - return '' - } +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; - if (!encoding) encoding = 'utf8' +function noop() {} - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) +process.listeners = function (name) { return [] } - case 'ascii': - return asciiSlice(this, start, end) +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; - case 'base64': - return base64Slice(this, start, end) - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) +/***/ }), - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} +/***/ "../node_modules/readable-stream/lib/_stream_duplex.js": +/*!*************************************************************!*\ + !*** ../node_modules/readable-stream/lib/_stream_duplex.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} +/*<replacement>*/ -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} +var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/process-nextick-args/index.js"); +/*</replacement>*/ -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} +/*<replacement>*/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) { + keys.push(key); + }return keys; +}; +/*</replacement>*/ -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '<Buffer ' + str + '>' -} +module.exports = Duplex; -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } +/*<replacement>*/ +var util = __webpack_require__(/*! core-util-is */ "../node_modules/core-util-is/lib/util.js"); +util.inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js"); +/*</replacement>*/ - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } +var Readable = __webpack_require__(/*! ./_stream_readable */ "../node_modules/readable-stream/lib/_stream_readable.js"); +var Writable = __webpack_require__(/*! ./_stream_writable */ "../node_modules/readable-stream/lib/_stream_writable.js"); - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } +util.inherits(Duplex, Readable); - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 +{ + // avoid scope creep, the keys array can then be collected + var keys = objectKeys(Writable.prototype); + for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; } +} - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 +function Duplex(options) { + if (!(this instanceof Duplex)) return new Duplex(options); - if (this === target) return 0 + Readable.call(this, options); + Writable.call(this, options); - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) + if (options && options.readable === false) this.readable = false; - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) + if (options && options.writable === false) this.writable = false; - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - if (x < y) return -1 - if (y < x) return 1 - return 0 + this.once('end', onend); } -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) +Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; } +}); - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } + // no more data can be written. + // But allow more writes to happen in this tick. + pna.nextTick(onEndNT, this); +} - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 +function onEndNT(self) { + self.end(); +} + +Object.defineProperty(Duplex.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined || this._writableState === undefined) { + return false; } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } + return this._readableState.destroyed && this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; + +/***/ }), + +/***/ "../node_modules/readable-stream/lib/_stream_passthrough.js": +/*!******************************************************************!*\ + !*** ../node_modules/readable-stream/lib/_stream_passthrough.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. - throw new TypeError('val must be string, number or Buffer') -} +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } +module.exports = PassThrough; - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } +var Transform = __webpack_require__(/*! ./_stream_transform */ "../node_modules/readable-stream/lib/_stream_transform.js"); - return -1 -} +/*<replacement>*/ +var util = __webpack_require__(/*! core-util-is */ "../node_modules/core-util-is/lib/util.js"); +util.inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js"); +/*</replacement>*/ -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} +util.inherits(PassThrough, Transform); -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} +function PassThrough(options) { + if (!(this instanceof PassThrough)) return new PassThrough(options); -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) + Transform.call(this, options); } -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } +PassThrough.prototype._transform = function (chunk, encoding, cb) { + cb(null, chunk); +}; - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') +/***/ }), - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} +/***/ "../node_modules/readable-stream/lib/_stream_readable.js": +/*!***************************************************************!*\ + !*** ../node_modules/readable-stream/lib/_stream_readable.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} +"use strict"; +/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} +/*<replacement>*/ -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} +var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/process-nextick-args/index.js"); +/*</replacement>*/ -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } +module.exports = Readable; - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining +/*<replacement>*/ +var isArray = __webpack_require__(/*! isarray */ "../node_modules/isarray/index.js"); +/*</replacement>*/ - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } +/*<replacement>*/ +var Duplex; +/*</replacement>*/ - if (!encoding) encoding = 'utf8' +Readable.ReadableState = ReadableState; - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) +/*<replacement>*/ +var EE = __webpack_require__(/*! events */ "../node_modules/events/events.js").EventEmitter; - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/*</replacement>*/ - case 'ascii': - return asciiWrite(this, string, offset, length) +/*<replacement>*/ +var Stream = __webpack_require__(/*! ./internal/streams/stream */ "../node_modules/readable-stream/lib/internal/streams/stream-browser.js"); +/*</replacement>*/ - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) +/*<replacement>*/ - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) +var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) +/*</replacement>*/ - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } +/*<replacement>*/ +var util = __webpack_require__(/*! core-util-is */ "../node_modules/core-util-is/lib/util.js"); +util.inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js"); +/*</replacement>*/ + +/*<replacement>*/ +var debugUtil = __webpack_require__(/*! util */ 0); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/*</replacement>*/ + +var BufferList = __webpack_require__(/*! ./internal/streams/BufferList */ "../node_modules/readable-stream/lib/internal/streams/BufferList.js"); +var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "../node_modules/readable-stream/lib/internal/streams/destroy.js"); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; } -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} +function ReadableState(options, stream) { + Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/readable-stream/lib/_stream_duplex.js"); -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} + options = options || {}; -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var readableHwm = options.readableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm; - res.push(codePoint) - i += bytesPerSequence - } + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); - return decodeCodePointsArray(res) -} + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} + // has it been destroyed + this.destroyed = false; -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) + // if true, a maybeReadMore has been scheduled + this.readingMore = false; - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "../node_modules/string_decoder/lib/string_decoder.js").StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; } - return ret } -function hexSlice (buf, start, end) { - var len = buf.length +function Readable(options) { + Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/readable-stream/lib/_stream_duplex.js"); - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len + if (!(this instanceof Readable)) return new Readable(options); - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} + this._readableState = new ReadableState(options, this); -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + // legacy + this.readable = true; + + if (options) { + if (typeof options.read === 'function') this._read = options.read; + + if (typeof options.destroy === 'function') this._destroy = options.destroy; } - return res + + Stream.call(this); } -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end +Object.defineProperty(Readable.prototype, 'destroyed', { + get: function () { + if (this._readableState === undefined) { + return false; + } + return this._readableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; } +}); - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } +Readable.prototype.destroy = destroyImpl.destroy; +Readable.prototype._undestroy = destroyImpl.undestroy; +Readable.prototype._destroy = function (err, cb) { + this.push(null); + cb(err); +}; - if (end < start) end = start +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function (chunk, encoding) { + var state = this._readableState; + var skipChunkCheck; - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end) - newBuf.__proto__ = Buffer.prototype - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start] + if (!state.objectMode) { + if (typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = Buffer.from(chunk, encoding); + encoding = ''; + } + skipChunkCheck = true; } + } else { + skipChunkCheck = true; } - return newBuf -} + return readableAddChunk(this, chunk, encoding, false, skipChunkCheck); +}; -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function (chunk) { + return readableAddChunk(this, chunk, null, true, false); +}; -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) { + var state = stream._readableState; + if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else { + var er; + if (!skipChunkCheck) er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) { + chunk = _uint8ArrayToBuffer(chunk); + } - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul + if (addToFront) { + if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true); + } else if (state.ended) { + stream.emit('error', new Error('stream.push() after EOF')); + } else { + state.reading = false; + if (state.decoder && !encoding) { + chunk = state.decoder.write(chunk); + if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state); + } else { + addChunk(stream, state, chunk, false); + } + } + } else if (!addToFront) { + state.reading = false; + } } - return val + return needMoreData(state); } -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } +function addChunk(stream, state, chunk, addToFront) { + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul + if (state.needReadable) emitReadable(stream); } - - return val + maybeReadMore(stream, state); } -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] +function chunkInvalid(state, chunk) { + var er; + if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; } -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); } -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = __webpack_require__(/*! string_decoder/ */ "../node_modules/string_decoder/lib/string_decoder.js").StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; } -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; } -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function (n) { + debug('read', n); + n = parseInt(n, 10); + var state = this._readableState; + var nOrig = n; - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul + if (n !== 0) state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); + return null; } - mul *= 0x80 - if (val >= mul) val -= Math.pow(2, 8 * byteLength) + n = howMuchToRead(n, state); - return val -} + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } else if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - return val -} + var ret; + if (n > 0) ret = fromList(n, state);else ret = null; -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} + if (ret === null) { + state.needReadable = true; + n = 0; + } else { + state.length -= n; + } -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) + if (ret !== null) this.emit('data', ret); - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} + return ret; +}; -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); } -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream); + } } -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); } -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + pna.nextTick(maybeReadMore_, stream, state); + } } -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; } -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function (n) { + this.emit('error', new Error('_read() is not implemented')); +}; -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } +Readable.prototype.pipe = function (dest, pipeOpts) { + var src = this; + var state = this._readableState; - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - return offset + byteLength -} + var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) + var endFn = doEnd ? onend : unpipe; + if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable, unpipeInfo) { + debug('onunpipe'); + if (readable === src) { + if (unpipeInfo && unpipeInfo.hasUnpiped === false) { + unpipeInfo.hasUnpiped = true; + cleanup(); + } + } } - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF + function onend() { + debug('onend'); + dest.end(); } - return offset + byteLength -} + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', unpipe); + src.removeListener('data', ondata); -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } -} -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + increasedAwaitDrain = true; + } + src.pause(); + } } - return offset + 2 -} -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } - return offset + 2 -} -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); } - return offset + 4 -} + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) + function unpipe() { + debug('unpipe'); + src.unpipe(dest); } - return offset + 4 -} -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) + // tell the dest that it's being piped to + dest.emit('pipe', src); - checkInt(this, value, offset, byteLength, limit - 1, -limit) + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); } - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } + return dest; +}; - return offset + byteLength +function pipeOnDrain(src) { + return function () { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; } -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) +Readable.prototype.unpipe = function (dest) { + var state = this._readableState; + var unpipeInfo = { hasUnpiped: false }; - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; } - return offset + byteLength -} + // slow case. multiple pipe destinations. -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) + for (var i = 0; i < len; i++) { + dests[i].emit('unpipe', this, unpipeInfo); + }return this; } - return offset + 2 -} -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} + // try to find the right one. + var index = indexOf(state.pipes, dest); + if (index === -1) return this; -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) + state.pipes.splice(index, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) state.pipes = state.pipes[0]; + + dest.emit('unpipe', this, unpipeInfo); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { + var state = this._readableState; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; + state.emittedReadable = false; + if (!state.reading) { + pna.nextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this); + } + } } - return offset + 4 + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); } -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function () { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} + return this; +}; -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + pna.nextTick(resume_, stream, state); } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 } -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) + state.resumeScheduled = false; + state.awaitDrain = 0; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) stream.read(0); } -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) +Readable.prototype.pause = function () { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} + return this; +}; -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + while (state.flowing && stream.read() !== null) {} } -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function (stream) { + var _this = this; -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start + var state = this._readableState; + var paused = false; - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 + stream.on('end', function () { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) _this.push(chunk); + } - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') + _this.push(null); + }); - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } + stream.on('data', function (chunk) { + debug('wrapped data'); + if (state.decoder) chunk = state.decoder.write(chunk); - var len = end - start - var i + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] + var ret = _this.push(chunk); + if (!ret) { + paused = true; + stream.pause(); } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function (method) { + return function () { + return stream[method].apply(stream, arguments); + }; + }(i); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ) + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); } - return len + return ret; } -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); + } + break; } - if (val.length === 1) { - var code = val.charCodeAt(0) - if (code < 256) { - val = code + ++c; + } + list.length -= c; + return ret; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = Buffer.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); } + break; } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255 + ++c; } + list.length -= c; + return ret; +} - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + pna.nextTick(endReadableNT, state, stream); } +} - if (end <= start) { - return this +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); } +} - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 +function indexOf(xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../process/browser.js */ "../node_modules/process/browser.js"))) - if (!val) val = 0 +/***/ }), - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()) - var len = bytes.length - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } +/***/ "../node_modules/readable-stream/lib/_stream_transform.js": +/*!****************************************************************!*\ + !*** ../node_modules/readable-stream/lib/_stream_transform.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { - return this -} +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. -// HELPER FUNCTIONS -// ================ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} +module.exports = Transform; -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} +var Duplex = __webpack_require__(/*! ./_stream_duplex */ "../node_modules/readable-stream/lib/_stream_duplex.js"); -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] +/*<replacement>*/ +var util = __webpack_require__(/*! core-util-is */ "../node_modules/core-util-is/lib/util.js"); +util.inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js"); +/*</replacement>*/ - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) +util.inherits(Transform, Duplex); - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } +function afterTransform(er, data) { + var ts = this._transformState; + ts.transforming = false; - // valid lead - leadSurrogate = codePoint + var cb = ts.writecb; - continue - } + if (!cb) { + return this.emit('error', new Error('write callback called multiple times')); + } - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } + ts.writechunk = null; + ts.writecb = null; - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } + if (data != null) // single equals check for both `null` and `undefined` + this.push(data); - leadSurrogate = null + cb(er); - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } + var rs = this._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + this._read(rs.highWaterMark); + } +} + +function Transform(options) { + if (!(this instanceof Transform)) return new Transform(options); + + Duplex.call(this, options); + + this._transformState = { + afterTransform: afterTransform.bind(this), + needTransform: false, + transforming: false, + writecb: null, + writechunk: null, + writeencoding: null + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; } - return bytes + // When the writable side finishes, then flush out anything remaining. + this.on('prefinish', prefinish); } -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) +function prefinish() { + var _this = this; + + if (typeof this._flush === 'function') { + this._flush(function (er, data) { + done(_this, er, data); + }); + } else { + done(this, null, null); } - return byteArray } -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break +Transform.prototype.push = function (chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function (chunk, encoding, cb) { + throw new Error('_transform() is not implemented'); +}; - return byteArray -} +Transform.prototype._write = function (chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); + } +}; -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function (n) { + var ts = this._transformState; -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; } - return i -} +}; -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} +Transform.prototype._destroy = function (err, cb) { + var _this2 = this; -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) + Duplex.prototype._destroy.call(this, err, function (err2) { + cb(err2); + _this2.emit('close'); + }); +}; + +function done(stream, er, data) { + if (er) return stream.emit('error', er); + + if (data != null) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0'); + + if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming'); + + return stream.push(null); +} /***/ }), -/***/ "../node_modules/events/events.js": -/*!****************************************!*\ - !*** ../node_modules/events/events.js ***! - \****************************************/ +/***/ "../node_modules/readable-stream/lib/_stream_writable.js": +/*!***************************************************************!*\ + !*** ../node_modules/readable-stream/lib/_stream_writable.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -// Copyright Joyent, Inc. and other Node contributors. +/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the @@ -14438,773 +9809,877 @@ function isnan (val) { // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. -var R = typeof Reflect === 'object' ? Reflect : null -var ReflectApply = R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - } -var ReflectOwnKeys -if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys -} else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target) - .concat(Object.getOwnPropertySymbols(target)); - }; -} else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; -} +/*<replacement>*/ + +var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/process-nextick-args/index.js"); +/*</replacement>*/ + +module.exports = Writable; + +/* <replacement> */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +function CorkedRequest(state) { + var _this = this; + + this.next = null; + this.entry = null; + this.finish = function () { + onCorkedFinish(_this, state); + }; +} +/* </replacement> */ + +/*<replacement>*/ +var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; +/*</replacement>*/ + +/*<replacement>*/ +var Duplex; +/*</replacement>*/ + +Writable.WritableState = WritableState; + +/*<replacement>*/ +var util = __webpack_require__(/*! core-util-is */ "../node_modules/core-util-is/lib/util.js"); +util.inherits = __webpack_require__(/*! inherits */ "../node_modules/inherits/inherits_browser.js"); +/*</replacement>*/ + +/*<replacement>*/ +var internalUtil = { + deprecate: __webpack_require__(/*! util-deprecate */ "../node_modules/util-deprecate/browser.js") +}; +/*</replacement>*/ + +/*<replacement>*/ +var Stream = __webpack_require__(/*! ./internal/streams/stream */ "../node_modules/readable-stream/lib/internal/streams/stream-browser.js"); +/*</replacement>*/ + +/*<replacement>*/ + +var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer; +var OurUint8Array = global.Uint8Array || function () {}; +function _uint8ArrayToBuffer(chunk) { + return Buffer.from(chunk); +} +function _isUint8Array(obj) { + return Buffer.isBuffer(obj) || obj instanceof OurUint8Array; +} + +/*</replacement>*/ + +var destroyImpl = __webpack_require__(/*! ./internal/streams/destroy */ "../node_modules/readable-stream/lib/internal/streams/destroy.js"); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/readable-stream/lib/_stream_duplex.js"); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var writableHwm = options.writableHighWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + + if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; -function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); -} + // a flag to see when we're in the middle of a write. + this.writing = false; -var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { - return value !== value; -} + // when true all writes will be buffered until .uncork() call + this.corked = 0; -function EventEmitter() { - EventEmitter.init.call(this); -} -module.exports = EventEmitter; + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; -// Backwards-compat with node 0.10.x -EventEmitter.EventEmitter = EventEmitter; + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; -EventEmitter.prototype._events = undefined; -EventEmitter.prototype._eventsCount = 0; -EventEmitter.prototype._maxListeners = undefined; + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; -// By default EventEmitters will print a warning if more than 10 listeners are -// added to it. This is a useful default which helps finding memory leaks. -var defaultMaxListeners = 10; + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; -Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); - } - defaultMaxListeners = arg; - } -}); + // the amount that is being written when _write is called. + this.writelen = 0; -EventEmitter.init = function() { + this.bufferedRequest = null; + this.lastBufferedRequest = null; - if (this._events === undefined || - this._events === Object.getPrototypeOf(this)._events) { - this._events = Object.create(null); - this._eventsCount = 0; - } + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; - this._maxListeners = this._maxListeners || undefined; -}; + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; -// Obviously not all Emitters should be limited to 10. This function allows -// that to be increased. Set to zero for unlimited. -EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); - } - this._maxListeners = n; - return this; -}; + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; -function $getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + this.corkedRequestsFree = new CorkedRequest(this); } -EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return $getMaxListeners(this); +WritableState.prototype.getBuffer = function getBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; }; -EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); +(function () { + try { + Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function () { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003') + }); + } catch (_) {} +})(); - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +var realHasInstance; +if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') { + realHasInstance = Function.prototype[Symbol.hasInstance]; + Object.defineProperty(Writable, Symbol.hasInstance, { + value: function (object) { + if (realHasInstance.call(this, object)) return true; + if (this !== Writable) return false; - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event + return object && object._writableState instanceof WritableState; } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } + }); +} else { + realHasInstance = function (object) { + return object instanceof this; + }; +} - var handler = events[type]; +function Writable(options) { + Duplex = Duplex || __webpack_require__(/*! ./_stream_duplex */ "../node_modules/readable-stream/lib/_stream_duplex.js"); - if (handler === undefined) - return false; + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); } - return true; -}; + this._writableState = new WritableState(options, this); -function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; + // legacy. + this.writable = true; - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } + if (options) { + if (typeof options.write === 'function') this._write = options.write; - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); + if (typeof options.writev === 'function') this._writev = options.writev; - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; + if (typeof options.destroy === 'function') this._destroy = options.destroy; + + if (typeof options.final === 'function') this._final = options.final; } - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } + Stream.call(this); +} - // Check for listener leak - m = $getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; - return target; +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); } -EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); -}; +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +function validChunk(stream, state, chunk, cb) { + var valid = true; + var er = false; -EventEmitter.prototype.on = EventEmitter.prototype.addListener; + if (chunk === null) { + er = new TypeError('May not write null values to stream'); + } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + if (er) { + stream.emit('error', er); + pna.nextTick(cb, er); + valid = false; + } + return valid; +} -EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; +Writable.prototype.write = function (chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + var isBuf = !state.objectMode && _isUint8Array(chunk); -function onceWrapper() { - var args = []; - for (var i = 0; i < arguments.length; i++) args.push(arguments[i]); - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - ReflectApply(this.listener, this.target, args); + if (isBuf && !Buffer.isBuffer(chunk)) { + chunk = _uint8ArrayToBuffer(chunk); } -} -function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; -} + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } -EventEmitter.prototype.once = function once(type, listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; + + if (typeof cb !== 'function') cb = nop; + + if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb); } - this.on(type, _onceWrap(this, type, listener)); - return this; + + return ret; }; -EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; +Writable.prototype.cork = function () { + var state = this._writableState; -// Emits a 'removeListener' event if and only if the listener was removed. -EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; + state.corked++; +}; - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } +Writable.prototype.uncork = function () { + var state = this._writableState; - events = this._events; - if (events === undefined) - return this; + if (state.corked) { + state.corked--; - list = events[type]; - if (list === undefined) - return this; + if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); + } +}; - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; + return this; +}; - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { + chunk = Buffer.from(chunk, encoding); + } + return chunk; +} - if (position < 0) - return this; +Object.defineProperty(Writable.prototype, 'writableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { + if (!isBuf) { + var newChunk = decodeChunk(state, chunk, encoding); + if (chunk !== newChunk) { + isBuf = true; + encoding = 'buffer'; + chunk = newChunk; + } + } + var len = state.objectMode ? 1 : chunk.length; - if (list.length === 1) - events[type] = list[0]; + state.length += len; - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; - return this; + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: isBuf, + callback: cb, + next: null }; + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + state.bufferedRequestCount += 1; + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } -EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - -EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; + return ret; +} - events = this._events; - if (events === undefined) - return this; +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } + if (sync) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + finishMaybe(stream, state); + } +} - listeners = events[type]; +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; - return this; - }; + onwriteStateUpdate(state); -function _listeners(target, type, unwrap) { - var events = target._events; + if (er) onwriteError(stream, state, sync, er, cb);else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); - if (events === undefined) - return []; + if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { + clearBuffer(stream, state); + } - var evlistener = events[type]; - if (evlistener === undefined) - return []; + if (sync) { + /*<replacement>*/ + asyncWrite(afterWrite, stream, state, finished, cb); + /*</replacement>*/ + } else { + afterWrite(stream, state, finished, cb); + } + } +} - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; +function afterWrite(stream, state, finished, cb) { + if (!finished) onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } } -EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); -}; +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; -EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); -}; + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var l = state.bufferedRequestCount; + var buffer = new Array(l); + var holder = state.corkedRequestsFree; + holder.entry = entry; -EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } -}; + var count = 0; + var allBuffers = true; + while (entry) { + buffer[count] = entry; + if (!entry.isBuf) allBuffers = false; + entry = entry.next; + count += 1; + } + buffer.allBuffers = allBuffers; -EventEmitter.prototype.listenerCount = listenerCount; -function listenerCount(type) { - var events = this._events; + doWrite(stream, state, true, state.length, buffer, '', holder.finish); - if (events !== undefined) { - var evlistener = events[type]; + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + state.pendingcb++; + state.lastBufferedRequest = null; + if (holder.next) { + state.corkedRequestsFree = holder.next; + holder.next = null; + } else { + state.corkedRequestsFree = new CorkedRequest(state); + } + state.bufferedRequestCount = 0; + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + state.bufferedRequestCount--; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } } + + if (entry === null) state.lastBufferedRequest = null; } - return 0; + state.bufferedRequest = entry; + state.bufferProcessing = false; } -EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; +Writable.prototype._write = function (chunk, encoding, cb) { + cb(new Error('_write() is not implemented')); }; -function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; -} +Writable.prototype._writev = null; -function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); -} +Writable.prototype.end = function (chunk, encoding, cb) { + var state = this._writableState; -function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; } - return ret; -} - -/***/ }), + if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); -/***/ "../node_modules/ieee754/index.js": -/*!****************************************!*\ - !*** ../node_modules/ieee754/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) endWritable(this, state, cb); +}; - i += d +function needFinish(state) { + return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; +} +function callFinal(stream, state) { + stream._final(function (err) { + state.pendingcb--; + if (err) { + stream.emit('error', err); + } + state.prefinished = true; + stream.emit('prefinish'); + finishMaybe(stream, state); + }); +} +function prefinish(stream, state) { + if (!state.prefinished && !state.finalCalled) { + if (typeof stream._final === 'function') { + state.pendingcb++; + state.finalCalled = true; + pna.nextTick(callFinal, stream, state); + } else { + state.prefinished = true; + stream.emit('prefinish'); + } + } +} - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {} +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + prefinish(stream, state); + if (state.pendingcb === 0) { + state.finished = true; + stream.emit('finish'); + } + } + return need; +} - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {} +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) pna.nextTick(cb);else stream.once('finish', cb); + } + state.ended = true; + stream.writable = false; +} - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) +function onCorkedFinish(corkReq, state, err) { + var entry = corkReq.entry; + corkReq.entry = null; + while (entry) { + var cb = entry.callback; + state.pendingcb--; + cb(err); + entry = entry.next; + } + if (state.corkedRequestsFree) { + state.corkedRequestsFree.next = corkReq; } else { - m = m + Math.pow(2, mLen) - e = e - eBias + state.corkedRequestsFree = corkReq; } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) } -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = (nBytes * 8) - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; } - if (value * c >= 2) { - e++ - c /= 2 + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; } - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = ((value * c) - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; } +}); - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "../node_modules/process/browser.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "../node_modules/timers-browserify/main.js").setImmediate, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} +/***/ }), - buffer[offset + i - d] |= s * 128 -} +/***/ "../node_modules/readable-stream/lib/internal/streams/BufferList.js": +/*!**************************************************************************!*\ + !*** ../node_modules/readable-stream/lib/internal/streams/BufferList.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -/***/ }), -/***/ "../node_modules/inherits/inherits_browser.js": -/*!****************************************************!*\ - !*** ../node_modules/inherits/inherits_browser.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } +var Buffer = __webpack_require__(/*! safe-buffer */ "../node_modules/safe-buffer/index.js").Buffer; +var util = __webpack_require__(/*! util */ 1); + +function copyBuffer(src, target, offset) { + src.copy(target, offset); } +module.exports = function () { + function BufferList() { + _classCallCheck(this, BufferList); -/***/ }), + this.head = null; + this.tail = null; + this.length = 0; + } -/***/ "../node_modules/isarray/index.js": -/*!****************************************!*\ - !*** ../node_modules/isarray/index.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + BufferList.prototype.push = function push(v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; + }; -var toString = {}.toString; + BufferList.prototype.unshift = function unshift(v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; + }; -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; + BufferList.prototype.shift = function shift() { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; + }; + BufferList.prototype.clear = function clear() { + this.head = this.tail = null; + this.length = 0; + }; -/***/ }), + BufferList.prototype.join = function join(s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; + }; -/***/ "../node_modules/process/browser.js": -/*!******************************************!*\ - !*** ../node_modules/process/browser.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { + BufferList.prototype.concat = function concat(n) { + if (this.length === 0) return Buffer.alloc(0); + if (this.length === 1) return this.head.data; + var ret = Buffer.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + copyBuffer(p.data, ret, i); + i += p.data.length; + p = p.next; + } + return ret; + }; -// shim for using process in browser -var process = module.exports = {}; + return BufferList; +}(); -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. +if (util && util.inspect && util.inspect.custom) { + module.exports.prototype[util.inspect.custom] = function () { + var obj = util.inspect({ length: this.length }); + return this.constructor.name + ' ' + obj; + }; +} -var cachedSetTimeout; -var cachedClearTimeout; +/***/ }), -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } +/***/ "../node_modules/readable-stream/lib/internal/streams/destroy.js": +/*!***********************************************************************!*\ + !*** ../node_modules/readable-stream/lib/internal/streams/destroy.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } +/*<replacement>*/ +var pna = __webpack_require__(/*! process-nextick-args */ "../node_modules/process-nextick-args/index.js"); +/*</replacement>*/ +// undocumented cb() API, needed for core, not for public API +function destroy(err, cb) { + var _this = this; -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; + var readableDestroyed = this._readableState && this._readableState.destroyed; + var writableDestroyed = this._writableState && this._writableState.destroyed; -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); + if (readableDestroyed || writableDestroyed) { + if (cb) { + cb(err); + } else if (err && (!this._writableState || !this._writableState.errorEmitted)) { + pna.nextTick(emitErrorNT, this, err); } -} + return this; + } -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + if (this._writableState) { + this._writableState.destroyed = true; + } + + this._destroy(err || null, function (err) { + if (!cb && err) { + pna.nextTick(emitErrorNT, _this, err); + if (_this._writableState) { + _this._writableState.errorEmitted = true; + } + } else if (cb) { + cb(err); } - currentQueue = null; - draining = false; - runClearTimeout(timeout); + }); + + return this; } -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; +function undestroy() { + if (this._readableState) { + this._readableState.destroyed = false; + this._readableState.reading = false; + this._readableState.ended = false; + this._readableState.endEmitted = false; + } -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; + if (this._writableState) { + this._writableState.destroyed = false; + this._writableState.ended = false; + this._writableState.ending = false; + this._writableState.finished = false; + this._writableState.errorEmitted = false; + } } -Item.prototype.run = function () { - this.fun.apply(null, this.array); + +function emitErrorNT(self, err) { + self.emit('error', err); +} + +module.exports = { + destroy: destroy, + undestroy: undestroy }; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; -function noop() {} +/***/ }), -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; +/***/ "../node_modules/readable-stream/lib/internal/streams/stream-browser.js": +/*!******************************************************************************!*\ + !*** ../node_modules/readable-stream/lib/internal/streams/stream-browser.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -process.listeners = function (name) { return [] } +module.exports = __webpack_require__(/*! events */ "../node_modules/events/events.js").EventEmitter; -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; +/***/ }), + +/***/ "../node_modules/readable-stream/readable-browser.js": +/*!***********************************************************!*\ + !*** ../node_modules/readable-stream/readable-browser.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +exports = module.exports = __webpack_require__(/*! ./lib/_stream_readable.js */ "../node_modules/readable-stream/lib/_stream_readable.js"); +exports.Stream = exports; +exports.Readable = exports; +exports.Writable = __webpack_require__(/*! ./lib/_stream_writable.js */ "../node_modules/readable-stream/lib/_stream_writable.js"); +exports.Duplex = __webpack_require__(/*! ./lib/_stream_duplex.js */ "../node_modules/readable-stream/lib/_stream_duplex.js"); +exports.Transform = __webpack_require__(/*! ./lib/_stream_transform.js */ "../node_modules/readable-stream/lib/_stream_transform.js"); +exports.PassThrough = __webpack_require__(/*! ./lib/_stream_passthrough.js */ "../node_modules/readable-stream/lib/_stream_passthrough.js"); /***/ }), @@ -15862,6 +11337,85 @@ exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || /***/ }), +/***/ "../node_modules/util-deprecate/browser.js": +/*!*************************************************!*\ + !*** ../node_modules/util-deprecate/browser.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(global) { +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "../node_modules/webpack/buildin/global.js"))) + +/***/ }), + /***/ "../node_modules/util/support/isBufferBrowser.js": /*!*******************************************************!*\ !*** ../node_modules/util/support/isBufferBrowser.js ***! diff --git a/src/Components/Browser.JS/dist/Release/blazor.server.js b/src/Components/Browser.JS/dist/Release/blazor.server.js index cf70e47bf12e71fabaac0118071ad9beeba97f2a..4beb03c01dd0d32e4deb8de0ebbbb38b7a1c6cb4 100644 --- a/src/Components/Browser.JS/dist/Release/blazor.server.js +++ b/src/Components/Browser.JS/dist/Release/blazor.server.js @@ -1,15 +1,15 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=54)}([function(e,t,n){"use strict";var r;n.d(t,"a",function(){return r}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(r||(r={}))},function(e,t,n){"use strict";var r;n.d(t,"a",function(){return r}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return h}),n.d(t,"e",function(){return f}),n.d(t,"d",function(){return p}),n.d(t,"b",function(){return d});var r=n(0),o=n(9),i=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},s=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=function(){function e(){}return e.isRequired=function(e,t){if(null==e)throw new Error("The '"+t+"' argument is required.")},e.isIn=function(e,t,n){if(!(e in t))throw new Error("Unknown "+n+" value: "+e+".")},e}(),c=function(){function e(){}return Object.defineProperty(e,"isBrowser",{get:function(){return"object"==typeof window},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWebWorker",{get:function(){return"object"==typeof self&&"importScripts"in self},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isNode",{get:function(){return!this.isBrowser&&!this.isWebWorker},enumerable:!0,configurable:!0}),e}();function u(e,t){var n="";return l(e)?(n="Binary data of length "+e.byteLength,t&&(n+=". Content: '"+function(e){var t=new Uint8Array(e),n="";return t.forEach(function(e){n+="0x"+(e<16?"0":"")+e.toString(16)+" "}),n.substr(0,n.length-1)}(e)+"'")):"string"==typeof e&&(n="String data of length "+e.length,t&&(n+=". Content: '"+e+"'")),n}function l(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function h(e,t,n,o,a,c,h){return i(this,void 0,void 0,function(){var i,f,p,d,g;return s(this,function(s){switch(s.label){case 0:return a?[4,a()]:[3,2];case 1:(p=s.sent())&&((i={}).Authorization="Bearer "+p,f=i),s.label=2;case 2:return e.log(r.a.Trace,"("+t+" transport) sending data. "+u(c,h)+"."),d=l(c)?"arraybuffer":"text",[4,n.post(o,{content:c,headers:f,responseType:d})];case 3:return g=s.sent(),e.log(r.a.Trace,"("+t+" transport) request complete. Response status: "+g.statusCode+"."),[2]}})})}function f(e){return void 0===e?new d(r.a.Information):null===e?o.a.instance:e.log?e:new d(e)}var p=function(){function e(e,t){this.subject=e,this.observer=t}return e.prototype.dispose=function(){var e=this.subject.observers.indexOf(this.observer);e>-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"f",function(){return u}),n.d(t,"g",function(){return l}),n.d(t,"h",function(){return h}),n.d(t,"e",function(){return f}),n.d(t,"d",function(){return p}),n.d(t,"b",function(){return d});var r=n(1),o=n(10),i=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},s=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},a=function(){function e(){}return e.isRequired=function(e,t){if(null==e)throw new Error("The '"+t+"' argument is required.")},e.isIn=function(e,t,n){if(!(e in t))throw new Error("Unknown "+n+" value: "+e+".")},e}(),c=function(){function e(){}return Object.defineProperty(e,"isBrowser",{get:function(){return"object"==typeof window},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isWebWorker",{get:function(){return"object"==typeof self&&"importScripts"in self},enumerable:!0,configurable:!0}),Object.defineProperty(e,"isNode",{get:function(){return!this.isBrowser&&!this.isWebWorker},enumerable:!0,configurable:!0}),e}();function u(e,t){var n="";return l(e)?(n="Binary data of length "+e.byteLength,t&&(n+=". Content: '"+function(e){var t=new Uint8Array(e),n="";return t.forEach(function(e){n+="0x"+(e<16?"0":"")+e.toString(16)+" "}),n.substr(0,n.length-1)}(e)+"'")):"string"==typeof e&&(n="String data of length "+e.length,t&&(n+=". Content: '"+e+"'")),n}function l(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function h(e,t,n,o,a,c,h){return i(this,void 0,void 0,function(){var i,f,p,d,g;return s(this,function(s){switch(s.label){case 0:return a?[4,a()]:[3,2];case 1:(p=s.sent())&&((i={}).Authorization="Bearer "+p,f=i),s.label=2;case 2:return e.log(r.a.Trace,"("+t+" transport) sending data. "+u(c,h)+"."),d=l(c)?"arraybuffer":"text",[4,n.post(o,{content:c,headers:f,responseType:d})];case 3:return g=s.sent(),e.log(r.a.Trace,"("+t+" transport) request complete. Response status: "+g.statusCode+"."),[2]}})})}function f(e){return void 0===e?new d(r.a.Information):null===e?o.a.instance:e.log?e:new d(e)}var p=function(){function e(e,t){this.subject=e,this.observer=t}return e.prototype.dispose=function(){var e=this.subject.observers.indexOf(this.observer);e>-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e,this.outputConsole=console}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:this.outputConsole.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:this.outputConsole.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:this.outputConsole.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:this.outputConsole.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return a});var r,o=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t,n){var r=this,o=this.constructor.prototype;return(r=e.call(this,t)||this).statusCode=n,r.__proto__=o,r}return o(t,e),t}(Error),s=function(e){function t(t){void 0===t&&(t="A timeout occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return o(t,e),t}(Error),a=function(e){function t(t){void 0===t&&(t="An abort occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return o(t,e),t}(Error)},function(e,t,n){"use strict";n.d(t,"b",function(){return i}),n.d(t,"c",function(){return s}),n.d(t,"a",function(){return a});var r,o=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=function(e){function t(t,n){var r=this,o=this.constructor.prototype;return(r=e.call(this,t)||this).statusCode=n,r.__proto__=o,r}return o(t,e),t}(Error),s=function(e){function t(t){void 0===t&&(t="A timeout occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return o(t,e),t}(Error),a=function(e){function t(t){void 0===t&&(t="An abort occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return o(t,e),t}(Error)},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=function(){return function(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}(),i=function(){function e(){}return e.prototype.get=function(e,t){return this.send(r({},t,{method:"GET",url:e}))},e.prototype.post=function(e,t){return this.send(r({},t,{method:"POST",url:e}))},e.prototype.delete=function(e,t){return this.send(r({},t,{method:"DELETE",url:e}))},e.prototype.getCookieString=function(e){return""},e}()},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return i});var r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},o=function(){return function(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}(),i=function(){function e(){}return e.prototype.get=function(e,t){return this.send(r({},t,{method:"GET",url:e}))},e.prototype.post=function(e,t){return this.send(r({},t,{method:"POST",url:e}))},e.prototype.delete=function(e,t){return this.send(r({},t,{method:"DELETE",url:e}))},e.prototype.getCookieString=function(e){return""},e}()},function(e,t,n){"use strict";(function(e){ +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=46)}([function(e,t,n){"use strict";var r;n.d(t,"a",function(){return r}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(r||(r={}))},function(e,t,n){"use strict";n.d(t,"a",function(){return s}),n.d(t,"e",function(){return u}),n.d(t,"f",function(){return c}),n.d(t,"g",function(){return l}),n.d(t,"d",function(){return f}),n.d(t,"c",function(){return h}),n.d(t,"b",function(){return d});var r=n(0),o=n(3),i=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},a=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},s=function(){function e(){}return e.isRequired=function(e,t){if(null==e)throw new Error("The '"+t+"' argument is required.")},e.isIn=function(e,t,n){if(!(e in t))throw new Error("Unknown "+n+" value: "+e+".")},e}();function u(e,t){var n="";return c(e)?(n="Binary data of length "+e.byteLength,t&&(n+=". Content: '"+function(e){var t=new Uint8Array(e),n="";return t.forEach(function(e){n+="0x"+(e<16?"0":"")+e.toString(16)+" "}),n.substr(0,n.length-1)}(e)+"'")):"string"==typeof e&&(n="String data of length "+e.length,t&&(n+=". Content: '"+e+"'")),n}function c(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function l(e,t,n,o,s,l,f){return i(this,void 0,void 0,function(){var i,h,p,d,g;return a(this,function(a){switch(a.label){case 0:return s?[4,s()]:[3,2];case 1:(p=a.sent())&&((i={}).Authorization="Bearer "+p,h=i),a.label=2;case 2:return e.log(r.a.Trace,"("+t+" transport) sending data. "+u(l,f)+"."),d=c(l)?"arraybuffer":"text",[4,n.post(o,{content:l,headers:h,responseType:d})];case 3:return g=a.sent(),e.log(r.a.Trace,"("+t+" transport) request complete. Response status: "+g.statusCode+"."),[2]}})})}function f(e){return void 0===e?new d(r.a.Information):null===e?o.a.instance:e.log?e:new d(e)}var h=function(){function e(e){this.observers=[],this.cancelCallback=e}return e.prototype.next=function(e){for(var t=0,n=this.observers;t<n.length;t++){n[t].next(e)}},e.prototype.error=function(e){for(var t=0,n=this.observers;t<n.length;t++){var r=n[t];r.error&&r.error(e)}},e.prototype.complete=function(){for(var e=0,t=this.observers;e<t.length;e++){var n=t[e];n.complete&&n.complete()}},e.prototype.subscribe=function(e){return this.observers.push(e),new p(this,e)},e}(),p=function(){function e(e,t){this.subject=e,this.observer=t}return e.prototype.dispose=function(){var e=this.subject.observers.indexOf(this.observer);e>-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback().catch(function(e){})},e}(),d=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.a.Critical:case r.a.Error:console.error("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Warning:console.warn("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;case r.a.Information:console.info("["+(new Date).toISOString()+"] "+r.a[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.a[e]+": "+t)}},e}()},function(e,t,n){"use strict";n.r(t);var r,o,i=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=function(e){function t(t,n){var r=this,o=this.constructor.prototype;return(r=e.call(this,t)||this).statusCode=n,r.__proto__=o,r}return i(t,e),t}(Error),s=function(e){function t(t){void 0===t&&(t="A timeout occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return i(t,e),t}(Error),u=function(e){function t(t){void 0===t&&(t="An abort occurred.");var n=this,r=this.constructor.prototype;return(n=e.call(this,t)||this).__proto__=r,n}return i(t,e),t}(Error),c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l=function(){return function(e,t,n){this.statusCode=e,this.statusText=t,this.content=n}}(),f=function(){function e(){}return e.prototype.get=function(e,t){return this.send(c({},t,{method:"GET",url:e}))},e.prototype.post=function(e,t){return this.send(c({},t,{method:"POST",url:e}))},e.prototype.delete=function(e,t){return this.send(c({},t,{method:"DELETE",url:e}))},e.prototype.getCookieString=function(e){return""},e}(),h=n(0),p=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return p(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new u):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var i=e.headers;i&&Object.keys(i).forEach(function(e){o.setRequestHeader(e,i[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new u)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new l(o.status,o.statusText,o.response||o.responseText)):r(new a(o.statusText,o.status))},o.onerror=function(){t.logger.log(h.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new a(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(h.a.Warning,"Timeout from HTTP request."),r(new s)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(f),g=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();if("undefined"==typeof XMLHttpRequest){var y=require;o=y("./NodeHttpClient")}var v,m=function(e){function t(t){var n=e.call(this)||this;if("undefined"!=typeof XMLHttpRequest)n.httpClient=new d(t);else{if(void 0===o)throw new Error("No HttpClient could be created.");n.httpClient=new o.NodeHttpClient(t)}return n}return g(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new u):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(f),b=n(41);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(v||(v={}));var w,E=n(1),S=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},_=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},T=3e4,k=15e3;!function(e){e[e.Disconnected=0]="Disconnected",e[e.Connected=1]="Connected"}(w||(w={}));var C,I,x=function(){function e(e,t,n){var r=this;E.a.isRequired(e,"connection"),E.a.isRequired(t,"logger"),E.a.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=T,this.keepAliveIntervalInMilliseconds=k,this.logger=t,this.protocol=n,this.connection=e,this.handshakeProtocol=new b.a,this.connection.onreceive=function(e){return r.processIncomingData(e)},this.connection.onclose=function(e){return r.connectionClosed(e)},this.callbacks={},this.methods={},this.closedCallbacks=[],this.id=0,this.receivedHandshakeResponse=!1,this.connectionState=w.Disconnected,this.cachedPingMessage=this.protocol.writeMessage({type:v.Ping})}return e.create=function(t,n,r){return new e(t,n,r)},Object.defineProperty(e.prototype,"state",{get:function(){return this.connectionState},enumerable:!0,configurable:!0}),e.prototype.start=function(){return S(this,void 0,void 0,function(){var e,t,n=this;return _(this,function(r){switch(r.label){case 0:return e={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(h.a.Debug,"Starting HubConnection."),this.receivedHandshakeResponse=!1,t=new Promise(function(e,t){n.handshakeResolver=e,n.handshakeRejecter=t}),[4,this.connection.start(this.protocol.transferFormat)];case 1:return r.sent(),this.logger.log(h.a.Debug,"Sending handshake request."),[4,this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(e))];case 2:return r.sent(),this.logger.log(h.a.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.resetTimeoutPeriod(),this.resetKeepAliveInterval(),[4,t];case 3:return r.sent(),this.connectionState=w.Connected,[2]}})})},e.prototype.stop=function(){return this.logger.log(h.a.Debug,"Stopping HubConnection."),this.cleanupTimeout(),this.cleanupPingTimer(),this.connection.stop()},e.prototype.stream=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.createStreamInvocation(e,n),i=new E.c(function(){var e=t.createCancelInvocation(o.invocationId),n=t.protocol.writeMessage(e);return delete t.callbacks[o.invocationId],t.sendMessage(n)});this.callbacks[o.invocationId]=function(e,t){t?i.error(t):e&&(e.type===v.Completion?e.error?i.error(new Error(e.error)):i.complete():i.next(e.item))};var a=this.protocol.writeMessage(o);return this.sendMessage(a).catch(function(e){i.error(e),delete t.callbacks[o.invocationId]}),i},e.prototype.sendMessage=function(e){return this.resetKeepAliveInterval(),this.connection.send(e)},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.createInvocation(e,t,!0),o=this.protocol.writeMessage(r);return this.sendMessage(o)},e.prototype.invoke=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.createInvocation(e,n,!1);return new Promise(function(e,n){t.callbacks[o.invocationId]=function(t,r){r?n(r):t&&(t.type===v.Completion?t.error?n(new Error(t.error)):e(t.result):n(new Error("Unexpected message type: "+t.type)))};var r=t.protocol.writeMessage(o);t.sendMessage(r).catch(function(e){n(e),delete t.callbacks[o.invocationId]})})},e.prototype.on=function(e,t){e&&t&&(e=e.toLowerCase(),this.methods[e]||(this.methods[e]=[]),-1===this.methods[e].indexOf(t)&&this.methods[e].push(t))},e.prototype.off=function(e,t){if(e){e=e.toLowerCase();var n=this.methods[e];if(n)if(t){var r=n.indexOf(t);-1!==r&&(n.splice(r,1),0===n.length&&delete this.methods[e])}else delete this.methods[e]}},e.prototype.onclose=function(e){e&&this.closedCallbacks.push(e)},e.prototype.processIncomingData=function(e){if(this.cleanupTimeout(),this.receivedHandshakeResponse||(e=this.processHandshakeResponse(e),this.receivedHandshakeResponse=!0),e)for(var t=0,n=this.protocol.parseMessages(e,this.logger);t<n.length;t++){var r=n[t];switch(r.type){case v.Invocation:this.invokeClientMethod(r);break;case v.StreamItem:case v.Completion:var o=this.callbacks[r.invocationId];null!=o&&(r.type===v.Completion&&delete this.callbacks[r.invocationId],o(r));break;case v.Ping:break;case v.Close:this.logger.log(h.a.Information,"Close message received from server."),this.connection.stop(r.error?new Error("Server returned an error on close: "+r.error):void 0);break;default:this.logger.log(h.a.Warning,"Invalid message type: "+r.type+".")}}this.resetTimeoutPeriod()},e.prototype.processHandshakeResponse=function(e){var t,n,r;try{r=(t=this.handshakeProtocol.parseHandshakeResponse(e))[0],n=t[1]}catch(e){var o="Error parsing handshake response: "+e;this.logger.log(h.a.Error,o);var i=new Error(o);throw this.connection.stop(i),this.handshakeRejecter(i),i}if(n.error){o="Server returned handshake error: "+n.error;throw this.logger.log(h.a.Error,o),this.handshakeRejecter(o),this.connection.stop(new Error(o)),new Error(o)}return this.logger.log(h.a.Debug,"Server handshake complete."),this.handshakeResolver(),r},e.prototype.resetKeepAliveInterval=function(){var e=this;this.cleanupPingTimer(),this.pingServerHandle=setTimeout(function(){return S(e,void 0,void 0,function(){return _(this,function(e){switch(e.label){case 0:if(this.connectionState!==w.Connected)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.sendMessage(this.cachedPingMessage)];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.cleanupPingTimer(),[3,4];case 4:return[2]}})})},this.keepAliveIntervalInMilliseconds)},e.prototype.resetTimeoutPeriod=function(){var e=this;this.connection.features&&this.connection.features.inherentKeepAlive||(this.timeoutHandle=setTimeout(function(){return e.serverTimeout()},this.serverTimeoutInMilliseconds))},e.prototype.serverTimeout=function(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))},e.prototype.invokeClientMethod=function(e){var t=this,n=this.methods[e.target.toLowerCase()];if(n){if(n.forEach(function(n){return n.apply(t,e.arguments)}),e.invocationId){var r="Server requested a response, which is not supported in this version of the client.";this.logger.log(h.a.Error,r),this.connection.stop(new Error(r))}}else this.logger.log(h.a.Warning,"No client method with the name '"+e.target+"' found.")},e.prototype.connectionClosed=function(e){var t=this,n=this.callbacks;this.callbacks={},this.connectionState=w.Disconnected,this.handshakeRejecter&&this.handshakeRejecter(e),Object.keys(n).forEach(function(t){(0,n[t])(null,e||new Error("Invocation canceled due to connection being closed."))}),this.cleanupTimeout(),this.cleanupPingTimer(),this.closedCallbacks.forEach(function(n){return n.apply(t,[e])})},e.prototype.cleanupPingTimer=function(){this.pingServerHandle&&clearTimeout(this.pingServerHandle)},e.prototype.cleanupTimeout=function(){this.timeoutHandle&&clearTimeout(this.timeoutHandle)},e.prototype.createInvocation=function(e,t,n){if(n)return{arguments:t,target:e,type:v.Invocation};var r=this.id;return this.id++,{arguments:t,invocationId:r.toString(),target:e,type:v.Invocation}},e.prototype.createStreamInvocation=function(e,t){var n=this.id;return this.id++,{arguments:t,invocationId:n.toString(),target:e,type:v.StreamInvocation}},e.prototype.createCancelInvocation=function(e){return{invocationId:e,type:v.CancelInvocation}},e}();!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(C||(C={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(I||(I={}));var R=function(){function e(){this.isAborted=!1,this.onabort=null}return e.prototype.abort=function(){this.isAborted||(this.isAborted=!0,this.onabort&&this.onabort())},Object.defineProperty(e.prototype,"signal",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aborted",{get:function(){return this.isAborted},enumerable:!0,configurable:!0}),e}(),O=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},P=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function e(e,t,n,r){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.pollAbort=new R,this.logMessageContent=r,this.running=!1,this.onreceive=null,this.onclose=null}return Object.defineProperty(e.prototype,"pollAborted",{get:function(){return this.pollAbort.aborted},enumerable:!0,configurable:!0}),e.prototype.connect=function(e,t){return O(this,void 0,void 0,function(){var n,r,o,i;return P(this,function(s){switch(s.label){case 0:if(E.a.isRequired(e,"url"),E.a.isRequired(t,"transferFormat"),E.a.isIn(t,I,"transferFormat"),this.url=e,this.logger.log(h.a.Trace,"(LongPolling transport) Connecting."),t===I.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");return n={abortSignal:this.pollAbort.signal,headers:{},timeout:1e5},t===I.Binary&&(n.responseType="arraybuffer"),[4,this.getAccessToken()];case 1:return r=s.sent(),this.updateHeaderToken(n,r),o=e+"&_="+Date.now(),this.logger.log(h.a.Trace,"(LongPolling transport) polling: "+o+"."),[4,this.httpClient.get(o,n)];case 2:return 200!==(i=s.sent()).statusCode?(this.logger.log(h.a.Error,"(LongPolling transport) Unexpected response code: "+i.statusCode+"."),this.closeError=new a(i.statusText||"",i.statusCode),this.running=!1):this.running=!0,this.receiving=this.poll(this.url,n),[2]}})})},e.prototype.getAccessToken=function(){return O(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,null]}})})},e.prototype.updateHeaderToken=function(e,t){e.headers||(e.headers={}),t?e.headers.Authorization="Bearer "+t:e.headers.Authorization&&delete e.headers.Authorization},e.prototype.poll=function(e,t){return O(this,void 0,void 0,function(){var n,r,o,i;return P(this,function(u){switch(u.label){case 0:u.trys.push([0,,8,9]),u.label=1;case 1:return this.running?[4,this.getAccessToken()]:[3,7];case 2:n=u.sent(),this.updateHeaderToken(t,n),u.label=3;case 3:return u.trys.push([3,5,,6]),r=e+"&_="+Date.now(),this.logger.log(h.a.Trace,"(LongPolling transport) polling: "+r+"."),[4,this.httpClient.get(r,t)];case 4:return 204===(o=u.sent()).statusCode?(this.logger.log(h.a.Information,"(LongPolling transport) Poll terminated by server."),this.running=!1):200!==o.statusCode?(this.logger.log(h.a.Error,"(LongPolling transport) Unexpected response code: "+o.statusCode+"."),this.closeError=new a(o.statusText||"",o.statusCode),this.running=!1):o.content?(this.logger.log(h.a.Trace,"(LongPolling transport) data received. "+Object(E.e)(o.content,this.logMessageContent)+"."),this.onreceive&&this.onreceive(o.content)):this.logger.log(h.a.Trace,"(LongPolling transport) Poll timed out, reissuing."),[3,6];case 5:return i=u.sent(),this.running?i instanceof s?this.logger.log(h.a.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.closeError=i,this.running=!1):this.logger.log(h.a.Trace,"(LongPolling transport) Poll errored after shutdown: "+i.message),[3,6];case 6:return[3,1];case 7:return[3,9];case 8:return this.logger.log(h.a.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.raiseOnClose(),[7];case 9:return[2]}})})},e.prototype.send=function(e){return O(this,void 0,void 0,function(){return P(this,function(t){return this.running?[2,Object(E.g)(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return O(this,void 0,void 0,function(){var e,t;return P(this,function(n){switch(n.label){case 0:this.logger.log(h.a.Trace,"(LongPolling transport) Stopping polling."),this.running=!1,this.pollAbort.abort(),n.label=1;case 1:return n.trys.push([1,,5,6]),[4,this.receiving];case 2:return n.sent(),this.logger.log(h.a.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),e={headers:{}},[4,this.getAccessToken()];case 3:return t=n.sent(),this.updateHeaderToken(e,t),[4,this.httpClient.delete(this.url,e)];case 4:return n.sent(),this.logger.log(h.a.Trace,"(LongPolling transport) DELETE request sent."),[3,6];case 5:return this.logger.log(h.a.Trace,"(LongPolling transport) Stop finished."),this.raiseOnClose(),[7];case 6:return[2]}})})},e.prototype.raiseOnClose=function(){if(this.onclose){var e="(LongPolling transport) Firing onclose event.";this.closeError&&(e+=" Error: "+this.closeError),this.logger.log(h.a.Trace,e),this.onclose(this.closeError)}},e}(),L=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},A=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},B=function(){function e(e,t,n,r,o){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.logMessageContent=r,this.eventSourceConstructor=o,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return L(this,void 0,void 0,function(){var n,r=this;return A(this,function(o){switch(o.label){case 0:return E.a.isRequired(e,"url"),E.a.isRequired(t,"transferFormat"),E.a.isIn(t,I,"transferFormat"),this.logger.log(h.a.Trace,"(SSE transport) Connecting."),this.url=e,this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i=!1;if(t===I.Text){var a;if("undefined"!=typeof window)a=new r.eventSourceConstructor(e,{withCredentials:!0});else{var s=r.httpClient.getCookieString(e);a=new r.eventSourceConstructor(e,{withCredentials:!0,headers:{Cookie:s}})}try{a.onmessage=function(e){if(r.onreceive)try{r.logger.log(h.a.Trace,"(SSE transport) data received. "+Object(E.e)(e.data,r.logMessageContent)+"."),r.onreceive(e.data)}catch(e){return void r.close(e)}},a.onerror=function(e){var t=new Error(e.data||"Error occurred");i?r.close(t):o(t)},a.onopen=function(){r.logger.log(h.a.Information,"SSE connected to "+r.url),r.eventSource=a,i=!0,n()}}catch(e){return void o(e)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})]}})})},e.prototype.send=function(e){return L(this,void 0,void 0,function(){return A(this,function(t){return this.eventSource?[2,Object(E.g)(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return this.close(),Promise.resolve()},e.prototype.close=function(e){this.eventSource&&(this.eventSource.close(),this.eventSource=void 0,this.onclose&&this.onclose(e))},e}(),D=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},U=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},N=function(){function e(e,t,n,r,o){this.logger=n,this.accessTokenFactory=t,this.logMessageContent=r,this.webSocketConstructor=o,this.httpClient=e,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return D(this,void 0,void 0,function(){var n,r=this;return U(this,function(o){switch(o.label){case 0:return E.a.isRequired(e,"url"),E.a.isRequired(t,"transferFormat"),E.a.isIn(t,I,"transferFormat"),this.logger.log(h.a.Trace,"(WebSockets transport) Connecting."),this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i;e=e.replace(/^http/,"ws");var a=r.httpClient.getCookieString(e);"undefined"==typeof window&&a&&(i=new r.webSocketConstructor(e,void 0,{headers:{Cookie:""+a}})),i||(i=new r.webSocketConstructor(e)),t===I.Binary&&(i.binaryType="arraybuffer"),i.onopen=function(t){r.logger.log(h.a.Information,"WebSocket connected to "+e+"."),r.webSocket=i,n()},i.onerror=function(e){var t=null;"undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent&&(t=e.error),o(t)},i.onmessage=function(e){r.logger.log(h.a.Trace,"(WebSockets transport) data received. "+Object(E.e)(e.data,r.logMessageContent)+"."),r.onreceive&&r.onreceive(e.data)},i.onclose=function(e){return r.close(e)}})]}})})},e.prototype.send=function(e){return this.webSocket&&this.webSocket.readyState===this.webSocketConstructor.OPEN?(this.logger.log(h.a.Trace,"(WebSockets transport) sending data. "+Object(E.e)(e,this.logMessageContent)+"."),this.webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},e.prototype.stop=function(){return this.webSocket&&(this.webSocket.onclose=function(){},this.webSocket.onmessage=function(){},this.webSocket.onerror=function(){},this.webSocket.close(),this.webSocket=void 0,this.close(void 0)),Promise.resolve()},e.prototype.close=function(e){this.logger.log(h.a.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!e||!1!==e.wasClean&&1e3===e.code?this.onclose():this.onclose(new Error("WebSocket closed with status code: "+e.code+" ("+e.reason+").")))},e}(),j=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},F=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},H=null,q=null;if("undefined"==typeof window){var W=require;H=W("ws"),q=W("eventsource")}var z=function(){function e(e,t){void 0===t&&(t={}),this.features={},E.a.isRequired(e,"url"),this.logger=Object(E.d)(t.logger),this.baseUrl=this.resolveUrl(e),(t=t||{}).logMessageContent=t.logMessageContent||!1;var n="undefined"==typeof window;n||"undefined"==typeof WebSocket||t.WebSocket?n&&!t.WebSocket&&H&&(t.WebSocket=H):t.WebSocket=WebSocket,n||"undefined"==typeof EventSource||t.EventSource?n&&!t.EventSource&&void 0!==q&&(t.EventSource=q):t.EventSource=EventSource,this.httpClient=t.httpClient||new m(this.logger),this.connectionState=2,this.options=t,this.onreceive=null,this.onclose=null}return e.prototype.start=function(e){return e=e||I.Binary,E.a.isIn(e,I,"transferFormat"),this.logger.log(h.a.Debug,"Starting connection with transfer format '"+I[e]+"'."),2!==this.connectionState?Promise.reject(new Error("Cannot start a connection that is not in the 'Disconnected' state.")):(this.connectionState=0,this.startPromise=this.startInternal(e),this.startPromise)},e.prototype.send=function(e){if(1!==this.connectionState)throw new Error("Cannot send data if the connection is not in the 'Connected' State.");return this.transport.send(e)},e.prototype.stop=function(e){return j(this,void 0,void 0,function(){return F(this,function(t){switch(t.label){case 0:this.connectionState=2,this.stopError=e,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.startPromise];case 2:return t.sent(),[3,4];case 3:return t.sent(),[3,4];case 4:return this.transport?[4,this.transport.stop()]:[3,6];case 5:t.sent(),this.transport=void 0,t.label=6;case 6:return[2]}})})},e.prototype.startInternal=function(e){return j(this,void 0,void 0,function(){var t,n,r,o,i,a,s,u=this;return F(this,function(c){switch(c.label){case 0:t=this.baseUrl,this.accessTokenFactory=this.options.accessTokenFactory,c.label=1;case 1:return c.trys.push([1,12,,13]),this.options.skipNegotiation?this.options.transport!==C.WebSockets?[3,3]:(this.transport=this.constructTransport(C.WebSockets),[4,this.transport.connect(t,e)]):[3,5];case 2:return c.sent(),[3,4];case 3:throw Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:n=null,r=0,o=function(){var e;return F(this,function(o){switch(o.label){case 0:return[4,i.getNegotiationResponse(t)];case 1:if(n=o.sent(),2===i.connectionState)return[2,{value:void 0}];if(n.error)throw Error(n.error);if(n.ProtocolVersion)throw Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");return n.url&&(t=n.url),n.accessToken&&(e=n.accessToken,i.accessTokenFactory=function(){return e}),r++,[2]}})},i=this,c.label=6;case 6:return[5,o()];case 7:if("object"==typeof(a=c.sent()))return[2,a.value];c.label=8;case 8:if(n.url&&r<100)return[3,6];c.label=9;case 9:if(100===r&&n.url)throw Error("Negotiate redirection limit exceeded.");return[4,this.createTransport(t,this.options.transport,n,e)];case 10:c.sent(),c.label=11;case 11:return this.transport instanceof M&&(this.features.inherentKeepAlive=!0),this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return u.stopConnection(e)},this.changeState(0,1),[3,13];case 12:throw s=c.sent(),this.logger.log(h.a.Error,"Failed to start the connection: "+s),this.connectionState=2,this.transport=void 0,s;case 13:return[2]}})})},e.prototype.getNegotiationResponse=function(e){return j(this,void 0,void 0,function(){var t,n,r,o,i,a;return F(this,function(s){switch(s.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(r=s.sent())&&((t={}).Authorization="Bearer "+r,n=t),s.label=2;case 2:o=this.resolveNegotiateUrl(e),this.logger.log(h.a.Debug,"Sending negotiation request: "+o+"."),s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.httpClient.post(o,{content:"",headers:n})];case 4:if(200!==(i=s.sent()).statusCode)throw Error("Unexpected status code returned from negotiate "+i.statusCode);return[2,JSON.parse(i.content)];case 5:throw a=s.sent(),this.logger.log(h.a.Error,"Failed to complete negotiation with the server: "+a),a;case 6:return[2]}})})},e.prototype.createConnectUrl=function(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+"id="+t:e},e.prototype.createTransport=function(e,t,n,r){return j(this,void 0,void 0,function(){var o,i,a,s,u,c,l;return F(this,function(f){switch(f.label){case 0:return o=this.createConnectUrl(e,n.connectionId),this.isITransport(t)?(this.logger.log(h.a.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,[4,this.transport.connect(o,r)]):[3,2];case 1:return f.sent(),this.changeState(0,1),[2];case 2:i=n.availableTransports||[],a=0,s=i,f.label=3;case 3:return a<s.length?(u=s[a],this.connectionState=0,"number"!=typeof(c=this.resolveTransport(u,t,r))?[3,8]:(this.transport=this.constructTransport(c),n.connectionId?[3,5]:[4,this.getNegotiationResponse(e)])):[3,9];case 4:n=f.sent(),o=this.createConnectUrl(e,n.connectionId),f.label=5;case 5:return f.trys.push([5,7,,8]),[4,this.transport.connect(o,r)];case 6:return f.sent(),this.changeState(0,1),[2];case 7:return l=f.sent(),this.logger.log(h.a.Error,"Failed to start the transport '"+C[c]+"': "+l),this.connectionState=2,n.connectionId=void 0,[3,8];case 8:return a++,[3,3];case 9:throw new Error("Unable to initialize any of the available transports.")}})})},e.prototype.constructTransport=function(e){switch(e){case C.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new N(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case C.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new B(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case C.LongPolling:return new M(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.resolveTransport=function(e,t,n){var r=C[e.transport];if(null==r)this.logger.log(h.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client.");else{var o=e.transferFormats.map(function(e){return I[e]});if(function(e,t){return!e||0!=(t&e)}(t,r))if(o.indexOf(n)>=0){if((r!==C.WebSockets||this.options.WebSocket)&&(r!==C.ServerSentEvents||this.options.EventSource))return this.logger.log(h.a.Debug,"Selecting transport '"+C[r]+"'."),r;this.logger.log(h.a.Debug,"Skipping transport '"+C[r]+"' because it is not supported in your environment.'")}else this.logger.log(h.a.Debug,"Skipping transport '"+C[r]+"' because it does not support the requested transfer format '"+I[n]+"'.");else this.logger.log(h.a.Debug,"Skipping transport '"+C[r]+"' because it was disabled by the client.")}return null},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.changeState=function(e,t){return this.connectionState===e&&(this.connectionState=t,!0)},e.prototype.stopConnection=function(e){this.transport=void 0,(e=this.stopError||e)?this.logger.log(h.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(h.a.Information,"Connection disconnected."),this.connectionState=2,this.onclose&&this.onclose(e)},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if("undefined"==typeof window||!window||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(h.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var Y=n(3),K=n(4),J="json",X=function(){function e(){this.name=J,this.version=1,this.transferFormat=I.Text}return e.prototype.parseMessages=function(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=Y.a.instance);for(var n=[],r=0,o=K.a.parse(e);r<o.length;r++){var i=o[r],a=JSON.parse(i);if("number"!=typeof a.type)throw new Error("Invalid payload.");switch(a.type){case v.Invocation:this.isInvocationMessage(a);break;case v.StreamItem:this.isStreamItemMessage(a);break;case v.Completion:this.isCompletionMessage(a);break;case v.Ping:case v.Close:break;default:t.log(h.a.Information,"Unknown message type '"+a.type+"' ignored.");continue}n.push(a)}return n},e.prototype.writeMessage=function(e){return K.a.write(JSON.stringify(e))},e.prototype.isInvocationMessage=function(e){this.assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this.assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")},e.prototype.isStreamItemMessage=function(e){if(this.assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")},e.prototype.isCompletionMessage=function(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this.assertNotEmptyString(e.error,"Invalid payload for Completion message."),this.assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")},e.prototype.assertNotEmptyString=function(e,t){if("string"!=typeof e||""===e)throw new Error(t)},e}(),G=function(){function e(){}return e.prototype.configureLogging=function(e){return E.a.isRequired(e,"logging"),void 0!==e.log?this.logger=e:this.logger=new E.b(e),this},e.prototype.withUrl=function(e,t){return E.a.isRequired(e,"url"),this.url=e,this.httpConnectionOptions="object"==typeof t?t:{transport:t},this},e.prototype.withHubProtocol=function(e){return E.a.isRequired(e,"protocol"),this.protocol=e,this},e.prototype.build=function(){var e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");var t=new z(this.url,e);return x.create(t,this.logger||Y.a.instance,this.protocol||new X)},e}();n.d(t,"VERSION",function(){return V}),n.d(t,"AbortError",function(){return u}),n.d(t,"HttpError",function(){return a}),n.d(t,"TimeoutError",function(){return s}),n.d(t,"HttpClient",function(){return f}),n.d(t,"HttpResponse",function(){return l}),n.d(t,"DefaultHttpClient",function(){return m}),n.d(t,"HubConnection",function(){return x}),n.d(t,"HubConnectionState",function(){return w}),n.d(t,"HubConnectionBuilder",function(){return G}),n.d(t,"MessageType",function(){return v}),n.d(t,"LogLevel",function(){return h.a}),n.d(t,"HttpTransportType",function(){return C}),n.d(t,"TransferFormat",function(){return I}),n.d(t,"NullLogger",function(){return Y.a}),n.d(t,"JsonHubProtocol",function(){return X});var V="1.1.2"},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.write=function(t){return""+t+e.RecordSeparator},e.parse=function(t){if(t[t.length-1]!==e.RecordSeparator)throw new Error("Message is incomplete.");var n=t.split(e.RecordSeparator);return n.pop(),n},e.RecordSeparatorCode=30,e.RecordSeparator=String.fromCharCode(e.RecordSeparatorCode),e}()},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(11),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=a),i(o,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23),o=n(9),i={};function a(e,t,n){var o=i[e];o||(o=i[e]=new r.BrowserRenderer(e)),o.attachRootComponentToLogicalElement(n,t)}t.attachRootComponentToLogicalElement=a,t.attachRootComponentToElement=function(e,t,n){var r=document.querySelector(t);if(!r)throw new Error("Could not find any element matching selector '"+t+"'.");a(e,o.toLogicalElement(r,!0),n)},t.renderBatch=function(e,t){var n=i[e];if(!n)throw new Error("There is no browser renderer with ID "+e+".");for(var r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),s=r.count(o),u=t.referenceFrames(),c=r.values(u),l=t.diffReader,f=0;f<s;f++){var h=t.updatedComponentsEntry(a,f),p=l.componentId(h),d=l.edits(h);n.updateComponent(t,p,d,c)}var g=t.disposedComponentIds(),y=r.values(g),v=r.count(g);for(f=0;f<v;f++)p=t.disposedComponentIdsEntry(y,f),n.disposeComponent(p);var m=t.disposedEventHandlerIds(),b=r.values(m),w=r.count(m);for(f=0;f<w;f++){var E=t.disposedEventHandlerIdsEntry(b,f);n.disposeEventHandler(E)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p("_blazorLogicalChildren"),o=p("_blazorLogicalParent"),i=p("_blazorLogicalEnd");function a(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return e[r]=[],e}function s(e,t,n){var i=e;if(e instanceof Comment&&(c(i)&&c(i).length>0))throw new Error("Not implemented: inserting non-empty logical container");if(u(i))throw new Error("Not implemented: moving existing logical children");var a=c(t);if(n<a.length){var s=a[n];s.parentNode.insertBefore(e,s),a.splice(n,0,i)}else h(e,t),a.push(i);i[o]=t,r in i||(i[r]=[])}function u(e){return e[o]||null}function c(e){return e[r]}function l(e){if(e instanceof Element)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function f(e){var t=c(u(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function h(e,t){if(t instanceof Element)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error("Cannot append node because the parent is not a valid logical element. Parent: "+t);var n=f(t);n?n.parentNode.insertBefore(e,n):h(e,u(t))}}function p(e){return"function"==typeof Symbol?Symbol():e}t.toLogicalRootCommentElement=function(e,t){if(!e.parentNode)throw new Error("Comment not connected to the DOM "+e.textContent);var n=e.parentNode,r=a(n,!0),s=c(r);return Array.from(n.childNodes).forEach(function(e){return s.push(e)}),e[o]=r,e[i]=t,a(t,!0),a(e,!0)},t.toLogicalElement=a,t.createAndInsertLogicalContainer=function(e,t){var n=document.createComment("!");return s(n,e,t),n},t.insertLogicalChild=s,t.removeLogicalChild=function e(t,n){var r=c(t).splice(n,1)[0];if(r instanceof Comment)for(var o=c(r);o.length>0;)e(r,0);var i=r;i.parentNode.removeChild(i)},t.getLogicalParent=u,t.getLogicalSiblingEnd=function(e){return e[i]||null},t.getLogicalChild=function(e,t){return c(e)[t]},t.isSvgElement=function(e){return"http://www.w3.org/2000/svg"===l(e).namespaceURI},t.getLogicalChildrenArray=c,t.permuteLogicalChildren=function(e,t){var n=c(e);t.forEach(function(e){e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=function e(t){if(t instanceof Element)return t;var n=f(t);if(n)return n.previousSibling;var r=u(t);return r instanceof Element?r.lastChild:e(r)}(e.moveRangeStart)}),t.forEach(function(t){var r=t.moveToBeforeMarker=document.createComment("marker"),o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):h(r,e)}),t.forEach(function(e){for(var t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd,i=r;i;){var a=i.nextSibling;if(n.insertBefore(i,t),i===o)break;i=a}n.removeChild(t)}),t.forEach(function(e){n[e.toSiblingIndex]=e.moveRangeStart})},t.getClosestDomElement=l},function(e,t,n){"use strict";var r=n(18),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(15);i.inherits=n(7);var a=n(33),s=n(37);i.inherits(f,a);for(var u=o(s.prototype),c=0;c<u.length;c++){var l=u[c];f.prototype[l]||(f.prototype[l]=s.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),f.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -var r=n(55),o=n(56),i=n(57);function s(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=c.prototype:(null===e&&(e=new c(t)),e.length=t),e}function c(e,t,n){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return u(this,e,t,n)}function u(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);c.TYPED_ARRAY_SUPPORT?(e=t).__proto__=c.prototype:e=f(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!c.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=a(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(c.isBuffer(t)){var n=0|p(t.length);return 0===(e=a(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?a(e,0):f(e,t);if("Buffer"===t.type&&i(t.data))return f(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(l(t),e=a(e,t<0?0:0|p(t)),!c.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function f(e,t){var n=t.length<0?0:0|p(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return F(e).length;default:if(r)return H(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=c.from(t,r)),c.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,s=1,a=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var l=-1;for(i=n;i<a;i++)if(u(e,i)===u(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===c)return l*s}else-1!==l&&(i-=i-l),l=-1}else for(n+c>a&&(n=a-c),i=n;i>=0;i--){for(var h=!0,f=0;f<c;f++)if(u(e,i+f)!==u(t,f)){h=!1;break}if(h)return i}return-1}function b(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function m(e,t,n,r){return W(H(t,e.length-n),e,n,r)}function w(e,t,n,r){return W(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return w(e,t,n,r)}function E(e,t,n,r){return W(F(t),e,n,r)}function C(e,t,n,r){return W(function(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function k(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function I(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,s,a,c,u=e[o],l=null,h=u>239?4:u>223?3:u>191?2:1;if(o+h<=n)switch(h){case 1:u<128&&(l=u);break;case 2:128==(192&(i=e[o+1]))&&(c=(31&u)<<6|63&i)>127&&(l=c);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(c=(15&u)<<12|(63&i)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(c=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=h}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=T));return n}(r)}t.Buffer=c,t.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},t.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=s(),c.poolSize=8192,c._augment=function(e){return e.__proto__=c.prototype,e},c.from=function(e,t,n){return u(null,e,t,n)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},c.allocUnsafe=function(e){return h(null,e)},c.allocUnsafeSlow=function(e){return h(null,e)},c.isBuffer=function(e){return!(null==e||!e._isBuffer)},c.compare=function(e,t){if(!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},c.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}},c.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=c.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!c.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.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)g(this,t,t+1);return this},c.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)g(this,t,t+3),g(this,t+1,t+2);return this},c.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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?I(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return I(this,t,n);case"ascii":return _(this,t,n);case"latin1":case"binary":return P(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},c.prototype.compare=function(e,t,n,r,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(r,o),l=e.slice(t,n),h=0;h<a;++h)if(u[h]!==l[h]){i=u[h],s=l[h];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},c.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},c.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},c.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return m(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function _(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function P(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function x(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=U(e[i]);return o}function R(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function D(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function M(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,i){return i||M(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||M(e,0,n,8),o.write(e,t,n,r,52,8),n+8}c.prototype.slice=function(e,t){var n,r=this.length;if((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),c.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=c.prototype;else{var o=t-e;n=new c(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},c.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},c.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||D(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return t||D(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},c.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},c.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);O(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},c.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},c.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},c.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},c.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var s=c.isBuffer(e)?e:H(new c(e,r).toString()),a=s.length;for(i=0;i<n-t;++i)this[i+t]=s[i%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(13))},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.write=function(t){return""+t+e.RecordSeparator},e.parse=function(t){if(t[t.length-1]!==e.RecordSeparator)throw new Error("Message is incomplete.");var n=t.split(e.RecordSeparator);return n.pop(),n},e.RecordSeparatorCode=30,e.RecordSeparator=String.fromCharCode(e.RecordSeparatorCode),e}()},function(e,t,n){"use strict";n.d(t,"a",function(){return r});var r=function(){function e(){}return e.write=function(t){return""+t+e.RecordSeparator},e.parse=function(t){if(t[t.length-1]!==e.RecordSeparator)throw new Error("Message is incomplete.");var n=t.split(e.RecordSeparator);return n.pop(),n},e.RecordSeparatorCode=30,e.RecordSeparator=String.fromCharCode(e.RecordSeparatorCode),e}()},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(26),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=h;var i=n(23);i.inherits=n(19);var s=n(38),a=n(43);i.inherits(h,s);for(var c=o(a.prototype),u=0;u<c.length;u++){var l=c[u];h.prototype[l]||(h.prototype[l]=a.prototype[l])}function h(e){if(!(this instanceof h))return new h(e);s.call(this,e),a.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),h.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t,n){"use strict";var r=n(18).Buffer,o=n(58),i=n(25),s=n(70),a=n(73),c=n(74);e.exports=function(e){var t=[],n=[];return{encode:c(t,(e=e||{forceFloat64:!1,compatibilityMode:!1,disableTimestampEncoding:!1}).forceFloat64,e.compatibilityMode,e.disableTimestampEncoding),decode:a(n),register:function(e,t,n,s){return o(t,"must have a constructor"),o(n,"must have an encode function"),o(e>=0,"must have a non-negative type"),o(s,"must have a decode function"),this.registerEncoder(function(e){return e instanceof t},function(t){var o=i(),s=r.allocUnsafe(1);return s.writeInt8(e,0),o.append(s),o.append(n(t)),o}),this.registerDecoder(e,s),this},registerEncoder:function(e,n){return o(e,"must have an encode function"),o(n,"must have an encode function"),t.push({check:e,encode:n}),this},registerDecoder:function(e,t){return o(e>=0,"must have a non-negative type"),o(t,"must have a decode function"),n.push({type:e,decode:t}),this},encoder:s.encoder,decoder:s.decoder,buffer:!0,type:"msgpack5",IncompleteBufferError:a.IncompleteBufferError}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(30),o=n(17),i={};function s(e,t,n){var o=i[e];o||(o=i[e]=new r.BrowserRenderer(e)),o.attachRootComponentToLogicalElement(n,t)}t.attachRootComponentToLogicalElement=s,t.attachRootComponentToElement=function(e,t,n){var r=document.querySelector(t);if(!r)throw new Error("Could not find any element matching selector '"+t+"'.");s(e,o.toLogicalElement(r,!0),n)},t.renderBatch=function(e,t){var n=i[e];if(!n)throw new Error("There is no browser renderer with ID "+e+".");for(var r=t.arrayRangeReader,o=t.updatedComponents(),s=r.values(o),a=r.count(o),c=t.referenceFrames(),u=r.values(c),l=t.diffReader,h=0;h<a;h++){var f=t.updatedComponentsEntry(s,h),p=l.componentId(f),d=l.edits(f);n.updateComponent(t,p,d,u)}var g=t.disposedComponentIds(),y=r.values(g),v=r.count(g);for(h=0;h<v;h++)p=t.disposedComponentIdsEntry(y,h),n.disposeComponent(p);var b=t.disposedEventHandlerIds(),m=r.values(b),w=r.count(b);for(h=0;h<w;h++){var S=t.disposedEventHandlerIdsEntry(m,h);n.disposeEventHandler(S)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p("_blazorLogicalChildren"),o=p("_blazorLogicalParent"),i=p("_blazorLogicalEnd");function s(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return e[r]=[],e}function a(e,t,n){var i=e;if(e instanceof Comment&&(u(i)&&u(i).length>0))throw new Error("Not implemented: inserting non-empty logical container");if(c(i))throw new Error("Not implemented: moving existing logical children");var s=u(t);if(n<s.length){var a=s[n];a.parentNode.insertBefore(e,a),s.splice(n,0,i)}else f(e,t),s.push(i);i[o]=t,r in i||(i[r]=[])}function c(e){return e[o]||null}function u(e){return e[r]}function l(e){if(e instanceof Element)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function h(e){var t=u(c(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function f(e,t){if(t instanceof Element)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error("Cannot append node because the parent is not a valid logical element. Parent: "+t);var n=h(t);n?n.parentNode.insertBefore(e,n):f(e,c(t))}}function p(e){return"function"==typeof Symbol?Symbol():e}t.toLogicalRootCommentElement=function(e,t){if(!e.parentNode)throw new Error("Comment not connected to the DOM "+e.textContent);var n=e.parentNode,r=s(n,!0),a=u(r);return Array.from(n.childNodes).forEach(function(e){return a.push(e)}),e[o]=r,e[i]=t,s(t,!0),s(e,!0)},t.toLogicalElement=s,t.createAndInsertLogicalContainer=function(e,t){var n=document.createComment("!");return a(n,e,t),n},t.insertLogicalChild=a,t.removeLogicalChild=function e(t,n){var r=u(t).splice(n,1)[0];if(r instanceof Comment)for(var o=u(r);o.length>0;)e(r,0);var i=r;i.parentNode.removeChild(i)},t.getLogicalParent=c,t.getLogicalSiblingEnd=function(e){return e[i]||null},t.getLogicalChild=function(e,t){return u(e)[t]},t.isSvgElement=function(e){return"http://www.w3.org/2000/svg"===l(e).namespaceURI},t.getLogicalChildrenArray=u,t.permuteLogicalChildren=function(e,t){var n=u(e);t.forEach(function(e){e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=function e(t){if(t instanceof Element)return t;var n=h(t);if(n)return n.previousSibling;var r=c(t);return r instanceof Element?r.lastChild:e(r)}(e.moveRangeStart)}),t.forEach(function(t){var r=t.moveToBeforeMarker=document.createComment("marker"),o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):f(r,e)}),t.forEach(function(e){for(var t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd,i=r;i;){var s=i.nextSibling;if(n.insertBefore(i,t),i===o)break;i=s}n.removeChild(t)}),t.forEach(function(e){n[e.toSiblingIndex]=e.moveRangeStart})},t.getClosestDomElement=l},function(e,t,n){var r=n(8),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),i(o,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";var r;!function(e){window.DotNet=e;var t=[],n={},r={},o=1,i=null;function s(e){t.push(e)}function a(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return u(e,t,null,n)}function c(e,t,n,r){var o=l();if(o.invokeDotNetFromJS){var i=JSON.stringify(r,y),s=o.invokeDotNetFromJS(e,t,n,i);return s?f(s):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function u(e,t,r,i){var s=o++,a=new Promise(function(e,t){n[s]={resolve:e,reject:t}});try{var c=JSON.stringify(i,y);l().beginInvokeDotNetFromJS(s,e,t,r,c)}catch(e){h(s,!1,e)}return a}function l(){if(null!==i)return i;throw new Error("No .NET call dispatcher has been set.")}function h(e,t,r){if(!n.hasOwnProperty(e))throw new Error("There is no pending async call with ID "+e+".");var o=n[e];delete n[e],t?o.resolve(r):o.reject(r)}function f(e){return e?JSON.parse(e,function(e,n){return t.reduce(function(t,n){return n(e,t)},n)}):null}function p(e){return e instanceof Error?e.message+"\n"+e.stack:e?e.toString():"null"}function d(e){if(r.hasOwnProperty(e))return r[e];var t=window,n="window";if(e.split(".").forEach(function(e){if(!(e in t))throw new Error("Could not find '"+e+"' in '"+n+"'.");t=t[e],n+="."+e}),t instanceof Function)return t;throw new Error("The value '"+n+"' is not a function.")}e.attachDispatcher=function(e){i=e},e.attachReviver=s,e.invokeMethod=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return c(e,t,null,n)},e.invokeMethodAsync=a,e.jsCallDispatcher={findJSFunction:d,invokeJSFromDotNet:function(e,t){var n=d(e).apply(null,f(t));return null==n?null:JSON.stringify(n,y)},beginInvokeJSFromDotNet:function(e,t,n){var r=new Promise(function(e){e(d(t).apply(null,f(n)))});e&&r.then(function(t){return l().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!0,t],y))},function(t){return l().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!1,p(t)]))})},endInvokeDotNetFromJS:function(e,t,n){var r=t?n:new Error(n);h(parseInt(e),t,r)}};var g=function(){function e(e){this._id=e}return e.prototype.invokeMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return c(null,e,this._id,t)},e.prototype.invokeMethodAsync=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return u(null,e,this._id,t)},e.prototype.dispose=function(){a("Microsoft.JSInterop","DotNetDispatcher.ReleaseDotNetObject",this._id).catch(function(e){return console.error(e)})},e.prototype.serializeAsArg=function(){return{__dotNetObject:this._id}},e}();function y(e,t){return t instanceof g?t.serializeAsArg():t}s(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__dotNetObject")?new g(t.__dotNetObject):t})}(r||(r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPlatform=function(e){return t.platform=e,t.platform}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(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{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,h=-1;function f(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&p())}function p(){if(!l){var e=a(f);l=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new d(e,t)),1!==u.length||l||a(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(8).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(20);var i,s=!1,a=!1,c=null;function u(e,t){var n=f(e);!t&&p(n)?l(n,!1):location.href=e}function l(e,t){history.pushState(null,"",e),h(t)}function h(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return c?[4,DotNet.invokeMethodAsync(c.assemblyName,c.functionName,location.href,e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}function f(e){return(i=i||document.createElement("a")).href=e,i.href}function p(e){var t,n=(t=document.baseURI).substr(0,t.lastIndexOf("/")+1);return e.startsWith(n)}t.internalFunctions={listenForNavigationEvents:function(e,t){if(a)return;c={assemblyName:e,functionName:t},a=!0,window.addEventListener("popstate",function(){return h(!1)})},enableNavigationInterception:function(){if(s)return;s=!0,document.addEventListener("click",function(e){if(0===e.button&&!function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)){var t=function e(t,n){return t?t.tagName===n?t:e(t.parentElement,n):null}(e.target,"A");if(t&&t.hasAttribute("href")){var n=t.getAttribute("target"),r=!n||"_self"===n;if(!r)return;var o=t.getAttribute("href"),i=f(o);p(i)&&(e.preventDefault(),l(i,!0))}}})},navigateTo:u,getBaseURI:function(){return document.baseURI},getLocationHref:function(){return location.href}},t.navigateTo=u},function(e,t,n){var r=n(61),o=n(37),i=n(18).Buffer;function s(e){if(!(this instanceof s))return new s(e);if(this._bufs=[],this.length=0,"function"==typeof e){this._callback=e;var t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)})}else this.append(e);r.call(this)}o.inherits(s,r),s.prototype._offset=function(e){var t,n=0,r=0;if(0===e)return[0,0];for(;r<this._bufs.length;r++){if(e<(t=n+this._bufs[r].length)||r==this._bufs.length-1)return[r,e-n];n=t}},s.prototype.append=function(e){var t=0;if(i.isBuffer(e))this._appendBuffer(e);else if(Array.isArray(e))for(;t<e.length;t++)this.append(e[t]);else if(e instanceof s)for(;t<e._bufs.length;t++)this.append(e._bufs[t]);else null!=e&&("number"==typeof e&&(e=e.toString()),this._appendBuffer(i.from(e)));return this},s.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},s.prototype._write=function(e,t,n){this._appendBuffer(e),"function"==typeof n&&n()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype.get=function(e){return this.slice(e,e+1)[0]},s.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},s.prototype.copy=function(e,t,n,r){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof r||r>this.length)&&(r=this.length),n>=this.length)return e||i.alloc(0);if(r<=0)return e||i.alloc(0);var o,s,a=!!e,c=this._offset(n),u=r-n,l=u,h=a&&t||0,f=c[1];if(0===n&&r==this.length){if(!a)return 1===this._bufs.length?this._bufs[0]:i.concat(this._bufs,this.length);for(s=0;s<this._bufs.length;s++)this._bufs[s].copy(e,h),h+=this._bufs[s].length;return e}if(l<=this._bufs[c[0]].length-f)return a?this._bufs[c[0]].copy(e,t,f,f+l):this._bufs[c[0]].slice(f,f+l);for(a||(e=i.allocUnsafe(u)),s=c[0];s<this._bufs.length;s++){if(!(l>(o=this._bufs[s].length-f))){this._bufs[s].copy(e,h,f,f+l);break}this._bufs[s].copy(e,h,f),h+=o,l-=o,f&&(f=0)}return e},s.prototype.shallowSlice=function(e,t){e=e||0,t=t||this.length,e<0&&(e+=this.length),t<0&&(t+=this.length);var n=this._offset(e),r=this._offset(t),o=this._bufs.slice(n[0],r[0]+1);return 0==r[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,r[1]),0!=n[1]&&(o[0]=o[0].slice(n[1])),new s(o)},s.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)},s.prototype.consume=function(e){for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){for(var e=0,t=new s;e<this._bufs.length;e++)t.append(this._bufs[e]);return t},s.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)},function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var t in e)!function(t){s.prototype[t]=function(n){return this.slice(n,n+e[t])[t](0)}}(t)}(),e.exports=s},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(a-1),s=0;s<i.length;)i[s++]=arguments[s];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,n(22))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(t.LogLevel||(t.LogLevel={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),o=n(29),i=n(16);window.Blazor={navigateTo:r.navigateTo,_internal:{attachRootComponentToElement:i.attachRootComponentToElement,http:o.internalFunctions,uriHelper:r.internalFunctions}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i,s,a=n(21),c="Microsoft.AspNetCore.Blazor",u=c+".Http",l="WebAssemblyHttpMessageHandler";function h(e,t,n,r){i||(i=a.platform.findMethod(c,u,l,"ReceiveResponse")),a.platform.callMethod(i,null,[a.platform.toDotNetString(e.toString()),t,n,r])}t.internalFunctions={sendAsync:function(e,t,n){return r(this,void 0,void 0,function(){var r,i,f,p,d;return o(this,function(o){switch(o.label){case 0:f=JSON.parse(a.platform.toJavaScriptString(n)),p=Object.assign({credentials:(g=f.requestInit).credentials,method:g.method,headers:g.headers.map(function(e){return[e.name,e.value]})},f.requestInitOverrides),t&&(p.body=a.platform.toUint8Array(t)),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(f.requestUri,p)];case 2:return[4,(r=o.sent()).arrayBuffer()];case 3:return i=o.sent(),[3,5];case 4:return d=o.sent(),function(e,t){h(e,null,null,a.platform.toDotNetString(t))}(e,d.toString()),[2];case 5:return function(e,t,n){var r={statusCode:t.status,statusText:t.statusText,headers:[]};t.headers.forEach(function(e,t){r.headers.push({name:t,value:e})}),s||(s=a.platform.findMethod(c,u,l,"AllocateArray"));var o=a.platform.callMethod(s,null,[a.platform.toDotNetString(n.byteLength.toString())]);a.platform.toUint8Array(o).set(new Uint8Array(n)),h(e,a.platform.toDotNetString(JSON.stringify(r)),o,null)}(e,r,i),[2]}var g})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(31),o=n(32),i=n(17),s=n(34),a=document.createElement("template"),c=document.createElementNS("http://www.w3.org/2000/svg","g"),u={submit:!0},l={},h=function(){function e(e){var t=this;this.childComponentLocations={},this.browserRendererId=e,this.eventDelegator=new o.EventDelegator(function(e,n,r){!function(e,t,n,r){u[e.type]&&e.preventDefault();var o={browserRendererId:t,eventHandlerId:n,eventArgsType:r.type};DotNet.invokeMethodAsync("Microsoft.AspNetCore.Components.Browser","DispatchEvent",o,JSON.stringify(r.data))}(e,t.browserRendererId,n,r)})}return e.prototype.attachRootComponentToLogicalElement=function(e,t){this.attachComponentToElement(e,t),l[e]=t},e.prototype.updateComponent=function(e,t,n,r){var o=this.childComponentLocations[t];if(!o)throw new Error("No element is currently associated with component "+t);var s=l[t];if(s){var a=i.getLogicalSiblingEnd(s);delete l[t],a?function(e,t){var n=i.getLogicalParent(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");for(var r=i.getLogicalChildrenArray(n),o=r.indexOf(e)+1,s=r.indexOf(t),a=o;a<=s;a++)i.removeLogicalChild(n,o);e.textContent="!"}(s,a):function(e){var t;for(;t=e.firstChild;)e.removeChild(t)}(s)}var c=i.getClosestDomElement(o).ownerDocument,u=c&&c.activeElement;this.applyEdits(e,o,0,n,r),u instanceof HTMLElement&&c&&c.activeElement!==u&&u.focus()},e.prototype.disposeComponent=function(e){delete this.childComponentLocations[e]},e.prototype.disposeEventHandler=function(e){this.eventDelegator.removeListener(e)},e.prototype.attachComponentToElement=function(e,t){this.childComponentLocations[e]=t},e.prototype.applyEdits=function(e,t,n,o,s){for(var a,c=0,u=n,l=e.arraySegmentReader,h=e.editReader,f=e.frameReader,p=l.values(o),d=l.offset(o),g=d+l.count(o),y=d;y<g;y++){var v=e.diffReader.editsEntry(p,y),b=h.editType(v);switch(b){case r.EditType.prependFrame:var m=h.newTreeIndex(v),w=e.referenceFramesEntry(s,m),S=h.siblingIndex(v);this.insertFrame(e,t,u+S,s,w,m);break;case r.EditType.removeFrame:S=h.siblingIndex(v);i.removeLogicalChild(t,u+S);break;case r.EditType.setAttribute:m=h.newTreeIndex(v),w=e.referenceFramesEntry(s,m),S=h.siblingIndex(v);if(!((E=i.getLogicalChild(t,u+S))instanceof Element))throw new Error("Cannot set attribute on non-element child");this.applyAttribute(e,E,w);break;case r.EditType.removeAttribute:var E;S=h.siblingIndex(v);if(!((E=i.getLogicalChild(t,u+S))instanceof HTMLElement))throw new Error("Cannot remove attribute from non-element child");var C=h.removedAttributeName(v);this.tryApplySpecialProperty(e,E,C,null)||E.removeAttribute(C);break;case r.EditType.updateText:m=h.newTreeIndex(v),w=e.referenceFramesEntry(s,m),S=h.siblingIndex(v);var k=i.getLogicalChild(t,u+S);if(!(k instanceof Text))throw new Error("Cannot set text content on non-text child");k.textContent=f.textContent(w);break;case r.EditType.updateMarkup:m=h.newTreeIndex(v),w=e.referenceFramesEntry(s,m),S=h.siblingIndex(v);i.removeLogicalChild(t,u+S),this.insertMarkup(e,t,u+S,w);break;case r.EditType.stepIn:S=h.siblingIndex(v);t=i.getLogicalChild(t,u+S),c++,u=0;break;case r.EditType.stepOut:t=i.getLogicalParent(t),u=0===--c?n:0;break;case r.EditType.permutationListEntry:(a=a||[]).push({fromSiblingIndex:u+h.siblingIndex(v),toSiblingIndex:u+h.moveToSiblingIndex(v)});break;case r.EditType.permutationListEnd:i.permuteLogicalChildren(t,a),a=void 0;break;default:throw new Error("Unknown edit type: "+b)}}},e.prototype.insertFrame=function(e,t,n,o,i,a){var c=e.frameReader,u=c.frameType(i);switch(u){case r.FrameType.element:return this.insertElement(e,t,n,o,i,a),1;case r.FrameType.text:return this.insertText(e,t,n,i),1;case r.FrameType.attribute:throw new Error("Attribute frames should only be present as leading children of element frames.");case r.FrameType.component:return this.insertComponent(e,t,n,i),1;case r.FrameType.region:return this.insertFrameRange(e,t,n,o,a+1,a+c.subtreeLength(i));case r.FrameType.elementReferenceCapture:if(t instanceof Element)return s.applyCaptureIdToElement(t,c.elementReferenceCaptureId(i)),0;throw new Error("Reference capture frames can only be children of element frames.");case r.FrameType.markup:return this.insertMarkup(e,t,n,i),1;default:throw new Error("Unknown frame type: "+u)}},e.prototype.insertElement=function(e,t,n,o,s,a){var c=e.frameReader,u=c.elementName(s),l="svg"===u||i.isSvgElement(t)?document.createElementNS("http://www.w3.org/2000/svg",u):document.createElement(u),h=i.toLogicalElement(l);i.insertLogicalChild(l,t,n);for(var f=a+c.subtreeLength(s),p=a+1;p<f;p++){var d=e.referenceFramesEntry(o,p);if(c.frameType(d)!==r.FrameType.attribute){this.insertFrameRange(e,h,0,o,p,f);break}this.applyAttribute(e,l,d)}},e.prototype.insertComponent=function(e,t,n,r){var o=i.createAndInsertLogicalContainer(t,n),s=e.frameReader.componentId(r);this.attachComponentToElement(s,o)},e.prototype.insertText=function(e,t,n,r){var o=e.frameReader.textContent(r),s=document.createTextNode(o);i.insertLogicalChild(s,t,n)},e.prototype.insertMarkup=function(e,t,n,r){for(var o,s=i.createAndInsertLogicalContainer(t,n),u=e.frameReader.markupContent(r),l=(o=u,i.isSvgElement(t)?(c.innerHTML=o||" ",c):(a.innerHTML=o||" ",a.content)),h=0;l.firstChild;)i.insertLogicalChild(l.firstChild,s,h++)},e.prototype.applyAttribute=function(e,t,n){var r=e.frameReader,o=r.attributeName(n),i=(this.browserRendererId,r.attributeEventHandlerId(n));if(i){var s=o.substring(0,2),a=o.substring(2);if("on"!==s||!a)throw new Error("Attribute has nonzero event handler ID, but attribute name '"+o+"' does not start with 'on'.");this.eventDelegator.setListener(t,a,i)}else this.tryApplySpecialProperty(e,t,o,n)||t.setAttribute(o,r.attributeValue(n))},e.prototype.tryApplySpecialProperty=function(e,t,n,r){switch(n){case"value":return this.tryApplyValueProperty(e,t,r);case"checked":return this.tryApplyCheckedProperty(e,t,r);default:return!1}},e.prototype.tryApplyValueProperty=function(e,t,n){var r=e.frameReader;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":var o=n?r.attributeValue(n):null;return t.value=o,"SELECT"===t.tagName&&(t._blazorSelectValue=o),!0;case"OPTION":(o=n?r.attributeValue(n):null)?t.setAttribute("value",o):t.removeAttribute("value");var i=t.parentElement;return i&&"_blazorSelectValue"in i&&i._blazorSelectValue===o&&(this.tryApplyValueProperty(e,i,n),delete i._blazorSelectValue),!0;default:return!1}},e.prototype.tryApplyCheckedProperty=function(e,t,n){if("INPUT"===t.tagName){var r=n?e.frameReader.attributeValue(n):null;return t.checked=null!==r,!0}return!1},e.prototype.insertFrameRange=function(e,t,n,r,o,i){for(var s=n,a=o;a<i;a++){var c=e.referenceFramesEntry(r,a);n+=this.insertFrame(e,t,n,r,c,a),a+=f(e,c)}return n-s},e}();function f(e,t){var n=e.frameReader;switch(n.frameType(t)){case r.FrameType.component:case r.FrameType.element:case r.FrameType.region:return n.subtreeLength(t)-1;default:return 0}}t.BrowserRenderer=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t.EditType||(t.EditType={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(t.FrameType||(t.FrameType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(33),i=(r={},["abort","blur","change","error","focus","load","loadend","loadstart","mouseenter","mouseleave","progress","reset","scroll","submit","unload","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"].forEach(function(e){r[e]=!0}),r),s=function(){function e(t){this.onEvent=t;var n=++e.nextEventDelegatorId;this.eventsCollectionKey="_blazorEvents_"+n,this.eventInfoStore=new a(this.onGlobalEvent.bind(this))}return e.prototype.setListener=function(e,t,n){var r=e[this.eventsCollectionKey];if(r||(r=e[this.eventsCollectionKey]={}),r.hasOwnProperty(t)){var o=r[t];this.eventInfoStore.update(o.eventHandlerId,n)}else{var i={element:e,eventName:t,eventHandlerId:n};this.eventInfoStore.add(i),r[t]=i}},e.prototype.removeListener=function(e){var t=this.eventInfoStore.remove(e);if(t){var n=t.element;if(n.hasOwnProperty(this.eventsCollectionKey)){var r=n[this.eventsCollectionKey];delete r[t.eventName],0===Object.getOwnPropertyNames(r).length&&delete n[this.eventsCollectionKey]}}},e.prototype.onGlobalEvent=function(e){if(e.target instanceof Element)for(var t=e.target,n=null,r=i.hasOwnProperty(e.type);t;){if(t.hasOwnProperty(this.eventsCollectionKey)){var s=t[this.eventsCollectionKey];if(s.hasOwnProperty(e.type)){n||(n=o.EventForDotNet.fromDOMEvent(e));var a=s[e.type];this.onEvent(e,a.eventHandlerId,n)}}t=r?null:t.parentElement}},e.nextEventDelegatorId=0,e}();t.EventDelegator=s;var a=function(){function e(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={}}return e.prototype.add=function(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error("Event "+e.eventHandlerId+" is already tracked");this.infosByEventHandlerId[e.eventHandlerId]=e;var t=e.eventName;if(this.countByEventName.hasOwnProperty(t))this.countByEventName[t]++;else{this.countByEventName[t]=1;var n=i.hasOwnProperty(t);document.addEventListener(t,this.globalListener,n)}},e.prototype.update=function(e,t){if(this.infosByEventHandlerId.hasOwnProperty(t))throw new Error("Event "+t+" is already tracked");var n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n},e.prototype.remove=function(e){var t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];var n=t.eventName;0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t},e}()},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.type=e,this.data=t}return e.fromDOMEvent=function(t){var n=t.target;switch(t.type){case"input":case"change":var o=function(e){return e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(n)?!!n.checked:n.value;return new e("change",{type:t.type,value:o});case"copy":case"cut":case"paste":return new e("clipboard",{type:t.type});case"drag":case"dragend":case"dragenter":case"dragleave":case"dragover":case"dragstart":case"drop":return new e("drag",function(e){return{type:e.type,detail:e.detail,dataTransfer:e.dataTransfer,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"focus":case"blur":case"focusin":case"focusout":return new e("focus",{type:t.type});case"keydown":case"keyup":case"keypress":return new e("keyboard",function(e){return{type:e.type,key:e.key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"contextmenu":case"click":case"mouseover":case"mouseout":case"mousemove":case"mousedown":case"mouseup":case"dblclick":return new e("mouse",i(t));case"error":return new e("error",function(e){return{type:e.type,message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno}}(t));case"loadstart":case"timeout":case"abort":case"load":case"loadend":case"progress":return new e("progress",function(e){return{type:e.type,lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total}}(t));case"touchcancel":case"touchend":case"touchmove":case"touchenter":case"touchleave":case"touchstart":return new e("touch",function(e){function t(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push({identifier:r.identifier,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY,pageX:r.pageX,pageY:r.pageY})}return t}return{type:e.type,detail:e.detail,touches:t(e.touches),targetTouches:t(e.targetTouches),changedTouches:t(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointerenter":case"pointerleave":case"pointermove":case"pointerout":case"pointerover":case"pointerup":return new e("pointer",function(e){return r({},i(e),{pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary})}(t));case"wheel":case"mousewheel":return new e("wheel",function(e){return r({},i(e),{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode})}(t));default:return new e("unknown",{type:t.type})}},e}();function i(e){return{type:e.type,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}t.EventForDotNet=o},function(e,t,n){"use strict";function r(e){return"_bl_"+e}Object.defineProperty(t,"__esModule",{value:!0}),t.applyCaptureIdToElement=function(e,t){e.setAttribute(r(t),"")};DotNet.attachReviver(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__internalId")&&"string"==typeof t.__internalId?(n=t.__internalId,o="["+r(n)+"]",document.querySelector(o)):t;var n,o})},,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function i(e){return new Promise(function(t,n){e.onload=t,e.onerror=n,document.head.appendChild(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchBootConfigAsync=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,fetch("_framework/blazor.boot.json",{method:"Get",credentials:"include"})];case 1:return[2,e.sent().json()]}})})},t.loadEmbeddedResourcesAsync=function(e){var t=e.cssReferences.map(function(e){var t=document.createElement("link");return t.rel="stylesheet",t.href=e,i(t)}),n=e.jsReferences.map(function(e){var t=document.createElement("script");return t.src=e,i(t)});return Promise.all(t.concat(n))},t.shouldAutoStart=function(){return document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")}},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(a(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,s=String(e).replace(o,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),c=r[n];n<i;c=r[++n])g(c)||!w(c)?s+=" "+c:s+=" "+a(c);return s},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),o=!0}return n.apply(this,arguments)}};var i,s={};function a(e,n){var r={seen:[],stylize:u};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=c),l(r,e,r.depth)}function c(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function u(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&C(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=l(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,n);if(i)return i;var s=Object.keys(n),a=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(n)),E(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(C(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(m(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(S(n))return e.stylize(Date.prototype.toString.call(n),"date");if(E(n))return h(n)}var u,w="",k=!1,I=["{","}"];(p(n)&&(k=!0,I=["[","]"]),C(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return m(n)&&(w=" "+RegExp.prototype.toString.call(n)),S(n)&&(w=" "+Date.prototype.toUTCString.call(n)),E(n)&&(w=" "+h(n)),0!==s.length||k&&0!=n.length?r<0?m(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=k?function(e,t,n,r,o){for(var i=[],s=0,a=t.length;s<a;++s)_(t,String(s))?i.push(f(e,t,n,r,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(f(e,t,n,r,o,!0))}),i}(e,n,r,a,s):s.map(function(t){return f(e,n,r,a,t,k)}),e.seen.pop(),function(e,t,n){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(u,w,I)):I[0]+w+I[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,o,i){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),_(r,o)||(s="["+o+"]"),a||(e.seen.indexOf(c.value)<0?(a=g(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),b(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function m(e){return w(e)&&"[object RegExp]"===k(e)}function w(e){return"object"==typeof e&&null!==e}function S(e){return w(e)&&"[object Date]"===k(e)}function E(e){return w(e)&&("[object Error]"===k(e)||e instanceof Error)}function C(e){return"function"==typeof e}function k(e){return Object.prototype.toString.call(e)}function I(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(i)&&(i=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(i)){var r=e.pid;s[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else s[n]=function(){};return s[n]},t.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=m,t.isObject=w,t.isDate=S,t.isError=E,t.isFunction=C,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(59);var T=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[I(e.getHours()),I(e.getMinutes()),I(e.getSeconds())].join(":"),[e.getDate(),T[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(60),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function x(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},t.promisify.custom=P,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,s=function(){return o.apply(i,arguments)};t.apply(this,n).then(function(t){e.nextTick(s,null,t)},function(t){e.nextTick(x,t,s)})}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,r(t)),n}}).call(this,n(22))},function(e,t,n){"use strict";(function(t,r){var o=n(26);e.exports=m;var i,s=n(62);m.ReadableState=b;n(39).EventEmitter;var a=function(e,t){return e.listeners(t).length},c=n(40),u=n(18).Buffer,l=t.Uint8Array||function(){};var h=n(23);h.inherits=n(19);var f=n(63),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var d,g=n(64),y=n(41);h.inherits(m,c);var v=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var r=t instanceof(i=i||n(14));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,s=e.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(42).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function m(e){if(i=i||n(14),!(this instanceof m))return new m(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function w(e,t,n,r,o){var i,s=e._readableState;null===t?(s.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,k(e)}(e,s)):(o||(i=function(e,t){var n;r=t,u.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(s,t)),i?e.emit("error",i):s.objectMode||t&&t.length>0?("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),r?s.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,s,t,!0):s.ended?e.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(t=s.decoder.write(t),s.objectMode||0!==t.length?S(e,s,t,!1):T(e,s)):S(e,s,t,!1))):r||(s.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(s)}function S(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&k(e)),T(e,t)}Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),m.prototype.destroy=y.destroy,m.prototype._undestroy=y.undestroy,m.prototype._destroy=function(e,t){this.push(null),t(e)},m.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=u.from(e,t),t=""),n=!0),w(this,e,t,!1,n)},m.prototype.unshift=function(e){return w(this,e,null,!0,!1)},m.prototype.isPaused=function(){return!1===this._readableState.flowing},m.prototype.setEncoding=function(e){return d||(d=n(42).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var E=8388608;function C(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>=E?e=E:(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 k(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(I,e):I(e))}function I(e){p("emit readable"),e.emit("readable"),R(e)}function T(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(_,e,t))}function _(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function P(e){p("readable nexttick read 0"),e.read(0)}function x(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(p("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,s=e>i.length?i.length:e;if(s===i.length?o+=i:o+=i.slice(0,e),0===(e-=s)){s===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(s));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=u.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,s),0===(e-=s)){s===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(s));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(L,t,e))}function L(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function A(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}m.prototype.read=function(e){p("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):k(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&p("length less than watermark",o=!0),t.ended||t.reading?p("reading or ended",o=!1):o&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(n,t))),null===(r=e>0?D(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var c=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:m;function u(t,r){p("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),e.removeListener("close",v),e.removeListener("finish",b),e.removeListener("drain",h),e.removeListener("error",y),e.removeListener("unpipe",u),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",g),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||h())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(c):n.once("end",c),e.on("unpipe",u);var h=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,R(e))}}(n);e.on("drain",h);var f=!1;var d=!1;function g(t){p("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==A(i.pipes,e))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(t){p("onerror",t),m(),e.removeListener("error",y),0===a(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",b),m()}function b(){p("onfinish"),e.removeListener("close",v),m()}function m(){p("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",y),e.once("close",v),e.once("finish",b),e.emit("pipe",n),i.flowing||(p("pipe resume"),n.resume()),e},m.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var s=A(t.pipes,e);return-1===s?this:(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},m.prototype.on=function(e,t){var n=c.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&k(this):o.nextTick(P,this))}return n},m.prototype.addListener=m.prototype.on,m.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(x,e,t))}(this,e)),this},m.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},m.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(p("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(p("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!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 i=0;i<v.length;i++)e.on(v[i],this.emit.bind(this,v[i]));return this._read=function(t){p("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(m.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),m._fromList=D}).call(this,n(13),n(22))},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=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 s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,s,a;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=u(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}.bind(r);return o.listener=n,r.wrapFn=o,o}function f(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.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},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(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},a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=d(c,u);for(n=0;n<u;++n)i(l[n],this,t)}return!0},a.prototype.addListener=function(e,t){return l(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return l(this,e,t,!0)},a.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,h(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,h(this,e,t)),this},a.prototype.removeListener=function(e,t){var n,r,o,i,s;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},a.prototype.listeners=function(e){return f(this,e,!0)},a.prototype.rawListeners=function(e){return f(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(39).EventEmitter},function(e,t,n){"use strict";var r=n(26);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return i||s?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";var r=n(66).Buffer,o=r.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 i(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&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=h,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){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!==n?n: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 c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?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-n))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=s(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=s(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=s(t[r]))>=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=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.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}},function(e,t,n){"use strict";(function(t,r,o){var i=n(26);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=b;var a,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;b.WritableState=v;var u=n(23);u.inherits=n(19);var l={deprecate:n(69)},h=n(40),f=n(18).Buffer,p=o.Uint8Array||function(){};var d,g=n(41);function y(){}function v(e,t){a=a||n(14),e=e||{};var r=t instanceof a;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,u=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(u||0===u)?u:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===e.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=e.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,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),k(e,t))}(e,n,r,t,o);else{var s=E(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||S(e,n),r?c(w,e,n,s,o):w(e,n,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function b(e){if(a=a||n(14),!(d.call(b,this)||this instanceof a))return new b(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function m(e,t,n,r,o,i,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),k(e,t)}function S(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var a=0,c=!0;n;)o[a]=n,n.isBuf||(c=!1),n=n.next,a+=1;o.allBuffers=c,m(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,h=n.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,l,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function E(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function C(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var n=E(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(b,h),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:l.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(b,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===b&&(e&&e._writableState instanceof v)}})):d=function(e){return e instanceof this},b.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},b.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,f.isBuffer(r)||r instanceof p);return a&&!f.isBuffer(e)&&(e=function(e){return f.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=y),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(e.emit("error",s),i.nextTick(r,s),o=!1),o}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,n,r,o,i){if(!n){var s=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=f.from(t,n));return t}(t,r,o);r!==s&&(n=!0,o="buffer",r=s)}var a=t.objectMode?1:r.length;t.length+=a;var c=t.length<t.highWaterMark;c||(t.needDrain=!0);if(t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else m(e,t,!1,a,r,o,i);return c}(this,o,a,e,t,n)),s},b.prototype.cork=function(){this._writableState.corked++},b.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||S(this,e))},b.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(b.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),b.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},b.prototype._writev=null,b.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,k(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),b.prototype.destroy=g.destroy,b.prototype._undestroy=g.undestroy,b.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(22),n(67).setImmediate,n(13))},function(e,t,n){"use strict";e.exports=s;var r=n(14),o=n(23);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function s(e){if(!(this instanceof s))return new s(e);r.call(this,e),this._transformState={afterTransform:i.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",a)}function a(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){c(e,t,n)}):c(this,null,null)}function c(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(19),o.inherits(s,r),s.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},s.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},s.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},s.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},s.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(75),s=n(76),a=n(27),c=function(){function e(t){var n=this;this.logger=t,this.reconnectDisplay=new s.DefaultReconnectDisplay(document),document.addEventListener("DOMContentLoaded",function(){var t=document.getElementById(e.DialogId);t&&(n.reconnectDisplay=new i.UserSpecifiedDisplay(t))})}return e.prototype.onConnectionUp=function(){this.reconnectDisplay.hide()},e.prototype.delay=function(){return new Promise(function(t){return setTimeout(t,e.RetryInterval)})},e.prototype.onConnectionDown=function(){return r(this,void 0,void 0,function(){var t,n;return o(this,function(r){switch(r.label){case 0:this.reconnectDisplay.show(),t=0,r.label=1;case 1:return t<e.MaxRetries?[4,this.delay()]:[3,7];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,6]),[4,window.Blazor.reconnect()];case 4:return r.sent()?[2]:[3,7];case 5:return n=r.sent(),this.logger.log(a.LogLevel.Error,n),[3,6];case 6:return t++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}})})},e.MaxRetries=5,e.RetryInterval=3e3,e.DialogId="components-reconnect-modal",e}();t.AutoReconnectCircuitHandler=c},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return f});var r,o,i=n(4),s=n(6),a=n(0),c=n(2),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};if("undefined"==typeof XMLHttpRequest){var h=require;o=h("request")}var f=function(t){function n(e){var n=t.call(this)||this;if(void 0===o)throw new Error("The 'request' module could not be loaded.");return n.logger=e,n.cookieJar=o.jar(),n.request=o.defaults({jar:n.cookieJar}),n}return u(n,t),n.prototype.send=function(t){var n=this;return new Promise(function(r,o){var u;u=Object(c.g)(t.content)?e.from(t.content):t.content||"";var h=n.request(t.url,{body:u,encoding:"arraybuffer"===t.responseType?null:"utf8",headers:l({"X-Requested-With":"XMLHttpRequest"},t.headers),method:t.method,timeout:t.timeout},function(e,c,u){if(t.abortSignal&&(t.abortSignal.onabort=null),e)return"ETIMEDOUT"===e.code&&(n.logger.log(a.a.Warning,"Timeout from HTTP request."),o(new i.c)),n.logger.log(a.a.Warning,"Error from HTTP request. "+e),void o(e);c.statusCode>=200&&c.statusCode<300?r(new s.b(c.statusCode,c.statusMessage||"",u)):o(new i.b(c.statusMessage||"",c.statusCode||0))});t.abortSignal&&(t.abortSignal.onabort=function(){h.abort(),o(new i.a)})})},n.prototype.getCookieString=function(e){return this.cookieJar.getCookieString(e)},n}(s.a)}).call(this,n(8).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return i});var r=n(11),o=n(2),i=function(){function t(){}return t.prototype.writeHandshakeRequest=function(e){return r.a.write(JSON.stringify(e))},t.prototype.parseHandshakeResponse=function(t){var n,i;if(Object(o.g)(t)||void 0!==e&&t instanceof e){var s=new Uint8Array(t);if(-1===(c=s.indexOf(r.a.RecordSeparatorCode)))throw new Error("Message is incomplete.");var a=c+1;n=String.fromCharCode.apply(null,s.slice(0,a)),i=s.byteLength>a?s.slice(a).buffer:null}else{var c,u=t;if(-1===(c=u.indexOf(r.a.RecordSeparator)))throw new Error("Message is incomplete.");a=c+1;n=u.substring(0,a),i=u.length>a?u.substring(a):null}var l=r.a.parse(n),h=JSON.parse(l[0]);if(h.type)throw new Error("Expected a handshake response from the server.");return[i,h]},t}()}).call(this,n(8).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return f});var r,o,i=n(5),s=n(7),a=n(1),c=n(3),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};if("undefined"==typeof XMLHttpRequest){var h=require;o=h("request")}var f=function(t){function n(e){var n=t.call(this)||this;if(void 0===o)throw new Error("The 'request' module could not be loaded.");return n.logger=e,n.cookieJar=o.jar(),n.request=o.defaults({jar:n.cookieJar}),n}return u(n,t),n.prototype.send=function(t){var n=this;return new Promise(function(r,o){var u;u=Object(c.g)(t.content)?e.from(t.content):t.content||"";var h=n.request(t.url,{body:u,encoding:"arraybuffer"===t.responseType?null:"utf8",headers:l({"X-Requested-With":"XMLHttpRequest"},t.headers),method:t.method,timeout:t.timeout},function(e,c,u){if(t.abortSignal&&(t.abortSignal.onabort=null),e)return"ETIMEDOUT"===e.code&&(n.logger.log(a.a.Warning,"Timeout from HTTP request."),o(new i.c)),n.logger.log(a.a.Warning,"Error from HTTP request. "+e),void o(e);c.statusCode>=200&&c.statusCode<300?r(new s.b(c.statusCode,c.statusMessage||"",u)):o(new i.b(c.statusMessage||"",c.statusCode||0))});t.abortSignal&&(t.abortSignal.onabort=function(){h.abort(),o(new i.a)})})},n.prototype.getCookieString=function(e){return this.cookieJar.getCookieString(e)},n}(s.a)}).call(this,n(8).Buffer)},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return i});var r=n(12),o=n(3),i=function(){function t(){}return t.prototype.writeHandshakeRequest=function(e){return r.a.write(JSON.stringify(e))},t.prototype.parseHandshakeResponse=function(t){var n,i;if(Object(o.g)(t)||void 0!==e&&t instanceof e){var s=new Uint8Array(t);if(-1===(c=s.indexOf(r.a.RecordSeparatorCode)))throw new Error("Message is incomplete.");var a=c+1;n=String.fromCharCode.apply(null,s.slice(0,a)),i=s.byteLength>a?s.slice(a).buffer:null}else{var c,u=t;if(-1===(c=u.indexOf(r.a.RecordSeparator)))throw new Error("Message is incomplete.");a=c+1;n=u.substring(0,a),i=u.length>a?u.substring(a):null}var l=r.a.parse(n),h=JSON.parse(l[0]);if(h.type)throw new Error("Expected a handshake response from the server.");return[i,h]},t}()}).call(this,n(8).Buffer)},,,,,function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(20),n(28);var s=n(84),a=n(83),c=n(36),u=n(45),l=n(77),h=n(80),f=n(27),p=n(81),d=!1,g=!1;function y(e){return o(this,void 0,void 0,function(){var t,n,s,a,l,y,b,m,w,S,E,C,k,I=this;return i(this,function(T){switch(T.label){case 0:if(g)throw new Error("Blazor has already started.");return g=!0,t={configureSignalR:function(e){},logLevel:f.LogLevel.Warning},n=r({},t,e),(s=new h.ConsoleLogger(n.logLevel)).log(f.LogLevel.Information,"Starting up blazor server-side application."),a=[new u.AutoReconnectCircuitHandler(s)],window.Blazor.circuitHandlers=a,l=c.fetchBootConfigAsync().then(function(e){return c.loadEmbeddedResourcesAsync(e)}),[4,v(n,a,s)];case 1:for(y=T.sent(),b=p.discoverPrerenderedCircuits(document),m=0;m<b.length;m++)for(w=b[m],S=0;S<w.components.length;S++)w.components[S].initialize();return[4,l];case 2:return T.sent(),[4,p.startCircuit(y)];case 3:return(E=T.sent())||s.log(f.LogLevel.Information,"No preregistered components to render."),C=function(e){return o(I,void 0,void 0,function(){var t,r;return i(this,function(o){switch(o.label){case 0:return d?[2,!1]:(r=e)?[3,2]:[4,v(n,a,s)];case 1:r=o.sent(),o.label=2;case 2:return t=r,[4,Promise.all(b.map(function(e){return e.reconnect(t)}))];case 3:return function(e){return!e.reduce(function(e,t){return e&&t},!0)}(o.sent())?[2,!1]:(a.forEach(function(e){return e.onConnectionUp&&e.onConnectionUp()}),[2,!0])}})})},window.Blazor.reconnect=C,k=C(y),E&&b.push(E),[4,k];case 4:return T.sent(),s.log(f.LogLevel.Information,"Blazor server-side application started."),[2]}})})}function v(e,t,n){return o(this,void 0,void 0,function(){var r,o,c,u;return i(this,function(i){switch(i.label){case 0:(r=new a.MessagePackHubProtocol).name="blazorpack",o=(new s.HubConnectionBuilder).withUrl("_blazor").withHubProtocol(r),e.configureSignalR(o),(c=o.build()).on("JS.BeginInvokeJS",DotNet.jsCallDispatcher.beginInvokeJSFromDotNet),c.on("JS.RenderBatch",function(e,t,r){n.log(f.LogLevel.Debug,"Received render batch for "+e+" with id "+t+" and "+r.byteLength+" bytes."),l.default.getOrCreateQueue(e,n).processBatch(t,r,c)}),c.onclose(function(e){return!d&&t.forEach(function(t){return t.onConnectionDown&&t.onConnectionDown(e)})}),c.on("JS.Error",function(e){return b(c,e,n)}),window.Blazor._internal.forceCloseConnection=function(){return c.stop()},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,c.start()];case 2:return i.sent(),[3,4];case 3:return u=i.sent(),b(c,u,n),[3,4];case 4:return DotNet.attachDispatcher({beginInvokeDotNetFromJS:function(e,t,n,r,o){c.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)}}),[2,c]}})})}function b(e,t,n){n.log(f.LogLevel.Error,t),e&&(d=!0,e.stop())}window.Blazor.start=y,c.shouldAutoStart()&&y()},function(e,t,n){"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=u(e),r=n[0],s=n[1],a=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,s)),c=0,l=s>0?r-4:r,h=0;h<l;h+=4)t=o[e.charCodeAt(h)]<<18|o[e.charCodeAt(h+1)]<<12|o[e.charCodeAt(h+2)]<<6|o[e.charCodeAt(h+3)],a[c++]=t>>16&255,a[c++]=t>>8&255,a[c++]=255&t;2===s&&(t=o[e.charCodeAt(h)]<<2|o[e.charCodeAt(h+1)]>>4,a[c++]=255&t);1===s&&(t=o[e.charCodeAt(h)]<<10|o[e.charCodeAt(h+1)]<<4|o[e.charCodeAt(h+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t);return a},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],s=0,a=n-o;s<a;s+=16383)i.push(l(e,s,s+16383>a?a:s+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=s.length;a<c;++a)r[a]=s[a],o[s.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,s=[],a=t;a<n;a+=3)o=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,s,a=8*o-r-1,c=(1<<a)-1,u=c>>1,l=-7,h=n?o-1:0,f=n?-1:1,p=e[t+h];for(h+=f,i=p&(1<<-l)-1,p>>=-l,l+=a;l>0;i=256*i+e[t+h],h+=f,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=r;l>0;s=256*s+e[t+h],h+=f,l-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),i-=u}return(p?-1:1)*s*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var s,a,c,u=8*i-o-1,l=(1<<u)-1,h=l>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(t*c-1)*Math.pow(2,o),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[n+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+p]=255&s,p+=d,s/=256,u-=8);e[n+p-d]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t){ +var r=n(47),o=n(48),i=n(31);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return f(this,e)}return c(this,e,t,n)}function c(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(t,n),o=(e=s(e,r)).write(t,n);o!==r&&(e=e.slice(0,o));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|p(t.length);return 0===(e=s(e,n)).length?e:(t.copy(e,0,0,n),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):h(e,t);if("Buffer"===t.type&&i(t.data))return h(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e,t){if(l(t),e=s(e,t<0?0:0|p(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|p(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function p(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return F(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,o);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,o){var i,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;i<s;i++)if(c(e,i)===c(t,-1===l?0:i-l)){if(-1===l&&(l=i),i-l+1===u)return l*a}else-1!==l&&(i-=i-l),l=-1}else for(n+u>s&&(n=s-u),i=n;i>=0;i--){for(var f=!0,h=0;h<u;h++)if(c(e,i+h)!==c(t,h)){f=!1;break}if(f)return i}return-1}function m(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return q(F(t,e.length-n),e,n,r)}function w(e,t,n,r){return q(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function E(e,t,n,r){return w(e,t,n,r)}function S(e,t,n,r){return q(H(t),e,n,r)}function _(e,t,n,r){return q(function(e,t){for(var n,r,o,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function T(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,a,s,u,c=e[o],l=null,f=c>239?4:c>223?3:c>191?2:1;if(o+f<=n)switch(f){case 1:c<128&&(l=c);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&c)<<6|63&i)>127&&(l=u);break;case 3:i=e[o+1],a=e[o+2],128==(192&i)&&128==(192&a)&&(u=(15&c)<<12|(63&i)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,f=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),o+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=C));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return c(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return l(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},u.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}},u.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,o),o+=a.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.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)g(this,t,t+1);return this},u.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)g(this,t,t+3),g(this,t+1,t+2);return this},u.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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?k(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return I(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return T(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,o){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),c=this.slice(r,o),l=e.slice(t,n),f=0;f<s;++f)if(c[f]!==l[f]){i=c[f],a=l[f];break}return i<a?-1:a<i?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return m(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function I(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function x(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=j(e[i]);return o}function O(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function P(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,i){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function L(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function A(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function B(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(e,t,n,r,i){return i||B(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,i){return i||B(e,0,n,8),o.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((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),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var o=t-e;n=new u(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||P(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i<n&&(a*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);M(this,e,t,n,o-1,-o)}var i=n-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return D(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return D(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!u.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var a=u.isBuffer(e)?e:F(new u(e,r).toString()),s=a.length;for(i=0;i<n-t;++i)this[i+t]=a[i%s]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function j(e){return e<16?"0"+e.toString(16):e.toString(16)}function F(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function H(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(5))},function(e,t,n){"use strict";var r;!function(e){window.DotNet=e;var t=[],n={},r={},o=1,i=null;function a(e){t.push(e)}function s(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return c(e,t,null,n)}function u(e,t,n,r){var o=l();if(o.invokeDotNetFromJS){var i=JSON.stringify(r,y),a=o.invokeDotNetFromJS(e,t,n,i);return a?h(a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function c(e,t,r,i){var a=o++,s=new Promise(function(e,t){n[a]={resolve:e,reject:t}});try{var u=JSON.stringify(i,y);l().beginInvokeDotNetFromJS(a,e,t,r,u)}catch(e){f(a,!1,e)}return s}function l(){if(null!==i)return i;throw new Error("No .NET call dispatcher has been set.")}function f(e,t,r){if(!n.hasOwnProperty(e))throw new Error("There is no pending async call with ID "+e+".");var o=n[e];delete n[e],t?o.resolve(r):o.reject(r)}function h(e){return e?JSON.parse(e,function(e,n){return t.reduce(function(t,n){return n(e,t)},n)}):null}function p(e){return e instanceof Error?e.message+"\n"+e.stack:e?e.toString():"null"}function d(e){if(r.hasOwnProperty(e))return r[e];var t=window,n="window";if(e.split(".").forEach(function(e){if(!(e in t))throw new Error("Could not find '"+e+"' in '"+n+"'.");t=t[e],n+="."+e}),t instanceof Function)return t;throw new Error("The value '"+n+"' is not a function.")}e.attachDispatcher=function(e){i=e},e.attachReviver=a,e.invokeMethod=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return u(e,t,null,n)},e.invokeMethodAsync=s,e.jsCallDispatcher={findJSFunction:d,invokeJSFromDotNet:function(e,t){var n=d(e).apply(null,h(t));return null==n?null:JSON.stringify(n,y)},beginInvokeJSFromDotNet:function(e,t,n){var r=new Promise(function(e){e(d(t).apply(null,h(n)))});e&&r.then(function(t){return l().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!0,t],y))},function(t){return l().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!1,p(t)]))})},endInvokeDotNetFromJS:function(e,t,n){var r=t?n:new Error(n);f(parseInt(e),t,r)}};var g=function(){function e(e){this._id=e}return e.prototype.invokeMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return u(null,e,this._id,t)},e.prototype.invokeMethodAsync=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return c(null,e,this._id,t)},e.prototype.dispose=function(){s("Microsoft.JSInterop","DotNetDispatcher.ReleaseDotNetObject",this._id).catch(function(e){return console.error(e)})},e.prototype.serializeAsArg=function(){return{__dotNetObject:this._id}},e}();function y(e,t){return t instanceof g?t.serializeAsArg():t}a(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__dotNetObject")?new g(t.__dotNetObject):t})}(r||(r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPlatform=function(e){return t.platform=e,t.platform}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function a(){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{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function h(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&p())}function p(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new d(e,t)),1!==c.length||l||s(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(11).Buffer)},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(12);var i,a=!1,s=!1,u=null;function c(e,t){var n=h(e);!t&&p(n)?l(n,!1):location.href=e}function l(e,t){history.pushState(null,"",e),f(t)}function f(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return u?[4,DotNet.invokeMethodAsync(u.assemblyName,u.functionName,location.href,e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}function h(e){return(i=i||document.createElement("a")).href=e,i.href}function p(e){var t,n=(t=document.baseURI).substr(0,t.lastIndexOf("/")+1);return e.startsWith(n)}t.internalFunctions={listenForNavigationEvents:function(e,t){if(s)return;u={assemblyName:e,functionName:t},s=!0,window.addEventListener("popstate",function(){return f(!1)})},enableNavigationInterception:function(){if(a)return;a=!0,document.addEventListener("click",function(e){if(0===e.button&&!function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)){var t=function e(t,n){return t?t.tagName===n?t:e(t.parentElement,n):null}(e.target,"A");if(t&&t.hasAttribute("href")){var n=t.getAttribute("target"),r=!n||"_self"===n;if(!r)return;var o=t.getAttribute("href"),i=h(o);p(i)&&(e.preventDefault(),l(i,!0))}}})},navigateTo:c,getBaseURI:function(){return document.baseURI},getLocationHref:function(){return location.href}},t.navigateTo=c},function(e,t,n){"use strict";var r=n(32).Duplex,o=n(30),i=n(6).Buffer;function a(e){if(!(this instanceof a))return new a(e);if(this._bufs=[],this.length=0,"function"==typeof e){this._callback=e;var t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)})}else this.append(e);r.call(this)}o.inherits(a,r),a.prototype._offset=function(e){var t,n=0,r=0;if(0===e)return[0,0];for(;r<this._bufs.length;r++){if(e<(t=n+this._bufs[r].length)||r==this._bufs.length-1)return[r,e-n];n=t}},a.prototype._reverseOffset=function(e){for(var t=e[0],n=e[1],r=0;r<t;r++)n+=this._bufs[r].length;return n},a.prototype.append=function(e){var t=0;if(i.isBuffer(e))this._appendBuffer(e);else if(Array.isArray(e))for(;t<e.length;t++)this.append(e[t]);else if(e instanceof a)for(;t<e._bufs.length;t++)this.append(e._bufs[t]);else null!=e&&("number"==typeof e&&(e=e.toString()),this._appendBuffer(i.from(e)));return this},a.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},a.prototype._write=function(e,t,n){this._appendBuffer(e),"function"==typeof n&&n()},a.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},a.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},a.prototype.get=function(e){if(!(e>this.length||e<0)){var t=this._offset(e);return this._bufs[t[0]][t[1]]}},a.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},a.prototype.copy=function(e,t,n,r){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof r||r>this.length)&&(r=this.length),n>=this.length)return e||i.alloc(0);if(r<=0)return e||i.alloc(0);var o,a,s=!!e,u=this._offset(n),c=r-n,l=c,f=s&&t||0,h=u[1];if(0===n&&r==this.length){if(!s)return 1===this._bufs.length?this._bufs[0]:i.concat(this._bufs,this.length);for(a=0;a<this._bufs.length;a++)this._bufs[a].copy(e,f),f+=this._bufs[a].length;return e}if(l<=this._bufs[u[0]].length-h)return s?this._bufs[u[0]].copy(e,t,h,h+l):this._bufs[u[0]].slice(h,h+l);for(s||(e=i.allocUnsafe(c)),a=u[0];a<this._bufs.length;a++){if(!(l>(o=this._bufs[a].length-h))){this._bufs[a].copy(e,f,h,h+l);break}this._bufs[a].copy(e,f,h),f+=o,l-=o,h&&(h=0)}return e},a.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return new a;var n=this._offset(e),r=this._offset(t),o=this._bufs.slice(n[0],r[0]+1);return 0==r[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,r[1]),0!=n[1]&&(o[0]=o[0].slice(n[1])),new a(o)},a.prototype.toString=function(e,t,n){return this.slice(t,n).toString(e)},a.prototype.consume=function(e){for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},a.prototype.duplicate=function(){for(var e=0,t=new a;e<this._bufs.length;e++)t.append(this._bufs[e]);return t},a.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)},a.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=i.from([e]):"string"==typeof e?e=i.from(e,n):e instanceof a?e=e.slice():i.isBuffer(e)||(e=i.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;for(var r=this._offset(t),o=r[0],s=r[1];o<this._bufs.length;o++){for(var u=this._bufs[o];s<u.length;){if(u.length-s>=e.length){var c=u.indexOf(e,s);if(-1!==c)return this._reverseOffset([o,c]);s=u.length-e.length+1}else{var l=this._reverseOffset([o,s]);if(this._match(l,e))return l;s++}}s=0}return-1},a.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(var n=0;n<t.length;n++)if(this.get(e+n)!==t[n])return!1;return!0},function(){var e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(var t in e)!function(t){a.prototype[t]=null===e[t]?function(e,n){return this.slice(e,e+n)[t](0,n)}:function(n){return this.slice(n,n+e[t])[t](0)}}(t)}(),e.exports=a},function(e,t,n){"use strict";(function(t){!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,o){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,n)});case 3:return t.nextTick(function(){e.call(null,n,r)});case 4:return t.nextTick(function(){e.call(null,n,r,o)});default:for(i=new Array(s-1),a=0;a<i.length;)i[a++]=arguments[a];return t.nextTick(function(){e.apply(null,i)})}}}:e.exports=t}).call(this,n(14))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"}(t.LogLevel||(t.LogLevel={}))},function(e,t,n){"use strict";var r=n(6).Buffer,o=n(49),i=n(17),a=n(58),s=n(59),u=n(60);e.exports=function(e){var t=[],n=[];return{encode:u(t,(e=e||{forceFloat64:!1,compatibilityMode:!1,disableTimestampEncoding:!1}).forceFloat64,e.compatibilityMode,e.disableTimestampEncoding),decode:s(n),register:function(e,t,n,a){return o(t,"must have a constructor"),o(n,"must have an encode function"),o(e>=0,"must have a non-negative type"),o(a,"must have a decode function"),this.registerEncoder(function(e){return e instanceof t},function(t){var o=i(),a=r.allocUnsafe(1);return a.writeInt8(e,0),o.append(a),o.append(n(t)),o}),this.registerDecoder(e,a),this},registerEncoder:function(e,n){return o(e,"must have an encode function"),o(n,"must have an encode function"),t.push({check:e,encode:n}),this},registerDecoder:function(e,t){return o(e>=0,"must have a non-negative type"),o(t,"must have a decode function"),n.push({type:e,decode:t}),this},encoder:a.encoder,decoder:a.decoder,buffer:!0,type:"msgpack5",IncompleteBufferError:s.IncompleteBufferError}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=n(22),i=n(8);window.Blazor={navigateTo:r.navigateTo,_internal:{attachRootComponentToElement:i.attachRootComponentToElement,http:o.internalFunctions,uriHelper:r.internalFunctions}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i,a,s=n(13),u="Microsoft.AspNetCore.Blazor",c=u+".Http",l="WebAssemblyHttpMessageHandler";function f(e,t,n,r){i||(i=s.platform.findMethod(u,c,l,"ReceiveResponse")),s.platform.callMethod(i,null,[s.platform.toDotNetString(e.toString()),t,n,r])}t.internalFunctions={sendAsync:function(e,t,n){return r(this,void 0,void 0,function(){var r,i,h,p,d;return o(this,function(o){switch(o.label){case 0:h=JSON.parse(s.platform.toJavaScriptString(n)),p=Object.assign({credentials:(g=h.requestInit).credentials,method:g.method,headers:g.headers.map(function(e){return[e.name,e.value]})},h.requestInitOverrides),t&&(p.body=s.platform.toUint8Array(t)),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(h.requestUri,p)];case 2:return[4,(r=o.sent()).arrayBuffer()];case 3:return i=o.sent(),[3,5];case 4:return d=o.sent(),function(e,t){f(e,null,null,s.platform.toDotNetString(t))}(e,d.toString()),[2];case 5:return function(e,t,n){var r={statusCode:t.status,statusText:t.statusText,headers:[]};t.headers.forEach(function(e,t){r.headers.push({name:t,value:e})}),a||(a=s.platform.findMethod(u,c,l,"AllocateArray"));var o=s.platform.callMethod(a,null,[s.platform.toDotNetString(n.byteLength.toString())]);s.platform.toUint8Array(o).set(new Uint8Array(n)),f(e,s.platform.toDotNetString(JSON.stringify(r)),o,null)}(e,r,i),[2]}var g})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),o=n(25),i=n(9),a=n(27),s=document.createElement("template"),u=document.createElementNS("http://www.w3.org/2000/svg","g"),c={submit:!0},l={},f=function(){function e(e){var t=this;this.childComponentLocations={},this.browserRendererId=e,this.eventDelegator=new o.EventDelegator(function(e,n,r){!function(e,t,n,r){c[e.type]&&e.preventDefault();var o={browserRendererId:t,eventHandlerId:n,eventArgsType:r.type};DotNet.invokeMethodAsync("Microsoft.AspNetCore.Components.Browser","DispatchEvent",o,JSON.stringify(r.data))}(e,t.browserRendererId,n,r)})}return e.prototype.attachRootComponentToLogicalElement=function(e,t){this.attachComponentToElement(e,t),l[e]=t},e.prototype.updateComponent=function(e,t,n,r){var o=this.childComponentLocations[t];if(!o)throw new Error("No element is currently associated with component "+t);var a=l[t];if(a){var s=i.getLogicalSiblingEnd(a);delete l[t],s?function(e,t){var n=i.getLogicalParent(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");for(var r=i.getLogicalChildrenArray(n),o=r.indexOf(e)+1,a=r.indexOf(t),s=o;s<=a;s++)i.removeLogicalChild(n,o);e.textContent="!"}(a,s):function(e){var t;for(;t=e.firstChild;)e.removeChild(t)}(a)}var u=i.getClosestDomElement(o).ownerDocument,c=u&&u.activeElement;this.applyEdits(e,o,0,n,r),c instanceof HTMLElement&&u&&u.activeElement!==c&&c.focus()},e.prototype.disposeComponent=function(e){delete this.childComponentLocations[e]},e.prototype.disposeEventHandler=function(e){this.eventDelegator.removeListener(e)},e.prototype.attachComponentToElement=function(e,t){this.childComponentLocations[e]=t},e.prototype.applyEdits=function(e,t,n,o,a){for(var s,u=0,c=n,l=e.arraySegmentReader,f=e.editReader,h=e.frameReader,p=l.values(o),d=l.offset(o),g=d+l.count(o),y=d;y<g;y++){var v=e.diffReader.editsEntry(p,y),m=f.editType(v);switch(m){case r.EditType.prependFrame:var b=f.newTreeIndex(v),w=e.referenceFramesEntry(a,b),E=f.siblingIndex(v);this.insertFrame(e,t,c+E,a,w,b);break;case r.EditType.removeFrame:E=f.siblingIndex(v);i.removeLogicalChild(t,c+E);break;case r.EditType.setAttribute:b=f.newTreeIndex(v),w=e.referenceFramesEntry(a,b),E=f.siblingIndex(v);if(!((S=i.getLogicalChild(t,c+E))instanceof Element))throw new Error("Cannot set attribute on non-element child");this.applyAttribute(e,S,w);break;case r.EditType.removeAttribute:var S;E=f.siblingIndex(v);if(!((S=i.getLogicalChild(t,c+E))instanceof HTMLElement))throw new Error("Cannot remove attribute from non-element child");var _=f.removedAttributeName(v);this.tryApplySpecialProperty(e,S,_,null)||S.removeAttribute(_);break;case r.EditType.updateText:b=f.newTreeIndex(v),w=e.referenceFramesEntry(a,b),E=f.siblingIndex(v);var T=i.getLogicalChild(t,c+E);if(!(T instanceof Text))throw new Error("Cannot set text content on non-text child");T.textContent=h.textContent(w);break;case r.EditType.updateMarkup:b=f.newTreeIndex(v),w=e.referenceFramesEntry(a,b),E=f.siblingIndex(v);i.removeLogicalChild(t,c+E),this.insertMarkup(e,t,c+E,w);break;case r.EditType.stepIn:E=f.siblingIndex(v);t=i.getLogicalChild(t,c+E),u++,c=0;break;case r.EditType.stepOut:t=i.getLogicalParent(t),c=0===--u?n:0;break;case r.EditType.permutationListEntry:(s=s||[]).push({fromSiblingIndex:c+f.siblingIndex(v),toSiblingIndex:c+f.moveToSiblingIndex(v)});break;case r.EditType.permutationListEnd:i.permuteLogicalChildren(t,s),s=void 0;break;default:throw new Error("Unknown edit type: "+m)}}},e.prototype.insertFrame=function(e,t,n,o,i,s){var u=e.frameReader,c=u.frameType(i);switch(c){case r.FrameType.element:return this.insertElement(e,t,n,o,i,s),1;case r.FrameType.text:return this.insertText(e,t,n,i),1;case r.FrameType.attribute:throw new Error("Attribute frames should only be present as leading children of element frames.");case r.FrameType.component:return this.insertComponent(e,t,n,i),1;case r.FrameType.region:return this.insertFrameRange(e,t,n,o,s+1,s+u.subtreeLength(i));case r.FrameType.elementReferenceCapture:if(t instanceof Element)return a.applyCaptureIdToElement(t,u.elementReferenceCaptureId(i)),0;throw new Error("Reference capture frames can only be children of element frames.");case r.FrameType.markup:return this.insertMarkup(e,t,n,i),1;default:throw new Error("Unknown frame type: "+c)}},e.prototype.insertElement=function(e,t,n,o,a,s){var u=e.frameReader,c=u.elementName(a),l="svg"===c||i.isSvgElement(t)?document.createElementNS("http://www.w3.org/2000/svg",c):document.createElement(c),f=i.toLogicalElement(l);i.insertLogicalChild(l,t,n);for(var h=s+u.subtreeLength(a),p=s+1;p<h;p++){var d=e.referenceFramesEntry(o,p);if(u.frameType(d)!==r.FrameType.attribute){this.insertFrameRange(e,f,0,o,p,h);break}this.applyAttribute(e,l,d)}},e.prototype.insertComponent=function(e,t,n,r){var o=i.createAndInsertLogicalContainer(t,n),a=e.frameReader.componentId(r);this.attachComponentToElement(a,o)},e.prototype.insertText=function(e,t,n,r){var o=e.frameReader.textContent(r),a=document.createTextNode(o);i.insertLogicalChild(a,t,n)},e.prototype.insertMarkup=function(e,t,n,r){for(var o,a=i.createAndInsertLogicalContainer(t,n),c=e.frameReader.markupContent(r),l=(o=c,i.isSvgElement(t)?(u.innerHTML=o||" ",u):(s.innerHTML=o||" ",s.content)),f=0;l.firstChild;)i.insertLogicalChild(l.firstChild,a,f++)},e.prototype.applyAttribute=function(e,t,n){var r=e.frameReader,o=r.attributeName(n),i=(this.browserRendererId,r.attributeEventHandlerId(n));if(i){var a=o.substring(0,2),s=o.substring(2);if("on"!==a||!s)throw new Error("Attribute has nonzero event handler ID, but attribute name '"+o+"' does not start with 'on'.");this.eventDelegator.setListener(t,s,i)}else this.tryApplySpecialProperty(e,t,o,n)||t.setAttribute(o,r.attributeValue(n))},e.prototype.tryApplySpecialProperty=function(e,t,n,r){switch(n){case"value":return this.tryApplyValueProperty(e,t,r);case"checked":return this.tryApplyCheckedProperty(e,t,r);default:return!1}},e.prototype.tryApplyValueProperty=function(e,t,n){var r=e.frameReader;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":var o=n?r.attributeValue(n):null;return t.value=o,"SELECT"===t.tagName&&(t._blazorSelectValue=o),!0;case"OPTION":(o=n?r.attributeValue(n):null)?t.setAttribute("value",o):t.removeAttribute("value");var i=t.parentElement;return i&&"_blazorSelectValue"in i&&i._blazorSelectValue===o&&(this.tryApplyValueProperty(e,i,n),delete i._blazorSelectValue),!0;default:return!1}},e.prototype.tryApplyCheckedProperty=function(e,t,n){if("INPUT"===t.tagName){var r=n?e.frameReader.attributeValue(n):null;return t.checked=null!==r,!0}return!1},e.prototype.insertFrameRange=function(e,t,n,r,o,i){for(var a=n,s=o;s<i;s++){var u=e.referenceFramesEntry(r,s);n+=this.insertFrame(e,t,n,r,u,s),s+=h(e,u)}return n-a},e}();function h(e,t){var n=e.frameReader;switch(n.frameType(t)){case r.FrameType.component:case r.FrameType.element:case r.FrameType.region:return n.subtreeLength(t)-1;default:return 0}}t.BrowserRenderer=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t.EditType||(t.EditType={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(t.FrameType||(t.FrameType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(26),i=(r={},["abort","blur","change","error","focus","load","loadend","loadstart","mouseenter","mouseleave","progress","reset","scroll","submit","unload","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"].forEach(function(e){r[e]=!0}),r),a=function(){function e(t){this.onEvent=t;var n=++e.nextEventDelegatorId;this.eventsCollectionKey="_blazorEvents_"+n,this.eventInfoStore=new s(this.onGlobalEvent.bind(this))}return e.prototype.setListener=function(e,t,n){var r=e[this.eventsCollectionKey];if(r||(r=e[this.eventsCollectionKey]={}),r.hasOwnProperty(t)){var o=r[t];this.eventInfoStore.update(o.eventHandlerId,n)}else{var i={element:e,eventName:t,eventHandlerId:n};this.eventInfoStore.add(i),r[t]=i}},e.prototype.removeListener=function(e){var t=this.eventInfoStore.remove(e);if(t){var n=t.element;if(n.hasOwnProperty(this.eventsCollectionKey)){var r=n[this.eventsCollectionKey];delete r[t.eventName],0===Object.getOwnPropertyNames(r).length&&delete n[this.eventsCollectionKey]}}},e.prototype.onGlobalEvent=function(e){if(e.target instanceof Element)for(var t=e.target,n=null,r=i.hasOwnProperty(e.type);t;){if(t.hasOwnProperty(this.eventsCollectionKey)){var a=t[this.eventsCollectionKey];if(a.hasOwnProperty(e.type)){n||(n=o.EventForDotNet.fromDOMEvent(e));var s=a[e.type];this.onEvent(e,s.eventHandlerId,n)}}t=r?null:t.parentElement}},e.nextEventDelegatorId=0,e}();t.EventDelegator=a;var s=function(){function e(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={}}return e.prototype.add=function(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error("Event "+e.eventHandlerId+" is already tracked");this.infosByEventHandlerId[e.eventHandlerId]=e;var t=e.eventName;if(this.countByEventName.hasOwnProperty(t))this.countByEventName[t]++;else{this.countByEventName[t]=1;var n=i.hasOwnProperty(t);document.addEventListener(t,this.globalListener,n)}},e.prototype.update=function(e,t){if(this.infosByEventHandlerId.hasOwnProperty(t))throw new Error("Event "+t+" is already tracked");var n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n},e.prototype.remove=function(e){var t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];var n=t.eventName;0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t},e}()},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.type=e,this.data=t}return e.fromDOMEvent=function(t){var n=t.target;switch(t.type){case"input":case"change":var o=function(e){return e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(n)?!!n.checked:n.value;return new e("change",{type:t.type,value:o});case"copy":case"cut":case"paste":return new e("clipboard",{type:t.type});case"drag":case"dragend":case"dragenter":case"dragleave":case"dragover":case"dragstart":case"drop":return new e("drag",function(e){return{type:e.type,detail:e.detail,dataTransfer:e.dataTransfer,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"focus":case"blur":case"focusin":case"focusout":return new e("focus",{type:t.type});case"keydown":case"keyup":case"keypress":return new e("keyboard",function(e){return{type:e.type,key:e.key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"contextmenu":case"click":case"mouseover":case"mouseout":case"mousemove":case"mousedown":case"mouseup":case"dblclick":return new e("mouse",i(t));case"error":return new e("error",function(e){return{type:e.type,message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno}}(t));case"loadstart":case"timeout":case"abort":case"load":case"loadend":case"progress":return new e("progress",function(e){return{type:e.type,lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total}}(t));case"touchcancel":case"touchend":case"touchmove":case"touchenter":case"touchleave":case"touchstart":return new e("touch",function(e){function t(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push({identifier:r.identifier,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY,pageX:r.pageX,pageY:r.pageY})}return t}return{type:e.type,detail:e.detail,touches:t(e.touches),targetTouches:t(e.targetTouches),changedTouches:t(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointerenter":case"pointerleave":case"pointermove":case"pointerout":case"pointerover":case"pointerup":return new e("pointer",function(e){return r({},i(e),{pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary})}(t));case"wheel":case"mousewheel":return new e("wheel",function(e){return r({},i(e),{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode})}(t));default:return new e("unknown",{type:t.type})}},e}();function i(e){return{type:e.type,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}t.EventForDotNet=o},function(e,t,n){"use strict";function r(e){return"_bl_"+e}Object.defineProperty(t,"__esModule",{value:!0}),t.applyCaptureIdToElement=function(e,t){e.setAttribute(r(t),"")};DotNet.attachReviver(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__internalId")&&"string"==typeof t.__internalId?(n=t.__internalId,o="["+r(n)+"]",document.querySelector(o)):t;var n,o})},,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function i(e){return new Promise(function(t,n){e.onload=t,e.onerror=n,document.head.appendChild(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchBootConfigAsync=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,fetch("_framework/blazor.boot.json",{method:"Get",credentials:"include"})];case 1:return[2,e.sent().json()]}})})},t.loadEmbeddedResourcesAsync=function(e){var t=e.cssReferences.map(function(e){var t=document.createElement("link");return t.rel="stylesheet",t.href=e,i(t)}),n=e.jsReferences.map(function(e){var t=document.createElement("script");return t.src=e,i(t)});return Promise.all(t.concat(n))},t.shouldAutoStart=function(){return document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")}},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},o=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n<i;u=r[++n])g(u)||!w(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(n,r){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),o=!0}return n.apply(this,arguments)}};var i,a={};function s(e,n){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,e,r.depth)}function u(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function c(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&_(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return v(o)||(o=l(e,o,r)),o}var i=function(e,t){if(m(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(y(t))return e.stylize(""+t,"number");if(d(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,n);if(i)return i;var a=Object.keys(n),s=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(_(n)){var u=n.name?": "+n.name:"";return e.stylize("[Function"+u+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return f(n)}var c,w="",T=!1,k=["{","}"];(p(n)&&(T=!0,k=["[","]"]),_(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return b(n)&&(w=" "+RegExp.prototype.toString.call(n)),E(n)&&(w=" "+Date.prototype.toUTCString.call(n)),S(n)&&(w=" "+f(n)),0!==a.length||T&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=T?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a<s;++a)I(t,String(a))?i.push(h(e,t,n,r,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))}),i}(e,n,r,s,a):a.map(function(t){return h(e,n,r,s,t,T)}),e.seen.pop(),function(e,t,n){if(e.reduce(function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(c,w,k)):k[0]+w+k[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),I(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(n)?l(e,u.value,null):l(e,u.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),m(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function m(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===T(e)}function w(e){return"object"==typeof e&&null!==e}function E(e){return w(e)&&"[object Date]"===T(e)}function S(e){return w(e)&&("[object Error]"===T(e)||e instanceof Error)}function _(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(m(i)&&(i=e.env.NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(i)){var r=e.pid;a[n]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",n,r,e)}}else a[n]=function(){};return a[n]},t.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"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=y,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=m,t.isRegExp=b,t.isObject=w,t.isDate=E,t.isError=S,t.isFunction=_,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(50);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(e=new Date,n=[k(e.getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(7),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(x&&e[x]){var t;if("function"!=typeof(t=e[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise(function(e,r){t=e,n=r}),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push(function(e,r){e?n(e):t(r)});try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),x&&Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,r(e))},t.promisify.custom=x,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};t.apply(this,n).then(function(t){e.nextTick(a,null,t)},function(t){e.nextTick(R,t,a)})}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,r(t)),n}}).call(this,n(14))},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){(t=e.exports=n(33)).Stream=t,t.Readable=t,t.Writable=n(37),t.Duplex=n(10),t.Transform=n(39),t.PassThrough=n(57)},function(e,t,n){"use strict";(function(t,r){var o=n(18);e.exports=b;var i,a=n(31);b.ReadableState=m;n(34).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(35),c=n(6).Buffer,l=t.Uint8Array||function(){};var f=n(15);f.inherits=n(7);var h=n(51),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var d,g=n(52),y=n(36);f.inherits(b,u);var v=["error","close","destroy","pause","resume"];function m(e,t){e=e||{};var r=t instanceof(i=i||n(10));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var o=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(38).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(i=i||n(10),!(this instanceof b))return new b(e);this._readableState=new m(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,o){var i,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,T(e)}(e,a)):(o||(i=function(e,t){var n;r=t,c.isBuffer(r)||r instanceof l||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(a,t)),i?e.emit("error",i):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):E(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?E(e,a,t,!1):C(e,a)):E(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function E(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&T(e)),C(e,t)}Object.defineProperty(b.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),b.prototype.destroy=y.destroy,b.prototype._undestroy=y.undestroy,b.prototype._destroy=function(e,t){this.push(null),t(e)},b.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=c.from(e,t),t=""),n=!0),w(this,e,t,!1,n)},b.prototype.unshift=function(e){return w(this,e,null,!0,!1)},b.prototype.isPaused=function(){return!1===this._readableState.flowing},b.prototype.setEncoding=function(e){return d||(d=n(38).StringDecoder),this._readableState.decoder=new d(e),this._readableState.encoding=e,this};var S=8388608;function _(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=S?e=S:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(k,e):k(e))}function k(e){p("emit readable"),e.emit("readable"),O(e)}function C(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(I,e,t))}function I(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function x(e){p("readable nexttick read 0"),e.read(0)}function R(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),O(e),t.flowing&&!t.reading&&e.read(0)}function O(e){var t=e._readableState;for(p("flow",t.flowing);t.flowing&&null!==e.read(););}function P(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?function(e,t){var n=t.head,r=1,o=n.data;e-=o.length;for(;n=n.next;){var i=n.data,a=e>i.length?i.length:e;if(a===i.length?o+=i:o+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(a));break}++r}return t.length-=r,o}(e,t):function(e,t){var n=c.allocUnsafe(e),r=t.head,o=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,a),0===(e-=a)){a===i.length?(++o,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(a));break}++o}return t.length-=o,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function M(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(L,t,e))}function L(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function A(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}b.prototype.read=function(e){p("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):T(this),null;if(0===(e=_(e,t))&&t.ended)return 0===t.length&&M(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&p("length less than watermark",o=!0),t.ended||t.reading?p("reading or ended",o=!1):o&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=_(n,t))),null===(r=e>0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&M(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,p("pipe count=%d opts=%j",i.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?l:b;function c(t,r){p("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),e.removeListener("close",v),e.removeListener("finish",m),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",b),n.removeListener("data",g),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(u):n.once("end",u),e.on("unpipe",c);var f=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,O(e))}}(n);e.on("drain",f);var h=!1;var d=!1;function g(t){p("ondata"),d=!1,!1!==e.write(t)||d||((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==A(i.pipes,e))&&!h&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(t){p("onerror",t),b(),e.removeListener("error",y),0===s(e,"error")&&e.emit("error",t)}function v(){e.removeListener("finish",m),b()}function m(){p("onfinish"),e.removeListener("close",v),b()}function b(){p("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",y),e.once("close",v),e.once("finish",m),e.emit("pipe",n),i.flowing||(p("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<o;i++)r[i].emit("unpipe",this,n);return this}var a=A(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},b.prototype.on=function(e,t){var n=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&T(this):o.nextTick(x,this))}return n},b.prototype.addListener=b.prototype.on,b.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(R,e,t))}(this,e)),this},b.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},b.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var o in e.on("end",function(){if(p("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(o){(p("wrapped data"),n.decoder&&(o=n.decoder.write(o)),n.objectMode&&null==o)||(n.objectMode||o&&o.length)&&(t.push(o)||(r=!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 i=0;i<v.length;i++)e.on(v[i],this.emit.bind(this,v[i]));return this._read=function(t){p("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(b.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),b._fromList=P}).call(this,n(5),n(14))},function(e,t,n){"use strict";var r,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=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 a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var o,i,a,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),a=i[t]),void 0===a)a=i[t]=n,++e._eventsCount;else if("function"==typeof a?a=i[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return e}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=function(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,i(this.listener,this.target,e))}.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):d(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function d(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)i(u,this,t);else{var c=u.length,l=d(u,c);for(n=0;n<c;++n)i(l[n],this,t)}return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,o,i,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){a=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(34).EventEmitter},function(e,t,n){"use strict";var r=n(18);function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,i=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return i||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(o,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(o,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";(function(t,r,o){var i=n(18);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var o=r.callback;t.pendingcb--,o(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;m.WritableState=v;var c=n(15);c.inherits=n(7);var l={deprecate:n(56)},f=n(35),h=n(6).Buffer,p=o.Uint8Array||function(){};var d,g=n(36);function y(){}function v(e,t){s=s||n(10),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var o=e.highWaterMark,c=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=o||0===o?o:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.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,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),T(e,t))}(e,n,r,t,o);else{var a=S(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||E(e,n),r?u(w,e,n,a,o):w(e,n,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function m(e){if(s=s||n(10),!(d.call(m,this)||this instanceof s))return new m(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,o,i,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),T(e,t)}function E(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,o=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var s=0,u=!0;n;)o[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;o.allBuffers=u,b(e,t,!0,t.length,o,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:c.length,c,l,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function _(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var n=S(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(_,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(m,f),v.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(v.prototype,"buffer",{get:l.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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===m&&(e&&e._writableState instanceof v)}})):d=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,n){var r,o=this._writableState,a=!1,s=!o.objectMode&&(r=e,h.isBuffer(r)||r instanceof p);return s&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=y),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),i.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var o=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),i.nextTick(r,a),o=!1),o}(this,o,e,n))&&(o.pendingcb++,a=function(e,t,n,r,o,i){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n));return t}(t,r,o);r!==a&&(n=!0,o="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:o,isBuf:n,callback:i,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else b(e,t,!1,s,r,o,i);return u}(this,o,s,e,t,n)),a},m.prototype.cork=function(){this._writableState.corked++},m.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},m.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,T(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=g.destroy,m.prototype._undestroy=g.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(14),n(54).setImmediate,n(5))},function(e,t,n){"use strict";var r=n(6).Buffer,o=r.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 i(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&&(r.isEncoding===o||!o(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){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!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?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-n))}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 h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},i.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},i.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var o=a(t[r]);if(o>=0)return o>0&&(e.lastNeed=o-1),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=0)return o>0&&(e.lastNeed=o-2),o;if(--r<n||-2===o)return 0;if((o=a(t[r]))>=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=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},i.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}},function(e,t,n){"use strict";e.exports=a;var r=n(10),o=n(15);function i(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e),this._transformState={afterTransform:i.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,n){u(e,t,n)}):u(this,null,null)}function u(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}o.inherits=n(7),o.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var o=this._readableState;(r.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(61),a=n(62),s=n(19),u=function(){function e(t){var n=this;this.logger=t,this.reconnectDisplay=new a.DefaultReconnectDisplay(document),document.addEventListener("DOMContentLoaded",function(){var t=document.getElementById(e.DialogId);t&&(n.reconnectDisplay=new i.UserSpecifiedDisplay(t))})}return e.prototype.onConnectionUp=function(){this.reconnectDisplay.hide()},e.prototype.delay=function(){return new Promise(function(t){return setTimeout(t,e.RetryInterval)})},e.prototype.onConnectionDown=function(){return r(this,void 0,void 0,function(){var t,n;return o(this,function(r){switch(r.label){case 0:this.reconnectDisplay.show(),t=0,r.label=1;case 1:return t<e.MaxRetries?[4,this.delay()]:[3,7];case 2:r.sent(),r.label=3;case 3:return r.trys.push([3,5,,6]),[4,window.Blazor.reconnect()];case 4:return r.sent()?[2]:[3,7];case 5:return n=r.sent(),this.logger.log(s.LogLevel.Error,n),[3,6];case 6:return t++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}})})},e.MaxRetries=5,e.RetryInterval=3e3,e.DialogId="components-reconnect-modal",e}();t.AutoReconnectCircuitHandler=u},function(e,t,n){"use strict";(function(e){n.d(t,"a",function(){return i});var r=n(4),o=n(1),i=function(){function t(){}return t.prototype.writeHandshakeRequest=function(e){return r.a.write(JSON.stringify(e))},t.prototype.parseHandshakeResponse=function(t){var n,i;if(Object(o.f)(t)||void 0!==e&&t instanceof e){var a=new Uint8Array(t);if(-1===(u=a.indexOf(r.a.RecordSeparatorCode)))throw new Error("Message is incomplete.");var s=u+1;n=String.fromCharCode.apply(null,a.slice(0,s)),i=a.byteLength>s?a.slice(s).buffer:null}else{var u,c=t;if(-1===(u=c.indexOf(r.a.RecordSeparator)))throw new Error("Message is incomplete.");s=u+1;n=c.substring(0,s),i=c.length>s?c.substring(s):null}var l=r.a.parse(n),f=JSON.parse(l[0]);if(f.type)throw new Error("Expected a handshake response from the server.");return[i,f]},t}()}).call(this,n(11).Buffer)},,,,,function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(12),n(21);var a=n(2),s=n(69),u=n(29),c=n(40),l=n(63),f=n(66),h=n(19),p=n(67),d=!1,g=!1;function y(e){return o(this,void 0,void 0,function(){var t,n,a,s,l,y,m,b,w,E,S,_,T,k=this;return i(this,function(C){switch(C.label){case 0:if(g)throw new Error("Blazor has already started.");return g=!0,t={configureSignalR:function(e){},logLevel:h.LogLevel.Warning},n=r({},t,e),(a=new f.ConsoleLogger(n.logLevel)).log(h.LogLevel.Information,"Starting up blazor server-side application."),s=[new c.AutoReconnectCircuitHandler(a)],window.Blazor.circuitHandlers=s,l=u.fetchBootConfigAsync().then(function(e){return u.loadEmbeddedResourcesAsync(e)}),[4,v(n,s,a)];case 1:for(y=C.sent(),m=p.discoverPrerenderedCircuits(document),b=0;b<m.length;b++)for(w=m[b],E=0;E<w.components.length;E++)w.components[E].initialize();return[4,l];case 2:return C.sent(),[4,p.startCircuit(y)];case 3:return(S=C.sent())||a.log(h.LogLevel.Information,"No preregistered components to render."),_=function(e){return o(k,void 0,void 0,function(){var t,r;return i(this,function(o){switch(o.label){case 0:return d?[2,!1]:(r=e)?[3,2]:[4,v(n,s,a)];case 1:r=o.sent(),o.label=2;case 2:return t=r,[4,Promise.all(m.map(function(e){return e.reconnect(t)}))];case 3:return function(e){return!e.reduce(function(e,t){return e&&t},!0)}(o.sent())?[2,!1]:(s.forEach(function(e){return e.onConnectionUp&&e.onConnectionUp()}),[2,!0])}})})},window.Blazor.reconnect=_,T=_(y),S&&m.push(S),[4,T];case 4:return C.sent(),a.log(h.LogLevel.Information,"Blazor server-side application started."),[2]}})})}function v(e,t,n){return o(this,void 0,void 0,function(){var r,o,u,c;return i(this,function(i){switch(i.label){case 0:(r=new s.MessagePackHubProtocol).name="blazorpack",o=(new a.HubConnectionBuilder).withUrl("_blazor").withHubProtocol(r),e.configureSignalR(o),(u=o.build()).on("JS.BeginInvokeJS",DotNet.jsCallDispatcher.beginInvokeJSFromDotNet),u.on("JS.RenderBatch",function(e,t,r){n.log(h.LogLevel.Debug,"Received render batch for "+e+" with id "+t+" and "+r.byteLength+" bytes."),l.default.getOrCreateQueue(e,n).processBatch(t,r,u)}),u.onclose(function(e){return!d&&t.forEach(function(t){return t.onConnectionDown&&t.onConnectionDown(e)})}),u.on("JS.Error",function(e){return m(u,e,n)}),window.Blazor._internal.forceCloseConnection=function(){return u.stop()},i.label=1;case 1:return i.trys.push([1,3,,4]),[4,u.start()];case 2:return i.sent(),[3,4];case 3:return c=i.sent(),m(u,c,n),[3,4];case 4:return DotNet.attachDispatcher({beginInvokeDotNetFromJS:function(e,t,n,r,o){u.send("BeginInvokeDotNetFromJS",e?e.toString():null,t,n,r||0,o)}}),[2,u]}})})}function m(e,t,n){n.log(h.LogLevel.Error,t),e&&(d=!0,e.stop())}window.Blazor.start=y,u.shouldAutoStart()&&y()},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){for(var t,n=c(e),r=n[0],a=n[1],s=new i(function(e,t,n){return 3*(t+n)/4-n}(0,r,a)),u=0,l=a>0?r-4:r,f=0;f<l;f+=4)t=o[e.charCodeAt(f)]<<18|o[e.charCodeAt(f+1)]<<12|o[e.charCodeAt(f+2)]<<6|o[e.charCodeAt(f+3)],s[u++]=t>>16&255,s[u++]=t>>8&255,s[u++]=255&t;2===a&&(t=o[e.charCodeAt(f)]<<2|o[e.charCodeAt(f+1)]>>4,s[u++]=255&t);1===a&&(t=o[e.charCodeAt(f)]<<10|o[e.charCodeAt(f+1)]<<4|o[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t);return s},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a<s;a+=16383)i.push(l(e,a,a+16383>s?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],o[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s<n;s+=3)o=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?o-1:0,h=n?-1:1,p=e[t+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=s;l>0;i=256*i+e[t+f],f+=h,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=r;l>0;a=256*a+e[t+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=c}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,u,c=8*i-o-1,l=(1<<c)-1,f=l>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:i-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*u-1)*Math.pow(2,o),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[n+p]=255&s,p+=d,s/=256,o-=8);for(a=a<<o|s,c+=o;c>0;e[n+p]=255&a,p+=d,a/=256,c-=8);e[n+p-d]|=128*g}},function(e,t,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */ -function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var i=n(37),s=Object.prototype.hasOwnProperty,a=Array.prototype.slice,c="foo"===function(){}.name;function u(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var h=e.exports=v,f=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(i.isFunction(e)){if(c)return e.name;var t=e.toString().match(f);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(c||!i.isFunction(e))return i.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,n,r,o){throw new h.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function v(e,t){e||y(e,!0,t,"==",h.ok)}function b(e,t,n,s){if(e===t)return!0;if(o(e)&&o(t))return 0===r(e,t);if(i.isDate(e)&&i.isDate(t))return e.getTime()===t.getTime();if(i.isRegExp(e)&&i.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&u(e)===u(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===r(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var c=(s=s||{actual:[],expected:[]}).actual.indexOf(e);return-1!==c&&c===s.expected.indexOf(t)||(s.actual.push(e),s.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(i.isPrimitive(e)||i.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=m(e),s=m(t);if(o&&!s||!o&&s)return!1;if(o)return e=a.call(e),t=a.call(t),b(e,t,n);var c,u,l=E(e),h=E(t);if(l.length!==h.length)return!1;for(l.sort(),h.sort(),u=l.length-1;u>=0;u--)if(l[u]!==h[u])return!1;for(u=l.length-1;u>=0;u--)if(c=l[u],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,s))}return n?e===t:e==t}function m(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function S(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var s="string"==typeof r,a=!e&&o&&!n;if((!e&&i.isError(o)&&s&&w(o,n)||a)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}h.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),s=o.indexOf("\n"+i);if(s>=0){var a=o.indexOf("\n",s+1);o=o.substring(a+1)}this.stack=o}}},i.inherits(h.AssertionError,Error),h.fail=y,h.ok=v,h.equal=function(e,t,n){e!=t&&y(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){b(e,t,!1)||y(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){b(e,t,!0)||y(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){b(e,t,!1)&&y(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",h.notStrictEqual)},h.throws=function(e,t,n){S(!0,e,t,n)},h.doesNotThrow=function(e,t,n){S(!1,e,t,n)},h.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(13))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){e.exports=n(14)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t){},function(e,t,n){"use strict";var r=n(18).Buffer,o=n(65);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=i,o=a,t.copy(n,o),a+=s.data.length,s=s.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){var r=n(8),o=r.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function s(e,t,n){return o(e,t,n)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s),i(o,s),s.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},s.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=o(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(68),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(13))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,s,a,c=1,u={},l=!1,h=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(o=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}),f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return u[c]=o,r(c),c++},f.clearImmediate=p}function p(e){delete u[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(13),n(22))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(13))},function(e,t,n){"use strict";var r=n(71).Transform,o=n(19),i=n(25);function s(e){(e=e||{}).objectMode=!0,e.highWaterMark=16,r.call(this,e),this._msgpack=e.msgpack}function a(e){if(!(this instanceof a))return(e=e||{}).msgpack=this,new a(e);s.call(this,e)}function c(e){if(!(this instanceof c))return(e=e||{}).msgpack=this,new c(e);s.call(this,e),this._chunks=i()}o(s,r),o(a,s),a.prototype._transform=function(e,t,n){var r=null;try{r=this._msgpack.encode(e).slice(0)}catch(e){return this.emit("error",e),n()}this.push(r),n()},o(c,s),c.prototype._transform=function(e,t,n){e&&this._chunks.append(e);try{var r=this._msgpack.decode(this._chunks);this.push(r)}catch(e){return void(e instanceof this._msgpack.IncompleteBufferError?n():this.emit("error",e))}this._chunks.length>0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=a},function(e,t,n){(t=e.exports=n(38)).Stream=t,t.Readable=t,t.Writable=n(43),t.Duplex=n(14),t.Transform=n(44),t.PassThrough=n(72)},function(e,t,n){"use strict";e.exports=i;var r=n(44),o=n(23);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(19),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(25);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(37).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,h,f=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t<n)}(f,o))return null;switch(f){case 192:return n(null,1);case 194:return n(!1,1);case 195:return n(!0,1);case 204:return n(p=e.readUInt8(r+1),2);case 205:return n(p=e.readUInt16BE(r+1),3);case 206:return n(p=e.readUInt32BE(r+1),5);case 207:for(h=7;h>=0;h--)p+=e.readUInt8(r+h+1)*Math.pow(2,8*(7-h));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var s=e.readUInt32BE(t+0),a=e.readUInt32BE(t+4);return(4294967296*s+a)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),s(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),s(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),a(e,r,i,3);case 223:throw new Error("map too big to decode in JS");case 212:return c(e,r,1);case 213:return c(e,r,2);case 214:return c(e,r,4);case 215:return c(e,r,8);case 216:return c(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?u(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?u(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?u(e,r,l,i,6):null}if(144==(240&f))return s(e,r,i=15&f,1);if(128==(240&f))return a(e,r,i=15&f,1);if(160==(224&f))return t(i=31&f,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(f>=224)return n(p=f-256,1);if(f<128)return n(f,1);throw new Error("not implemented yet")}function s(e,t,r,o){var s,a=[],c=0;for(t+=o,s=0;s<r;s++){var u=i(e,t);if(!u)return null;a.push(u.value),t+=u.bytesConsumed,c+=u.bytesConsumed}return n(a,o+c)}function a(e,t,r,o){var s,a={},c=0;for(t+=o,s=0;s<r;s++){var u=i(e,t);if(!u)return null;var l=i(e,t+=u.bytesConsumed);if(!l)return null;a[u.value]=l.value,t+=l.bytesConsumed,c+=u.bytesConsumed+l.bytesConsumed}return n(a,o+c)}function c(e,t,n){var r=e.readInt8(t+1);return u(e,t,r,n,2)}function u(t,r,o,i,s){var a,c;if(r+=s,o<0)switch(o){case-1:return function(e,t,r){var o,i;switch(i=0,t){case 4:o=e.readUInt32BE(0);break;case 8:var s=e.readUInt32BE(0),a=e.readUInt32BE(4);i=s/4,o=(3&s)*Math.pow(2,32)+a;break;case 12:throw new Error("timestamp 96 is not yet implemented")}var c=1e3*o+Math.round(i/1e6);return n(new Date(c),t+r)}(c=t.slice(r,r+i),i,s)}for(a=0;a<e.length;a++){if(o===e[a].type)return c=t.slice(r,r+i),n(e[a].decode(c),s+i)}throw new Error("unable to find ext type "+o)}},e.exports.IncompleteBufferError=o},function(e,t,n){"use strict";var r=n(18).Buffer,o=n(25),i=.1;function s(e,t){var n;return(n=r.allocUnsafe(5))[0]=202,n.writeFloatBE(e,1),(t||Math.abs(e-n.readFloatBE(1))>i)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,i){function a(c,u){var l,h,f;if(void 0===c)throw new Error("undefined is not encodable in msgpack!");if(null===c)(l=r.allocUnsafe(1))[0]=192;else if(!0===c)(l=r.allocUnsafe(1))[0]=195;else if(!1===c)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof c)(h=r.byteLength(c))<32?((l=r.allocUnsafe(1+h))[0]=160|h,h>0&&l.write(c,1)):h<=255&&!n?((l=r.allocUnsafe(2+h))[0]=217,l[1]=h,l.write(c,2)):h<=65535?((l=r.allocUnsafe(3+h))[0]=218,l.writeUInt16BE(h,1),l.write(c,3)):((l=r.allocUnsafe(5+h))[0]=219,l.writeUInt32BE(h,1),l.write(c,5));else if(c&&(c.readUInt32LE||c instanceof Uint8Array))c instanceof Uint8Array&&(c=r.from(c)),c.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=c.length):c.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(c.length,1)),l=o([l,c]);else if(Array.isArray(c))c.length<16?(l=r.allocUnsafe(1))[0]=144|c.length:c.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(c.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(c.length,1)),l=c.reduce(function(e,t){return e.append(a(t,!0)),e},o().append(l));else{if(!i&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),s=1e6*(n-1e3*i);if(s||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var a=4*s,c=i/Math.pow(2,32),u=a+c&4294967295,l=4294967295&i;t.writeInt32BE(u,2),t.writeInt32BE(l,6)}else(t=new r(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(c);if("object"==typeof c)l=function(t){var n,i,s=-1,a=[];for(n=0;n<e.length;n++)if(e[n].check(t)){i=e[n].encode(t);break}if(!i)return null;1==(s=i.length-1)?a.push(212):2===s?a.push(213):4===s?a.push(214):8===s?a.push(215):16===s?a.push(216):s<256?(a.push(199),a.push(s)):s<65536?(a.push(200),a.push(s>>8),a.push(255&s)):(a.push(201),a.push(s>>24),a.push(s>>16&255),a.push(s>>8&255),a.push(255&s));return o().append(r.from(a)).append(i)}(c)||function(e){var t,n,i=[],s=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++s,i.push(a(t,!0)),i.push(a(e[t],!0)));s<16?(n=r.allocUnsafe(1))[0]=128|s:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(s,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(c);else if("number"==typeof c){if((f=c)!==Math.floor(f))return s(c,t);if(c>=0)if(c<128)(l=r.allocUnsafe(1))[0]=c;else if(c<256)(l=r.allocUnsafe(2))[0]=204,l[1]=c;else if(c<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(c,1);else if(c<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(c,1);else{if(!(c<=9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,c)}else if(c>=-32)(l=r.allocUnsafe(1))[0]=256+c;else if(c>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(c,1);else if(c>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(c,1);else if(c>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(c,1);else{if(!(c>=-9007199254740991))return s(c,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var s=1,a=t+7;a>=t;a--){var c=(255^e[a])+s;e[a]=255&c,s=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(45),o=function(){function e(e){this.document=e,this.addedToDom=!1,this.modal=this.document.createElement("div"),this.modal.id=r.AutoReconnectCircuitHandler.DialogId;this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1000","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold"].join(";"),this.modal.innerHTML='<h5 style="margin-top: 20px"></h5><button style="margin:5px auto 5px">Retry?</button>',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.button.addEventListener("click",function(){return window.Blazor.reconnect()})}return e.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},e.prototype.hide=function(){this.modal.style.display="none"},e.prototype.failed=function(){this.button.style.display="block",this.message.textContent="Failed to reconnect to the server."},e}();t.DefaultReconnectDisplay=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(16),s=n(78),a=n(27),c=function(){function e(e,t){this.nextBatchId=2,this.browserRendererId=e,this.logger=t}return e.getOrCreateQueue=function(t,n){var r=this.renderQueues.get(t);if(r)return r;var o=new e(t,n);return this.renderQueues.set(t,o),o},e.prototype.processBatch=function(e,t,n){if(e<this.nextBatchId)this.logger.log(a.LogLevel.Debug,"Batch "+e+" already processed. Waiting for batch "+this.nextBatchId+".");else if(e>this.nextBatchId)this.logger.log(a.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed.");else try{this.nextBatchId++,this.logger.log(a.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new s.OutOfProcessRenderBatch(t)),this.completeBatch(n,e)}catch(t){throw this.logger.log(a.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,t.toString()),t}},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(a.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e.renderQueues=new Map,e}();t.default=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(79),o=function(){function e(e){this.batchData=e;var t=new c(e);this.arrayRangeReader=new u(e),this.arraySegmentReader=new l(e),this.diffReader=new i(e),this.editReader=new s(e,t),this.frameReader=new a(e,t)}return e.prototype.updatedComponents=function(){return h(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return h(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return h(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return h(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return h(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+16*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return h(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+4*t;return h(this.batchData,n)},e}();t.OutOfProcessRenderBatch=o;var i=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return h(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return h(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return h(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return h(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return h(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=h(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),a=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return h(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return h(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=h(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return h(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=h(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=h(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=h(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=h(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=h(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return h(this.batchDataUint8,e+12)},e}(),c=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=h(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=h(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<<r,i<128)break;r+=7}return n}(this.batchDataUint8,n),i=n+((t=o)<128?1:t<16384?2:t<2097152?3:4),s=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,o);return r.decodeUtf8(s)},e}(),u=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return h(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return h(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}();function h(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t<n;){var i=e[t++];if(0===i)break;if(0==(128&i))r.push(i);else if(192==(224&i)){var s=63&e[t++];r.push((31&i)<<6|s)}else if(224==(240&i)){var s=63&e[t++],a=63&e[t++];r.push((31&i)<<12|s<<6|a)}else if(240==(248&i)){var s=63&e[t++],a=63&e[t++],c=63&e[t++],u=(7&i)<<18|s<<12|a<<6|c;u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(27),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}},s=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(t,"__esModule",{value:!0});var a=n(24),c=n(82),u=function(){function e(e,t){this.circuitId=e,this.components=t}return e.prototype.reconnect=function(e){return e.invoke("ConnectCircuit",this.circuitId)},e}();function l(e){if(e.nodeType===Node.COMMENT_NODE&&e.textContent){var t=/\W+M.A.C.Component:[^{]*(.*)$/.exec(e.textContent),n=t&&t[1];if(n)try{var r=JSON.parse(n),o=r.componentId,i=r.circuitId,s=r.rendererId;if(!!o&&!!i&&!!s)return{node:e,circuitId:i,rendererId:Number.parseInt(s),componentId:Number.parseInt(o)};throw new Error("Found malformed start component comment at "+e.textContent)}catch(t){throw new Error("Found malformed start component comment at "+e.textContent)}}}function h(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];if(i.nodeType===Node.COMMENT_NODE&&i.textContent){var s=/\W+M.A.C.Component:\W+(\d+)\W+$/.exec(i.textContent),a=s&&s[1];if(a)try{var c=Number.parseInt(a);if(c===e.componentId)return{componentId:c,node:i,index:o};throw new Error("Found malformed end component comment at "+i.textContent)}catch(e){throw new Error("Found malformed end component comment at "+i.textContent)}}}throw new Error("End component comment not found for "+e.node)}t.CircuitDescriptor=u,t.discoverPrerenderedCircuits=function(e){for(var t,n,r=function e(t){if(!t.hasChildNodes())return[];for(var n=[],r=t.childNodes,o=0,i=r.length;o<i;){var s=r[o],a=l(s);if(a){var c=h(a,r,o+1,i);n.push({start:a,end:c}),o=c.index+1}else{o++;for(var u=e(s),f=0;f<u.length;f++){var p=u[f];n.push(p)}}}return n}(e),o=new Map,a=0;a<r.length;a++){var f=r[a],p=o.get(f.start.circuitId);p||(p=[],o.set(f.start.circuitId,p));var d=new c.ComponentDescriptor(f.start.componentId,f.start.circuitId,f.start.rendererId,f);p.push(d)}var g=[];try{for(var y=i(o),v=y.next();!v.done;v=y.next()){var b=s(v.value,2),m=b[0],w=b[1];g.push(new u(m,w))}}catch(e){t={error:e}}finally{try{v&&!v.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}return g},t.startCircuit=function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return[4,e.invoke("StartCircuit",a.internalFunctions.getLocationHref(),a.internalFunctions.getBaseURI())];case 1:return(t=n.sent())?[2,new u(t,[])]:[2,void 0]}})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=n(17),i=function(){function e(e,t,n,r){this.componentId=e,this.circuitId=t,this.rendererId=n,this.registrationTags=r}return e.prototype.initialize=function(){var e={start:this.registrationTags.start.node,end:this.registrationTags.end.node},t=o.toLogicalRootCommentElement(e.start,e.end);r.attachRootComponentToLogicalElement(this.rendererId,t,this.componentId)},e}();t.ComponentDescriptor=i},function(e,t,n){"use strict";n.r(t);var r,o,i=n(8),s=n(15),a=n(5),c=n(7),u=n(48),l=n(1),h=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),f=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return h(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new a.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var i=e.headers;i&&Object.keys(i).forEach(function(e){o.setRequestHeader(e,i[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new a.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new c.b(o.status,o.statusText,o.response||o.responseText)):r(new a.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(l.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new a.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(l.a.Warning,"Timeout from HTTP request."),r(new a.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(c.a),p=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),d=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new f(t):n.httpClient=new u.a(t),n}return p(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new a.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(c.a),g=n(49);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var y,v=n(3),b=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t<n.length;t++){n[t].next(e)}},e.prototype.error=function(e){for(var t=0,n=this.observers;t<n.length;t++){var r=n[t];r.error&&r.error(e)}},e.prototype.complete=function(){for(var e=0,t=this.observers;e<t.length;e++){var n=t[e];n.complete&&n.complete()}},e.prototype.subscribe=function(e){return this.observers.push(e),new v.d(this,e)},e}(),m=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},w=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},S=3e4,E=15e3;!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(y||(y={}));var C,k,I=function(){function e(e,t,n,r){var i=this;v.a.isRequired(e,"connection"),v.a.isRequired(t,"logger"),v.a.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=S,this.keepAliveIntervalInMilliseconds=E,this.logger=t,this.protocol=n,this.connection=e,this.reconnectPolicy=r,this.handshakeProtocol=new g.a,this.connection.onreceive=function(e){return i.processIncomingData(e)},this.connection.onclose=function(e){return i.connectionClosed(e)},this.callbacks={},this.methods={},this.closedCallbacks=[],this.reconnectingCallbacks=[],this.reconnectedCallbacks=[],this.invocationId=0,this.receivedHandshakeResponse=!1,this.connectionState=y.Disconnected,this.connectionStarted=!1,this.cachedPingMessage=this.protocol.writeMessage({type:o.Ping})}return e.create=function(t,n,r,o){return new e(t,n,r,o)},Object.defineProperty(e.prototype,"state",{get:function(){return this.connectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"connectionId",{get:function(){return this.connection&&this.connection.connectionId||null},enumerable:!0,configurable:!0}),e.prototype.start=function(){return this.startPromise=this.startWithStateTransitions(),this.startPromise},e.prototype.startWithStateTransitions=function(){return m(this,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:if(this.connectionState!==y.Disconnected)return[2,Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))];this.connectionState=y.Connecting,this.logger.log(l.a.Debug,"Starting HubConnection."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.startInternal()];case 2:return t.sent(),this.connectionState=y.Connected,this.connectionStarted=!0,this.logger.log(l.a.Debug,"HubConnection connected successfully."),[3,4];case 3:return e=t.sent(),this.connectionState=y.Disconnected,this.logger.log(l.a.Debug,"HubConnection failed to start successfully because of error '"+e+"'."),[2,Promise.reject(e)];case 4:return[2]}})})},e.prototype.startInternal=function(){return m(this,void 0,void 0,function(){var e,t,n,r=this;return w(this,function(o){switch(o.label){case 0:return this.stopDuringStartError=void 0,this.receivedHandshakeResponse=!1,e=new Promise(function(e,t){r.handshakeResolver=e,r.handshakeRejecter=t}),[4,this.connection.start(this.protocol.transferFormat)];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,5,,7]),t={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(l.a.Debug,"Sending handshake request."),[4,this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(t))];case 3:return o.sent(),this.logger.log(l.a.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.resetTimeoutPeriod(),this.resetKeepAliveInterval(),[4,e];case 4:if(o.sent(),this.stopDuringStartError)throw this.stopDuringStartError;return[3,7];case 5:return n=o.sent(),this.logger.log(l.a.Debug,"Hub handshake failed with error '"+n+"' during start(). Stopping HubConnection."),this.cleanupTimeout(),this.cleanupPingTimer(),[4,this.connection.stop(n)];case 6:throw o.sent(),n;case 7:return[2]}})})},e.prototype.stop=function(){return m(this,void 0,void 0,function(){var e;return w(this,function(t){switch(t.label){case 0:return e=this.startPromise,this.stopPromise=this.stopInternal(),[4,this.stopPromise];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e];case 3:return t.sent(),[3,5];case 4:return t.sent(),[3,5];case 5:return[2]}})})},e.prototype.stopInternal=function(e){return this.connectionState===y.Disconnected?(this.logger.log(l.a.Debug,"Call to HubConnection.stop("+e+") ignored because it is already in the disconnected state."),Promise.resolve()):this.connectionState===y.Disconnecting?(this.logger.log(l.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnecting state."),this.stopPromise):(this.connectionState=y.Disconnecting,this.logger.log(l.a.Debug,"Stopping HubConnection."),this.reconnectDelayHandle?(this.logger.log(l.a.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.reconnectDelayHandle),this.reconnectDelayHandle=void 0,this.completeClose(),Promise.resolve()):(this.cleanupTimeout(),this.cleanupPingTimer(),this.stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))},e.prototype.stream=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i,s=this.replaceStreamingParams(n),a=s[0],c=s[1],u=this.createStreamInvocation(e,n,c),l=new b;return l.cancelCallback=function(){var e=t.createCancelInvocation(u.invocationId);return delete t.callbacks[u.invocationId],i.then(function(){return t.sendWithProtocol(e)})},this.callbacks[u.invocationId]=function(e,t){t?l.error(t):e&&(e.type===o.Completion?e.error?l.error(new Error(e.error)):l.complete():l.next(e.item))},i=this.sendWithProtocol(u).catch(function(e){l.error(e),delete t.callbacks[u.invocationId]}),this.launchStreams(a,i),l},e.prototype.sendMessage=function(e){return this.resetKeepAliveInterval(),this.connection.send(e)},e.prototype.sendWithProtocol=function(e){return this.sendMessage(this.protocol.writeMessage(e))},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.replaceStreamingParams(t),o=r[0],i=r[1],s=this.sendWithProtocol(this.createInvocation(e,t,!0,i));return this.launchStreams(o,s),s},e.prototype.invoke=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.replaceStreamingParams(n),s=i[0],a=i[1],c=this.createInvocation(e,n,!1,a);return new Promise(function(e,n){t.callbacks[c.invocationId]=function(t,r){r?n(r):t&&(t.type===o.Completion?t.error?n(new Error(t.error)):e(t.result):n(new Error("Unexpected message type: "+t.type)))};var r=t.sendWithProtocol(c).catch(function(e){n(e),delete t.callbacks[c.invocationId]});t.launchStreams(s,r)})},e.prototype.on=function(e,t){e&&t&&(e=e.toLowerCase(),this.methods[e]||(this.methods[e]=[]),-1===this.methods[e].indexOf(t)&&this.methods[e].push(t))},e.prototype.off=function(e,t){if(e){e=e.toLowerCase();var n=this.methods[e];if(n)if(t){var r=n.indexOf(t);-1!==r&&(n.splice(r,1),0===n.length&&delete this.methods[e])}else delete this.methods[e]}},e.prototype.onclose=function(e){e&&this.closedCallbacks.push(e)},e.prototype.onreconnecting=function(e){e&&this.reconnectingCallbacks.push(e)},e.prototype.onreconnected=function(e){e&&this.reconnectedCallbacks.push(e)},e.prototype.processIncomingData=function(e){if(this.cleanupTimeout(),this.receivedHandshakeResponse||(e=this.processHandshakeResponse(e),this.receivedHandshakeResponse=!0),e)for(var t=0,n=this.protocol.parseMessages(e,this.logger);t<n.length;t++){var r=n[t];switch(r.type){case o.Invocation:this.invokeClientMethod(r);break;case o.StreamItem:case o.Completion:var i=this.callbacks[r.invocationId];i&&(r.type===o.Completion&&delete this.callbacks[r.invocationId],i(r));break;case o.Ping:break;case o.Close:this.logger.log(l.a.Information,"Close message received from server."),this.stopPromise=this.stopInternal(r.error?new Error("Server returned an error on close: "+r.error):void 0);break;default:this.logger.log(l.a.Warning,"Invalid message type: "+r.type+".")}}this.resetTimeoutPeriod()},e.prototype.processHandshakeResponse=function(e){var t,n,r;try{r=(t=this.handshakeProtocol.parseHandshakeResponse(e))[0],n=t[1]}catch(e){var o="Error parsing handshake response: "+e;this.logger.log(l.a.Error,o);var i=new Error(o);throw this.handshakeRejecter(i),i}if(n.error){o="Server returned handshake error: "+n.error;this.logger.log(l.a.Error,o);i=new Error(o);throw this.handshakeRejecter(i),i}return this.logger.log(l.a.Debug,"Server handshake complete."),this.handshakeResolver(),r},e.prototype.resetKeepAliveInterval=function(){var e=this;this.cleanupPingTimer(),this.pingServerHandle=setTimeout(function(){return m(e,void 0,void 0,function(){return w(this,function(e){switch(e.label){case 0:if(this.connectionState!==y.Connected)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.sendMessage(this.cachedPingMessage)];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.cleanupPingTimer(),[3,4];case 4:return[2]}})})},this.keepAliveIntervalInMilliseconds)},e.prototype.resetTimeoutPeriod=function(){var e=this;this.connection.features&&this.connection.features.inherentKeepAlive||(this.timeoutHandle=setTimeout(function(){return e.serverTimeout()},this.serverTimeoutInMilliseconds))},e.prototype.serverTimeout=function(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))},e.prototype.invokeClientMethod=function(e){var t=this,n=this.methods[e.target.toLowerCase()];if(n){try{n.forEach(function(n){return n.apply(t,e.arguments)})}catch(t){this.logger.log(l.a.Error,"A callback for the method "+e.target.toLowerCase()+" threw error '"+t+"'.")}if(e.invocationId){var r="Server requested a response, which is not supported in this version of the client.";this.logger.log(l.a.Error,r),this.stopPromise=this.stopInternal(new Error(r))}}else this.logger.log(l.a.Warning,"No client method with the name '"+e.target+"' found.")},e.prototype.connectionClosed=function(e){this.logger.log(l.a.Debug,"HubConnection.connectionClosed("+e+") called while in state "+this.connectionState+"."),this.stopDuringStartError=this.stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this.handshakeResolver&&this.handshakeResolver(),this.cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this.cleanupTimeout(),this.cleanupPingTimer(),this.connectionState===y.Disconnecting?this.completeClose(e):this.connectionState===y.Connected&&this.reconnectPolicy?this.reconnect(e):this.connectionState===y.Connected&&this.completeClose(e)},e.prototype.completeClose=function(e){var t=this;if(this.connectionStarted){this.connectionState=y.Disconnected,this.connectionStarted=!1;try{this.closedCallbacks.forEach(function(n){return n.apply(t,[e])})}catch(t){this.logger.log(l.a.Error,"An onclose callback called with error '"+e+"' threw error '"+t+"'.")}}},e.prototype.reconnect=function(e){return m(this,void 0,void 0,function(){var t,n,r,o,i=this;return w(this,function(s){switch(s.label){case 0:if(t=Date.now(),n=0,null===(r=this.getNextRetryDelay(n++,0)))return this.logger.log(l.a.Debug,"Connection not reconnecting because the IReconnectPolicy returned null on the first reconnect attempt."),this.completeClose(e),[2];if(this.connectionState=y.Reconnecting,e?this.logger.log(l.a.Information,"Connection reconnecting because of error '"+e+"'."):this.logger.log(l.a.Information,"Connection reconnecting."),this.onreconnecting){try{this.reconnectingCallbacks.forEach(function(t){return t.apply(i,[e])})}catch(t){this.logger.log(l.a.Error,"An onreconnecting callback called with error '"+e+"' threw error '"+t+"'.")}if(this.connectionState!==y.Reconnecting)return this.logger.log(l.a.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting."),[2]}s.label=1;case 1:return null===r?[3,7]:(this.logger.log(l.a.Information,"Reconnect attempt number "+n+" will start in "+r+" ms."),[4,new Promise(function(e){i.reconnectDelayHandle=setTimeout(e,r)})]);case 2:if(s.sent(),this.reconnectDelayHandle=void 0,this.connectionState!==y.Reconnecting)return this.logger.log(l.a.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting."),[2];s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.startInternal()];case 4:if(s.sent(),this.connectionState=y.Connected,this.logger.log(l.a.Information,"HubConnection reconnected successfully."),this.onreconnected)try{this.reconnectedCallbacks.forEach(function(e){return e.apply(i,[i.connection.connectionId])})}catch(e){this.logger.log(l.a.Error,"An onreconnected callback called with connectionId '"+this.connection.connectionId+"; threw error '"+e+"'.")}return[2];case 5:return o=s.sent(),this.logger.log(l.a.Information,"Reconnect attempt failed because of error '"+o+"'."),this.connectionState!==y.Reconnecting?(this.logger.log(l.a.Debug,"Connection left the reconnecting state during reconnect attempt. Done reconnecting."),[2]):[3,6];case 6:return r=this.getNextRetryDelay(n++,Date.now()-t),[3,1];case 7:return this.logger.log(l.a.Information,"Reconnect retries have been exhausted after "+(Date.now()-t)+" ms and "+n+" failed attempts. Connection disconnecting."),this.completeClose(),[2]}})})},e.prototype.getNextRetryDelay=function(e,t){try{return this.reconnectPolicy.nextRetryDelayInMilliseconds(e,t)}catch(n){return this.logger.log(l.a.Error,"IReconnectPolicy.nextRetryDelayInMilliseconds("+e+", "+t+") threw error '"+n+"'."),null}},e.prototype.cancelCallbacksWithError=function(e){var t=this.callbacks;this.callbacks={},Object.keys(t).forEach(function(n){(0,t[n])(null,e)})},e.prototype.cleanupPingTimer=function(){this.pingServerHandle&&clearTimeout(this.pingServerHandle)},e.prototype.cleanupTimeout=function(){this.timeoutHandle&&clearTimeout(this.timeoutHandle)},e.prototype.createInvocation=function(e,t,n,r){if(n)return{arguments:t,streamIds:r,target:e,type:o.Invocation};var i=this.invocationId;return this.invocationId++,{arguments:t,invocationId:i.toString(),streamIds:r,target:e,type:o.Invocation}},e.prototype.launchStreams=function(e,t){var n=this;if(0!==e.length){t||(t=Promise.resolve());var r=function(r){e[r].subscribe({complete:function(){t=t.then(function(){return n.sendWithProtocol(n.createCompletionMessage(r))})},error:function(e){var o;o=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then(function(){return n.sendWithProtocol(n.createCompletionMessage(r,o))})},next:function(e){t=t.then(function(){return n.sendWithProtocol(n.createStreamItemMessage(r,e))})}})};for(var o in e)r(o)}},e.prototype.replaceStreamingParams=function(e){for(var t=[],n=[],r=0;r<e.length;r++){var o=e[r];if(this.isObservable(o)){var i=this.invocationId;this.invocationId++,t[i]=o,n.push(i.toString()),e.splice(r,1)}}return[t,n]},e.prototype.isObservable=function(e){return e&&e.subscribe&&"function"==typeof e.subscribe},e.prototype.createStreamInvocation=function(e,t,n){var r=this.invocationId;return this.invocationId++,{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:o.StreamInvocation}},e.prototype.createCancelInvocation=function(e){return{invocationId:e,type:o.CancelInvocation}},e.prototype.createStreamItemMessage=function(e,t){return{invocationId:e,item:t,type:o.StreamItem}},e.prototype.createCompletionMessage=function(e,t,n){return t?{error:t,invocationId:e,type:o.Completion}:{invocationId:e,result:n,type:o.Completion}},e}(),T=[0,2e3,1e4,3e4,null],_=function(){function e(e){this.retryDelays=void 0!==e?e.concat([null]):T}return e.prototype.nextRetryDelayInMilliseconds=function(e){return this.retryDelays[e]},e}();!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(C||(C={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(k||(k={}));var P=function(){function e(){this.isAborted=!1,this.onabort=null}return e.prototype.abort=function(){this.isAborted||(this.isAborted=!0,this.onabort&&this.onabort())},Object.defineProperty(e.prototype,"signal",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aborted",{get:function(){return this.isAborted},enumerable:!0,configurable:!0}),e}(),x=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},R=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},D=function(){function e(e,t,n,r){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.pollAbort=new P,this.logMessageContent=r,this.running=!1,this.onreceive=null,this.onclose=null}return Object.defineProperty(e.prototype,"pollAborted",{get:function(){return this.pollAbort.aborted},enumerable:!0,configurable:!0}),e.prototype.connect=function(e,t){return x(this,void 0,void 0,function(){var n,r,o,i;return R(this,function(s){switch(s.label){case 0:if(v.a.isRequired(e,"url"),v.a.isRequired(t,"transferFormat"),v.a.isIn(t,k,"transferFormat"),this.url=e,this.logger.log(l.a.Trace,"(LongPolling transport) Connecting."),t===k.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");return n={abortSignal:this.pollAbort.signal,headers:{},timeout:1e5},t===k.Binary&&(n.responseType="arraybuffer"),[4,this.getAccessToken()];case 1:return r=s.sent(),this.updateHeaderToken(n,r),o=e+"&_="+Date.now(),this.logger.log(l.a.Trace,"(LongPolling transport) polling: "+o+"."),[4,this.httpClient.get(o,n)];case 2:return 200!==(i=s.sent()).statusCode?(this.logger.log(l.a.Error,"(LongPolling transport) Unexpected response code: "+i.statusCode+"."),this.closeError=new a.b(i.statusText||"",i.statusCode),this.running=!1):this.running=!0,this.receiving=this.poll(this.url,n),[2]}})})},e.prototype.getAccessToken=function(){return x(this,void 0,void 0,function(){return R(this,function(e){switch(e.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,null]}})})},e.prototype.updateHeaderToken=function(e,t){e.headers||(e.headers={}),t?e.headers.Authorization="Bearer "+t:e.headers.Authorization&&delete e.headers.Authorization},e.prototype.poll=function(e,t){return x(this,void 0,void 0,function(){var n,r,o,i;return R(this,function(s){switch(s.label){case 0:s.trys.push([0,,8,9]),s.label=1;case 1:return this.running?[4,this.getAccessToken()]:[3,7];case 2:n=s.sent(),this.updateHeaderToken(t,n),s.label=3;case 3:return s.trys.push([3,5,,6]),r=e+"&_="+Date.now(),this.logger.log(l.a.Trace,"(LongPolling transport) polling: "+r+"."),[4,this.httpClient.get(r,t)];case 4:return 204===(o=s.sent()).statusCode?(this.logger.log(l.a.Information,"(LongPolling transport) Poll terminated by server."),this.running=!1):200!==o.statusCode?(this.logger.log(l.a.Error,"(LongPolling transport) Unexpected response code: "+o.statusCode+"."),this.closeError=new a.b(o.statusText||"",o.statusCode),this.running=!1):o.content?(this.logger.log(l.a.Trace,"(LongPolling transport) data received. "+Object(v.f)(o.content,this.logMessageContent)+"."),this.onreceive&&this.onreceive(o.content)):this.logger.log(l.a.Trace,"(LongPolling transport) Poll timed out, reissuing."),[3,6];case 5:return i=s.sent(),this.running?i instanceof a.c?this.logger.log(l.a.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.closeError=i,this.running=!1):this.logger.log(l.a.Trace,"(LongPolling transport) Poll errored after shutdown: "+i.message),[3,6];case 6:return[3,1];case 7:return[3,9];case 8:return this.logger.log(l.a.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.raiseOnClose(),[7];case 9:return[2]}})})},e.prototype.send=function(e){return x(this,void 0,void 0,function(){return R(this,function(t){return this.running?[2,Object(v.h)(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return x(this,void 0,void 0,function(){var e,t;return R(this,function(n){switch(n.label){case 0:this.logger.log(l.a.Trace,"(LongPolling transport) Stopping polling."),this.running=!1,this.pollAbort.abort(),n.label=1;case 1:return n.trys.push([1,,5,6]),[4,this.receiving];case 2:return n.sent(),this.logger.log(l.a.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),e={headers:{}},[4,this.getAccessToken()];case 3:return t=n.sent(),this.updateHeaderToken(e,t),[4,this.httpClient.delete(this.url,e)];case 4:return n.sent(),this.logger.log(l.a.Trace,"(LongPolling transport) DELETE request sent."),[3,6];case 5:return this.logger.log(l.a.Trace,"(LongPolling transport) Stop finished."),this.raiseOnClose(),[7];case 6:return[2]}})})},e.prototype.raiseOnClose=function(){if(this.onclose){var e="(LongPolling transport) Firing onclose event.";this.closeError&&(e+=" Error: "+this.closeError),this.logger.log(l.a.Trace,e),this.onclose(this.closeError)}},e}(),O=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},L=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},A=function(){function e(e,t,n,r,o){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.logMessageContent=r,this.eventSourceConstructor=o,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return O(this,void 0,void 0,function(){var n,r=this;return L(this,function(o){switch(o.label){case 0:return v.a.isRequired(e,"url"),v.a.isRequired(t,"transferFormat"),v.a.isIn(t,k,"transferFormat"),this.logger.log(l.a.Trace,"(SSE transport) Connecting."),this.url=e,this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i=!1;if(t===k.Text){var s;if(v.c.isBrowser||v.c.isWebWorker)s=new r.eventSourceConstructor(e,{withCredentials:!0});else{var a=r.httpClient.getCookieString(e);s=new r.eventSourceConstructor(e,{withCredentials:!0,headers:{Cookie:a}})}try{s.onmessage=function(e){if(r.onreceive)try{r.logger.log(l.a.Trace,"(SSE transport) data received. "+Object(v.f)(e.data,r.logMessageContent)+"."),r.onreceive(e.data)}catch(e){return void r.close(e)}},s.onerror=function(e){var t=new Error(e.data||"Error occurred");i?r.close(t):o(t)},s.onopen=function(){r.logger.log(l.a.Information,"SSE connected to "+r.url),r.eventSource=s,i=!0,n()}}catch(e){return void o(e)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})]}})})},e.prototype.send=function(e){return O(this,void 0,void 0,function(){return L(this,function(t){return this.eventSource?[2,Object(v.h)(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return this.close(),Promise.resolve()},e.prototype.close=function(e){this.eventSource&&(this.eventSource.close(),this.eventSource=void 0,this.onclose&&this.onclose(e))},e}(),M=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},j=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},B=function(){function e(e,t,n,r,o){this.logger=n,this.accessTokenFactory=t,this.logMessageContent=r,this.webSocketConstructor=o,this.httpClient=e,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return M(this,void 0,void 0,function(){var n,r=this;return j(this,function(o){switch(o.label){case 0:return v.a.isRequired(e,"url"),v.a.isRequired(t,"transferFormat"),v.a.isIn(t,k,"transferFormat"),this.logger.log(l.a.Trace,"(WebSockets transport) Connecting."),this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i;e=e.replace(/^http/,"ws");var s=r.httpClient.getCookieString(e);v.c.isNode&&s&&(i=new r.webSocketConstructor(e,void 0,{headers:{Cookie:""+s}})),i||(i=new r.webSocketConstructor(e)),t===k.Binary&&(i.binaryType="arraybuffer"),i.onopen=function(t){r.logger.log(l.a.Information,"WebSocket connected to "+e+"."),r.webSocket=i,n()},i.onerror=function(e){var t=null;"undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent&&(t=e.error),o(t)},i.onmessage=function(e){r.logger.log(l.a.Trace,"(WebSockets transport) data received. "+Object(v.f)(e.data,r.logMessageContent)+"."),r.onreceive&&r.onreceive(e.data)},i.onclose=function(e){return r.close(e)}})]}})})},e.prototype.send=function(e){return this.webSocket&&this.webSocket.readyState===this.webSocketConstructor.OPEN?(this.logger.log(l.a.Trace,"(WebSockets transport) sending data. "+Object(v.f)(e,this.logMessageContent)+"."),this.webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},e.prototype.stop=function(){return this.webSocket&&(this.webSocket.onclose=function(){},this.webSocket.onmessage=function(){},this.webSocket.onerror=function(){},this.webSocket.close(),this.webSocket=void 0,this.close(void 0)),Promise.resolve()},e.prototype.close=function(e){this.logger.log(l.a.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!e||!1!==e.wasClean&&1e3===e.code?this.onclose():this.onclose(new Error("WebSocket closed with status code: "+e.code+" ("+e.reason+").")))},e}(),N=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},U=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},H=null,F=null;if(v.c.isNode){var W=require;H=W("ws"),F=W("eventsource")}var q=function(){function e(e,t){void 0===t&&(t={}),this.features={},v.a.isRequired(e,"url"),this.logger=Object(v.e)(t.logger),this.baseUrl=this.resolveUrl(e),(t=t||{}).logMessageContent=t.logMessageContent||!1,v.c.isNode||"undefined"==typeof WebSocket||t.WebSocket?v.c.isNode&&!t.WebSocket&&H&&(t.WebSocket=H):t.WebSocket=WebSocket,v.c.isNode||"undefined"==typeof EventSource||t.EventSource?v.c.isNode&&!t.EventSource&&void 0!==F&&(t.EventSource=F):t.EventSource=EventSource,this.httpClient=t.httpClient||new d(this.logger),this.connectionState="Disconnected",this.connectionStarted=!1,this.options=t,this.onreceive=null,this.onclose=null}return e.prototype.start=function(e){return N(this,void 0,void 0,function(){var t;return U(this,function(n){switch(n.label){case 0:return e=e||k.Binary,v.a.isIn(e,k,"transferFormat"),this.logger.log(l.a.Debug,"Starting connection with transfer format '"+k[e]+"'."),"Disconnected"!==this.connectionState?[2,Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))]:(this.connectionState="Connecting ",this.startInternalPromise=this.startInternal(e),[4,this.startInternalPromise]);case 1:return n.sent(),"Disconnecting"!==this.connectionState?[3,3]:(t="Failed to start the HttpConnection before stop() was called.",this.logger.log(l.a.Error,t),[4,this.stopPromise]);case 2:return n.sent(),[2,Promise.reject(new Error(t))];case 3:if("Connected"!==this.connectionState)return t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!",this.logger.log(l.a.Error,t),[2,Promise.reject(new Error(t))];n.label=4;case 4:return this.connectionStarted=!0,[2]}})})},e.prototype.send=function(e){return"Connected"!==this.connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.sendQueue||(this.sendQueue=new z(this.transport)),this.sendQueue.send(e))},e.prototype.stop=function(e){return N(this,void 0,void 0,function(){var t=this;return U(this,function(n){switch(n.label){case 0:return"Disconnected"===this.connectionState?(this.logger.log(l.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnected state."),[2,Promise.resolve()]):"Disconnecting"===this.connectionState?(this.logger.log(l.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnecting state."),[2,this.stopPromise]):(this.connectionState="Disconnecting",this.stopPromise=new Promise(function(e){t.stopPromiseResolver=e}),[4,this.stopInternal(e)]);case 1:return n.sent(),[4,this.stopPromise];case 2:return n.sent(),[2]}})})},e.prototype.stopInternal=function(e){return N(this,void 0,void 0,function(){var t;return U(this,function(n){switch(n.label){case 0:this.stopError=e,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.startInternalPromise];case 2:return n.sent(),[3,4];case 3:return n.sent(),[3,4];case 4:if(!this.transport)return[3,9];this.sendQueue&&(this.sendQueue.stop(),this.sendQueue=void 0),n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.transport.stop()];case 6:return n.sent(),[3,8];case 7:return t=n.sent(),this.logger.log(l.a.Error,"HttpConnection.transport.stop() threw error '"+t+"'."),this.stopConnection(),[3,8];case 8:return this.transport=void 0,[3,10];case 9:this.logger.log(l.a.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."),this.stopConnection(),n.label=10;case 10:return[2]}})})},e.prototype.startInternal=function(e){return N(this,void 0,void 0,function(){var t,n,r,o,i,s,a=this;return U(this,function(c){switch(c.label){case 0:t=this.baseUrl,this.accessTokenFactory=this.options.accessTokenFactory,c.label=1;case 1:return c.trys.push([1,12,,13]),this.options.skipNegotiation?this.options.transport!==C.WebSockets?[3,3]:(this.transport=this.constructTransport(C.WebSockets),[4,this.transport.connect(t,e)]):[3,5];case 2:return c.sent(),[3,4];case 3:throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:n=null,r=0,o=function(){var e;return U(this,function(o){switch(o.label){case 0:return[4,i.getNegotiationResponse(t)];case 1:if(n=o.sent(),"Disconnecting"===i.connectionState||"Disconnected"===i.connectionState)throw new Error("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");return n.url&&(t=n.url),n.accessToken&&(e=n.accessToken,i.accessTokenFactory=function(){return e}),r++,[2]}})},i=this,c.label=6;case 6:return[5,o()];case 7:c.sent(),c.label=8;case 8:if(n.url&&r<100)return[3,6];c.label=9;case 9:if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");return this.connectionId=n.connectionId,[4,this.createTransport(t,this.options.transport,n,e)];case 10:c.sent(),c.label=11;case 11:return this.transport instanceof D&&(this.features.inherentKeepAlive=!0),this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return a.stopConnection(e)},"Connecting "===this.connectionState&&(this.logger.log(l.a.Debug,"The HttpConnection connected successfully."),this.connectionState="Connected"),[3,13];case 12:return s=c.sent(),this.logger.log(l.a.Error,"Failed to start the connection: "+s),this.connectionState="Disconnected",this.transport=void 0,[2,Promise.reject(s)];case 13:return[2]}})})},e.prototype.getNegotiationResponse=function(e){return N(this,void 0,void 0,function(){var t,n,r,o,i,s;return U(this,function(a){switch(a.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(r=a.sent())&&((t={}).Authorization="Bearer "+r,n=t),a.label=2;case 2:o=this.resolveNegotiateUrl(e),this.logger.log(l.a.Debug,"Sending negotiation request: "+o+"."),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,this.httpClient.post(o,{content:"",headers:n})];case 4:return 200!==(i=a.sent()).statusCode?[2,Promise.reject(new Error("Unexpected status code returned from negotiate "+i.statusCode))]:[2,JSON.parse(i.content)];case 5:return s=a.sent(),this.logger.log(l.a.Error,"Failed to complete negotiation with the server: "+s),[2,Promise.reject(s)];case 6:return[2]}})})},e.prototype.createConnectUrl=function(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+"id="+t:e},e.prototype.createTransport=function(e,t,n,r){return N(this,void 0,void 0,function(){var o,i,s,a,c,u,h,f,p;return U(this,function(d){switch(d.label){case 0:return o=this.createConnectUrl(e,n.connectionId),this.isITransport(t)?(this.logger.log(l.a.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,[4,this.transport.connect(o,r)]):[3,2];case 1:return d.sent(),[2];case 2:i=[],s=n.availableTransports||[],a=0,c=s,d.label=3;case 3:if(!(a<c.length))return[3,11];u=c[a],d.label=4;case 4:return d.trys.push([4,9,,10]),"number"!=typeof(h=this.resolveTransport(u,t,r))?[3,8]:(this.transport=this.constructTransport(h),n.connectionId?[3,6]:[4,this.getNegotiationResponse(e)]);case 5:n=d.sent(),o=this.createConnectUrl(e,n.connectionId),d.label=6;case 6:return[4,this.transport.connect(o,r)];case 7:return d.sent(),[2];case 8:return[3,10];case 9:return f=d.sent(),this.logger.log(l.a.Error,"Failed to start the transport '"+u.transport+"': "+f),n.connectionId=void 0,i.push(u.transport+" failed: "+f),"Connecting "!==this.connectionState?(p="Failed to select transport before stop() was called.",this.logger.log(l.a.Debug,p),[2,Promise.reject(new Error(p))]):[3,10];case 10:return a++,[3,3];case 11:return i.length>0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case C.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new B(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case C.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new A(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case C.LongPolling:return new D(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.resolveTransport=function(e,t,n){var r=C[e.transport];if(null!=r){var o=e.transferFormats.map(function(e){return k[e]});if(function(e,t){return!e||0!=(t&e)}(t,r)){if(o.indexOf(n)>=0){if(r===C.WebSockets&&!this.options.WebSocket||r===C.ServerSentEvents&&!this.options.EventSource)throw this.logger.log(l.a.Debug,"Skipping transport '"+C[r]+"' because it is not supported in your environment.'"),new Error("'"+C[r]+"' is not supported in your environment.");return this.logger.log(l.a.Debug,"Selecting transport '"+C[r]+"'."),r}throw this.logger.log(l.a.Debug,"Skipping transport '"+C[r]+"' because it does not support the requested transfer format '"+k[n]+"'."),new Error("'"+C[r]+"' does not support "+k[n]+".")}throw this.logger.log(l.a.Debug,"Skipping transport '"+C[r]+"' because it was disabled by the client."),new Error("'"+C[r]+"' is disabled by the client.")}return this.logger.log(l.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),null},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(l.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(l.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(l.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(l.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(l.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(l.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!v.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(l.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var z=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new Y,this.transportResult=new Y,this.sendLoop().then(function(){},function(e){})}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult.promise},e.prototype.stop=function(){this.executing=!1,this.sendBufferedData.resolve()},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return N(this,void 0,void 0,function(){var t,n,r;return U(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return[3,6];this.sendBufferedData=new Y,t=this.transportResult,this.transportResult=new Y,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o<i.length;o++){var s=i[o];n.set(new Uint8Array(s),r),r+=s.byteLength}return n},e}(),Y=function(){function e(){var e=this;this.promise=new Promise(function(t,n){var r;return r=[t,n],e.resolver=r[0],e.rejecter=r[1],r})}return e.prototype.resolve=function(){this.resolver()},e.prototype.reject=function(e){this.rejecter(e)},e}(),J=n(10),K=n(12),X="json",G=function(){function e(){this.name=X,this.version=1,this.transferFormat=k.Text}return e.prototype.parseMessages=function(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=J.a.instance);for(var n=[],r=0,i=K.a.parse(e);r<i.length;r++){var s=i[r],a=JSON.parse(s);if("number"!=typeof a.type)throw new Error("Invalid payload.");switch(a.type){case o.Invocation:this.isInvocationMessage(a);break;case o.StreamItem:this.isStreamItemMessage(a);break;case o.Completion:this.isCompletionMessage(a);break;case o.Ping:case o.Close:break;default:t.log(l.a.Information,"Unknown message type '"+a.type+"' ignored.");continue}n.push(a)}return n},e.prototype.writeMessage=function(e){return K.a.write(JSON.stringify(e))},e.prototype.isInvocationMessage=function(e){this.assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this.assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")},e.prototype.isStreamItemMessage=function(e){if(this.assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")},e.prototype.isCompletionMessage=function(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this.assertNotEmptyString(e.error,"Invalid payload for Completion message."),this.assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")},e.prototype.assertNotEmptyString=function(e,t){if("string"!=typeof e||""===e)throw new Error(t)},e}(),V=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Q={trace:l.a.Trace,debug:l.a.Debug,info:l.a.Information,information:l.a.Information,warn:l.a.Warning,warning:l.a.Warning,error:l.a.Error,critical:l.a.Critical,none:l.a.None};!function(){function e(){}e.prototype.configureLogging=function(e){if(v.a.isRequired(e,"logging"),void 0!==e.log)this.logger=e;else if("string"==typeof e){var t=function(e){var t=Q[e.toLowerCase()];if(void 0!==t)return t;throw new Error("Unknown log level: "+e)}(e);this.logger=new v.b(t)}else this.logger=new v.b(e);return this},e.prototype.withUrl=function(e,t){return v.a.isRequired(e,"url"),this.url=e,this.httpConnectionOptions=V({},this.httpConnectionOptions,"object"==typeof t?t:{transport:t}),this},e.prototype.withHubProtocol=function(e){return v.a.isRequired(e,"protocol"),this.protocol=e,this},e.prototype.withAutomaticReconnect=function(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new _(e):this.reconnectPolicy=e:this.reconnectPolicy=new _,this},e.prototype.build=function(){var e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");var t=new q(this.url,e);return I.create(t,this.logger||J.a.instance,this.protocol||new G,this.reconnectPolicy)}}();var $=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o<e.byteLength;){var i=0,s=0,a=void 0;do{s|=(127&(a=n[o+i]))<<r[i],i++}while(i<Math.min(5,e.byteLength-o)&&0!=(128&a));if(0!=(128&a)&&i<5)throw new Error("Cannot read message size.");if(5===i&&a>7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+s))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+s):n.subarray(o+i,o+i+s)),o=o+i+s}return t},e}();var Z=new Uint8Array([145,o.Ping]),ee=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=k.Binary,this.errorResult=1,this.voidResult=2,this.nonVoidResult=3}return e.prototype.parseMessages=function(e,t){if(!(e instanceof i.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=J.a.instance);for(var r=[],o=0,s=$.parse(e);o<s.length;o++){var a=s[o],c=this.parseMessage(a,t);c&&r.push(c)}return r},e.prototype.writeMessage=function(e){switch(e.type){case o.Invocation:return this.writeInvocation(e);case o.StreamInvocation:return this.writeStreamInvocation(e);case o.StreamItem:return this.writeStreamItem(e);case o.Completion:return this.writeCompletion(e);case o.Ping:return $.write(Z);case o.CancelInvocation:return this.writeCancelInvocation(e);default:throw new Error("Invalid message type.")}},e.prototype.parseMessage=function(e,t){if(0===e.length)throw new Error("Invalid payload.");var n=s().decode(i.Buffer.from(e));if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");var r=n[0];switch(r){case o.Invocation:return this.createInvocationMessage(this.readHeaders(n),n);case o.StreamItem:return this.createStreamItemMessage(this.readHeaders(n),n);case o.Completion:return this.createCompletionMessage(this.readHeaders(n),n);case o.Ping:return this.createPingMessage(n);case o.Close:return this.createCloseMessage(n);default:return t.log(l.a.Information,"Unknown message type '"+r+"' ignored."),null}},e.prototype.createCloseMessage=function(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{error:e[1],type:o.Close}},e.prototype.createPingMessage=function(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:o.Ping}},e.prototype.createInvocationMessage=function(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");var n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,streamIds:[],target:t[3],type:o.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:o.Invocation}},e.prototype.createStreamItemMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:o.StreamItem}},e.prototype.createCompletionMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");var n,r,i=t[3];if(i!==this.voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");switch(i){case this.errorResult:n=t[4];break;case this.nonVoidResult:r=t[4]}return{error:n,headers:e,invocationId:t[2],result:r,type:o.Completion}},e.prototype.writeInvocation=function(e){var t=s().encode([o.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]);return $.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t=s().encode([o.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]);return $.write(t.slice())},e.prototype.writeStreamItem=function(e){var t=s().encode([o.StreamItem,e.headers||{},e.invocationId,e.item]);return $.write(t.slice())},e.prototype.writeCompletion=function(e){var t,n=s(),r=e.error?this.errorResult:e.result?this.nonVoidResult:this.voidResult;switch(r){case this.errorResult:t=n.encode([o.Completion,e.headers||{},e.invocationId,r,e.error]);break;case this.voidResult:t=n.encode([o.Completion,e.headers||{},e.invocationId,r]);break;case this.nonVoidResult:t=n.encode([o.Completion,e.headers||{},e.invocationId,r,e.result])}return $.write(t.slice())},e.prototype.writeCancelInvocation=function(e){var t=s().encode([o.CancelInvocation,e.headers||{},e.invocationId]);return $.write(t.slice())},e.prototype.readHeaders=function(e){var t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t},e}();n.d(t,"VERSION",function(){return te}),n.d(t,"MessagePackHubProtocol",function(){return ee});var te="0.0.0-DEV_BUILD"},function(e,t,n){"use strict";n.r(t);var r,o,i=n(4),s=n(6),a=n(46),c=n(0),u=(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),l=function(e){function t(t){var n=e.call(this)||this;return n.logger=t,n}return u(t,e),t.prototype.send=function(e){var t=this;return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?new Promise(function(n,r){var o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=!0,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");var a=e.headers;a&&Object.keys(a).forEach(function(e){o.setRequestHeader(e,a[e])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=function(){o.abort(),r(new i.a)}),e.timeout&&(o.timeout=e.timeout),o.onload=function(){e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new s.b(o.status,o.statusText,o.response||o.responseText)):r(new i.b(o.statusText,o.status))},o.onerror=function(){t.logger.log(c.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i.b(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(c.a.Warning,"Timeout from HTTP request."),r(new i.c)},o.send(e.content||"")}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(s.a),h=function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),f=function(e){function t(t){var n=e.call(this)||this;return"undefined"!=typeof XMLHttpRequest?n.httpClient=new l(t):n.httpClient=new a.a(t),n}return h(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new i.a):e.method?e.url?this.httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t.prototype.getCookieString=function(e){return this.httpClient.getCookieString(e)},t}(s.a),p=n(47);!function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close"}(o||(o={}));var d,g=n(2),y=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t<n.length;t++){n[t].next(e)}},e.prototype.error=function(e){for(var t=0,n=this.observers;t<n.length;t++){var r=n[t];r.error&&r.error(e)}},e.prototype.complete=function(){for(var e=0,t=this.observers;e<t.length;e++){var n=t[e];n.complete&&n.complete()}},e.prototype.subscribe=function(e){return this.observers.push(e),new g.d(this,e)},e}(),v=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},b=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},m=3e4,w=15e3;!function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"}(d||(d={}));var S,E,C=function(){function e(e,t,n,r){var i=this;g.a.isRequired(e,"connection"),g.a.isRequired(t,"logger"),g.a.isRequired(n,"protocol"),this.serverTimeoutInMilliseconds=m,this.keepAliveIntervalInMilliseconds=w,this.logger=t,this.protocol=n,this.connection=e,this.reconnectPolicy=r,this.handshakeProtocol=new p.a,this.connection.onreceive=function(e){return i.processIncomingData(e)},this.connection.onclose=function(e){return i.connectionClosed(e)},this.callbacks={},this.methods={},this.closedCallbacks=[],this.reconnectingCallbacks=[],this.reconnectedCallbacks=[],this.invocationId=0,this.receivedHandshakeResponse=!1,this.connectionState=d.Disconnected,this.connectionStarted=!1,this.cachedPingMessage=this.protocol.writeMessage({type:o.Ping})}return e.create=function(t,n,r,o){return new e(t,n,r,o)},Object.defineProperty(e.prototype,"state",{get:function(){return this.connectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"connectionId",{get:function(){return this.connection&&this.connection.connectionId||null},enumerable:!0,configurable:!0}),e.prototype.start=function(){return this.startPromise=this.startWithStateTransitions(),this.startPromise},e.prototype.startWithStateTransitions=function(){return v(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:if(this.connectionState!==d.Disconnected)return[2,Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."))];this.connectionState=d.Connecting,this.logger.log(c.a.Debug,"Starting HubConnection."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.startInternal()];case 2:return t.sent(),this.connectionState=d.Connected,this.connectionStarted=!0,this.logger.log(c.a.Debug,"HubConnection connected successfully."),[3,4];case 3:return e=t.sent(),this.connectionState=d.Disconnected,this.logger.log(c.a.Debug,"HubConnection failed to start successfully because of error '"+e+"'."),[2,Promise.reject(e)];case 4:return[2]}})})},e.prototype.startInternal=function(){return v(this,void 0,void 0,function(){var e,t,n,r=this;return b(this,function(o){switch(o.label){case 0:return this.stopDuringStartError=void 0,this.receivedHandshakeResponse=!1,e=new Promise(function(e,t){r.handshakeResolver=e,r.handshakeRejecter=t}),[4,this.connection.start(this.protocol.transferFormat)];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,5,,7]),t={protocol:this.protocol.name,version:this.protocol.version},this.logger.log(c.a.Debug,"Sending handshake request."),[4,this.sendMessage(this.handshakeProtocol.writeHandshakeRequest(t))];case 3:return o.sent(),this.logger.log(c.a.Information,"Using HubProtocol '"+this.protocol.name+"'."),this.cleanupTimeout(),this.resetTimeoutPeriod(),this.resetKeepAliveInterval(),[4,e];case 4:if(o.sent(),this.stopDuringStartError)throw this.stopDuringStartError;return[3,7];case 5:return n=o.sent(),this.logger.log(c.a.Debug,"Hub handshake failed with error '"+n+"' during start(). Stopping HubConnection."),this.cleanupTimeout(),this.cleanupPingTimer(),[4,this.connection.stop(n)];case 6:throw o.sent(),n;case 7:return[2]}})})},e.prototype.stop=function(){return v(this,void 0,void 0,function(){var e;return b(this,function(t){switch(t.label){case 0:return e=this.startPromise,this.stopPromise=this.stopInternal(),[4,this.stopPromise];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e];case 3:return t.sent(),[3,5];case 4:return t.sent(),[3,5];case 5:return[2]}})})},e.prototype.stopInternal=function(e){return this.connectionState===d.Disconnected?(this.logger.log(c.a.Debug,"Call to HubConnection.stop("+e+") ignored because it is already in the disconnected state."),Promise.resolve()):this.connectionState===d.Disconnecting?(this.logger.log(c.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnecting state."),this.stopPromise):(this.connectionState=d.Disconnecting,this.logger.log(c.a.Debug,"Stopping HubConnection."),this.reconnectDelayHandle?(this.logger.log(c.a.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this.reconnectDelayHandle),this.reconnectDelayHandle=void 0,this.completeClose(),Promise.resolve()):(this.cleanupTimeout(),this.cleanupPingTimer(),this.stopDuringStartError=e||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(e)))},e.prototype.stream=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i,s=this.replaceStreamingParams(n),a=s[0],c=s[1],u=this.createStreamInvocation(e,n,c),l=new y;return l.cancelCallback=function(){var e=t.createCancelInvocation(u.invocationId);return delete t.callbacks[u.invocationId],i.then(function(){return t.sendWithProtocol(e)})},this.callbacks[u.invocationId]=function(e,t){t?l.error(t):e&&(e.type===o.Completion?e.error?l.error(new Error(e.error)):l.complete():l.next(e.item))},i=this.sendWithProtocol(u).catch(function(e){l.error(e),delete t.callbacks[u.invocationId]}),this.launchStreams(a,i),l},e.prototype.sendMessage=function(e){return this.resetKeepAliveInterval(),this.connection.send(e)},e.prototype.sendWithProtocol=function(e){return this.sendMessage(this.protocol.writeMessage(e))},e.prototype.send=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.replaceStreamingParams(t),o=r[0],i=r[1],s=this.sendWithProtocol(this.createInvocation(e,t,!0,i));return this.launchStreams(o,s),s},e.prototype.invoke=function(e){for(var t=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this.replaceStreamingParams(n),s=i[0],a=i[1],c=this.createInvocation(e,n,!1,a);return new Promise(function(e,n){t.callbacks[c.invocationId]=function(t,r){r?n(r):t&&(t.type===o.Completion?t.error?n(new Error(t.error)):e(t.result):n(new Error("Unexpected message type: "+t.type)))};var r=t.sendWithProtocol(c).catch(function(e){n(e),delete t.callbacks[c.invocationId]});t.launchStreams(s,r)})},e.prototype.on=function(e,t){e&&t&&(e=e.toLowerCase(),this.methods[e]||(this.methods[e]=[]),-1===this.methods[e].indexOf(t)&&this.methods[e].push(t))},e.prototype.off=function(e,t){if(e){e=e.toLowerCase();var n=this.methods[e];if(n)if(t){var r=n.indexOf(t);-1!==r&&(n.splice(r,1),0===n.length&&delete this.methods[e])}else delete this.methods[e]}},e.prototype.onclose=function(e){e&&this.closedCallbacks.push(e)},e.prototype.onreconnecting=function(e){e&&this.reconnectingCallbacks.push(e)},e.prototype.onreconnected=function(e){e&&this.reconnectedCallbacks.push(e)},e.prototype.processIncomingData=function(e){if(this.cleanupTimeout(),this.receivedHandshakeResponse||(e=this.processHandshakeResponse(e),this.receivedHandshakeResponse=!0),e)for(var t=0,n=this.protocol.parseMessages(e,this.logger);t<n.length;t++){var r=n[t];switch(r.type){case o.Invocation:this.invokeClientMethod(r);break;case o.StreamItem:case o.Completion:var i=this.callbacks[r.invocationId];i&&(r.type===o.Completion&&delete this.callbacks[r.invocationId],i(r));break;case o.Ping:break;case o.Close:this.logger.log(c.a.Information,"Close message received from server."),this.stopPromise=this.stopInternal(r.error?new Error("Server returned an error on close: "+r.error):void 0);break;default:this.logger.log(c.a.Warning,"Invalid message type: "+r.type+".")}}this.resetTimeoutPeriod()},e.prototype.processHandshakeResponse=function(e){var t,n,r;try{r=(t=this.handshakeProtocol.parseHandshakeResponse(e))[0],n=t[1]}catch(e){var o="Error parsing handshake response: "+e;this.logger.log(c.a.Error,o);var i=new Error(o);throw this.handshakeRejecter(i),i}if(n.error){o="Server returned handshake error: "+n.error;this.logger.log(c.a.Error,o);i=new Error(o);throw this.handshakeRejecter(i),i}return this.logger.log(c.a.Debug,"Server handshake complete."),this.handshakeResolver(),r},e.prototype.resetKeepAliveInterval=function(){var e=this;this.cleanupPingTimer(),this.pingServerHandle=setTimeout(function(){return v(e,void 0,void 0,function(){return b(this,function(e){switch(e.label){case 0:if(this.connectionState!==d.Connected)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.sendMessage(this.cachedPingMessage)];case 2:return e.sent(),[3,4];case 3:return e.sent(),this.cleanupPingTimer(),[3,4];case 4:return[2]}})})},this.keepAliveIntervalInMilliseconds)},e.prototype.resetTimeoutPeriod=function(){var e=this;this.connection.features&&this.connection.features.inherentKeepAlive||(this.timeoutHandle=setTimeout(function(){return e.serverTimeout()},this.serverTimeoutInMilliseconds))},e.prototype.serverTimeout=function(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))},e.prototype.invokeClientMethod=function(e){var t=this,n=this.methods[e.target.toLowerCase()];if(n){try{n.forEach(function(n){return n.apply(t,e.arguments)})}catch(t){this.logger.log(c.a.Error,"A callback for the method "+e.target.toLowerCase()+" threw error '"+t+"'.")}if(e.invocationId){var r="Server requested a response, which is not supported in this version of the client.";this.logger.log(c.a.Error,r),this.stopPromise=this.stopInternal(new Error(r))}}else this.logger.log(c.a.Warning,"No client method with the name '"+e.target+"' found.")},e.prototype.connectionClosed=function(e){this.logger.log(c.a.Debug,"HubConnection.connectionClosed("+e+") called while in state "+this.connectionState+"."),this.stopDuringStartError=this.stopDuringStartError||e||new Error("The underlying connection was closed before the hub handshake could complete."),this.handshakeResolver&&this.handshakeResolver(),this.cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this.cleanupTimeout(),this.cleanupPingTimer(),this.connectionState===d.Disconnecting?this.completeClose(e):this.connectionState===d.Connected&&this.reconnectPolicy?this.reconnect(e):this.connectionState===d.Connected&&this.completeClose(e)},e.prototype.completeClose=function(e){var t=this;if(this.connectionStarted){this.connectionState=d.Disconnected,this.connectionStarted=!1;try{this.closedCallbacks.forEach(function(n){return n.apply(t,[e])})}catch(t){this.logger.log(c.a.Error,"An onclose callback called with error '"+e+"' threw error '"+t+"'.")}}},e.prototype.reconnect=function(e){return v(this,void 0,void 0,function(){var t,n,r,o,i=this;return b(this,function(s){switch(s.label){case 0:if(t=Date.now(),n=0,null===(r=this.getNextRetryDelay(n++,0)))return this.logger.log(c.a.Debug,"Connection not reconnecting because the IReconnectPolicy returned null on the first reconnect attempt."),this.completeClose(e),[2];if(this.connectionState=d.Reconnecting,e?this.logger.log(c.a.Information,"Connection reconnecting because of error '"+e+"'."):this.logger.log(c.a.Information,"Connection reconnecting."),this.onreconnecting){try{this.reconnectingCallbacks.forEach(function(t){return t.apply(i,[e])})}catch(t){this.logger.log(c.a.Error,"An onreconnecting callback called with error '"+e+"' threw error '"+t+"'.")}if(this.connectionState!==d.Reconnecting)return this.logger.log(c.a.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting."),[2]}s.label=1;case 1:return null===r?[3,7]:(this.logger.log(c.a.Information,"Reconnect attempt number "+n+" will start in "+r+" ms."),[4,new Promise(function(e){i.reconnectDelayHandle=setTimeout(e,r)})]);case 2:if(s.sent(),this.reconnectDelayHandle=void 0,this.connectionState!==d.Reconnecting)return this.logger.log(c.a.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting."),[2];s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.startInternal()];case 4:if(s.sent(),this.connectionState=d.Connected,this.logger.log(c.a.Information,"HubConnection reconnected successfully."),this.onreconnected)try{this.reconnectedCallbacks.forEach(function(e){return e.apply(i,[i.connection.connectionId])})}catch(e){this.logger.log(c.a.Error,"An onreconnected callback called with connectionId '"+this.connection.connectionId+"; threw error '"+e+"'.")}return[2];case 5:return o=s.sent(),this.logger.log(c.a.Information,"Reconnect attempt failed because of error '"+o+"'."),this.connectionState!==d.Reconnecting?(this.logger.log(c.a.Debug,"Connection left the reconnecting state during reconnect attempt. Done reconnecting."),[2]):[3,6];case 6:return r=this.getNextRetryDelay(n++,Date.now()-t),[3,1];case 7:return this.logger.log(c.a.Information,"Reconnect retries have been exhausted after "+(Date.now()-t)+" ms and "+n+" failed attempts. Connection disconnecting."),this.completeClose(),[2]}})})},e.prototype.getNextRetryDelay=function(e,t){try{return this.reconnectPolicy.nextRetryDelayInMilliseconds(e,t)}catch(n){return this.logger.log(c.a.Error,"IReconnectPolicy.nextRetryDelayInMilliseconds("+e+", "+t+") threw error '"+n+"'."),null}},e.prototype.cancelCallbacksWithError=function(e){var t=this.callbacks;this.callbacks={},Object.keys(t).forEach(function(n){(0,t[n])(null,e)})},e.prototype.cleanupPingTimer=function(){this.pingServerHandle&&clearTimeout(this.pingServerHandle)},e.prototype.cleanupTimeout=function(){this.timeoutHandle&&clearTimeout(this.timeoutHandle)},e.prototype.createInvocation=function(e,t,n,r){if(n)return{arguments:t,streamIds:r,target:e,type:o.Invocation};var i=this.invocationId;return this.invocationId++,{arguments:t,invocationId:i.toString(),streamIds:r,target:e,type:o.Invocation}},e.prototype.launchStreams=function(e,t){var n=this;if(0!==e.length){t||(t=Promise.resolve());var r=function(r){e[r].subscribe({complete:function(){t=t.then(function(){return n.sendWithProtocol(n.createCompletionMessage(r))})},error:function(e){var o;o=e instanceof Error?e.message:e&&e.toString?e.toString():"Unknown error",t=t.then(function(){return n.sendWithProtocol(n.createCompletionMessage(r,o))})},next:function(e){t=t.then(function(){return n.sendWithProtocol(n.createStreamItemMessage(r,e))})}})};for(var o in e)r(o)}},e.prototype.replaceStreamingParams=function(e){for(var t=[],n=[],r=0;r<e.length;r++){var o=e[r];if(this.isObservable(o)){var i=this.invocationId;this.invocationId++,t[i]=o,n.push(i.toString()),e.splice(r,1)}}return[t,n]},e.prototype.isObservable=function(e){return e&&e.subscribe&&"function"==typeof e.subscribe},e.prototype.createStreamInvocation=function(e,t,n){var r=this.invocationId;return this.invocationId++,{arguments:t,invocationId:r.toString(),streamIds:n,target:e,type:o.StreamInvocation}},e.prototype.createCancelInvocation=function(e){return{invocationId:e,type:o.CancelInvocation}},e.prototype.createStreamItemMessage=function(e,t){return{invocationId:e,item:t,type:o.StreamItem}},e.prototype.createCompletionMessage=function(e,t,n){return t?{error:t,invocationId:e,type:o.Completion}:{invocationId:e,result:n,type:o.Completion}},e}(),k=[0,2e3,1e4,3e4,null],I=function(){function e(e){this.retryDelays=void 0!==e?e.concat([null]):k}return e.prototype.nextRetryDelayInMilliseconds=function(e){return this.retryDelays[e]},e}();!function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"}(S||(S={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(E||(E={}));var T=function(){function e(){this.isAborted=!1,this.onabort=null}return e.prototype.abort=function(){this.isAborted||(this.isAborted=!0,this.onabort&&this.onabort())},Object.defineProperty(e.prototype,"signal",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aborted",{get:function(){return this.isAborted},enumerable:!0,configurable:!0}),e}(),_=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},P=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},x=function(){function e(e,t,n,r){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.pollAbort=new T,this.logMessageContent=r,this.running=!1,this.onreceive=null,this.onclose=null}return Object.defineProperty(e.prototype,"pollAborted",{get:function(){return this.pollAbort.aborted},enumerable:!0,configurable:!0}),e.prototype.connect=function(e,t){return _(this,void 0,void 0,function(){var n,r,o,s;return P(this,function(a){switch(a.label){case 0:if(g.a.isRequired(e,"url"),g.a.isRequired(t,"transferFormat"),g.a.isIn(t,E,"transferFormat"),this.url=e,this.logger.log(c.a.Trace,"(LongPolling transport) Connecting."),t===E.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");return n={abortSignal:this.pollAbort.signal,headers:{},timeout:1e5},t===E.Binary&&(n.responseType="arraybuffer"),[4,this.getAccessToken()];case 1:return r=a.sent(),this.updateHeaderToken(n,r),o=e+"&_="+Date.now(),this.logger.log(c.a.Trace,"(LongPolling transport) polling: "+o+"."),[4,this.httpClient.get(o,n)];case 2:return 200!==(s=a.sent()).statusCode?(this.logger.log(c.a.Error,"(LongPolling transport) Unexpected response code: "+s.statusCode+"."),this.closeError=new i.b(s.statusText||"",s.statusCode),this.running=!1):this.running=!0,this.receiving=this.poll(this.url,n),[2]}})})},e.prototype.getAccessToken=function(){return _(this,void 0,void 0,function(){return P(this,function(e){switch(e.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:return[2,e.sent()];case 2:return[2,null]}})})},e.prototype.updateHeaderToken=function(e,t){e.headers||(e.headers={}),t?e.headers.Authorization="Bearer "+t:e.headers.Authorization&&delete e.headers.Authorization},e.prototype.poll=function(e,t){return _(this,void 0,void 0,function(){var n,r,o,s;return P(this,function(a){switch(a.label){case 0:a.trys.push([0,,8,9]),a.label=1;case 1:return this.running?[4,this.getAccessToken()]:[3,7];case 2:n=a.sent(),this.updateHeaderToken(t,n),a.label=3;case 3:return a.trys.push([3,5,,6]),r=e+"&_="+Date.now(),this.logger.log(c.a.Trace,"(LongPolling transport) polling: "+r+"."),[4,this.httpClient.get(r,t)];case 4:return 204===(o=a.sent()).statusCode?(this.logger.log(c.a.Information,"(LongPolling transport) Poll terminated by server."),this.running=!1):200!==o.statusCode?(this.logger.log(c.a.Error,"(LongPolling transport) Unexpected response code: "+o.statusCode+"."),this.closeError=new i.b(o.statusText||"",o.statusCode),this.running=!1):o.content?(this.logger.log(c.a.Trace,"(LongPolling transport) data received. "+Object(g.f)(o.content,this.logMessageContent)+"."),this.onreceive&&this.onreceive(o.content)):this.logger.log(c.a.Trace,"(LongPolling transport) Poll timed out, reissuing."),[3,6];case 5:return s=a.sent(),this.running?s instanceof i.c?this.logger.log(c.a.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this.closeError=s,this.running=!1):this.logger.log(c.a.Trace,"(LongPolling transport) Poll errored after shutdown: "+s.message),[3,6];case 6:return[3,1];case 7:return[3,9];case 8:return this.logger.log(c.a.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this.raiseOnClose(),[7];case 9:return[2]}})})},e.prototype.send=function(e){return _(this,void 0,void 0,function(){return P(this,function(t){return this.running?[2,Object(g.h)(this.logger,"LongPolling",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return _(this,void 0,void 0,function(){var e,t;return P(this,function(n){switch(n.label){case 0:this.logger.log(c.a.Trace,"(LongPolling transport) Stopping polling."),this.running=!1,this.pollAbort.abort(),n.label=1;case 1:return n.trys.push([1,,5,6]),[4,this.receiving];case 2:return n.sent(),this.logger.log(c.a.Trace,"(LongPolling transport) sending DELETE request to "+this.url+"."),e={headers:{}},[4,this.getAccessToken()];case 3:return t=n.sent(),this.updateHeaderToken(e,t),[4,this.httpClient.delete(this.url,e)];case 4:return n.sent(),this.logger.log(c.a.Trace,"(LongPolling transport) DELETE request sent."),[3,6];case 5:return this.logger.log(c.a.Trace,"(LongPolling transport) Stop finished."),this.raiseOnClose(),[7];case 6:return[2]}})})},e.prototype.raiseOnClose=function(){if(this.onclose){var e="(LongPolling transport) Firing onclose event.";this.closeError&&(e+=" Error: "+this.closeError),this.logger.log(c.a.Trace,e),this.onclose(this.closeError)}},e}(),R=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},D=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},O=function(){function e(e,t,n,r,o){this.httpClient=e,this.accessTokenFactory=t,this.logger=n,this.logMessageContent=r,this.eventSourceConstructor=o,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return R(this,void 0,void 0,function(){var n,r=this;return D(this,function(o){switch(o.label){case 0:return g.a.isRequired(e,"url"),g.a.isRequired(t,"transferFormat"),g.a.isIn(t,E,"transferFormat"),this.logger.log(c.a.Trace,"(SSE transport) Connecting."),this.url=e,this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i=!1;if(t===E.Text){var s;if(g.c.isBrowser||g.c.isWebWorker)s=new r.eventSourceConstructor(e,{withCredentials:!0});else{var a=r.httpClient.getCookieString(e);s=new r.eventSourceConstructor(e,{withCredentials:!0,headers:{Cookie:a}})}try{s.onmessage=function(e){if(r.onreceive)try{r.logger.log(c.a.Trace,"(SSE transport) data received. "+Object(g.f)(e.data,r.logMessageContent)+"."),r.onreceive(e.data)}catch(e){return void r.close(e)}},s.onerror=function(e){var t=new Error(e.data||"Error occurred");i?r.close(t):o(t)},s.onopen=function(){r.logger.log(c.a.Information,"SSE connected to "+r.url),r.eventSource=s,i=!0,n()}}catch(e){return void o(e)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})]}})})},e.prototype.send=function(e){return R(this,void 0,void 0,function(){return D(this,function(t){return this.eventSource?[2,Object(g.h)(this.logger,"SSE",this.httpClient,this.url,this.accessTokenFactory,e,this.logMessageContent)]:[2,Promise.reject(new Error("Cannot send until the transport is connected"))]})})},e.prototype.stop=function(){return this.close(),Promise.resolve()},e.prototype.close=function(e){this.eventSource&&(this.eventSource.close(),this.eventSource=void 0,this.onclose&&this.onclose(e))},e}(),L=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},A=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},M=function(){function e(e,t,n,r,o){this.logger=n,this.accessTokenFactory=t,this.logMessageContent=r,this.webSocketConstructor=o,this.httpClient=e,this.onreceive=null,this.onclose=null}return e.prototype.connect=function(e,t){return L(this,void 0,void 0,function(){var n,r=this;return A(this,function(o){switch(o.label){case 0:return g.a.isRequired(e,"url"),g.a.isRequired(t,"transferFormat"),g.a.isIn(t,E,"transferFormat"),this.logger.log(c.a.Trace,"(WebSockets transport) Connecting."),this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(n=o.sent())&&(e+=(e.indexOf("?")<0?"?":"&")+"access_token="+encodeURIComponent(n)),o.label=2;case 2:return[2,new Promise(function(n,o){var i;e=e.replace(/^http/,"ws");var s=r.httpClient.getCookieString(e);g.c.isNode&&s&&(i=new r.webSocketConstructor(e,void 0,{headers:{Cookie:""+s}})),i||(i=new r.webSocketConstructor(e)),t===E.Binary&&(i.binaryType="arraybuffer"),i.onopen=function(t){r.logger.log(c.a.Information,"WebSocket connected to "+e+"."),r.webSocket=i,n()},i.onerror=function(e){var t=null;"undefined"!=typeof ErrorEvent&&e instanceof ErrorEvent&&(t=e.error),o(t)},i.onmessage=function(e){r.logger.log(c.a.Trace,"(WebSockets transport) data received. "+Object(g.f)(e.data,r.logMessageContent)+"."),r.onreceive&&r.onreceive(e.data)},i.onclose=function(e){return r.close(e)}})]}})})},e.prototype.send=function(e){return this.webSocket&&this.webSocket.readyState===this.webSocketConstructor.OPEN?(this.logger.log(c.a.Trace,"(WebSockets transport) sending data. "+Object(g.f)(e,this.logMessageContent)+"."),this.webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")},e.prototype.stop=function(){return this.webSocket&&(this.webSocket.onclose=function(){},this.webSocket.onmessage=function(){},this.webSocket.onerror=function(){},this.webSocket.close(),this.webSocket=void 0,this.close(void 0)),Promise.resolve()},e.prototype.close=function(e){this.logger.log(c.a.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!e||!1!==e.wasClean&&1e3===e.code?this.onclose():this.onclose(new Error("WebSocket closed with status code: "+e.code+" ("+e.reason+").")))},e}(),j=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},B=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},N=null,U=null;if(g.c.isNode){var H=require;N=H("ws"),U=H("eventsource")}var F=function(){function e(e,t){void 0===t&&(t={}),this.features={},g.a.isRequired(e,"url"),this.logger=Object(g.e)(t.logger),this.baseUrl=this.resolveUrl(e),(t=t||{}).logMessageContent=t.logMessageContent||!1,g.c.isNode||"undefined"==typeof WebSocket||t.WebSocket?g.c.isNode&&!t.WebSocket&&N&&(t.WebSocket=N):t.WebSocket=WebSocket,g.c.isNode||"undefined"==typeof EventSource||t.EventSource?g.c.isNode&&!t.EventSource&&void 0!==U&&(t.EventSource=U):t.EventSource=EventSource,this.httpClient=t.httpClient||new f(this.logger),this.connectionState="Disconnected",this.connectionStarted=!1,this.options=t,this.onreceive=null,this.onclose=null}return e.prototype.start=function(e){return j(this,void 0,void 0,function(){var t;return B(this,function(n){switch(n.label){case 0:return e=e||E.Binary,g.a.isIn(e,E,"transferFormat"),this.logger.log(c.a.Debug,"Starting connection with transfer format '"+E[e]+"'."),"Disconnected"!==this.connectionState?[2,Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."))]:(this.connectionState="Connecting ",this.startInternalPromise=this.startInternal(e),[4,this.startInternalPromise]);case 1:return n.sent(),"Disconnecting"!==this.connectionState?[3,3]:(t="Failed to start the HttpConnection before stop() was called.",this.logger.log(c.a.Error,t),[4,this.stopPromise]);case 2:return n.sent(),[2,Promise.reject(new Error(t))];case 3:if("Connected"!==this.connectionState)return t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!",this.logger.log(c.a.Error,t),[2,Promise.reject(new Error(t))];n.label=4;case 4:return this.connectionStarted=!0,[2]}})})},e.prototype.send=function(e){return"Connected"!==this.connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this.sendQueue||(this.sendQueue=new W(this.transport)),this.sendQueue.send(e))},e.prototype.stop=function(e){return j(this,void 0,void 0,function(){var t=this;return B(this,function(n){switch(n.label){case 0:return"Disconnected"===this.connectionState?(this.logger.log(c.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnected state."),[2,Promise.resolve()]):"Disconnecting"===this.connectionState?(this.logger.log(c.a.Debug,"Call to HttpConnection.stop("+e+") ignored because the connection is already in the disconnecting state."),[2,this.stopPromise]):(this.connectionState="Disconnecting",this.stopPromise=new Promise(function(e){t.stopPromiseResolver=e}),[4,this.stopInternal(e)]);case 1:return n.sent(),[4,this.stopPromise];case 2:return n.sent(),[2]}})})},e.prototype.stopInternal=function(e){return j(this,void 0,void 0,function(){var t;return B(this,function(n){switch(n.label){case 0:this.stopError=e,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.startInternalPromise];case 2:return n.sent(),[3,4];case 3:return n.sent(),[3,4];case 4:if(!this.transport)return[3,9];this.sendQueue&&(this.sendQueue.stop(),this.sendQueue=void 0),n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.transport.stop()];case 6:return n.sent(),[3,8];case 7:return t=n.sent(),this.logger.log(c.a.Error,"HttpConnection.transport.stop() threw error '"+t+"'."),this.stopConnection(),[3,8];case 8:return this.transport=void 0,[3,10];case 9:this.logger.log(c.a.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed."),this.stopConnection(),n.label=10;case 10:return[2]}})})},e.prototype.startInternal=function(e){return j(this,void 0,void 0,function(){var t,n,r,o,i,s,a=this;return B(this,function(u){switch(u.label){case 0:t=this.baseUrl,this.accessTokenFactory=this.options.accessTokenFactory,u.label=1;case 1:return u.trys.push([1,12,,13]),this.options.skipNegotiation?this.options.transport!==S.WebSockets?[3,3]:(this.transport=this.constructTransport(S.WebSockets),[4,this.transport.connect(t,e)]):[3,5];case 2:return u.sent(),[3,4];case 3:throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");case 4:return[3,11];case 5:n=null,r=0,o=function(){var e;return B(this,function(o){switch(o.label){case 0:return[4,i.getNegotiationResponse(t)];case 1:if(n=o.sent(),"Disconnecting"===i.connectionState||"Disconnected"===i.connectionState)throw new Error("The connection was stopped during negotiation.");if(n.error)throw new Error(n.error);if(n.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");return n.url&&(t=n.url),n.accessToken&&(e=n.accessToken,i.accessTokenFactory=function(){return e}),r++,[2]}})},i=this,u.label=6;case 6:return[5,o()];case 7:u.sent(),u.label=8;case 8:if(n.url&&r<100)return[3,6];u.label=9;case 9:if(100===r&&n.url)throw new Error("Negotiate redirection limit exceeded.");return this.connectionId=n.connectionId,[4,this.createTransport(t,this.options.transport,n,e)];case 10:u.sent(),u.label=11;case 11:return this.transport instanceof x&&(this.features.inherentKeepAlive=!0),this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return a.stopConnection(e)},"Connecting "===this.connectionState&&(this.logger.log(c.a.Debug,"The HttpConnection connected successfully."),this.connectionState="Connected"),[3,13];case 12:return s=u.sent(),this.logger.log(c.a.Error,"Failed to start the connection: "+s),this.connectionState="Disconnected",this.transport=void 0,[2,Promise.reject(s)];case 13:return[2]}})})},e.prototype.getNegotiationResponse=function(e){return j(this,void 0,void 0,function(){var t,n,r,o,i,s;return B(this,function(a){switch(a.label){case 0:return this.accessTokenFactory?[4,this.accessTokenFactory()]:[3,2];case 1:(r=a.sent())&&((t={}).Authorization="Bearer "+r,n=t),a.label=2;case 2:o=this.resolveNegotiateUrl(e),this.logger.log(c.a.Debug,"Sending negotiation request: "+o+"."),a.label=3;case 3:return a.trys.push([3,5,,6]),[4,this.httpClient.post(o,{content:"",headers:n})];case 4:return 200!==(i=a.sent()).statusCode?[2,Promise.reject(new Error("Unexpected status code returned from negotiate "+i.statusCode))]:[2,JSON.parse(i.content)];case 5:return s=a.sent(),this.logger.log(c.a.Error,"Failed to complete negotiation with the server: "+s),[2,Promise.reject(s)];case 6:return[2]}})})},e.prototype.createConnectUrl=function(e,t){return t?e+(-1===e.indexOf("?")?"?":"&")+"id="+t:e},e.prototype.createTransport=function(e,t,n,r){return j(this,void 0,void 0,function(){var o,i,s,a,u,l,h,f,p;return B(this,function(d){switch(d.label){case 0:return o=this.createConnectUrl(e,n.connectionId),this.isITransport(t)?(this.logger.log(c.a.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,[4,this.transport.connect(o,r)]):[3,2];case 1:return d.sent(),[2];case 2:i=[],s=n.availableTransports||[],a=0,u=s,d.label=3;case 3:if(!(a<u.length))return[3,11];l=u[a],d.label=4;case 4:return d.trys.push([4,9,,10]),"number"!=typeof(h=this.resolveTransport(l,t,r))?[3,8]:(this.transport=this.constructTransport(h),n.connectionId?[3,6]:[4,this.getNegotiationResponse(e)]);case 5:n=d.sent(),o=this.createConnectUrl(e,n.connectionId),d.label=6;case 6:return[4,this.transport.connect(o,r)];case 7:return d.sent(),[2];case 8:return[3,10];case 9:return f=d.sent(),this.logger.log(c.a.Error,"Failed to start the transport '"+l.transport+"': "+f),n.connectionId=void 0,i.push(l.transport+" failed: "+f),"Connecting "!==this.connectionState?(p="Failed to select transport before stop() was called.",this.logger.log(c.a.Debug,p),[2,Promise.reject(new Error(p))]):[3,10];case 10:return a++,[3,3];case 11:return i.length>0?[2,Promise.reject(new Error("Unable to connect to the server with any of the available transports. "+i.join(" ")))]:[2,Promise.reject(new Error("None of the transports supported by the client are supported by the server."))]}})})},e.prototype.constructTransport=function(e){switch(e){case S.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new M(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket);case S.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new O(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource);case S.LongPolling:return new x(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1);default:throw new Error("Unknown transport: "+e+".")}},e.prototype.resolveTransport=function(e,t,n){var r=S[e.transport];if(null!=r){var o=e.transferFormats.map(function(e){return E[e]});if(function(e,t){return!e||0!=(t&e)}(t,r)){if(o.indexOf(n)>=0){if(r===S.WebSockets&&!this.options.WebSocket||r===S.ServerSentEvents&&!this.options.EventSource)throw this.logger.log(c.a.Debug,"Skipping transport '"+S[r]+"' because it is not supported in your environment.'"),new Error("'"+S[r]+"' is not supported in your environment.");return this.logger.log(c.a.Debug,"Selecting transport '"+S[r]+"'."),r}throw this.logger.log(c.a.Debug,"Skipping transport '"+S[r]+"' because it does not support the requested transfer format '"+E[n]+"'."),new Error("'"+S[r]+"' does not support "+E[n]+".")}throw this.logger.log(c.a.Debug,"Skipping transport '"+S[r]+"' because it was disabled by the client."),new Error("'"+S[r]+"' is disabled by the client.")}return this.logger.log(c.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),null},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){if(this.logger.log(c.a.Debug,"HttpConnection.stopConnection("+e+") called while in state "+this.connectionState+"."),this.transport=void 0,e=this.stopError||e,this.stopError=void 0,"Disconnected"!==this.connectionState)if("Connecting "!==this.connectionState){if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(c.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(c.a.Information,"Connection disconnected."),this.connectionId=void 0,this.connectionState="Disconnected",this.onclose&&this.connectionStarted){this.connectionStarted=!1;try{this.onclose(e)}catch(t){this.logger.log(c.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(c.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection hasn't yet left the in the connecting state.");else this.logger.log(c.a.Debug,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is already in the disconnected state.")},e.prototype.resolveUrl=function(e){if(0===e.lastIndexOf("https://",0)||0===e.lastIndexOf("http://",0))return e;if(!g.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(c.a.Information,"Normalizing '"+e+"' to '"+t.href+"'."),t.href},e.prototype.resolveNegotiateUrl=function(e){var t=e.indexOf("?"),n=e.substring(0,-1===t?e.length:t);return"/"!==n[n.length-1]&&(n+="/"),n+="negotiate",n+=-1===t?"":e.substring(t)},e}();var W=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new q,this.transportResult=new q,this.sendLoop().then(function(){},function(e){})}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult.promise},e.prototype.stop=function(){this.executing=!1,this.sendBufferedData.resolve()},e.prototype.bufferData=function(e){if(this.buffer.length&&typeof this.buffer[0]!=typeof e)throw new Error("Expected data to be of type "+typeof this.buffer+" but was of type "+typeof e);this.buffer.push(e),this.sendBufferedData.resolve()},e.prototype.sendLoop=function(){return j(this,void 0,void 0,function(){var t,n,r;return B(this,function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return[3,6];this.sendBufferedData=new q,t=this.transportResult,this.transportResult=new q,n="string"==typeof this.buffer[0]?this.buffer.join(""):e.concatBuffers(this.buffer),this.buffer.length=0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,this.transport.send(n)];case 3:return o.sent(),t.resolve(),[3,5];case 4:return r=o.sent(),t.reject(r),[3,5];case 5:return[3,0];case 6:return[2]}})})},e.concatBuffers=function(e){for(var t=e.map(function(e){return e.byteLength}).reduce(function(e,t){return e+t}),n=new Uint8Array(t),r=0,o=0,i=e;o<i.length;o++){var s=i[o];n.set(new Uint8Array(s),r),r+=s.byteLength}return n},e}(),q=function(){function e(){var e=this;this.promise=new Promise(function(t,n){var r;return r=[t,n],e.resolver=r[0],e.rejecter=r[1],r})}return e.prototype.resolve=function(){this.resolver()},e.prototype.reject=function(e){this.rejecter(e)},e}(),z=n(9),Y=n(11),J="json",K=function(){function e(){this.name=J,this.version=1,this.transferFormat=E.Text}return e.prototype.parseMessages=function(e,t){if("string"!=typeof e)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];null===t&&(t=z.a.instance);for(var n=[],r=0,i=Y.a.parse(e);r<i.length;r++){var s=i[r],a=JSON.parse(s);if("number"!=typeof a.type)throw new Error("Invalid payload.");switch(a.type){case o.Invocation:this.isInvocationMessage(a);break;case o.StreamItem:this.isStreamItemMessage(a);break;case o.Completion:this.isCompletionMessage(a);break;case o.Ping:case o.Close:break;default:t.log(c.a.Information,"Unknown message type '"+a.type+"' ignored.");continue}n.push(a)}return n},e.prototype.writeMessage=function(e){return Y.a.write(JSON.stringify(e))},e.prototype.isInvocationMessage=function(e){this.assertNotEmptyString(e.target,"Invalid payload for Invocation message."),void 0!==e.invocationId&&this.assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")},e.prototype.isStreamItemMessage=function(e){if(this.assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),void 0===e.item)throw new Error("Invalid payload for StreamItem message.")},e.prototype.isCompletionMessage=function(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this.assertNotEmptyString(e.error,"Invalid payload for Completion message."),this.assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")},e.prototype.assertNotEmptyString=function(e,t){if("string"!=typeof e||""===e)throw new Error(t)},e}(),X=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},G={trace:c.a.Trace,debug:c.a.Debug,info:c.a.Information,information:c.a.Information,warn:c.a.Warning,warning:c.a.Warning,error:c.a.Error,critical:c.a.Critical,none:c.a.None};var V=function(){function e(){}return e.prototype.configureLogging=function(e){if(g.a.isRequired(e,"logging"),void 0!==e.log)this.logger=e;else if("string"==typeof e){var t=function(e){var t=G[e.toLowerCase()];if(void 0!==t)return t;throw new Error("Unknown log level: "+e)}(e);this.logger=new g.b(t)}else this.logger=new g.b(e);return this},e.prototype.withUrl=function(e,t){return g.a.isRequired(e,"url"),this.url=e,this.httpConnectionOptions=X({},this.httpConnectionOptions,"object"==typeof t?t:{transport:t}),this},e.prototype.withHubProtocol=function(e){return g.a.isRequired(e,"protocol"),this.protocol=e,this},e.prototype.withAutomaticReconnect=function(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new I(e):this.reconnectPolicy=e:this.reconnectPolicy=new I,this},e.prototype.build=function(){var e=this.httpConnectionOptions||{};if(void 0===e.logger&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");var t=new F(this.url,e);return C.create(t,this.logger||z.a.instance,this.protocol||new K,this.reconnectPolicy)},e}();n.d(t,"VERSION",function(){return Q}),n.d(t,"AbortError",function(){return i.a}),n.d(t,"HttpError",function(){return i.b}),n.d(t,"TimeoutError",function(){return i.c}),n.d(t,"HttpClient",function(){return s.a}),n.d(t,"HttpResponse",function(){return s.b}),n.d(t,"DefaultHttpClient",function(){return f}),n.d(t,"HubConnection",function(){return C}),n.d(t,"HubConnectionState",function(){return d}),n.d(t,"HubConnectionBuilder",function(){return V}),n.d(t,"MessageType",function(){return o}),n.d(t,"LogLevel",function(){return c.a}),n.d(t,"HttpTransportType",function(){return S}),n.d(t,"TransferFormat",function(){return E}),n.d(t,"NullLogger",function(){return z.a}),n.d(t,"JsonHubProtocol",function(){return K}),n.d(t,"Subject",function(){return y});var Q="0.0.0-DEV_BUILD"}]); \ No newline at end of file +function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var i=n(30),a=Object.prototype.hasOwnProperty,s=Array.prototype.slice,u="foo"===function(){}.name;function c(e){return Object.prototype.toString.call(e)}function l(e){return!o(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var f=e.exports=v,h=/\s*function\s+([^\(\s]*)\s*/;function p(e){if(i.isFunction(e)){if(u)return e.name;var t=e.toString().match(h);return t&&t[1]}}function d(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function g(e){if(u||!i.isFunction(e))return i.inspect(e);var t=p(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,n,r,o){throw new f.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function v(e,t){e||y(e,!0,t,"==",f.ok)}function m(e,t,n,a){if(e===t)return!0;if(o(e)&&o(t))return 0===r(e,t);if(i.isDate(e)&&i.isDate(t))return e.getTime()===t.getTime();if(i.isRegExp(e)&&i.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&c(e)===c(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===r(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var u=(a=a||{actual:[],expected:[]}).actual.indexOf(e);return-1!==u&&u===a.expected.indexOf(t)||(a.actual.push(e),a.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(i.isPrimitive(e)||i.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=b(e),a=b(t);if(o&&!a||!o&&a)return!1;if(o)return e=s.call(e),t=s.call(t),m(e,t,n);var u,c,l=S(e),f=S(t);if(l.length!==f.length)return!1;for(l.sort(),f.sort(),c=l.length-1;c>=0;c--)if(l[c]!==f[c])return!1;for(c=l.length-1;c>=0;c--)if(u=l[c],!m(e[u],t[u],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&y(o,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&o&&!n;if((!e&&i.isError(o)&&a&&w(o,n)||s)&&y(o,n,"Got unwanted exception"+r),e&&o&&n&&!w(o,n)||!e&&o)throw o}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g((t=this).actual),128)+" "+t.operator+" "+d(g(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=p(n),a=o.indexOf("\n"+i);if(a>=0){var s=o.indexOf("\n",a+1);o=o.substring(s+1)}this.stack=o}}},i.inherits(f.AssertionError,Error),f.fail=y,f.ok=v,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){m(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){m(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){m(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){m(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){E(!0,e,t,n)},f.doesNotThrow=function(e,t,n){E(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var S=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(5))},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){},function(e,t,n){"use strict";var r=n(6).Buffer,o=n(53);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,o,i=r.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,n=i,o=s,t.copy(n,o),s+=a.data.length,a=a.next;return i},e}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var e=o.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(55),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(5))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,u=1,c={},l=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){i.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(o=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):r=function(e){setTimeout(d,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var o={callback:e,args:t};return c[u]=o,r(u),u++},h.clearImmediate=p}function p(e){delete c[e]}function d(e){if(l)setTimeout(d,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}(t)}finally{p(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(5),n(14))},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(5))},function(e,t,n){"use strict";e.exports=i;var r=n(39),o=n(15);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(7),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){"use strict";var r=n(32).Transform,o=n(7),i=n(17);function a(e){(e=e||{}).objectMode=!0,e.highWaterMark=16,r.call(this,e),this._msgpack=e.msgpack}function s(e){if(!(this instanceof s))return(e=e||{}).msgpack=this,new s(e);a.call(this,e),this._wrap="wrap"in e&&e.wrap}function u(e){if(!(this instanceof u))return(e=e||{}).msgpack=this,new u(e);a.call(this,e),this._chunks=i(),this._wrap="wrap"in e&&e.wrap}o(a,r),o(s,a),s.prototype._transform=function(e,t,n){var r=null;try{r=this._msgpack.encode(this._wrap?e.value:e).slice(0)}catch(e){return this.emit("error",e),n()}this.push(r),n()},o(u,a),u.prototype._transform=function(e,t,n){e&&this._chunks.append(e);try{var r=this._msgpack.decode(this._chunks);this._wrap&&(r={value:r}),this.push(r)}catch(e){return void(e instanceof this._msgpack.IncompleteBufferError?n():this.emit("error",e))}this._chunks.length>0?this._transform(null,t,n):n()},e.exports.decoder=u,e.exports.encoder=s},function(e,t,n){"use strict";var r=n(17);function o(e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=e||"unable to decode"}n(30).inherits(o,Error),e.exports=function(e){return function(e){e instanceof r||(e=r().append(e));var t=i(e);if(t)return e.consume(t.bytesConsumed),t.value;throw new o};function t(e,t,n){return t>=n+e}function n(e,t){return{value:e,bytesConsumed:t}}function i(e,r){r=void 0===r?0:r;var o=e.length-r;if(o<=0)return null;var i,l,f,h=e.readUInt8(r),p=0;if(!function(e,t){var n=function(e){switch(e){case 196:return 2;case 197:return 3;case 198:return 5;case 199:return 3;case 200:return 4;case 201:return 6;case 202:return 5;case 203:return 9;case 204:return 2;case 205:return 3;case 206:return 5;case 207:return 9;case 208:return 2;case 209:return 3;case 210:return 5;case 211:return 9;case 212:return 3;case 213:return 4;case 214:return 6;case 215:return 10;case 216:return 18;case 217:return 2;case 218:return 3;case 219:return 5;case 222:return 3;default:return-1}}(e);return!(-1!==n&&t<n)}(h,o))return null;switch(h){case 192:return n(null,1);case 194:return n(!1,1);case 195:return n(!0,1);case 204:return n(p=e.readUInt8(r+1),2);case 205:return n(p=e.readUInt16BE(r+1),3);case 206:return n(p=e.readUInt32BE(r+1),5);case 207:for(f=7;f>=0;f--)p+=e.readUInt8(r+f+1)*Math.pow(2,8*(7-f));return n(p,9);case 208:return n(p=e.readInt8(r+1),2);case 209:return n(p=e.readInt16BE(r+1),3);case 210:return n(p=e.readInt32BE(r+1),5);case 211:return n(p=function(e,t){var n=128==(128&e[t]);if(n)for(var r=1,o=t+7;o>=t;o--){var i=(255^e[o])+r;e[o]=255&i,r=i>>8}var a=e.readUInt32BE(t+0),s=e.readUInt32BE(t+4);return(4294967296*a+s)*(n?-1:1)}(e.slice(r+1,r+9),0),9);case 202:return n(p=e.readFloatBE(r+1),5);case 203:return n(p=e.readDoubleBE(r+1),9);case 217:return t(i=e.readUInt8(r+1),o,2)?n(p=e.toString("utf8",r+2,r+2+i),2+i):null;case 218:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.toString("utf8",r+3,r+3+i),3+i):null;case 219:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.toString("utf8",r+5,r+5+i),5+i):null;case 196:return t(i=e.readUInt8(r+1),o,2)?n(p=e.slice(r+2,r+2+i),2+i):null;case 197:return t(i=e.readUInt16BE(r+1),o,3)?n(p=e.slice(r+3,r+3+i),3+i):null;case 198:return t(i=e.readUInt32BE(r+1),o,5)?n(p=e.slice(r+5,r+5+i),5+i):null;case 220:return o<3?null:(i=e.readUInt16BE(r+1),a(e,r,i,3));case 221:return o<5?null:(i=e.readUInt32BE(r+1),a(e,r,i,5));case 222:return i=e.readUInt16BE(r+1),s(e,r,i,3);case 223:return i=e.readUInt32BE(r+1),s(e,r,i,5);case 212:return u(e,r,1);case 213:return u(e,r,2);case 214:return u(e,r,4);case 215:return u(e,r,8);case 216:return u(e,r,16);case 199:return i=e.readUInt8(r+1),l=e.readUInt8(r+2),t(i,o,3)?c(e,r,l,i,3):null;case 200:return i=e.readUInt16BE(r+1),l=e.readUInt8(r+3),t(i,o,4)?c(e,r,l,i,4):null;case 201:return i=e.readUInt32BE(r+1),l=e.readUInt8(r+5),t(i,o,6)?c(e,r,l,i,6):null}if(144==(240&h))return a(e,r,i=15&h,1);if(128==(240&h))return s(e,r,i=15&h,1);if(160==(224&h))return t(i=31&h,o,1)?n(p=e.toString("utf8",r+1,r+i+1),i+1):null;if(h>=224)return n(p=h-256,1);if(h<128)return n(h,1);throw new Error("not implemented yet")}function a(e,t,r,o){var a,s=[],u=0;for(t+=o,a=0;a<r;a++){var c=i(e,t);if(!c)return null;s.push(c.value),t+=c.bytesConsumed,u+=c.bytesConsumed}return n(s,o+u)}function s(e,t,r,o){var a,s={},u=0;for(t+=o,a=0;a<r;a++){var c=i(e,t);if(!c)return null;var l=i(e,t+=c.bytesConsumed);if(!l)return null;s[c.value]=l.value,t+=l.bytesConsumed,u+=c.bytesConsumed+l.bytesConsumed}return n(s,o+u)}function u(e,t,n){var r=e.readInt8(t+1);return c(e,t,r,n,2)}function c(t,r,o,i,a){var s,u;if(r+=a,o<0)switch(o){case-1:return function(e,t,r){var o,i=0;switch(t){case 4:o=e.readUInt32BE(0);break;case 8:var a=e.readUInt32BE(0),s=e.readUInt32BE(4);i=a/4,o=(3&a)*Math.pow(2,32)+s;break;case 12:throw new Error("timestamp 96 is not yet implemented")}var u=1e3*o+Math.round(i/1e6);return n(new Date(u),t+r)}(u=t.slice(r,r+i),i,a)}for(s=0;s<e.length;s++){if(o===e[s].type)return u=t.slice(r,r+i),n(e[s].decode(u),a+i)}throw new Error("unable to find ext type "+o)}},e.exports.IncompleteBufferError=o},function(e,t,n){"use strict";var r=n(6).Buffer,o=n(17);function i(e,t){var n,o=!0;return Math.fround&&(o=Math.fround(e)!==e),t&&(o=!0),o?((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)):((n=r.allocUnsafe(5))[0]=202,n.writeFloatBE(e,1)),n}e.exports=function(e,t,n,a){function s(u,c){var l,f,h;if(void 0===u)throw new Error("undefined is not encodable in msgpack!");if((h=u)!=h&&"number"==typeof h)throw new Error("NaN is not encodable in msgpack!");if(null===u)(l=r.allocUnsafe(1))[0]=192;else if(!0===u)(l=r.allocUnsafe(1))[0]=195;else if(!1===u)(l=r.allocUnsafe(1))[0]=194;else if("string"==typeof u)(f=r.byteLength(u))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(u,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(u,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(u,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,1),l.write(u,5));else if(u&&(u.readUInt32LE||u instanceof Uint8Array))u instanceof Uint8Array&&(u=r.from(u)),u.length<=255?((l=r.allocUnsafe(2))[0]=196,l[1]=u.length):u.length<=65535?((l=r.allocUnsafe(3))[0]=197,l.writeUInt16BE(u.length,1)):((l=r.allocUnsafe(5))[0]=198,l.writeUInt32BE(u.length,1)),l=o([l,u]);else if(Array.isArray(u))u.length<16?(l=r.allocUnsafe(1))[0]=144|u.length:u.length<65536?((l=r.allocUnsafe(3))[0]=220,l.writeUInt16BE(u.length,1)):((l=r.allocUnsafe(5))[0]=221,l.writeUInt32BE(u.length,1)),l=u.reduce(function(e,t){return e.append(s(t,!0)),e},o().append(l));else{if(!a&&"function"==typeof u.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=r.allocUnsafe(10))[0]=215,t[1]=-1;var s=4*a,u=i/Math.pow(2,32),c=s+u&4294967295,l=4294967295&i;t.writeInt32BE(c,2),t.writeInt32BE(l,6)}else(t=r.allocUnsafe(6))[0]=214,t[1]=-1,t.writeUInt32BE(Math.floor(n/1e3),2);return o().append(t)}(u);if("object"==typeof u)l=function(t){var n,i,a=-1,s=[];for(n=0;n<e.length;n++)if(e[n].check(t)){i=e[n].encode(t);break}if(!i)return null;1==(a=i.length-1)?s.push(212):2===a?s.push(213):4===a?s.push(214):8===a?s.push(215):16===a?s.push(216):a<256?(s.push(199),s.push(a)):a<65536?(s.push(200),s.push(a>>8),s.push(255&a)):(s.push(201),s.push(a>>24),s.push(a>>16&255),s.push(a>>8&255),s.push(255&a));return o().append(r.from(s)).append(i)}(u)||function(e){var t,n,i=[],a=0;for(t in e)e.hasOwnProperty(t)&&void 0!==e[t]&&"function"!=typeof e[t]&&(++a,i.push(s(t,!0)),i.push(s(e[t],!0)));a<16?(n=r.allocUnsafe(1))[0]=128|a:a<65535?((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1)):((n=r.allocUnsafe(5))[0]=223,n.writeUInt32BE(a,1));return i.unshift(n),i.reduce(function(e,t){return e.append(t)},o())}(u);else if("number"==typeof u){if(function(e){return e%1!=0}(u))return i(u,t);if(u>=0)if(u<128)(l=r.allocUnsafe(1))[0]=u;else if(u<256)(l=r.allocUnsafe(2))[0]=204,l[1]=u;else if(u<65536)(l=r.allocUnsafe(3))[0]=205,l.writeUInt16BE(u,1);else if(u<=4294967295)(l=r.allocUnsafe(5))[0]=206,l.writeUInt32BE(u,1);else{if(!(u<=9007199254740991))return i(u,!0);(l=r.allocUnsafe(9))[0]=207,function(e,t){for(var n=7;n>=0;n--)e[n+1]=255&t,t/=256}(l,u)}else if(u>=-32)(l=r.allocUnsafe(1))[0]=256+u;else if(u>=-128)(l=r.allocUnsafe(2))[0]=208,l.writeInt8(u,1);else if(u>=-32768)(l=r.allocUnsafe(3))[0]=209,l.writeInt16BE(u,1);else if(u>-214748365)(l=r.allocUnsafe(5))[0]=210,l.writeInt32BE(u,1);else{if(!(u>=-9007199254740991))return i(u,!0);(l=r.allocUnsafe(9))[0]=211,function(e,t,n){var r=n<0;r&&(n=Math.abs(n));var o=n%4294967296,i=n/4294967296;if(e.writeUInt32BE(Math.floor(i),t+0),e.writeUInt32BE(o,t+4),r)for(var a=1,s=t+7;s>=t;s--){var u=(255^e[s])+a;e[s]=255&u,a=u>>8}}(l,1,u)}}}if(!l)throw new Error("not implemented yet");return c?l:l.slice()}return s}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.dialog=e}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.hide=function(){this.removeClasses(),this.dialog.classList.add(e.HideClassName)},e.prototype.failed=function(){this.removeClasses(),this.dialog.classList.add(e.FailedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(40),o=function(){function e(e){this.document=e,this.addedToDom=!1,this.modal=this.document.createElement("div"),this.modal.id=r.AutoReconnectCircuitHandler.DialogId;this.modal.style.cssText=["position: fixed","top: 0","right: 0","bottom: 0","left: 0","z-index: 1000","display: none","overflow: hidden","background-color: #fff","opacity: 0.8","text-align: center","font-weight: bold"].join(";"),this.modal.innerHTML='<h5 style="margin-top: 20px"></h5><button style="margin:5px auto 5px">Retry?</button>',this.message=this.modal.querySelector("h5"),this.button=this.modal.querySelector("button"),this.button.addEventListener("click",function(){return window.Blazor.reconnect()})}return e.prototype.show=function(){this.addedToDom||(this.addedToDom=!0,this.document.body.appendChild(this.modal)),this.modal.style.display="block",this.button.style.display="none",this.message.textContent="Attempting to reconnect to the server..."},e.prototype.hide=function(){this.modal.style.display="none"},e.prototype.failed=function(){this.button.style.display="block",this.message.textContent="Failed to reconnect to the server."},e}();t.DefaultReconnectDisplay=o},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),a=n(64),s=n(19),u=function(){function e(e,t){this.nextBatchId=2,this.browserRendererId=e,this.logger=t}return e.getOrCreateQueue=function(t,n){var r=this.renderQueues.get(t);if(r)return r;var o=new e(t,n);return this.renderQueues.set(t,o),o},e.prototype.processBatch=function(e,t,n){if(e<this.nextBatchId)this.logger.log(s.LogLevel.Debug,"Batch "+e+" already processed. Waiting for batch "+this.nextBatchId+".");else if(e>this.nextBatchId)this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed.");else try{this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),this.completeBatch(n,e)}catch(t){throw this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,t.toString()),t}},e.prototype.getLastBatchid=function(){return this.nextBatchId-1},e.prototype.completeBatch=function(e,t){return r(this,void 0,void 0,function(){return o(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e.send("OnRenderCompleted",t,null)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.logger.log(s.LogLevel.Warning,"Failed to deliver completion notification for render '"+t+"'."),[3,3];case 3:return[2]}})})},e.renderQueues=new Map,e}();t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(65),o=function(){function e(e){this.batchData=e;var t=new u(e);this.arrayRangeReader=new c(e),this.arraySegmentReader=new l(e),this.diffReader=new i(e),this.editReader=new a(e,t),this.frameReader=new s(e,t)}return e.prototype.updatedComponents=function(){return f(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return f(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return f(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return f(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+16*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+4*t;return f(this.batchData,n)},e}();t.OutOfProcessRenderBatch=o;var i=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return f(this.batchDataUint8,e)},e.prototype.edits=function(e){return e+4},e.prototype.editsEntry=function(e,t){return e+16*t},e}(),a=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.editType=function(e){return f(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return f(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return f(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=f(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),s=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return f(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return f(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return f(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=f(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=f(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return f(this.batchDataUint8,e+12)},e}(),u=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=f(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t,n=f(this.batchDataUint8,this.stringTableStartIndex+4*e),o=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<<r,i<128)break;r+=7}return n}(this.batchDataUint8,n),i=n+((t=o)<128?1:t<16384?2:t<2097152?3:4),a=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,o);return r.decodeUtf8(a)},e}(),c=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return f(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return f(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}();function f(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof TextDecoder?new TextDecoder("utf-8"):null;t.decodeUtf8=r?r.decode.bind(r):function(e){var t=0,n=e.length,r=[],o=[];for(;t<n;){var i=e[t++];if(0===i)break;if(0==(128&i))r.push(i);else if(192==(224&i)){var a=63&e[t++];r.push((31&i)<<6|a)}else if(224==(240&i)){var a=63&e[t++],s=63&e[t++];r.push((31&i)<<12|a<<6|s)}else if(240==(248&i)){var a=63&e[t++],s=63&e[t++],u=63&e[t++],c=(7&i)<<18|a<<12|s<<6|u;c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c)}r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(19),o=function(){function e(){}return e.prototype.log=function(e,t){},e.instance=new e,e}();t.NullLogger=o;var i=function(){function e(e){this.minimumLogLevel=e}return e.prototype.log=function(e,t){if(e>=this.minimumLogLevel)switch(e){case r.LogLevel.Critical:case r.LogLevel.Error:console.error("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Warning:console.warn("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;case r.LogLevel.Information:console.info("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t);break;default:console.log("["+(new Date).toISOString()+"] "+r.LogLevel[e]+": "+t)}},e}();t.ConsoleLogger=i},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(t,"__esModule",{value:!0});var s=n(16),u=n(68),c=function(){function e(e,t){this.circuitId=e,this.components=t}return e.prototype.reconnect=function(e){return e.invoke("ConnectCircuit",this.circuitId)},e}();function l(e){if(e.nodeType===Node.COMMENT_NODE&&e.textContent){var t=/\W+M.A.C.Component:[^{]*(.*)$/.exec(e.textContent),n=t&&t[1];if(n)try{var r=JSON.parse(n),o=r.componentId,i=r.circuitId,a=r.rendererId;if(!!o&&!!i&&!!a)return{node:e,circuitId:i,rendererId:Number.parseInt(a),componentId:Number.parseInt(o)};throw new Error("Found malformed start component comment at "+e.textContent)}catch(t){throw new Error("Found malformed start component comment at "+e.textContent)}}}function f(e,t,n,r){for(var o=n;o<r;o++){var i=t[o];if(i.nodeType===Node.COMMENT_NODE&&i.textContent){var a=/\W+M.A.C.Component:\W+(\d+)\W+$/.exec(i.textContent),s=a&&a[1];if(s)try{var u=Number.parseInt(s);if(u===e.componentId)return{componentId:u,node:i,index:o};throw new Error("Found malformed end component comment at "+i.textContent)}catch(e){throw new Error("Found malformed end component comment at "+i.textContent)}}}throw new Error("End component comment not found for "+e.node)}t.CircuitDescriptor=c,t.discoverPrerenderedCircuits=function(e){for(var t,n,r=function e(t){if(!t.hasChildNodes())return[];for(var n=[],r=t.childNodes,o=0,i=r.length;o<i;){var a=r[o],s=l(a);if(s){var u=f(s,r,o+1,i);n.push({start:s,end:u}),o=u.index+1}else{o++;for(var c=e(a),h=0;h<c.length;h++){var p=c[h];n.push(p)}}}return n}(e),o=new Map,s=0;s<r.length;s++){var h=r[s],p=o.get(h.start.circuitId);p||(p=[],o.set(h.start.circuitId,p));var d=new u.ComponentDescriptor(h.start.componentId,h.start.circuitId,h.start.rendererId,h);p.push(d)}var g=[];try{for(var y=i(o),v=y.next();!v.done;v=y.next()){var m=a(v.value,2),b=m[0],w=m[1];g.push(new c(b,w))}}catch(e){t={error:e}}finally{try{v&&!v.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}return g},t.startCircuit=function(e){return r(this,void 0,void 0,function(){var t;return o(this,function(n){switch(n.label){case 0:return[4,e.invoke("StartCircuit",s.internalFunctions.getLocationHref(),s.internalFunctions.getBaseURI())];case 1:return(t=n.sent())?[2,new c(t,[])]:[2,void 0]}})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(8),o=n(9),i=function(){function e(e,t,n,r){this.componentId=e,this.circuitId=t,this.rendererId=n,this.registrationTags=r}return e.prototype.initialize=function(){var e={start:this.registrationTags.start.node,end:this.registrationTags.end.node},t=o.toLogicalRootCommentElement(e.start,e.end);r.attachRootComponentToLogicalElement(this.rendererId,t,this.componentId)},e}();t.ComponentDescriptor=i},function(e,t,n){"use strict";n.r(t);var r=n(11),o=n(20),i=n(2),a=function(){function e(){}return e.write=function(e){var t=e.byteLength||e.length,n=[];do{var r=127&t;(t>>=7)>0&&(r|=128),n.push(r)}while(t>0);t=e.byteLength||e.length;var o=new Uint8Array(n.length+t);return o.set(n,0),o.set(e,n.length),o.buffer},e.parse=function(e){for(var t=[],n=new Uint8Array(e),r=[0,7,14,21,28],o=0;o<e.byteLength;){var i=0,a=0,s=void 0;do{a|=(127&(s=n[o+i]))<<r[i],i++}while(i<Math.min(5,e.byteLength-o)&&0!=(128&s));if(0!=(128&s)&&i<5)throw new Error("Cannot read message size.");if(5===i&&s>7)throw new Error("Messages bigger than 2GB are not supported.");if(!(n.byteLength>=o+i+a))throw new Error("Incomplete message.");t.push(n.slice?n.slice(o+i,o+i+a):n.subarray(o+i,o+i+a)),o=o+i+a}return t},e}();var s=new Uint8Array([145,i.MessageType.Ping]),u=function(){function e(){this.name="messagepack",this.version=1,this.transferFormat=i.TransferFormat.Binary}return e.prototype.parseMessages=function(e,t){if(!(e instanceof r.Buffer||(n=e,n&&"undefined"!=typeof ArrayBuffer&&(n instanceof ArrayBuffer||n.constructor&&"ArrayBuffer"===n.constructor.name))))throw new Error("Invalid input for MessagePack hub protocol. Expected an ArrayBuffer or Buffer.");var n;null===t&&(t=i.NullLogger.instance);for(var o=[],s=0,u=a.parse(e);s<u.length;s++){var c=u[s],l=this.parseMessage(c,t);l&&o.push(l)}return o},e.prototype.writeMessage=function(e){switch(e.type){case i.MessageType.Invocation:return this.writeInvocation(e);case i.MessageType.StreamInvocation:return this.writeStreamInvocation(e);case i.MessageType.StreamItem:case i.MessageType.Completion:throw new Error("Writing messages of type '"+e.type+"' is not supported.");case i.MessageType.Ping:return a.write(s);default:throw new Error("Invalid message type.")}},e.prototype.parseMessage=function(e,t){if(0===e.length)throw new Error("Invalid payload.");var n=o().decode(r.Buffer.from(e));if(0===n.length||!(n instanceof Array))throw new Error("Invalid payload.");var a=n[0];switch(a){case i.MessageType.Invocation:return this.createInvocationMessage(this.readHeaders(n),n);case i.MessageType.StreamItem:return this.createStreamItemMessage(this.readHeaders(n),n);case i.MessageType.Completion:return this.createCompletionMessage(this.readHeaders(n),n);case i.MessageType.Ping:return this.createPingMessage(n);case i.MessageType.Close:return this.createCloseMessage(n);default:return t.log(i.LogLevel.Information,"Unknown message type '"+a+"' ignored."),null}},e.prototype.createCloseMessage=function(e){if(e.length<2)throw new Error("Invalid payload for Close message.");return{error:e[1],type:i.MessageType.Close}},e.prototype.createPingMessage=function(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:i.MessageType.Ping}},e.prototype.createInvocationMessage=function(e,t){if(t.length<5)throw new Error("Invalid payload for Invocation message.");var n=t[2];return n?{arguments:t[4],headers:e,invocationId:n,target:t[3],type:i.MessageType.Invocation}:{arguments:t[4],headers:e,target:t[3],type:i.MessageType.Invocation}},e.prototype.createStreamItemMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for StreamItem message.");return{headers:e,invocationId:t[2],item:t[3],type:i.MessageType.StreamItem}},e.prototype.createCompletionMessage=function(e,t){if(t.length<4)throw new Error("Invalid payload for Completion message.");var n,r,o=t[3];if(2!==o&&t.length<5)throw new Error("Invalid payload for Completion message.");switch(o){case 1:n=t[4];break;case 3:r=t[4]}return{error:n,headers:e,invocationId:t[2],result:r,type:i.MessageType.Completion}},e.prototype.writeInvocation=function(e){var t=o().encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]);return a.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t=o().encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]);return a.write(t.slice())},e.prototype.readHeaders=function(e){var t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t},e}();n.d(t,"VERSION",function(){return c}),n.d(t,"MessagePackHubProtocol",function(){return u});var c="1.1.0"}]); \ No newline at end of file diff --git a/src/Components/Browser.JS/dist/Release/blazor.webassembly.js b/src/Components/Browser.JS/dist/Release/blazor.webassembly.js index d589ffa0774aefc3e54214df11990bdb5aa35d88..61e4479ccf903b8c0726cf0d74499d4cb5b8cca4 100644 --- a/src/Components/Browser.JS/dist/Release/blazor.webassembly.js +++ b/src/Components/Browser.JS/dist/Release/blazor.webassembly.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=50)}([,,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(30),o=n(17),a={};function i(e,t,n){var o=a[e];o||(o=a[e]=new r.BrowserRenderer(e)),o.attachRootComponentToLogicalElement(n,t)}t.attachRootComponentToLogicalElement=i,t.attachRootComponentToElement=function(e,t,n){var r=document.querySelector(t);if(!r)throw new Error("Could not find any element matching selector '"+t+"'.");i(e,o.toLogicalElement(r,!0),n)},t.renderBatch=function(e,t){var n=a[e];if(!n)throw new Error("There is no browser renderer with ID "+e+".");for(var r=t.arrayRangeReader,o=t.updatedComponents(),i=r.values(o),u=r.count(o),l=t.referenceFrames(),s=r.values(l),c=t.diffReader,f=0;f<u;f++){var d=t.updatedComponentsEntry(i,f),p=c.componentId(d),m=c.edits(d);n.updateComponent(t,p,m,s)}var h=t.disposedComponentIds(),y=r.values(h),v=r.count(h);for(f=0;f<v;f++)p=t.disposedComponentIdsEntry(y,f),n.disposeComponent(p);var g=t.disposedEventHandlerIds(),b=r.values(g),w=r.count(g);for(f=0;f<w;f++){var E=t.disposedEventHandlerIdsEntry(b,f);n.disposeEventHandler(E)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p("_blazorLogicalChildren"),o=p("_blazorLogicalParent"),a=p("_blazorLogicalEnd");function i(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return e[r]=[],e}function u(e,t,n){var a=e;if(e instanceof Comment&&(s(a)&&s(a).length>0))throw new Error("Not implemented: inserting non-empty logical container");if(l(a))throw new Error("Not implemented: moving existing logical children");var i=s(t);if(n<i.length){var u=i[n];u.parentNode.insertBefore(e,u),i.splice(n,0,a)}else d(e,t),i.push(a);a[o]=t,r in a||(a[r]=[])}function l(e){return e[o]||null}function s(e){return e[r]}function c(e){if(e instanceof Element)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function f(e){var t=s(l(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function d(e,t){if(t instanceof Element)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error("Cannot append node because the parent is not a valid logical element. Parent: "+t);var n=f(t);n?n.parentNode.insertBefore(e,n):d(e,l(t))}}function p(e){return"function"==typeof Symbol?Symbol():e}t.toLogicalRootCommentElement=function(e,t){if(!e.parentNode)throw new Error("Comment not connected to the DOM "+e.textContent);var n=e.parentNode,r=i(n,!0),u=s(r);return Array.from(n.childNodes).forEach(function(e){return u.push(e)}),e[o]=r,e[a]=t,i(t,!0),i(e,!0)},t.toLogicalElement=i,t.createAndInsertLogicalContainer=function(e,t){var n=document.createComment("!");return u(n,e,t),n},t.insertLogicalChild=u,t.removeLogicalChild=function e(t,n){var r=s(t).splice(n,1)[0];if(r instanceof Comment)for(var o=s(r);o.length>0;)e(r,0);var a=r;a.parentNode.removeChild(a)},t.getLogicalParent=l,t.getLogicalSiblingEnd=function(e){return e[a]||null},t.getLogicalChild=function(e,t){return s(e)[t]},t.isSvgElement=function(e){return"http://www.w3.org/2000/svg"===c(e).namespaceURI},t.getLogicalChildrenArray=s,t.permuteLogicalChildren=function(e,t){var n=s(e);t.forEach(function(e){e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=function e(t){if(t instanceof Element)return t;var n=f(t);if(n)return n.previousSibling;var r=l(t);return r instanceof Element?r.lastChild:e(r)}(e.moveRangeStart)}),t.forEach(function(t){var r=t.moveToBeforeMarker=document.createComment("marker"),o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):d(r,e)}),t.forEach(function(e){for(var t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd,a=r;a;){var i=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=i}n.removeChild(t)}),t.forEach(function(e){n[e.toSiblingIndex]=e.moveRangeStart})},t.getClosestDomElement=c},,,function(e,t,n){"use strict";var r;!function(e){window.DotNet=e;var t=[],n={},r={},o=1,a=null;function i(e){t.push(e)}function u(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return s(e,t,null,n)}function l(e,t,n,r){var o=c();if(o.invokeDotNetFromJS){var a=JSON.stringify(r,y),i=o.invokeDotNetFromJS(e,t,n,a);return i?d(i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function s(e,t,r,a){var i=o++,u=new Promise(function(e,t){n[i]={resolve:e,reject:t}});try{var l=JSON.stringify(a,y);c().beginInvokeDotNetFromJS(i,e,t,r,l)}catch(e){f(i,!1,e)}return u}function c(){if(null!==a)return a;throw new Error("No .NET call dispatcher has been set.")}function f(e,t,r){if(!n.hasOwnProperty(e))throw new Error("There is no pending async call with ID "+e+".");var o=n[e];delete n[e],t?o.resolve(r):o.reject(r)}function d(e){return e?JSON.parse(e,function(e,n){return t.reduce(function(t,n){return n(e,t)},n)}):null}function p(e){return e instanceof Error?e.message+"\n"+e.stack:e?e.toString():"null"}function m(e){if(r.hasOwnProperty(e))return r[e];var t=window,n="window";if(e.split(".").forEach(function(e){if(!(e in t))throw new Error("Could not find '"+e+"' in '"+n+"'.");t=t[e],n+="."+e}),t instanceof Function)return t;throw new Error("The value '"+n+"' is not a function.")}e.attachDispatcher=function(e){a=e},e.attachReviver=i,e.invokeMethod=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return l(e,t,null,n)},e.invokeMethodAsync=u,e.jsCallDispatcher={findJSFunction:m,invokeJSFromDotNet:function(e,t){var n=m(e).apply(null,d(t));return null==n?null:JSON.stringify(n,y)},beginInvokeJSFromDotNet:function(e,t,n){var r=new Promise(function(e){e(m(t).apply(null,d(n)))});e&&r.then(function(t){return c().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!0,t],y))},function(t){return c().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!1,p(t)]))})},endInvokeDotNetFromJS:function(e,t,n){var r=t?n:new Error(n);f(parseInt(e),t,r)}};var h=function(){function e(e){this._id=e}return e.prototype.invokeMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return l(null,e,this._id,t)},e.prototype.invokeMethodAsync=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return s(null,e,this._id,t)},e.prototype.dispose=function(){u("Microsoft.JSInterop","DotNetDispatcher.ReleaseDotNetObject",this._id).catch(function(e){return console.error(e)})},e.prototype.serializeAsArg=function(){return{__dotNetObject:this._id}},e}();function y(e,t){return t instanceof h?t.serializeAsArg():t}i(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__dotNetObject")?new h(t.__dotNetObject):t})}(r||(r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPlatform=function(e){return t.platform=e,t.platform}},,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(20);var a,i=!1,u=!1,l=null;function s(e,t){var n=d(e);!t&&p(n)?c(n,!1):location.href=e}function c(e,t){history.pushState(null,"",e),f(t)}function f(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return l?[4,DotNet.invokeMethodAsync(l.assemblyName,l.functionName,location.href,e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}function d(e){return(a=a||document.createElement("a")).href=e,a.href}function p(e){var t,n=(t=document.baseURI).substr(0,t.lastIndexOf("/")+1);return e.startsWith(n)}t.internalFunctions={listenForNavigationEvents:function(e,t){if(u)return;l={assemblyName:e,functionName:t},u=!0,window.addEventListener("popstate",function(){return f(!1)})},enableNavigationInterception:function(){if(i)return;i=!0,document.addEventListener("click",function(e){if(0===e.button&&!function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)){var t=function e(t,n){return t?t.tagName===n?t:e(t.parentElement,n):null}(e.target,"A");if(t&&t.hasAttribute("href")){var n=t.getAttribute("target"),r=!n||"_self"===n;if(!r)return;var o=t.getAttribute("href"),a=d(o);p(a)&&(e.preventDefault(),c(a,!0))}}})},navigateTo:s,getBaseURI:function(){return document.baseURI},getLocationHref:function(){return location.href}},t.navigateTo=s},,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),o=n(29),a=n(16);window.Blazor={navigateTo:r.navigateTo,_internal:{attachRootComponentToElement:a.attachRootComponentToElement,http:o.internalFunctions,uriHelper:r.internalFunctions}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var a,i,u=n(21),l="Microsoft.AspNetCore.Blazor",s=l+".Http",c="WebAssemblyHttpMessageHandler";function f(e,t,n,r){a||(a=u.platform.findMethod(l,s,c,"ReceiveResponse")),u.platform.callMethod(a,null,[u.platform.toDotNetString(e.toString()),t,n,r])}t.internalFunctions={sendAsync:function(e,t,n){return r(this,void 0,void 0,function(){var r,a,d,p,m;return o(this,function(o){switch(o.label){case 0:d=JSON.parse(u.platform.toJavaScriptString(n)),p=Object.assign({credentials:(h=d.requestInit).credentials,method:h.method,headers:h.headers.map(function(e){return[e.name,e.value]})},d.requestInitOverrides),t&&(p.body=u.platform.toUint8Array(t)),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(d.requestUri,p)];case 2:return[4,(r=o.sent()).arrayBuffer()];case 3:return a=o.sent(),[3,5];case 4:return m=o.sent(),function(e,t){f(e,null,null,u.platform.toDotNetString(t))}(e,m.toString()),[2];case 5:return function(e,t,n){var r={statusCode:t.status,statusText:t.statusText,headers:[]};t.headers.forEach(function(e,t){r.headers.push({name:t,value:e})}),i||(i=u.platform.findMethod(l,s,c,"AllocateArray"));var o=u.platform.callMethod(i,null,[u.platform.toDotNetString(n.byteLength.toString())]);u.platform.toUint8Array(o).set(new Uint8Array(n)),f(e,u.platform.toDotNetString(JSON.stringify(r)),o,null)}(e,r,a),[2]}var h})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(31),o=n(32),a=n(17),i=n(34),u=document.createElement("template"),l=document.createElementNS("http://www.w3.org/2000/svg","g"),s={submit:!0},c={},f=function(){function e(e){var t=this;this.childComponentLocations={},this.browserRendererId=e,this.eventDelegator=new o.EventDelegator(function(e,n,r){!function(e,t,n,r){s[e.type]&&e.preventDefault();var o={browserRendererId:t,eventHandlerId:n,eventArgsType:r.type};DotNet.invokeMethodAsync("Microsoft.AspNetCore.Components.Browser","DispatchEvent",o,JSON.stringify(r.data))}(e,t.browserRendererId,n,r)})}return e.prototype.attachRootComponentToLogicalElement=function(e,t){this.attachComponentToElement(e,t),c[e]=t},e.prototype.updateComponent=function(e,t,n,r){var o=this.childComponentLocations[t];if(!o)throw new Error("No element is currently associated with component "+t);var i=c[t];if(i){var u=a.getLogicalSiblingEnd(i);delete c[t],u?function(e,t){var n=a.getLogicalParent(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");for(var r=a.getLogicalChildrenArray(n),o=r.indexOf(e)+1,i=r.indexOf(t),u=o;u<=i;u++)a.removeLogicalChild(n,o);e.textContent="!"}(i,u):function(e){var t;for(;t=e.firstChild;)e.removeChild(t)}(i)}var l=a.getClosestDomElement(o).ownerDocument,s=l&&l.activeElement;this.applyEdits(e,o,0,n,r),s instanceof HTMLElement&&l&&l.activeElement!==s&&s.focus()},e.prototype.disposeComponent=function(e){delete this.childComponentLocations[e]},e.prototype.disposeEventHandler=function(e){this.eventDelegator.removeListener(e)},e.prototype.attachComponentToElement=function(e,t){this.childComponentLocations[e]=t},e.prototype.applyEdits=function(e,t,n,o,i){for(var u,l=0,s=n,c=e.arraySegmentReader,f=e.editReader,d=e.frameReader,p=c.values(o),m=c.offset(o),h=m+c.count(o),y=m;y<h;y++){var v=e.diffReader.editsEntry(p,y),g=f.editType(v);switch(g){case r.EditType.prependFrame:var b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);this.insertFrame(e,t,s+E,i,w,b);break;case r.EditType.removeFrame:E=f.siblingIndex(v);a.removeLogicalChild(t,s+E);break;case r.EditType.setAttribute:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);if(!((S=a.getLogicalChild(t,s+E))instanceof Element))throw new Error("Cannot set attribute on non-element child");this.applyAttribute(e,S,w);break;case r.EditType.removeAttribute:var S;E=f.siblingIndex(v);if(!((S=a.getLogicalChild(t,s+E))instanceof HTMLElement))throw new Error("Cannot remove attribute from non-element child");var _=f.removedAttributeName(v);this.tryApplySpecialProperty(e,S,_,null)||S.removeAttribute(_);break;case r.EditType.updateText:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);var I=a.getLogicalChild(t,s+E);if(!(I instanceof Text))throw new Error("Cannot set text content on non-text child");I.textContent=d.textContent(w);break;case r.EditType.updateMarkup:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);a.removeLogicalChild(t,s+E),this.insertMarkup(e,t,s+E,w);break;case r.EditType.stepIn:E=f.siblingIndex(v);t=a.getLogicalChild(t,s+E),l++,s=0;break;case r.EditType.stepOut:t=a.getLogicalParent(t),s=0===--l?n:0;break;case r.EditType.permutationListEntry:(u=u||[]).push({fromSiblingIndex:s+f.siblingIndex(v),toSiblingIndex:s+f.moveToSiblingIndex(v)});break;case r.EditType.permutationListEnd:a.permuteLogicalChildren(t,u),u=void 0;break;default:throw new Error("Unknown edit type: "+g)}}},e.prototype.insertFrame=function(e,t,n,o,a,u){var l=e.frameReader,s=l.frameType(a);switch(s){case r.FrameType.element:return this.insertElement(e,t,n,o,a,u),1;case r.FrameType.text:return this.insertText(e,t,n,a),1;case r.FrameType.attribute:throw new Error("Attribute frames should only be present as leading children of element frames.");case r.FrameType.component:return this.insertComponent(e,t,n,a),1;case r.FrameType.region:return this.insertFrameRange(e,t,n,o,u+1,u+l.subtreeLength(a));case r.FrameType.elementReferenceCapture:if(t instanceof Element)return i.applyCaptureIdToElement(t,l.elementReferenceCaptureId(a)),0;throw new Error("Reference capture frames can only be children of element frames.");case r.FrameType.markup:return this.insertMarkup(e,t,n,a),1;default:throw new Error("Unknown frame type: "+s)}},e.prototype.insertElement=function(e,t,n,o,i,u){var l=e.frameReader,s=l.elementName(i),c="svg"===s||a.isSvgElement(t)?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s),f=a.toLogicalElement(c);a.insertLogicalChild(c,t,n);for(var d=u+l.subtreeLength(i),p=u+1;p<d;p++){var m=e.referenceFramesEntry(o,p);if(l.frameType(m)!==r.FrameType.attribute){this.insertFrameRange(e,f,0,o,p,d);break}this.applyAttribute(e,c,m)}},e.prototype.insertComponent=function(e,t,n,r){var o=a.createAndInsertLogicalContainer(t,n),i=e.frameReader.componentId(r);this.attachComponentToElement(i,o)},e.prototype.insertText=function(e,t,n,r){var o=e.frameReader.textContent(r),i=document.createTextNode(o);a.insertLogicalChild(i,t,n)},e.prototype.insertMarkup=function(e,t,n,r){for(var o,i=a.createAndInsertLogicalContainer(t,n),s=e.frameReader.markupContent(r),c=(o=s,a.isSvgElement(t)?(l.innerHTML=o||" ",l):(u.innerHTML=o||" ",u.content)),f=0;c.firstChild;)a.insertLogicalChild(c.firstChild,i,f++)},e.prototype.applyAttribute=function(e,t,n){var r=e.frameReader,o=r.attributeName(n),a=(this.browserRendererId,r.attributeEventHandlerId(n));if(a){var i=o.substring(0,2),u=o.substring(2);if("on"!==i||!u)throw new Error("Attribute has nonzero event handler ID, but attribute name '"+o+"' does not start with 'on'.");this.eventDelegator.setListener(t,u,a)}else this.tryApplySpecialProperty(e,t,o,n)||t.setAttribute(o,r.attributeValue(n))},e.prototype.tryApplySpecialProperty=function(e,t,n,r){switch(n){case"value":return this.tryApplyValueProperty(e,t,r);case"checked":return this.tryApplyCheckedProperty(e,t,r);default:return!1}},e.prototype.tryApplyValueProperty=function(e,t,n){var r=e.frameReader;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":var o=n?r.attributeValue(n):null;return t.value=o,"SELECT"===t.tagName&&(t._blazorSelectValue=o),!0;case"OPTION":(o=n?r.attributeValue(n):null)?t.setAttribute("value",o):t.removeAttribute("value");var a=t.parentElement;return a&&"_blazorSelectValue"in a&&a._blazorSelectValue===o&&(this.tryApplyValueProperty(e,a,n),delete a._blazorSelectValue),!0;default:return!1}},e.prototype.tryApplyCheckedProperty=function(e,t,n){if("INPUT"===t.tagName){var r=n?e.frameReader.attributeValue(n):null;return t.checked=null!==r,!0}return!1},e.prototype.insertFrameRange=function(e,t,n,r,o,a){for(var i=n,u=o;u<a;u++){var l=e.referenceFramesEntry(r,u);n+=this.insertFrame(e,t,n,r,l,u),u+=d(e,l)}return n-i},e}();function d(e,t){var n=e.frameReader;switch(n.frameType(t)){case r.FrameType.component:case r.FrameType.element:case r.FrameType.region:return n.subtreeLength(t)-1;default:return 0}}t.BrowserRenderer=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t.EditType||(t.EditType={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(t.FrameType||(t.FrameType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(33),a=(r={},["abort","blur","change","error","focus","load","loadend","loadstart","mouseenter","mouseleave","progress","reset","scroll","submit","unload","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"].forEach(function(e){r[e]=!0}),r),i=function(){function e(t){this.onEvent=t;var n=++e.nextEventDelegatorId;this.eventsCollectionKey="_blazorEvents_"+n,this.eventInfoStore=new u(this.onGlobalEvent.bind(this))}return e.prototype.setListener=function(e,t,n){var r=e[this.eventsCollectionKey];if(r||(r=e[this.eventsCollectionKey]={}),r.hasOwnProperty(t)){var o=r[t];this.eventInfoStore.update(o.eventHandlerId,n)}else{var a={element:e,eventName:t,eventHandlerId:n};this.eventInfoStore.add(a),r[t]=a}},e.prototype.removeListener=function(e){var t=this.eventInfoStore.remove(e);if(t){var n=t.element;if(n.hasOwnProperty(this.eventsCollectionKey)){var r=n[this.eventsCollectionKey];delete r[t.eventName],0===Object.getOwnPropertyNames(r).length&&delete n[this.eventsCollectionKey]}}},e.prototype.onGlobalEvent=function(e){if(e.target instanceof Element)for(var t=e.target,n=null,r=a.hasOwnProperty(e.type);t;){if(t.hasOwnProperty(this.eventsCollectionKey)){var i=t[this.eventsCollectionKey];if(i.hasOwnProperty(e.type)){n||(n=o.EventForDotNet.fromDOMEvent(e));var u=i[e.type];this.onEvent(e,u.eventHandlerId,n)}}t=r?null:t.parentElement}},e.nextEventDelegatorId=0,e}();t.EventDelegator=i;var u=function(){function e(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={}}return e.prototype.add=function(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error("Event "+e.eventHandlerId+" is already tracked");this.infosByEventHandlerId[e.eventHandlerId]=e;var t=e.eventName;if(this.countByEventName.hasOwnProperty(t))this.countByEventName[t]++;else{this.countByEventName[t]=1;var n=a.hasOwnProperty(t);document.addEventListener(t,this.globalListener,n)}},e.prototype.update=function(e,t){if(this.infosByEventHandlerId.hasOwnProperty(t))throw new Error("Event "+t+" is already tracked");var n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n},e.prototype.remove=function(e){var t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];var n=t.eventName;0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t},e}()},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.type=e,this.data=t}return e.fromDOMEvent=function(t){var n=t.target;switch(t.type){case"input":case"change":var o=function(e){return e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(n)?!!n.checked:n.value;return new e("change",{type:t.type,value:o});case"copy":case"cut":case"paste":return new e("clipboard",{type:t.type});case"drag":case"dragend":case"dragenter":case"dragleave":case"dragover":case"dragstart":case"drop":return new e("drag",function(e){return{type:e.type,detail:e.detail,dataTransfer:e.dataTransfer,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"focus":case"blur":case"focusin":case"focusout":return new e("focus",{type:t.type});case"keydown":case"keyup":case"keypress":return new e("keyboard",function(e){return{type:e.type,key:e.key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"contextmenu":case"click":case"mouseover":case"mouseout":case"mousemove":case"mousedown":case"mouseup":case"dblclick":return new e("mouse",a(t));case"error":return new e("error",function(e){return{type:e.type,message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno}}(t));case"loadstart":case"timeout":case"abort":case"load":case"loadend":case"progress":return new e("progress",function(e){return{type:e.type,lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total}}(t));case"touchcancel":case"touchend":case"touchmove":case"touchenter":case"touchleave":case"touchstart":return new e("touch",function(e){function t(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push({identifier:r.identifier,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY,pageX:r.pageX,pageY:r.pageY})}return t}return{type:e.type,detail:e.detail,touches:t(e.touches),targetTouches:t(e.targetTouches),changedTouches:t(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointerenter":case"pointerleave":case"pointermove":case"pointerout":case"pointerover":case"pointerup":return new e("pointer",function(e){return r({},a(e),{pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary})}(t));case"wheel":case"mousewheel":return new e("wheel",function(e){return r({},a(e),{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode})}(t));default:return new e("unknown",{type:t.type})}},e}();function a(e){return{type:e.type,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}t.EventForDotNet=o},function(e,t,n){"use strict";function r(e){return"_bl_"+e}Object.defineProperty(t,"__esModule",{value:!0}),t.applyCaptureIdToElement=function(e,t){e.setAttribute(r(t),"")};DotNet.attachReviver(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__internalId")&&"string"==typeof t.__internalId?(n=t.__internalId,o="["+r(n)+"]",document.querySelector(o)):t;var n,o})},function(e,t,n){"use strict";function r(e){var t=e.substring(e.lastIndexOf("/")+1),n=t.indexOf("?");return n<0?t:t.substring(0,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.getFileNameFromUrl=r,t.getAssemblyNameFromUrl=function(e){return r(e).replace(/\.dll$/,"")}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};function a(e){return new Promise(function(t,n){e.onload=t,e.onerror=n,document.head.appendChild(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchBootConfigAsync=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,fetch("_framework/blazor.boot.json",{method:"Get",credentials:"include"})];case 1:return[2,e.sent().json()]}})})},t.loadEmbeddedResourcesAsync=function(e){var t=e.cssReferences.map(function(e){var t=document.createElement("link");return t.rel="stylesheet",t.href=e,a(t)}),n=e.jsReferences.map(function(e){var t=document.createElement("script");return t.src=e,a(t)});return Promise.all(t.concat(n))},t.shouldAutoStart=function(){return document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")}},,,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(20),n(28);var a=n(21),i=n(51),u=n(35),l=n(16),s=n(53),c=n(36),f=!1;function d(e){return r(this,void 0,void 0,function(){var e,t,n,r,d,p;return o(this,function(o){switch(o.label){case 0:if(f)throw new Error("Blazor has already started.");return f=!0,e=a.setPlatform(i.monoPlatform),window.Blazor.platform=e,window.Blazor._internal.renderBatch=function(e,t){l.renderBatch(e,new s.SharedMemoryRenderBatch(t))},[4,c.fetchBootConfigAsync()];case 1:t=o.sent(),n=c.loadEmbeddedResourcesAsync(t),t.linkerEnabled||console.info("Blazor is running in dev mode without IL stripping. To make the bundle size significantly smaller, publish the application or see https://go.microsoft.com/fwlink/?linkid=870414"),r=[t.main].concat(t.assemblyReferences).map(function(e){return"_framework/_bin/"+e}),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e.start(r)];case 3:return o.sent(),[3,5];case 4:throw d=o.sent(),new Error("Failed to start platform. Reason: "+d);case 5:return[4,n];case 6:return o.sent(),p=u.getAssemblyNameFromUrl(t.main),e.callEntryPoint(p,t.entryPoint,[]),[2]}})})}window.Blazor.start=d,c.shouldAutoStart()&&d()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a,i,u,l,s=n(35),c=n(52),f={},d={},p={},m="appBinDir";function h(e,t,n){var a="["+e+"]"+t+"."+n,i=d[a];if(!i){if(!(i=o(function(e){var t=f[e];if(!t){if(!(t=r(e)))throw new Error('Could not find assembly "'+e+'"');f[e]=t}return t}(e),t,n)))throw new Error('Could not find type "'+n+'" in namespace "'+t+'" in assembly "'+e+'"');d[a]=i}return i}function y(e,t,n,r){var o="["+e+"]"+t+"."+n+"::"+r,i=p[o];if(!i){if(!(i=a(h(e,t,n),r,-1)))throw new Error('Could not find method "'+r+'" on type "'+t+"."+n+'"');p[o]=i}return i}t.monoPlatform={start:function(e){return new Promise(function(n,f){c.attachDebuggerHotkey(e),window.Browser={init:function(){}},window.Module=function(e,n,f){var d={},p=["DEBUGGING ENABLED"];return d.print=function(e){return p.indexOf(e)<0&&console.log("WASM: "+e)},d.printErr=function(e){return console.error("WASM: "+e)},d.preRun=[],d.postRun=[],d.preloadPlugins=[],d.locateFile=function(e){switch(e){case"mono.wasm":return"_framework/wasm/mono.wasm";default:return e}},d.preRun.push(function(){var t=Module.cwrap("mono_wasm_add_assembly",null,["string","number","number"]);r=Module.cwrap("mono_wasm_assembly_load","number",["string"]),o=Module.cwrap("mono_wasm_assembly_find_class","number",["number","string","string"]),a=Module.cwrap("mono_wasm_assembly_find_method","number",["number","string","number"]),i=Module.cwrap("mono_wasm_invoke_method","number",["number","number","number"]),u=Module.cwrap("mono_wasm_string_get_utf8","number",["number"]),l=Module.cwrap("mono_wasm_string_from_js","number",["string"]),MONO.loaded_files=[],e.forEach(function(e){var n=s.getFileNameFromUrl(e),r="blazor:"+n;addRunDependency(r),function(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response){var e=new Uint8Array(r.response);t(e)}else n(r)},r.onerror=n,r.send(void 0)})}(e).then(function(o){var a,i=Module._malloc(o.length);new Uint8Array(Module.HEAPU8.buffer,i,o.length).set(o),t(n,i,o.length),MONO.loaded_files.push((a=e,v.href=a,v.href)),removeRunDependency(r)},function(e){e instanceof XMLHttpRequest&&404===e.status&&n.match(/\.pdb$/)||f(e),removeRunDependency(r)})})}),d.postRun.push(function(){var e,r;MONO.mono_wasm_setenv("MONO_URI_DOTNETRELATIVEORABSOLUTE","true"),Module.cwrap("mono_wasm_load_runtime",null,["string","number"])(m,c.hasDebuggingEnabled()?1:0),MONO.mono_wasm_runtime_is_ready=!0,e=y("Mono.WebAssembly.Interop","Mono.WebAssembly.Interop","MonoWebAssemblyJSRuntime","InvokeDotNet"),r=y("Mono.WebAssembly.Interop","Mono.WebAssembly.Interop","MonoWebAssemblyJSRuntime","BeginInvokeDotNet"),DotNet.attachDispatcher({beginInvokeDotNetFromJS:function(e,n,o,a,i){var u=a?a.toString():n;t.monoPlatform.callMethod(r,null,[e?t.monoPlatform.toDotNetString(e.toString()):null,t.monoPlatform.toDotNetString(u),t.monoPlatform.toDotNetString(o),t.monoPlatform.toDotNetString(i)])},invokeDotNetFromJS:function(n,r,o,a){var i=t.monoPlatform.callMethod(e,null,[n?t.monoPlatform.toDotNetString(n):null,t.monoPlatform.toDotNetString(r),o?t.monoPlatform.toDotNetString(o.toString()):null,t.monoPlatform.toDotNetString(a)]);return i?t.monoPlatform.toJavaScriptString(i):null}}),n()}),d}(e,n,f),function(){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");var e=document.createElement("script");e.src="_framework/wasm/mono.js",e.defer=!0,document.body.appendChild(e)}()})},findMethod:y,callEntryPoint:function(e,n,r){var o=n.split("::");if(2!=o.length)throw new Error("Malformed entry point method name; could not resolve class name and method name.");var a=o[0],i=o[1],u=a.lastIndexOf("."),l=u>-1?a.substring(0,u):"",s=u>-1?a.substring(u+1):a,c=t.monoPlatform.findMethod(e,l,s,i);t.monoPlatform.callMethod(c,null,r)},callMethod:function(e,n,r){if(r.length>4)throw new Error("Currently, MonoPlatform supports passing a maximum of 4 arguments from JS to .NET. You tried to pass "+r.length+".");var o=Module.stackSave();try{for(var a=Module.stackAlloc(r.length),u=Module.stackAlloc(4),l=0;l<r.length;++l)Module.setValue(a+4*l,r[l],"i32");Module.setValue(u,0,"i32");var s=i(e,n,a,u);if(0!==Module.getValue(u,"i32"))throw new Error(t.monoPlatform.toJavaScriptString(s));return s}finally{Module.stackRestore(o)}},toJavaScriptString:function(e){var t=u(e),n=Module.UTF8ToString(t);return Module._free(t),n},toDotNetString:function(e){return l(e)},toUint8Array:function(e){var t=g(e),n=Module.getValue(t,"i32");return new Uint8Array(Module.HEAPU8.buffer,t+4,n)},getArrayLength:function(e){return Module.getValue(g(e),"i32")},getArrayEntryPtr:function(e,t,n){return g(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt32Field:function(e,t){return Module.getValue(e+(t||0),"i32")},readFloatField:function(e,t){return Module.getValue(e+(t||0),"float")},readObjectField:function(e,t){return Module.getValue(e+(t||0),"i32")},readStringField:function(e,n){var r=Module.getValue(e+(n||0),"i32");return 0===r?null:t.monoPlatform.toJavaScriptString(r)},readStructField:function(e,t){return e+(t||0)}};var v=document.createElement("a");function g(e){return e+12}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),o=window.chrome&&navigator.userAgent.indexOf("Edge")<0,a=!1;function i(){return a&&o}t.hasDebuggingEnabled=i,t.attachDebuggerHotkey=function(e){a=e.some(function(e){return/\.pdb$/.test(r.getFileNameFromUrl(e))});var t=navigator.platform.match(/^Mac/i)?"Cmd":"Alt";i()&&console.info("Debugging hotkey: Shift+"+t+"+D (when application has focus)"),document.addEventListener("keydown",function(e){var t;e.shiftKey&&(e.metaKey||e.altKey)&&"KeyD"===e.code&&(a?o?((t=document.createElement("a")).href="_framework/debug?url="+encodeURIComponent(location.href),t.target="_blank",t.rel="noopener noreferrer",t.click()):console.error("Currently, only Chrome is supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21),o=function(){function e(e){this.batchAddress=e,this.arrayRangeReader=a,this.arraySegmentReader=i,this.diffReader=u,this.editReader=l,this.frameReader=s}return e.prototype.updatedComponents=function(){return r.platform.readStructField(this.batchAddress,0)},e.prototype.referenceFrames=function(){return r.platform.readStructField(this.batchAddress,a.structLength)},e.prototype.disposedComponentIds=function(){return r.platform.readStructField(this.batchAddress,2*a.structLength)},e.prototype.disposedEventHandlerIds=function(){return r.platform.readStructField(this.batchAddress,3*a.structLength)},e.prototype.updatedComponentsEntry=function(e,t){return c(e,t,u.structLength)},e.prototype.referenceFramesEntry=function(e,t){return c(e,t,s.structLength)},e.prototype.disposedComponentIdsEntry=function(e,t){var n=c(e,t,4);return r.platform.readInt32Field(n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=c(e,t,4);return r.platform.readInt32Field(n)},e}();t.SharedMemoryRenderBatch=o;var a={structLength:8,values:function(e){return r.platform.readObjectField(e,0)},count:function(e){return r.platform.readInt32Field(e,4)}},i={structLength:12,values:function(e){return r.platform.readObjectField(e,0)},offset:function(e){return r.platform.readInt32Field(e,4)},count:function(e){return r.platform.readInt32Field(e,8)}},u={structLength:4+i.structLength,componentId:function(e){return r.platform.readInt32Field(e,0)},edits:function(e){return r.platform.readStructField(e,4)},editsEntry:function(e,t){return c(e,t,l.structLength)}},l={structLength:20,editType:function(e){return r.platform.readInt32Field(e,0)},siblingIndex:function(e){return r.platform.readInt32Field(e,4)},newTreeIndex:function(e){return r.platform.readInt32Field(e,8)},moveToSiblingIndex:function(e){return r.platform.readInt32Field(e,8)},removedAttributeName:function(e){return r.platform.readStringField(e,16)}},s={structLength:36,frameType:function(e){return r.platform.readInt32Field(e,4)},subtreeLength:function(e){return r.platform.readInt32Field(e,8)},elementReferenceCaptureId:function(e){return r.platform.readStringField(e,16)},componentId:function(e){return r.platform.readInt32Field(e,12)},elementName:function(e){return r.platform.readStringField(e,16)},textContent:function(e){return r.platform.readStringField(e,16)},markupContent:function(e){return r.platform.readStringField(e,16)},attributeName:function(e){return r.platform.readStringField(e,16)},attributeValue:function(e){return r.platform.readStringField(e,24)},attributeEventHandlerId:function(e){return r.platform.readInt32Field(e,8)}};function c(e,t,n){return r.platform.getArrayEntryPtr(e,t,n)}}]); \ No newline at end of file +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=42)}([,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(23),o=n(9),a={};function i(e,t,n){var o=a[e];o||(o=a[e]=new r.BrowserRenderer(e)),o.attachRootComponentToLogicalElement(n,t)}t.attachRootComponentToLogicalElement=i,t.attachRootComponentToElement=function(e,t,n){var r=document.querySelector(t);if(!r)throw new Error("Could not find any element matching selector '"+t+"'.");i(e,o.toLogicalElement(r,!0),n)},t.renderBatch=function(e,t){var n=a[e];if(!n)throw new Error("There is no browser renderer with ID "+e+".");for(var r=t.arrayRangeReader,o=t.updatedComponents(),i=r.values(o),u=r.count(o),l=t.referenceFrames(),s=r.values(l),c=t.diffReader,f=0;f<u;f++){var d=t.updatedComponentsEntry(i,f),p=c.componentId(d),m=c.edits(d);n.updateComponent(t,p,m,s)}var h=t.disposedComponentIds(),y=r.values(h),v=r.count(h);for(f=0;f<v;f++)p=t.disposedComponentIdsEntry(y,f),n.disposeComponent(p);var g=t.disposedEventHandlerIds(),b=r.values(g),w=r.count(g);for(f=0;f<w;f++){var E=t.disposedEventHandlerIdsEntry(b,f);n.disposeEventHandler(E)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=p("_blazorLogicalChildren"),o=p("_blazorLogicalParent"),a=p("_blazorLogicalEnd");function i(e,t){if(e.childNodes.length>0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return e[r]=[],e}function u(e,t,n){var a=e;if(e instanceof Comment&&(s(a)&&s(a).length>0))throw new Error("Not implemented: inserting non-empty logical container");if(l(a))throw new Error("Not implemented: moving existing logical children");var i=s(t);if(n<i.length){var u=i[n];u.parentNode.insertBefore(e,u),i.splice(n,0,a)}else d(e,t),i.push(a);a[o]=t,r in a||(a[r]=[])}function l(e){return e[o]||null}function s(e){return e[r]}function c(e){if(e instanceof Element)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function f(e){var t=s(l(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function d(e,t){if(t instanceof Element)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error("Cannot append node because the parent is not a valid logical element. Parent: "+t);var n=f(t);n?n.parentNode.insertBefore(e,n):d(e,l(t))}}function p(e){return"function"==typeof Symbol?Symbol():e}t.toLogicalRootCommentElement=function(e,t){if(!e.parentNode)throw new Error("Comment not connected to the DOM "+e.textContent);var n=e.parentNode,r=i(n,!0),u=s(r);return Array.from(n.childNodes).forEach(function(e){return u.push(e)}),e[o]=r,e[a]=t,i(t,!0),i(e,!0)},t.toLogicalElement=i,t.createAndInsertLogicalContainer=function(e,t){var n=document.createComment("!");return u(n,e,t),n},t.insertLogicalChild=u,t.removeLogicalChild=function e(t,n){var r=s(t).splice(n,1)[0];if(r instanceof Comment)for(var o=s(r);o.length>0;)e(r,0);var a=r;a.parentNode.removeChild(a)},t.getLogicalParent=l,t.getLogicalSiblingEnd=function(e){return e[a]||null},t.getLogicalChild=function(e,t){return s(e)[t]},t.isSvgElement=function(e){return"http://www.w3.org/2000/svg"===c(e).namespaceURI},t.getLogicalChildrenArray=s,t.permuteLogicalChildren=function(e,t){var n=s(e);t.forEach(function(e){e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=function e(t){if(t instanceof Element)return t;var n=f(t);if(n)return n.previousSibling;var r=l(t);return r instanceof Element?r.lastChild:e(r)}(e.moveRangeStart)}),t.forEach(function(t){var r=t.moveToBeforeMarker=document.createComment("marker"),o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):d(r,e)}),t.forEach(function(e){for(var t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd,a=r;a;){var i=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=i}n.removeChild(t)}),t.forEach(function(e){n[e.toSiblingIndex]=e.moveRangeStart})},t.getClosestDomElement=c},,,function(e,t,n){"use strict";var r;!function(e){window.DotNet=e;var t=[],n={},r={},o=1,a=null;function i(e){t.push(e)}function u(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return s(e,t,null,n)}function l(e,t,n,r){var o=c();if(o.invokeDotNetFromJS){var a=JSON.stringify(r,y),i=o.invokeDotNetFromJS(e,t,n,a);return i?d(i):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}function s(e,t,r,a){var i=o++,u=new Promise(function(e,t){n[i]={resolve:e,reject:t}});try{var l=JSON.stringify(a,y);c().beginInvokeDotNetFromJS(i,e,t,r,l)}catch(e){f(i,!1,e)}return u}function c(){if(null!==a)return a;throw new Error("No .NET call dispatcher has been set.")}function f(e,t,r){if(!n.hasOwnProperty(e))throw new Error("There is no pending async call with ID "+e+".");var o=n[e];delete n[e],t?o.resolve(r):o.reject(r)}function d(e){return e?JSON.parse(e,function(e,n){return t.reduce(function(t,n){return n(e,t)},n)}):null}function p(e){return e instanceof Error?e.message+"\n"+e.stack:e?e.toString():"null"}function m(e){if(r.hasOwnProperty(e))return r[e];var t=window,n="window";if(e.split(".").forEach(function(e){if(!(e in t))throw new Error("Could not find '"+e+"' in '"+n+"'.");t=t[e],n+="."+e}),t instanceof Function)return t;throw new Error("The value '"+n+"' is not a function.")}e.attachDispatcher=function(e){a=e},e.attachReviver=i,e.invokeMethod=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return l(e,t,null,n)},e.invokeMethodAsync=u,e.jsCallDispatcher={findJSFunction:m,invokeJSFromDotNet:function(e,t){var n=m(e).apply(null,d(t));return null==n?null:JSON.stringify(n,y)},beginInvokeJSFromDotNet:function(e,t,n){var r=new Promise(function(e){e(m(t).apply(null,d(n)))});e&&r.then(function(t){return c().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!0,t],y))},function(t){return c().beginInvokeDotNetFromJS(0,"Microsoft.JSInterop","DotNetDispatcher.EndInvoke",null,JSON.stringify([e,!1,p(t)]))})},endInvokeDotNetFromJS:function(e,t,n){var r=t?n:new Error(n);f(parseInt(e),t,r)}};var h=function(){function e(e){this._id=e}return e.prototype.invokeMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return l(null,e,this._id,t)},e.prototype.invokeMethodAsync=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return s(null,e,this._id,t)},e.prototype.dispose=function(){u("Microsoft.JSInterop","DotNetDispatcher.ReleaseDotNetObject",this._id).catch(function(e){return console.error(e)})},e.prototype.serializeAsArg=function(){return{__dotNetObject:this._id}},e}();function y(e,t){return t instanceof h?t.serializeAsArg():t}i(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__dotNetObject")?new h(t.__dotNetObject):t})}(r||(r={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setPlatform=function(e){return t.platform=e,t.platform}},,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(12);var a,i=!1,u=!1,l=null;function s(e,t){var n=d(e);!t&&p(n)?c(n,!1):location.href=e}function c(e,t){history.pushState(null,"",e),f(t)}function f(e){return r(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return l?[4,DotNet.invokeMethodAsync(l.assemblyName,l.functionName,location.href,e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}})})}function d(e){return(a=a||document.createElement("a")).href=e,a.href}function p(e){var t,n=(t=document.baseURI).substr(0,t.lastIndexOf("/")+1);return e.startsWith(n)}t.internalFunctions={listenForNavigationEvents:function(e,t){if(u)return;l={assemblyName:e,functionName:t},u=!0,window.addEventListener("popstate",function(){return f(!1)})},enableNavigationInterception:function(){if(i)return;i=!0,document.addEventListener("click",function(e){if(0===e.button&&!function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e)){var t=function e(t,n){return t?t.tagName===n?t:e(t.parentElement,n):null}(e.target,"A");if(t&&t.hasAttribute("href")){var n=t.getAttribute("target"),r=!n||"_self"===n;if(!r)return;var o=t.getAttribute("href"),a=d(o);p(a)&&(e.preventDefault(),c(a,!0))}}})},navigateTo:s,getBaseURI:function(){return document.baseURI},getLocationHref:function(){return location.href}},t.navigateTo=s},,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(16),o=n(22),a=n(8);window.Blazor={navigateTo:r.navigateTo,_internal:{attachRootComponentToElement:a.attachRootComponentToElement,http:o.internalFunctions,uriHelper:r.internalFunctions}}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var a,i,u=n(13),l="Microsoft.AspNetCore.Blazor",s=l+".Http",c="WebAssemblyHttpMessageHandler";function f(e,t,n,r){a||(a=u.platform.findMethod(l,s,c,"ReceiveResponse")),u.platform.callMethod(a,null,[u.platform.toDotNetString(e.toString()),t,n,r])}t.internalFunctions={sendAsync:function(e,t,n){return r(this,void 0,void 0,function(){var r,a,d,p,m;return o(this,function(o){switch(o.label){case 0:d=JSON.parse(u.platform.toJavaScriptString(n)),p=Object.assign({credentials:(h=d.requestInit).credentials,method:h.method,headers:h.headers.map(function(e){return[e.name,e.value]})},d.requestInitOverrides),t&&(p.body=u.platform.toUint8Array(t)),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,fetch(d.requestUri,p)];case 2:return[4,(r=o.sent()).arrayBuffer()];case 3:return a=o.sent(),[3,5];case 4:return m=o.sent(),function(e,t){f(e,null,null,u.platform.toDotNetString(t))}(e,m.toString()),[2];case 5:return function(e,t,n){var r={statusCode:t.status,statusText:t.statusText,headers:[]};t.headers.forEach(function(e,t){r.headers.push({name:t,value:e})}),i||(i=u.platform.findMethod(l,s,c,"AllocateArray"));var o=u.platform.callMethod(i,null,[u.platform.toDotNetString(n.byteLength.toString())]);u.platform.toUint8Array(o).set(new Uint8Array(n)),f(e,u.platform.toDotNetString(JSON.stringify(r)),o,null)}(e,r,a),[2]}var h})})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(24),o=n(25),a=n(9),i=n(27),u=document.createElement("template"),l=document.createElementNS("http://www.w3.org/2000/svg","g"),s={submit:!0},c={},f=function(){function e(e){var t=this;this.childComponentLocations={},this.browserRendererId=e,this.eventDelegator=new o.EventDelegator(function(e,n,r){!function(e,t,n,r){s[e.type]&&e.preventDefault();var o={browserRendererId:t,eventHandlerId:n,eventArgsType:r.type};DotNet.invokeMethodAsync("Microsoft.AspNetCore.Components.Browser","DispatchEvent",o,JSON.stringify(r.data))}(e,t.browserRendererId,n,r)})}return e.prototype.attachRootComponentToLogicalElement=function(e,t){this.attachComponentToElement(e,t),c[e]=t},e.prototype.updateComponent=function(e,t,n,r){var o=this.childComponentLocations[t];if(!o)throw new Error("No element is currently associated with component "+t);var i=c[t];if(i){var u=a.getLogicalSiblingEnd(i);delete c[t],u?function(e,t){var n=a.getLogicalParent(e);if(!n)throw new Error("Can't clear between nodes. The start node does not have a logical parent.");for(var r=a.getLogicalChildrenArray(n),o=r.indexOf(e)+1,i=r.indexOf(t),u=o;u<=i;u++)a.removeLogicalChild(n,o);e.textContent="!"}(i,u):function(e){var t;for(;t=e.firstChild;)e.removeChild(t)}(i)}var l=a.getClosestDomElement(o).ownerDocument,s=l&&l.activeElement;this.applyEdits(e,o,0,n,r),s instanceof HTMLElement&&l&&l.activeElement!==s&&s.focus()},e.prototype.disposeComponent=function(e){delete this.childComponentLocations[e]},e.prototype.disposeEventHandler=function(e){this.eventDelegator.removeListener(e)},e.prototype.attachComponentToElement=function(e,t){this.childComponentLocations[e]=t},e.prototype.applyEdits=function(e,t,n,o,i){for(var u,l=0,s=n,c=e.arraySegmentReader,f=e.editReader,d=e.frameReader,p=c.values(o),m=c.offset(o),h=m+c.count(o),y=m;y<h;y++){var v=e.diffReader.editsEntry(p,y),g=f.editType(v);switch(g){case r.EditType.prependFrame:var b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);this.insertFrame(e,t,s+E,i,w,b);break;case r.EditType.removeFrame:E=f.siblingIndex(v);a.removeLogicalChild(t,s+E);break;case r.EditType.setAttribute:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);if(!((S=a.getLogicalChild(t,s+E))instanceof Element))throw new Error("Cannot set attribute on non-element child");this.applyAttribute(e,S,w);break;case r.EditType.removeAttribute:var S;E=f.siblingIndex(v);if(!((S=a.getLogicalChild(t,s+E))instanceof HTMLElement))throw new Error("Cannot remove attribute from non-element child");var _=f.removedAttributeName(v);this.tryApplySpecialProperty(e,S,_,null)||S.removeAttribute(_);break;case r.EditType.updateText:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);var I=a.getLogicalChild(t,s+E);if(!(I instanceof Text))throw new Error("Cannot set text content on non-text child");I.textContent=d.textContent(w);break;case r.EditType.updateMarkup:b=f.newTreeIndex(v),w=e.referenceFramesEntry(i,b),E=f.siblingIndex(v);a.removeLogicalChild(t,s+E),this.insertMarkup(e,t,s+E,w);break;case r.EditType.stepIn:E=f.siblingIndex(v);t=a.getLogicalChild(t,s+E),l++,s=0;break;case r.EditType.stepOut:t=a.getLogicalParent(t),s=0===--l?n:0;break;case r.EditType.permutationListEntry:(u=u||[]).push({fromSiblingIndex:s+f.siblingIndex(v),toSiblingIndex:s+f.moveToSiblingIndex(v)});break;case r.EditType.permutationListEnd:a.permuteLogicalChildren(t,u),u=void 0;break;default:throw new Error("Unknown edit type: "+g)}}},e.prototype.insertFrame=function(e,t,n,o,a,u){var l=e.frameReader,s=l.frameType(a);switch(s){case r.FrameType.element:return this.insertElement(e,t,n,o,a,u),1;case r.FrameType.text:return this.insertText(e,t,n,a),1;case r.FrameType.attribute:throw new Error("Attribute frames should only be present as leading children of element frames.");case r.FrameType.component:return this.insertComponent(e,t,n,a),1;case r.FrameType.region:return this.insertFrameRange(e,t,n,o,u+1,u+l.subtreeLength(a));case r.FrameType.elementReferenceCapture:if(t instanceof Element)return i.applyCaptureIdToElement(t,l.elementReferenceCaptureId(a)),0;throw new Error("Reference capture frames can only be children of element frames.");case r.FrameType.markup:return this.insertMarkup(e,t,n,a),1;default:throw new Error("Unknown frame type: "+s)}},e.prototype.insertElement=function(e,t,n,o,i,u){var l=e.frameReader,s=l.elementName(i),c="svg"===s||a.isSvgElement(t)?document.createElementNS("http://www.w3.org/2000/svg",s):document.createElement(s),f=a.toLogicalElement(c);a.insertLogicalChild(c,t,n);for(var d=u+l.subtreeLength(i),p=u+1;p<d;p++){var m=e.referenceFramesEntry(o,p);if(l.frameType(m)!==r.FrameType.attribute){this.insertFrameRange(e,f,0,o,p,d);break}this.applyAttribute(e,c,m)}},e.prototype.insertComponent=function(e,t,n,r){var o=a.createAndInsertLogicalContainer(t,n),i=e.frameReader.componentId(r);this.attachComponentToElement(i,o)},e.prototype.insertText=function(e,t,n,r){var o=e.frameReader.textContent(r),i=document.createTextNode(o);a.insertLogicalChild(i,t,n)},e.prototype.insertMarkup=function(e,t,n,r){for(var o,i=a.createAndInsertLogicalContainer(t,n),s=e.frameReader.markupContent(r),c=(o=s,a.isSvgElement(t)?(l.innerHTML=o||" ",l):(u.innerHTML=o||" ",u.content)),f=0;c.firstChild;)a.insertLogicalChild(c.firstChild,i,f++)},e.prototype.applyAttribute=function(e,t,n){var r=e.frameReader,o=r.attributeName(n),a=(this.browserRendererId,r.attributeEventHandlerId(n));if(a){var i=o.substring(0,2),u=o.substring(2);if("on"!==i||!u)throw new Error("Attribute has nonzero event handler ID, but attribute name '"+o+"' does not start with 'on'.");this.eventDelegator.setListener(t,u,a)}else this.tryApplySpecialProperty(e,t,o,n)||t.setAttribute(o,r.attributeValue(n))},e.prototype.tryApplySpecialProperty=function(e,t,n,r){switch(n){case"value":return this.tryApplyValueProperty(e,t,r);case"checked":return this.tryApplyCheckedProperty(e,t,r);default:return!1}},e.prototype.tryApplyValueProperty=function(e,t,n){var r=e.frameReader;switch(t.tagName){case"INPUT":case"SELECT":case"TEXTAREA":var o=n?r.attributeValue(n):null;return t.value=o,"SELECT"===t.tagName&&(t._blazorSelectValue=o),!0;case"OPTION":(o=n?r.attributeValue(n):null)?t.setAttribute("value",o):t.removeAttribute("value");var a=t.parentElement;return a&&"_blazorSelectValue"in a&&a._blazorSelectValue===o&&(this.tryApplyValueProperty(e,a,n),delete a._blazorSelectValue),!0;default:return!1}},e.prototype.tryApplyCheckedProperty=function(e,t,n){if("INPUT"===t.tagName){var r=n?e.frameReader.attributeValue(n):null;return t.checked=null!==r,!0}return!1},e.prototype.insertFrameRange=function(e,t,n,r,o,a){for(var i=n,u=o;u<a;u++){var l=e.referenceFramesEntry(r,u);n+=this.insertFrame(e,t,n,r,l,u),u+=d(e,l)}return n-i},e}();function d(e,t){var n=e.frameReader;switch(n.frameType(t)){case r.FrameType.component:case r.FrameType.element:case r.FrameType.region:return n.subtreeLength(t)-1;default:return 0}}t.BrowserRenderer=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(t.EditType||(t.EditType={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup"}(t.FrameType||(t.FrameType={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(26),a=(r={},["abort","blur","change","error","focus","load","loadend","loadstart","mouseenter","mouseleave","progress","reset","scroll","submit","unload","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"].forEach(function(e){r[e]=!0}),r),i=function(){function e(t){this.onEvent=t;var n=++e.nextEventDelegatorId;this.eventsCollectionKey="_blazorEvents_"+n,this.eventInfoStore=new u(this.onGlobalEvent.bind(this))}return e.prototype.setListener=function(e,t,n){var r=e[this.eventsCollectionKey];if(r||(r=e[this.eventsCollectionKey]={}),r.hasOwnProperty(t)){var o=r[t];this.eventInfoStore.update(o.eventHandlerId,n)}else{var a={element:e,eventName:t,eventHandlerId:n};this.eventInfoStore.add(a),r[t]=a}},e.prototype.removeListener=function(e){var t=this.eventInfoStore.remove(e);if(t){var n=t.element;if(n.hasOwnProperty(this.eventsCollectionKey)){var r=n[this.eventsCollectionKey];delete r[t.eventName],0===Object.getOwnPropertyNames(r).length&&delete n[this.eventsCollectionKey]}}},e.prototype.onGlobalEvent=function(e){if(e.target instanceof Element)for(var t=e.target,n=null,r=a.hasOwnProperty(e.type);t;){if(t.hasOwnProperty(this.eventsCollectionKey)){var i=t[this.eventsCollectionKey];if(i.hasOwnProperty(e.type)){n||(n=o.EventForDotNet.fromDOMEvent(e));var u=i[e.type];this.onEvent(e,u.eventHandlerId,n)}}t=r?null:t.parentElement}},e.nextEventDelegatorId=0,e}();t.EventDelegator=i;var u=function(){function e(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={}}return e.prototype.add=function(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error("Event "+e.eventHandlerId+" is already tracked");this.infosByEventHandlerId[e.eventHandlerId]=e;var t=e.eventName;if(this.countByEventName.hasOwnProperty(t))this.countByEventName[t]++;else{this.countByEventName[t]=1;var n=a.hasOwnProperty(t);document.addEventListener(t,this.globalListener,n)}},e.prototype.update=function(e,t){if(this.infosByEventHandlerId.hasOwnProperty(t))throw new Error("Event "+t+" is already tracked");var n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n},e.prototype.remove=function(e){var t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];var n=t.eventName;0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t},e}()},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){this.type=e,this.data=t}return e.fromDOMEvent=function(t){var n=t.target;switch(t.type){case"input":case"change":var o=function(e){return e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(n)?!!n.checked:n.value;return new e("change",{type:t.type,value:o});case"copy":case"cut":case"paste":return new e("clipboard",{type:t.type});case"drag":case"dragend":case"dragenter":case"dragleave":case"dragover":case"dragstart":case"drop":return new e("drag",function(e){return{type:e.type,detail:e.detail,dataTransfer:e.dataTransfer,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"focus":case"blur":case"focusin":case"focusout":return new e("focus",{type:t.type});case"keydown":case"keyup":case"keypress":return new e("keyboard",function(e){return{type:e.type,key:e.key,code:e.code,location:e.location,repeat:e.repeat,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"contextmenu":case"click":case"mouseover":case"mouseout":case"mousemove":case"mousedown":case"mouseup":case"dblclick":return new e("mouse",a(t));case"error":return new e("error",function(e){return{type:e.type,message:e.message,filename:e.filename,lineno:e.lineno,colno:e.colno}}(t));case"loadstart":case"timeout":case"abort":case"load":case"loadend":case"progress":return new e("progress",function(e){return{type:e.type,lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total}}(t));case"touchcancel":case"touchend":case"touchmove":case"touchenter":case"touchleave":case"touchstart":return new e("touch",function(e){function t(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push({identifier:r.identifier,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY,pageX:r.pageX,pageY:r.pageY})}return t}return{type:e.type,detail:e.detail,touches:t(e.touches),targetTouches:t(e.targetTouches),changedTouches:t(e.changedTouches),ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}(t));case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointerenter":case"pointerleave":case"pointermove":case"pointerout":case"pointerover":case"pointerup":return new e("pointer",function(e){return r({},a(e),{pointerId:e.pointerId,width:e.width,height:e.height,pressure:e.pressure,tiltX:e.tiltX,tiltY:e.tiltY,pointerType:e.pointerType,isPrimary:e.isPrimary})}(t));case"wheel":case"mousewheel":return new e("wheel",function(e){return r({},a(e),{deltaX:e.deltaX,deltaY:e.deltaY,deltaZ:e.deltaZ,deltaMode:e.deltaMode})}(t));default:return new e("unknown",{type:t.type})}},e}();function a(e){return{type:e.type,detail:e.detail,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey}}t.EventForDotNet=o},function(e,t,n){"use strict";function r(e){return"_bl_"+e}Object.defineProperty(t,"__esModule",{value:!0}),t.applyCaptureIdToElement=function(e,t){e.setAttribute(r(t),"")};DotNet.attachReviver(function(e,t){return t&&"object"==typeof t&&t.hasOwnProperty("__internalId")&&"string"==typeof t.__internalId?(n=t.__internalId,o="["+r(n)+"]",document.querySelector(o)):t;var n,o})},function(e,t,n){"use strict";function r(e){var t=e.substring(e.lastIndexOf("/")+1),n=t.indexOf("?");return n<0?t:t.substring(0,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.getFileNameFromUrl=r,t.getAssemblyNameFromUrl=function(e){return r(e).replace(/\.dll$/,"")}},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};function a(e){return new Promise(function(t,n){e.onload=t,e.onerror=n,document.head.appendChild(e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.fetchBootConfigAsync=function(){return r(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,fetch("_framework/blazor.boot.json",{method:"Get",credentials:"include"})];case 1:return[2,e.sent().json()]}})})},t.loadEmbeddedResourcesAsync=function(e){var t=e.cssReferences.map(function(e){var t=document.createElement("link");return t.rel="stylesheet",t.href=e,a(t)}),n=e.jsReferences.map(function(e){var t=document.createElement("script");return t.src=e,a(t)});return Promise.all(t.concat(n))},t.shouldAutoStart=function(){return document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")}},,,,,,,,,,,,,function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function u(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,u)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}};Object.defineProperty(t,"__esModule",{value:!0}),n(12),n(21);var a=n(13),i=n(43),u=n(28),l=n(8),s=n(45),c=n(29),f=!1;function d(e){return r(this,void 0,void 0,function(){var e,t,n,r,d,p;return o(this,function(o){switch(o.label){case 0:if(f)throw new Error("Blazor has already started.");return f=!0,e=a.setPlatform(i.monoPlatform),window.Blazor.platform=e,window.Blazor._internal.renderBatch=function(e,t){l.renderBatch(e,new s.SharedMemoryRenderBatch(t))},[4,c.fetchBootConfigAsync()];case 1:t=o.sent(),n=c.loadEmbeddedResourcesAsync(t),t.linkerEnabled||console.info("Blazor is running in dev mode without IL stripping. To make the bundle size significantly smaller, publish the application or see https://go.microsoft.com/fwlink/?linkid=870414"),r=[t.main].concat(t.assemblyReferences).map(function(e){return"_framework/_bin/"+e}),o.label=2;case 2:return o.trys.push([2,4,,5]),[4,e.start(r)];case 3:return o.sent(),[3,5];case 4:throw d=o.sent(),new Error("Failed to start platform. Reason: "+d);case 5:return[4,n];case 6:return o.sent(),p=u.getAssemblyNameFromUrl(t.main),e.callEntryPoint(p,t.entryPoint,[]),[2]}})})}window.Blazor.start=d,c.shouldAutoStart()&&d()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o,a,i,u,l,s=n(28),c=n(44),f={},d={},p={},m="appBinDir";function h(e,t,n){var a="["+e+"]"+t+"."+n,i=d[a];if(!i){if(!(i=o(function(e){var t=f[e];if(!t){if(!(t=r(e)))throw new Error('Could not find assembly "'+e+'"');f[e]=t}return t}(e),t,n)))throw new Error('Could not find type "'+n+'" in namespace "'+t+'" in assembly "'+e+'"');d[a]=i}return i}function y(e,t,n,r){var o="["+e+"]"+t+"."+n+"::"+r,i=p[o];if(!i){if(!(i=a(h(e,t,n),r,-1)))throw new Error('Could not find method "'+r+'" on type "'+t+"."+n+'"');p[o]=i}return i}t.monoPlatform={start:function(e){return new Promise(function(n,f){c.attachDebuggerHotkey(e),window.Browser={init:function(){}},window.Module=function(e,n,f){var d={},p=["DEBUGGING ENABLED"];return d.print=function(e){return p.indexOf(e)<0&&console.log("WASM: "+e)},d.printErr=function(e){return console.error("WASM: "+e)},d.preRun=[],d.postRun=[],d.preloadPlugins=[],d.locateFile=function(e){switch(e){case"mono.wasm":return"_framework/wasm/mono.wasm";default:return e}},d.preRun.push(function(){var t=Module.cwrap("mono_wasm_add_assembly",null,["string","number","number"]);r=Module.cwrap("mono_wasm_assembly_load","number",["string"]),o=Module.cwrap("mono_wasm_assembly_find_class","number",["number","string","string"]),a=Module.cwrap("mono_wasm_assembly_find_method","number",["number","string","number"]),i=Module.cwrap("mono_wasm_invoke_method","number",["number","number","number"]),u=Module.cwrap("mono_wasm_string_get_utf8","number",["number"]),l=Module.cwrap("mono_wasm_string_from_js","number",["string"]),MONO.loaded_files=[],e.forEach(function(e){var n=s.getFileNameFromUrl(e),r="blazor:"+n;addRunDependency(r),function(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function(){if(200==r.status||0==r.status&&r.response){var e=new Uint8Array(r.response);t(e)}else n(r)},r.onerror=n,r.send(void 0)})}(e).then(function(o){var a,i=Module._malloc(o.length);new Uint8Array(Module.HEAPU8.buffer,i,o.length).set(o),t(n,i,o.length),MONO.loaded_files.push((a=e,v.href=a,v.href)),removeRunDependency(r)},function(e){e instanceof XMLHttpRequest&&404===e.status&&n.match(/\.pdb$/)||f(e),removeRunDependency(r)})})}),d.postRun.push(function(){var e,r;MONO.mono_wasm_setenv("MONO_URI_DOTNETRELATIVEORABSOLUTE","true"),Module.cwrap("mono_wasm_load_runtime",null,["string","number"])(m,c.hasDebuggingEnabled()?1:0),MONO.mono_wasm_runtime_is_ready=!0,e=y("Mono.WebAssembly.Interop","Mono.WebAssembly.Interop","MonoWebAssemblyJSRuntime","InvokeDotNet"),r=y("Mono.WebAssembly.Interop","Mono.WebAssembly.Interop","MonoWebAssemblyJSRuntime","BeginInvokeDotNet"),DotNet.attachDispatcher({beginInvokeDotNetFromJS:function(e,n,o,a,i){var u=a?a.toString():n;t.monoPlatform.callMethod(r,null,[e?t.monoPlatform.toDotNetString(e.toString()):null,t.monoPlatform.toDotNetString(u),t.monoPlatform.toDotNetString(o),t.monoPlatform.toDotNetString(i)])},invokeDotNetFromJS:function(n,r,o,a){var i=t.monoPlatform.callMethod(e,null,[n?t.monoPlatform.toDotNetString(n):null,t.monoPlatform.toDotNetString(r),o?t.monoPlatform.toDotNetString(o.toString()):null,t.monoPlatform.toDotNetString(a)]);return i?t.monoPlatform.toJavaScriptString(i):null}}),n()}),d}(e,n,f),function(){if("undefined"==typeof WebAssembly||!WebAssembly.validate)throw new Error("This browser does not support WebAssembly.");var e=document.createElement("script");e.src="_framework/wasm/mono.js",e.defer=!0,document.body.appendChild(e)}()})},findMethod:y,callEntryPoint:function(e,n,r){var o=n.split("::");if(2!=o.length)throw new Error("Malformed entry point method name; could not resolve class name and method name.");var a=o[0],i=o[1],u=a.lastIndexOf("."),l=u>-1?a.substring(0,u):"",s=u>-1?a.substring(u+1):a,c=t.monoPlatform.findMethod(e,l,s,i);t.monoPlatform.callMethod(c,null,r)},callMethod:function(e,n,r){if(r.length>4)throw new Error("Currently, MonoPlatform supports passing a maximum of 4 arguments from JS to .NET. You tried to pass "+r.length+".");var o=Module.stackSave();try{for(var a=Module.stackAlloc(r.length),u=Module.stackAlloc(4),l=0;l<r.length;++l)Module.setValue(a+4*l,r[l],"i32");Module.setValue(u,0,"i32");var s=i(e,n,a,u);if(0!==Module.getValue(u,"i32"))throw new Error(t.monoPlatform.toJavaScriptString(s));return s}finally{Module.stackRestore(o)}},toJavaScriptString:function(e){var t=u(e),n=Module.UTF8ToString(t);return Module._free(t),n},toDotNetString:function(e){return l(e)},toUint8Array:function(e){var t=g(e),n=Module.getValue(t,"i32");return new Uint8Array(Module.HEAPU8.buffer,t+4,n)},getArrayLength:function(e){return Module.getValue(g(e),"i32")},getArrayEntryPtr:function(e,t,n){return g(e)+4+t*n},getObjectFieldsBaseAddress:function(e){return e+8},readInt32Field:function(e,t){return Module.getValue(e+(t||0),"i32")},readFloatField:function(e,t){return Module.getValue(e+(t||0),"float")},readObjectField:function(e,t){return Module.getValue(e+(t||0),"i32")},readStringField:function(e,n){var r=Module.getValue(e+(n||0),"i32");return 0===r?null:t.monoPlatform.toJavaScriptString(r)},readStructField:function(e,t){return e+(t||0)}};var v=document.createElement("a");function g(e){return e+12}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28),o=window.chrome&&navigator.userAgent.indexOf("Edge")<0,a=!1;function i(){return a&&o}t.hasDebuggingEnabled=i,t.attachDebuggerHotkey=function(e){a=e.some(function(e){return/\.pdb$/.test(r.getFileNameFromUrl(e))});var t=navigator.platform.match(/^Mac/i)?"Cmd":"Alt";i()&&console.info("Debugging hotkey: Shift+"+t+"+D (when application has focus)"),document.addEventListener("keydown",function(e){var t;e.shiftKey&&(e.metaKey||e.altKey)&&"KeyD"===e.code&&(a?o?((t=document.createElement("a")).href="_framework/debug?url="+encodeURIComponent(location.href),t.target="_blank",t.rel="noopener noreferrer",t.click()):console.error("Currently, only Chrome is supported for debugging."):console.error("Cannot start debugging, because the application was not compiled with debugging enabled."))})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=function(){function e(e){this.batchAddress=e,this.arrayRangeReader=a,this.arraySegmentReader=i,this.diffReader=u,this.editReader=l,this.frameReader=s}return e.prototype.updatedComponents=function(){return r.platform.readStructField(this.batchAddress,0)},e.prototype.referenceFrames=function(){return r.platform.readStructField(this.batchAddress,a.structLength)},e.prototype.disposedComponentIds=function(){return r.platform.readStructField(this.batchAddress,2*a.structLength)},e.prototype.disposedEventHandlerIds=function(){return r.platform.readStructField(this.batchAddress,3*a.structLength)},e.prototype.updatedComponentsEntry=function(e,t){return c(e,t,u.structLength)},e.prototype.referenceFramesEntry=function(e,t){return c(e,t,s.structLength)},e.prototype.disposedComponentIdsEntry=function(e,t){var n=c(e,t,4);return r.platform.readInt32Field(n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=c(e,t,4);return r.platform.readInt32Field(n)},e}();t.SharedMemoryRenderBatch=o;var a={structLength:8,values:function(e){return r.platform.readObjectField(e,0)},count:function(e){return r.platform.readInt32Field(e,4)}},i={structLength:12,values:function(e){return r.platform.readObjectField(e,0)},offset:function(e){return r.platform.readInt32Field(e,4)},count:function(e){return r.platform.readInt32Field(e,8)}},u={structLength:4+i.structLength,componentId:function(e){return r.platform.readInt32Field(e,0)},edits:function(e){return r.platform.readStructField(e,4)},editsEntry:function(e,t){return c(e,t,l.structLength)}},l={structLength:20,editType:function(e){return r.platform.readInt32Field(e,0)},siblingIndex:function(e){return r.platform.readInt32Field(e,4)},newTreeIndex:function(e){return r.platform.readInt32Field(e,8)},moveToSiblingIndex:function(e){return r.platform.readInt32Field(e,8)},removedAttributeName:function(e){return r.platform.readStringField(e,16)}},s={structLength:36,frameType:function(e){return r.platform.readInt32Field(e,4)},subtreeLength:function(e){return r.platform.readInt32Field(e,8)},elementReferenceCaptureId:function(e){return r.platform.readStringField(e,16)},componentId:function(e){return r.platform.readInt32Field(e,12)},elementName:function(e){return r.platform.readStringField(e,16)},textContent:function(e){return r.platform.readStringField(e,16)},markupContent:function(e){return r.platform.readStringField(e,16)},attributeName:function(e){return r.platform.readStringField(e,16)},attributeValue:function(e){return r.platform.readStringField(e,24)},attributeEventHandlerId:function(e){return r.platform.readInt32Field(e,8)}};function c(e,t,n){return r.platform.getArrayEntryPtr(e,t,n)}}]); \ No newline at end of file diff --git a/src/Components/Browser.JS/package.json b/src/Components/Browser.JS/package.json index a19c9716e5ba0e9ae32a03407bf8b8925ecf590e..81d5679e85606b0d9ee2eb714eda8dcc34deb78c 100644 --- a/src/Components/Browser.JS/package.json +++ b/src/Components/Browser.JS/package.json @@ -5,16 +5,14 @@ "description": "", "main": "index.js", "scripts": { - "preclean": "cd utils && yarn install --mutex network", - "clean": "node utils/node_modules/rimraf/bin.js node_modules", - "prebuild": "yarn run clean && yarn install --mutex network", "build": "yarn run build:debug && yarn run build:production", "build:debug": "cd src && webpack --mode development --config ./webpack.config.js", "build:production": "cd src && webpack --mode production --config ./webpack.config.js", "test": "jest" }, "devDependencies": { - "@aspnet/signalr-protocol-msgpack": "file:../../SignalR/clients/ts/signalr-protocol-msgpack", + "@aspnet/signalr": "^1.0.0", + "@aspnet/signalr-protocol-msgpack": "^1.0.0", "@dotnet/jsinterop": "3.0.0-preview6.19280.1", "@types/emscripten": "0.0.31", "@types/jest": "^24.0.6", diff --git a/src/Components/Browser.JS/utils/package.json b/src/Components/Browser.JS/utils/package.json deleted file mode 100644 index d907073b214c89913fce12786555be0468dab5f7..0000000000000000000000000000000000000000 --- a/src/Components/Browser.JS/utils/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "common", - "private": true, - "version": "0.0.1", - "description": "Common dependencies used during dev time. DO NOT PUBLISH", - "devDependencies": { - "rimraf": "^2.6.2" - } -} diff --git a/src/Components/Browser.JS/utils/yarn.lock b/src/Components/Browser.JS/utils/yarn.lock deleted file mode 100644 index 146ae612a0e67caf41289d416b90d5a77ba39fc8..0000000000000000000000000000000000000000 --- a/src/Components/Browser.JS/utils/yarn.lock +++ /dev/null @@ -1,82 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -balanced-match@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" - integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -glob@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== - dependencies: - brace-expansion "^1.1.7" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -rimraf@^2.6.2: - version "2.6.3" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" - integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== - dependencies: - glob "^7.1.3" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/src/Components/Browser.JS/yarn.lock b/src/Components/Browser.JS/yarn.lock index 93412c449f5cb39bd57f99ffff324aa233069049..64311bdcc42e568235cda548c5ce303c7d787cdb 100644 --- a/src/Components/Browser.JS/yarn.lock +++ b/src/Components/Browser.JS/yarn.lock @@ -2,13 +2,17 @@ # yarn lockfile v1 -"@aspnet/signalr-protocol-msgpack@file:../../SignalR/clients/ts/signalr-protocol-msgpack": - version "3.0.0-dev" +"@aspnet/signalr-protocol-msgpack@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@aspnet/signalr-protocol-msgpack/-/signalr-protocol-msgpack-1.1.0.tgz#155038149e8e0eee1f97f4d1319f9f3271ff06fb" + integrity sha512-AQv5AavWvoFz2iLSIDK1DAIXMNhQ1Jt1qRDouXxLKAKP13u8iFq7i3/MwJ30ShOBGBoL5/zn6pBlNjAzTmAsMA== dependencies: msgpack5 "^4.0.2" -"@aspnet/signalr@file:../../SignalR/clients/ts/signalr": - version "3.0.0-dev" +"@aspnet/signalr@^1.0.0": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@aspnet/signalr/-/signalr-1.1.2.tgz#eb9cbc758ff5bfe9a2aba6669e05dfc25a6d783d" + integrity sha512-Xu2ndFTWYhyE+TOCK3LkPWGmc5xGLezBKgGEchyOA++alJ6fdWJ8P/Wsb4Mmd1buzcxGLlIyjpLfUP20rrCHIg== dependencies: eventsource "^1.0.7" request "^2.88.0" diff --git a/src/Components/test/testassets/ComponentsApp.App/Shared/NavMenu.razor b/src/Components/test/testassets/ComponentsApp.App/Shared/NavMenu.razor index 178e32d90a3ccef06ed621fa75715b884405d713..daace225376de886582d5ba3bff96da1bc38a53e 100644 --- a/src/Components/test/testassets/ComponentsApp.App/Shared/NavMenu.razor +++ b/src/Components/test/testassets/ComponentsApp.App/Shared/NavMenu.razor @@ -37,6 +37,11 @@ <span class="oi oi-list-rich" aria-hidden="true"></span> Error </NavLink> </li> + <li class="nav-item px-3"> + <NavLink class="nav-link" href="links"> + <span class="oi oi-list-rich" aria-hidden="true"></span> Links + </NavLink> + </li> </ul> </div> diff --git a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json index ec43ec225c137e148b3608557b65ded14fb52173..00b01bbd9a6cad357ebfb4a45edc90cd2741f68f 100644 --- a/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json +++ b/src/SignalR/clients/ts/signalr-protocol-msgpack/package.json @@ -41,8 +41,10 @@ "dist/**/*", "src/**/*" ], + "peerDependencies": { + "@aspnet/signalr": "^1.0.0-preview3" + }, "dependencies": { - "@aspnet/signalr": "file:../signalr", "msgpack5": "^4.0.2" }, "devDependencies": { diff --git a/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj b/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj index e42f9078d78a0963d4f85f9ca167661ef1b964a5..d918ed1ed0c1df37b9a70cdfad07ebb60e99245f 100644 --- a/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj +++ b/src/SignalR/clients/ts/signalr-protocol-msgpack/signalr-protocol-msgpack.npmproj @@ -3,19 +3,14 @@ <PropertyGroup> <PackageId>@aspnet/signalr-protocol-msgpack</PackageId> - <IsPackable>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsPackable> + <IsPackable>true</IsPackable> <IsTestProject>false</IsTestProject> - <IsShippingPackage>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsShippingPackage> - <IsBuildable>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsBuildable> + <IsShippingPackage>true</IsShippingPackage> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\signalr\signalr.npmproj" /> </ItemGroup> - <ItemGroup> - <ReplacePackageContent Include="file:../signalr" ReplaceWith=">=$(PackageVersion)" /> - </ItemGroup> - <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" /> </Project> diff --git a/src/SignalR/clients/ts/signalr-protocol-msgpack/yarn.lock b/src/SignalR/clients/ts/signalr-protocol-msgpack/yarn.lock index e4d150625feb5d40871edf7a32a398822fd2aa74..72f6c7ea87898f9881622072b26351384b3e68f6 100644 --- a/src/SignalR/clients/ts/signalr-protocol-msgpack/yarn.lock +++ b/src/SignalR/clients/ts/signalr-protocol-msgpack/yarn.lock @@ -2,13 +2,6 @@ # yarn lockfile v1 -"@aspnet/signalr@file:../signalr": - version "3.0.0-dev" - dependencies: - eventsource "^1.0.7" - request "^2.88.0" - ws "^6.0.0" - "@types/bl@*": version "0.8.31" resolved "https://registry.yarnpkg.com/@types/bl/-/bl-0.8.31.tgz#caa006702e13c36cda00345fa698b8d55c03113b" @@ -28,60 +21,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.5.tgz#6f9e8164ae1a55a9beb1d2571cfb7acf9d720c61" integrity sha512-JRnfoh0Ll4ElmIXKxbUfcOodkGvcNHljct6mO1X9hE/mlrMzAx0hYCLAD7sgT53YAY1HdlpzUcV0CkmDqUqTuA== -ajv@^6.5.5: - version "6.10.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" - integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== - dependencies: - fast-deep-equal "^2.0.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - -async-limiter@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" - integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" - integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== - base64-js@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.1.tgz#a91947da1f4a516ea38e5b4ec0ec3773675e0886" integrity sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw== -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - bl@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" @@ -98,118 +42,11 @@ buffer@^5.0.8: base64-js "^1.0.2" ieee754 "^1.1.4" -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= - -combined-stream@^1.0.6, combined-stream@~1.0.6: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -core-util-is@1.0.2, core-util-is@~1.0.0: +core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - -eventsource@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-1.0.7.tgz#8fbc72c93fcd34088090bc0a4e64f4b5cee6d8d0" - integrity sha512-4Ln17+vVT0k8aWq+t/bF5arcS3EpT9gYtW66EPacdj/mAFevznsnyoHLPy2BA8gbIQeIHoPsvwmfBftfcG//BQ== - dependencies: - original "^1.0.0" - -extend@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" - integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - -fast-deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" - integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= - -fast-json-stable-stringify@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" - integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= - -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.6" - mime-types "^2.1.12" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" - -har-schema@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" - integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= - -har-validator@~5.1.0: - version "5.1.3" - resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" - integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== - dependencies: - ajv "^6.5.5" - har-schema "^2.0.0" - -http-signature@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" - integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= - dependencies: - assert-plus "^1.0.0" - jsprim "^1.2.2" - sshpk "^1.7.0" - ieee754@^1.1.4: version "1.1.8" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" @@ -220,63 +57,11 @@ inherits@^2.0.3, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -is-typedarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" - integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= - isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= - -json-stringify-safe@~5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" - integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= - -jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.2.3" - verror "1.10.0" - -mime-db@1.40.0: - version "1.40.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.40.0.tgz#a65057e998db090f732a68f6c276d387d4126c32" - integrity sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA== - -mime-types@^2.1.12, mime-types@~2.1.19: - version "2.1.24" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.24.tgz#b6f8d0b3e951efb77dedeca194cff6d16f676f81" - integrity sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ== - dependencies: - mime-db "1.40.0" - msgpack5@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/msgpack5/-/msgpack5-4.0.2.tgz#88be70e432d142b7a379bfb170f433bd41447508" @@ -287,53 +72,11 @@ msgpack5@^4.0.2: readable-stream "^2.3.3" safe-buffer "^5.1.1" -oauth-sign@~0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" - integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== - -original@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" - integrity sha512-hyBVl6iqqUOJ8FqRe+l/gS8H+kKYjrEndd5Pm1MfBtsEKA038HkkdbAl/72EAXGyonD/PFsvmVG+EvcIpliMBg== - dependencies: - url-parse "^1.4.3" - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== -psl@^1.1.24: - version "1.1.31" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" - integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== - -punycode@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" - integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -querystringify@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.1.1.tgz#60e5a5fd64a7f8bfa4d2ab2ed6fdf4c85bad154e" - integrity sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA== - readable-stream@^2.3.3, readable-stream@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" @@ -347,67 +90,11 @@ readable-stream@^2.3.3, readable-stream@^2.3.5: string_decoder "~1.1.1" util-deprecate "~1.0.1" -request@^2.88.0: - version "2.88.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" - integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - har-validator "~5.1.0" - http-signature "~1.2.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - oauth-sign "~0.9.0" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.4.3" - tunnel-agent "^0.6.0" - uuid "^3.3.2" - -requires-port@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" - integrity sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8= - -safe-buffer@^5.0.1, safe-buffer@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" integrity sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg== -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - string_decoder@~1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" @@ -415,63 +102,7 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -tough-cookie@~2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" - integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== - dependencies: - psl "^1.1.24" - punycode "^1.4.1" - -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= - dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= - -uri-js@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" - integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== - dependencies: - punycode "^2.1.0" - -url-parse@^1.4.3: - version "1.4.7" - resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.4.7.tgz#a8a83535e8c00a316e403a5db4ac1b9b853ae278" - integrity sha512-d3uaVyzDB9tQoSXFvuSUNFibTd9zxd2bkVrDRvF5TmvWWQwqE4lgYJ5m+x1DbecWkw+LK4RNl2CU1hHuOKPVlg== - dependencies: - querystringify "^2.1.1" - requires-port "^1.0.0" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= - -uuid@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" - integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== - -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - -ws@^6.0.0: - version "6.2.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" - integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== - dependencies: - async-limiter "~1.0.0" diff --git a/src/SignalR/clients/ts/signalr/signalr.npmproj b/src/SignalR/clients/ts/signalr/signalr.npmproj index 28afdaec0afb0cc2d44fd4186975592023bd25f8..7c145fae0d20b47fbb584f4d724b9cb68da90400 100644 --- a/src/SignalR/clients/ts/signalr/signalr.npmproj +++ b/src/SignalR/clients/ts/signalr/signalr.npmproj @@ -3,10 +3,9 @@ <PropertyGroup> <PackageId>@aspnet/signalr</PackageId> - <IsPackable>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsPackable> + <IsPackable>true</IsPackable> <IsTestProject>false</IsTestProject> - <IsShippingPackage>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsShippingPackage> - <IsBuildable>!$(MSBuildProjectDirectory.Contains('node_modules'))</IsBuildable> + <IsShippingPackage>true</IsShippingPackage> </PropertyGroup> <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" /> diff --git a/src/SignalR/clients/ts/signalr/src/HttpConnection.ts b/src/SignalR/clients/ts/signalr/src/HttpConnection.ts index adaab94722b138261661a8307513f289a0db7229..729d01cc32a72dce33f54211f8d584de87ad6004 100644 --- a/src/SignalR/clients/ts/signalr/src/HttpConnection.ts +++ b/src/SignalR/clients/ts/signalr/src/HttpConnection.ts @@ -63,7 +63,6 @@ export class HttpConnection implements IConnection { private stopPromiseResolver!: (value?: PromiseLike<void>) => void; private stopError?: Error; private accessTokenFactory?: () => string | Promise<string>; - private sendQueue?: TransportSendQueue; public readonly features: any = {}; public connectionId?: string; @@ -147,12 +146,8 @@ export class HttpConnection implements IConnection { return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")); } - if (!this.sendQueue) { - this.sendQueue = new TransportSendQueue(this.transport!); - } - // Transport will not be null if state is connected - return this.sendQueue.send(data); + return this.transport!.send(data); } public async stop(error?: Error): Promise<void> { @@ -194,11 +189,6 @@ export class HttpConnection implements IConnection { // The transport should always be set if currently connected. If it wasn't set, it's likely because // stop was called during start() and start() failed. if (this.transport) { - if (this.sendQueue) { - this.sendQueue.stop(); - this.sendQueue = undefined; - } - try { await this.transport.stop(); } catch (e) { @@ -511,96 +501,3 @@ export class HttpConnection implements IConnection { function transportMatches(requestedTransport: HttpTransportType | undefined, actualTransport: HttpTransportType) { return !requestedTransport || ((actualTransport & requestedTransport) !== 0); } - -export class TransportSendQueue { - private buffer: any[] = []; - private sendBufferedData: PromiseSource; - private executing: boolean = true; - private transportResult: PromiseSource; - - constructor(private readonly transport: ITransport) { - this.sendBufferedData = new PromiseSource(); - this.transportResult = new PromiseSource(); - - // Suppress typescript error about handling Promises. The sendLoop doesn't need to be observed - this.sendLoop().then(() => {}, (_) => {}); - } - - public send(data: string | ArrayBuffer): Promise<void> { - this.bufferData(data); - return this.transportResult.promise; - } - - public stop(): void { - this.executing = false; - this.sendBufferedData.resolve(); - } - - private bufferData(data: string | ArrayBuffer): void { - if (this.buffer.length && typeof(this.buffer[0]) !== typeof(data)) { - throw new Error(`Expected data to be of type ${typeof(this.buffer)} but was of type ${typeof(data)}`); - } - - this.buffer.push(data); - this.sendBufferedData.resolve(); - } - - private async sendLoop(): Promise<void> { - while (true) { - await this.sendBufferedData.promise; - - if (!this.executing) { - // Did we stop? - break; - } - - this.sendBufferedData = new PromiseSource(); - - const transportResult = this.transportResult; - this.transportResult = new PromiseSource(); - - const data = typeof(this.buffer[0]) === "string" ? - this.buffer.join("") : - TransportSendQueue.concatBuffers(this.buffer); - - this.buffer.length = 0; - - try { - await this.transport.send(data); - transportResult.resolve(); - } catch (error) { - transportResult.reject(error); - } - } - } - - private static concatBuffers(arrayBuffers: ArrayBuffer[]): ArrayBuffer { - const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b); - const result = new Uint8Array(totalLength); - let offset = 0; - for (const item of arrayBuffers) { - result.set(new Uint8Array(item), offset); - offset += item.byteLength; - } - - return result; - } -} - -class PromiseSource { - private resolver?: () => void; - private rejecter!: (reason?: any) => void; - public promise: Promise<void>; - - constructor() { - this.promise = new Promise((resolve, reject) => [this.resolver, this.rejecter] = [resolve, reject]); - } - - public resolve(): void { - this.resolver!(); - } - - public reject(reason?: any): void { - this.rejecter!(reason); - } -} diff --git a/src/SignalR/clients/ts/signalr/src/HubConnection.ts b/src/SignalR/clients/ts/signalr/src/HubConnection.ts index 2a91ac45a15a4b932edfc7aa0f23151021d6ef64..1247c357977ef1f92896947011d4cfe4bb87191f 100644 --- a/src/SignalR/clients/ts/signalr/src/HubConnection.ts +++ b/src/SignalR/clients/ts/signalr/src/HubConnection.ts @@ -854,7 +854,7 @@ export class HubConnection { private isObservable(arg: any): arg is IStreamResult<any> { // This allows other stream implementations to just work (like rxjs) - return arg && arg.subscribe && typeof arg.subscribe === "function"; + return arg.subscribe && typeof arg.subscribe === "function"; } private createStreamInvocation(methodName: string, args: any[], streamIds: string[]): StreamInvocationMessage { diff --git a/src/SignalR/clients/ts/signalr/tests/HttpConnection.test.ts b/src/SignalR/clients/ts/signalr/tests/HttpConnection.test.ts index 3da6b5991848998685323c09daaae36fa7f432b1..39e44ef03d43bb98370daa402fd32690e230da31 100644 --- a/src/SignalR/clients/ts/signalr/tests/HttpConnection.test.ts +++ b/src/SignalR/clients/ts/signalr/tests/HttpConnection.test.ts @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. import { HttpResponse } from "../src/HttpClient"; -import { HttpConnection, INegotiateResponse, TransportSendQueue } from "../src/HttpConnection"; +import { HttpConnection, INegotiateResponse } from "../src/HttpConnection"; import { IHttpConnectionOptions } from "../src/IHttpConnectionOptions"; import { HttpTransportType, ITransport, TransferFormat } from "../src/ITransport"; @@ -12,7 +12,6 @@ import { EventSourceConstructor, WebSocketConstructor } from "../src/Polyfills"; import { eachEndpointUrl, eachTransport, VerifyLogger } from "./Common"; import { TestHttpClient } from "./TestHttpClient"; -import { TestTransport } from "./TestTransport"; import { PromiseSource, registerUnhandledRejectionHandler, SyncPoint } from "./Utils"; const commonOptions: IHttpConnectionOptions = { @@ -845,212 +844,3 @@ describe("HttpConnection", () => { }); }); }); - -describe("TransportSendQueue", () => { - it("sends data when not currently sending", async () => { - const sendMock = jest.fn(() => Promise.resolve()); - const transport = new TestTransport(); - transport.send = sendMock; - const queue = new TransportSendQueue(transport); - - await queue.send("Hello"); - - expect(sendMock.mock.calls.length).toBe(1); - - queue.stop(); - }); - - it("sends buffered data on fail", async () => { - const promiseSource1 = new PromiseSource(); - const promiseSource2 = new PromiseSource(); - const promiseSource3 = new PromiseSource(); - const transport = new TestTransport(); - const sendMock = jest.fn() - .mockImplementationOnce(async () => { - await promiseSource1; - promiseSource2.resolve(); - await promiseSource3; - }) - .mockImplementationOnce(() => Promise.resolve()); - transport.send = sendMock; - - const queue = new TransportSendQueue(transport); - - const first = queue.send("Hello"); - // This should allow first to enter transport.send - promiseSource1.resolve(); - // Wait until we're inside transport.send - await promiseSource2; - - // This should get queued. - const second = queue.send("world"); - - promiseSource3.reject(); - - let hasError = false; - try { - await first; - } catch { - hasError = true; - } - - await second; - - expect(hasError).toBe(true); - expect(sendMock.mock.calls.length).toBe(2); - expect(sendMock.mock.calls[0][0]).toEqual("Hello"); - expect(sendMock.mock.calls[1][0]).toEqual("world"); - - queue.stop(); - }); - - it("rejects promise for buffered sends", async () => { - const promiseSource1 = new PromiseSource(); - const promiseSource2 = new PromiseSource(); - const promiseSource3 = new PromiseSource(); - const transport = new TestTransport(); - const sendMock = jest.fn() - .mockImplementationOnce(async () => { - await promiseSource1; - promiseSource2.resolve(); - await promiseSource3; - }) - .mockImplementationOnce(() => Promise.reject()); - transport.send = sendMock; - - const queue = new TransportSendQueue(transport); - - const first = queue.send("Hello"); - // This should allow first to enter transport.send - promiseSource1.resolve(); - // Wait until we're inside transport.send - await promiseSource2; - - // This should get queued. - const second = queue.send("world"); - - promiseSource3.resolve(); - - await first; - - let hasError = false; - try { - await second; - } catch { - hasError = true; - } - - expect(hasError).toBe(true); - expect(sendMock.mock.calls.length).toBe(2); - expect(sendMock.mock.calls[0][0]).toEqual("Hello"); - expect(sendMock.mock.calls[1][0]).toEqual("world"); - - queue.stop(); - }); - - it ("concatenates string sends", async () => { - const promiseSource1 = new PromiseSource(); - const promiseSource2 = new PromiseSource(); - const promiseSource3 = new PromiseSource(); - const transport = new TestTransport(); - const sendMock = jest.fn() - .mockImplementationOnce(async () => { - await promiseSource1; - promiseSource2.resolve(); - await promiseSource3; - }) - .mockImplementationOnce(() => Promise.resolve()); - transport.send = sendMock; - - const queue = new TransportSendQueue(transport); - - const first = queue.send("Hello"); - // This should allow first to enter transport.send - promiseSource1.resolve(); - // Wait until we're inside transport.send - await promiseSource2; - - // These two operations should get queued. - const second = queue.send("world"); - const third = queue.send("!"); - - promiseSource3.resolve(); - - await Promise.all([first, second, third]); - - expect(sendMock.mock.calls.length).toBe(2); - expect(sendMock.mock.calls[0][0]).toEqual("Hello"); - expect(sendMock.mock.calls[1][0]).toEqual("world!"); - - queue.stop(); - }); - - it ("concatenates buffered ArrayBuffer", async () => { - const promiseSource1 = new PromiseSource(); - const promiseSource2 = new PromiseSource(); - const promiseSource3 = new PromiseSource(); - const transport = new TestTransport(); - const sendMock = jest.fn() - .mockImplementationOnce(async () => { - await promiseSource1; - promiseSource2.resolve(); - await promiseSource3; - }) - .mockImplementationOnce(() => Promise.resolve()); - transport.send = sendMock; - - const queue = new TransportSendQueue(transport); - - const first = queue.send(new Uint8Array([4, 5, 6])); - // This should allow first to enter transport.send - promiseSource1.resolve(); - // Wait until we're inside transport.send - await promiseSource2; - - // These two operations should get queued. - const second = queue.send(new Uint8Array([7, 8, 10])); - const third = queue.send(new Uint8Array([12, 14])); - - promiseSource3.resolve(); - - await Promise.all([first, second, third]); - - expect(sendMock.mock.calls.length).toBe(2); - expect(sendMock.mock.calls[0][0]).toEqual(new Uint8Array([4, 5, 6])); - expect(sendMock.mock.calls[1][0]).toEqual(new Uint8Array([7, 8, 10, 12, 14])); - - queue.stop(); - }); - - it ("throws if mixed data is queued", async () => { - const promiseSource1 = new PromiseSource(); - const promiseSource2 = new PromiseSource(); - const promiseSource3 = new PromiseSource(); - const transport = new TestTransport(); - const sendMock = jest.fn() - .mockImplementationOnce(async () => { - await promiseSource1; - promiseSource2.resolve(); - await promiseSource3; - }) - .mockImplementationOnce(() => Promise.resolve()); - transport.send = sendMock; - - const queue = new TransportSendQueue(transport); - - const first = queue.send(new Uint8Array([4, 5, 6])); - // This should allow first to enter transport.send - promiseSource1.resolve(); - // Wait until we're inside transport.send - await promiseSource2; - - // These two operations should get queued. - const second = queue.send(new Uint8Array([7, 8, 10])); - expect(() => queue.send("A string!")).toThrow(); - - promiseSource3.resolve(); - - await Promise.all([first, second]); - queue.stop(); - }); -}); diff --git a/src/SignalR/clients/ts/signalr/tests/HubConnection.test.ts b/src/SignalR/clients/ts/signalr/tests/HubConnection.test.ts index ed05cb32327ebd692aab51395a482828872cd82a..257f2e174dcf302a636bf189f0a76a42897e3933 100644 --- a/src/SignalR/clients/ts/signalr/tests/HubConnection.test.ts +++ b/src/SignalR/clients/ts/signalr/tests/HubConnection.test.ts @@ -123,35 +123,6 @@ describe("HubConnection", () => { } }); }); - - it("works if argument is null", async () => { - await VerifyLogger.run(async (logger) => { - const connection = new TestConnection(); - - const hubConnection = createHubConnection(connection, logger); - try { - // We don't actually care to wait for the send. - // tslint:disable-next-line:no-floating-promises - hubConnection.send("testMethod", "arg", null) - .catch((_) => { }); // Suppress exception and unhandled promise rejection warning. - - // Verify the message is sent - expect(connection.sentData.length).toBe(1); - expect(JSON.parse(connection.sentData[0])).toEqual({ - arguments: [ - "arg", - null, - ], - streamIds: [], - target: "testMethod", - type: MessageType.Invocation, - }); - } finally { - // Close the connection - await hubConnection.stop(); - } - }); - }); }); describe("invoke", () => { diff --git a/src/SignalR/clients/ts/signalr/tests/TestTransport.ts b/src/SignalR/clients/ts/signalr/tests/TestTransport.ts deleted file mode 100644 index c3a7d959641d893970df96575789c39c2ce8c131..0000000000000000000000000000000000000000 --- a/src/SignalR/clients/ts/signalr/tests/TestTransport.ts +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -import { ITransport } from "signalr/src/ITransport"; - -export class TestTransport implements ITransport { - public connect() { - return Promise.resolve(); - } - - public send(): Promise<void> { - return Promise.resolve(); - } - - public stop(): Promise<void> { - return Promise.resolve(); - } - - public onreceive: ((data: string | ArrayBuffer) => void) | null = null; - public onclose: ((error?: Error | undefined) => void) | null = null; -}