From 6c4a773d8bf7051299f4b22b5b0c3ebf75ae2b4e Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 13 Jan 2021 09:49:29 -0800 Subject: [PATCH 01/11] Remove Blazor WASM Sdk in repo --- eng/ProjectReferences.props | 1 - eng/targets/CSharp.Common.props | 16 - global.json | 2 +- .../Web.JS/dist/Release/blazor.server.js | 8 +- .../integrationtests/Directory.Build.props | 9 - ....BlazorWebAssembly.IntegrationTests.csproj | 80 -- .../integrationtests/ServiceWorkerAssert.cs | 85 -- .../WasmBuildIncrementalismTest.cs | 191 --- .../WasmBuildIntegrationTest.cs | 354 ------ .../integrationtests/WasmBuildLazyLoadTest.cs | 216 ---- .../integrationtests/WasmCompressionTests.cs | 168 --- .../WasmPublishIntegrationTest.cs | 1044 ----------------- .../integrationtests/WasmPwaManifestTests.cs | 213 ---- .../Sdk/integrationtests/xunit.runner.json | 5 - .../WebAssembly/Sdk/src/AssetsManifestFile.cs | 33 - .../src/BlazorReadSatelliteAssemblyFile.cs | 38 - .../src/BlazorWriteSatelliteAssemblyFile.cs | 53 - .../WebAssembly/Sdk/src/BootJsonData.cs | 108 -- .../WebAssembly/Sdk/src/BrotliCompress.cs | 136 --- .../CreateBlazorTrimmerRootDescriptorFile.cs | 79 -- .../WebAssembly/Sdk/src/GZipCompress.cs | 70 -- .../src/GenerateBlazorWebAssemblyBootJson.cs | 176 --- .../GenerateServiceWorkerAssetsManifest.cs | 97 -- ...Microsoft.NET.Sdk.BlazorWebAssembly.csproj | 95 -- ...Microsoft.NET.Sdk.BlazorWebAssembly.nuspec | 19 - .../WebAssembly/Sdk/src/Sdk/Sdk.props | 22 - .../WebAssembly/Sdk/src/Sdk/Sdk.targets | 24 - src/Components/WebAssembly/Sdk/src/_._ | 0 .../Microsoft.NET.Sdk.BlazorWebAssembly.props | 15 - .../Sdk/src/targets/BlazorWasm.web.config | 42 - ...ft.NET.Sdk.BlazorWebAssembly.Current.props | 34 - ....NET.Sdk.BlazorWebAssembly.Current.targets | 661 ----------- ...sembly.ServiceWorkerAssetsManifest.targets | 170 --- .../BlazorReadSatelliteAssemblyFileTest.cs | 68 -- .../Sdk/test/GenerateBlazorBootJsonTest.cs | 195 --- ...oft.NET.Sdk.BlazorWebAssembly.Tests.csproj | 12 - .../Sdk/testassets/Directory.Build.props | 40 - .../Sdk/testassets/Directory.Build.targets | 7 - .../LinkBaseToWebRoot/js/LinkedScript.js | 1 - .../RestoreBlazorWasmTestProjects.csproj | 14 - .../Sdk/testassets/blazor.webassembly.js | 1 - .../testassets/blazorhosted-rid/Program.cs | 12 - .../blazorhosted-rid/blazorhosted-rid.csproj | 22 - .../Sdk/testassets/blazorhosted/Program.cs | 16 - .../blazorhosted/blazorhosted.csproj | 12 - .../Sdk/testassets/blazorwasm-fxref/App.razor | 1 - .../testassets/blazorwasm-fxref/Program.cs | 11 - .../blazorwasm-fxref/blazorwasm-fxref.csproj | 31 - .../testassets/blazorwasm-minimal/App.razor | 8 - .../blazorwasm-minimal/Pages/Index.razor | 5 - .../testassets/blazorwasm-minimal/Program.cs | 11 - .../blazorwasm-minimal/_Imports.razor | 2 - .../blazorwasm-minimal.csproj | 27 - .../blazorwasm-minimal/wwwroot/css/app.css | 1 - .../blazorwasm-minimal/wwwroot/index.html | 24 - .../Sdk/testassets/blazorwasm/App.razor | 8 - .../blazorwasm/LinkToWebRoot/css/app.css | 1 - .../testassets/blazorwasm/Pages/Index.razor | 5 - .../Sdk/testassets/blazorwasm/Program.cs | 16 - .../blazorwasm/Resources.ja.resx.txt | 123 -- .../Sdk/testassets/blazorwasm/_Imports.razor | 2 - .../testassets/blazorwasm/blazorwasm.csproj | 53 - .../blazorwasm/wwwroot/Fake-License.txt | 1 - .../testassets/blazorwasm/wwwroot/css/app.css | 1 - .../testassets/blazorwasm/wwwroot/index.html | 24 - .../serviceworkers/my-prod-service-worker.js | 1 - .../serviceworkers/my-service-worker.js | 1 - .../Class1.cs | 12 - .../Resources.es-ES.resx | 123 -- ...classlibrarywithsatelliteassemblies.csproj | 14 - .../testassets/razorclasslibrary/Class1.cs | 6 - .../RazorClassLibrary.csproj | 9 - .../razorclasslibrary/wwwroot/styles.css | 1 - .../wwwroot/wwwroot/exampleJsInterop.js | 0 .../WebAssembly/Sdk/tools/Application.cs | 98 -- .../Sdk/tools/BrotliCompressCommand.cs | 85 -- .../WebAssembly/Sdk/tools/DebugMode.cs | 27 - ...oft.NET.Sdk.BlazorWebAssembly.Tools.csproj | 21 - .../WebAssembly/Sdk/tools/Program.cs | 30 - .../Sdk/tools/runtimeconfig.template.json | 3 - .../Directory.Build.props.in | 2 - 81 files changed, 5 insertions(+), 5447 deletions(-) delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/Directory.Build.props delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/ServiceWorkerAssert.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIncrementalismTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmBuildLazyLoadTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmCompressionTests.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/WasmPwaManifestTests.cs delete mode 100644 src/Components/WebAssembly/Sdk/integrationtests/xunit.runner.json delete mode 100644 src/Components/WebAssembly/Sdk/src/AssetsManifestFile.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/BlazorReadSatelliteAssemblyFile.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/BlazorWriteSatelliteAssemblyFile.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/BootJsonData.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/BrotliCompress.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/CreateBlazorTrimmerRootDescriptorFile.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/GZipCompress.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/GenerateBlazorWebAssemblyBootJson.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/GenerateServiceWorkerAssetsManifest.cs delete mode 100644 src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.csproj delete mode 100644 src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.nuspec delete mode 100644 src/Components/WebAssembly/Sdk/src/Sdk/Sdk.props delete mode 100644 src/Components/WebAssembly/Sdk/src/Sdk/Sdk.targets delete mode 100644 src/Components/WebAssembly/Sdk/src/_._ delete mode 100644 src/Components/WebAssembly/Sdk/src/build/net6.0/Microsoft.NET.Sdk.BlazorWebAssembly.props delete mode 100644 src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config delete mode 100644 src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props delete mode 100644 src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets delete mode 100644 src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets delete mode 100644 src/Components/WebAssembly/Sdk/test/BlazorReadSatelliteAssemblyFileTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/test/GenerateBlazorBootJsonTest.cs delete mode 100644 src/Components/WebAssembly/Sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/Directory.Build.props delete mode 100644 src/Components/WebAssembly/Sdk/testassets/Directory.Build.targets delete mode 100644 src/Components/WebAssembly/Sdk/testassets/LinkBaseToWebRoot/js/LinkedScript.js delete mode 100644 src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazor.webassembly.js delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/blazorhosted-rid.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorhosted/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorhosted/blazorhosted.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/App.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Pages/Index.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/_Imports.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/blazorwasm-minimal.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/css/app.css delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/index.html delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/App.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/LinkToWebRoot/css/app.css delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/Pages/Index.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/Resources.ja.resx.txt delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/_Imports.razor delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/blazorwasm.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/Fake-License.txt delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/css/app.css delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/index.html delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-prod-service-worker.js delete mode 100644 src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-service-worker.js delete mode 100644 src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Class1.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Resources.es-ES.resx delete mode 100644 src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/classlibrarywithsatelliteassemblies.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/Class1.cs delete mode 100644 src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/RazorClassLibrary.csproj delete mode 100644 src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/styles.css delete mode 100644 src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/wwwroot/exampleJsInterop.js delete mode 100644 src/Components/WebAssembly/Sdk/tools/Application.cs delete mode 100644 src/Components/WebAssembly/Sdk/tools/BrotliCompressCommand.cs delete mode 100644 src/Components/WebAssembly/Sdk/tools/DebugMode.cs delete mode 100644 src/Components/WebAssembly/Sdk/tools/Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj delete mode 100644 src/Components/WebAssembly/Sdk/tools/Program.cs delete mode 100644 src/Components/WebAssembly/Sdk/tools/runtimeconfig.template.json diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props index 5ad1aa1d9ca5..faf2d177965d 100644 --- a/eng/ProjectReferences.props +++ b/eng/ProjectReferences.props @@ -147,7 +147,6 @@ - diff --git a/eng/targets/CSharp.Common.props b/eng/targets/CSharp.Common.props index bddce450d74d..08e32152ae87 100644 --- a/eng/targets/CSharp.Common.props +++ b/eng/targets/CSharp.Common.props @@ -35,22 +35,6 @@ - - - - - - - - - - - $(ArtifactsBinDir)\Microsoft.NET.Sdk.BlazorWebAssembly\$(Configuration)\sdk-output\ - diff --git a/global.json b/global.json index 7318b27aacff..0022ce95d48a 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100-alpha.1.20523.3" + "version": "6.0.100-alpha.1.21063.4" }, "tools": { "dotnet": "6.0.100-alpha.1.20523.3", diff --git a/src/Components/Web.JS/dist/Release/blazor.server.js b/src/Components/Web.JS/dist/Release/blazor.server.js index a2813f891e77..360597aedf89 100644 --- a/src/Components/Web.JS/dist/Release/blazor.server.js +++ b/src/Components/Web.JS/dist/Release/blazor.server.js @@ -1,19 +1,19 @@ -!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";(function(e){n.d(t,"e",(function(){return c})),n.d(t,"a",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return f})),n.d(t,"i",(function(){return h})),n.d(t,"j",(function(){return p})),n.d(t,"f",(function(){return d})),n.d(t,"d",(function(){return g})),n.d(t,"b",(function(){return y})),n.d(t,"h",(function(){return v}));var r=n(0),o=n(4),i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch((function(e){}))},e}(),y=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 v(){var e="X-SignalR-User-Agent";return l.isNode&&(e="User-Agent"),[e,b(c,m(),E(),w())]}function b(e,t,n,r){var o="Microsoft SignalR/",i=e.split(".");return o+=i[0]+"."+i[1],o+=" ("+e+"; ",o+=t&&""!==t?t+"; ":"Unknown OS; ",o+=""+n,o+=r?"; "+r:"; Unknown Runtime Version",o+=")"}function m(){if(!l.isNode)return"";switch(e.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return e.platform}}function w(){if(l.isNode)return e.versions.node}function E(){return l.isNode?"NodeJS":"Browser"}}).call(this,n(13))},function(e,t,n){"use strict";n.r(t),n.d(t,"AbortError",(function(){return s})),n.d(t,"HttpError",(function(){return i})),n.d(t,"TimeoutError",(function(){return a})),n.d(t,"HttpClient",(function(){return l})),n.d(t,"HttpResponse",(function(){return u})),n.d(t,"DefaultHttpClient",(function(){return S})),n.d(t,"HubConnection",(function(){return O})),n.d(t,"HubConnectionState",(function(){return I})),n.d(t,"HubConnectionBuilder",(function(){return re})),n.d(t,"MessageType",(function(){return b})),n.d(t,"LogLevel",(function(){return f.a})),n.d(t,"HttpTransportType",(function(){return x})),n.d(t,"TransferFormat",(function(){return P})),n.d(t,"NullLogger",(function(){return $.a})),n.d(t,"JsonHubProtocol",(function(){return ee})),n.d(t,"Subject",(function(){return _})),n.d(t,"VERSION",(function(){return h.e}));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),a=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),s=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),c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=200&&o.status<300?n(new u(o.status,o.statusText,o.response||o.responseText)):r(new i(o.statusText,o.status))},o.onerror=function(){t.logger.log(f.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(f.a.Warning,"Timeout from HTTP request."),r(new a)},o.send(e.content||"")})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(l),E=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)}}(),S=function(e){function t(t){var n=e.call(this)||this;if("undefined"!=typeof fetch||h.c.isNode)n.httpClient=new v(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");n.httpClient=new w(t)}return n}return E(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new s):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}(l),C=n(46);!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"}(b||(b={}));var I,_=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]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]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]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]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]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 x.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new J(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket,this.options.headers||{});case x.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new H(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource,this.options.withCredentials,this.options.headers||{});case x.LongPolling:return new B(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.withCredentials,this.options.headers||{});default:throw new Error("Unknown transport: "+e+".")}},e.prototype.startTransport=function(e,t){var n=this;return this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return n.stopConnection(e)},this.transport.connect(e,t)},e.prototype.resolveTransportOrError=function(e,t,n){var r=x[e.transport];if(null==r)return this.logger.log(f.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(f.a.Debug,"Skipping transport '"+x[r]+"' because it was disabled by the client."),new Error("'"+x[r]+"' is disabled by the client.");if(!(e.transferFormats.map((function(e){return P[e]})).indexOf(n)>=0))return this.logger.log(f.a.Debug,"Skipping transport '"+x[r]+"' because it does not support the requested transfer format '"+P[n]+"'."),new Error("'"+x[r]+"' does not support "+P[n]+".");if(r===x.WebSockets&&!this.options.WebSocket||r===x.ServerSentEvents&&!this.options.EventSource)return this.logger.log(f.a.Debug,"Skipping transport '"+x[r]+"' because it is not supported in your environment.'"),new Error("'"+x[r]+"' is not supported in your environment.");this.logger.log(f.a.Debug,"Selecting transport '"+x[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){var t=this;if(this.logger.log(f.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)throw this.logger.log(f.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is still in the connecting state."),new Error("HttpConnection.stopConnection("+e+") was called while the connection is still in the connecting state.");if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(f.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(f.a.Information,"Connection disconnected."),this.sendQueue&&(this.sendQueue.stop().catch((function(e){t.logger.log(f.a.Error,"TransportSendQueue.stop() threw error '"+e+"'.")})),this.sendQueue=void 0),this.connectionId=void 0,this.connectionState="Disconnected",this.connectionStarted){this.connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this.logger.log(f.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(f.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(!h.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(f.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",-1===(n+=-1===t?"":e.substring(t)).indexOf("negotiateVersion")&&(n+=-1===t?"?":"&",n+="negotiateVersion="+this.negotiateVersion),n},e}();var G=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new Q,this.transportResult=new Q,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new Q),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},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 V(this,void 0,void 0,(function(){var t,n,r;return K(this,(function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new Q,t=this.transportResult,this.transportResult=void 0,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;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return r in e||(e[r]=[]),e}function s(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 a=u(t);if(n0;)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=f(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):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){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(21),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(19);i.inherits=n(15);var a=n(39),s=n(44);i.inherits(f,a);for(var c=o(s.prototype),u=0;u0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]-1&&this.subject.observers.splice(e,1),0===this.subject.observers.length&&this.subject.cancelCallback&&this.subject.cancelCallback().catch((function(e){}))},e}(),y=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 v(){var e="X-SignalR-User-Agent";return l.isNode&&(e="User-Agent"),[e,b(c,m(),E(),w())]}function b(e,t,n,r){var o="Microsoft SignalR/",i=e.split(".");return o+=i[0]+"."+i[1],o+=" ("+e+"; ",o+=t&&""!==t?t+"; ":"Unknown OS; ",o+=""+n,o+=r?"; "+r:"; Unknown Runtime Version",o+=")"}function m(){if(!l.isNode)return"";switch(e.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return e.platform}}function w(){if(l.isNode)return e.versions.node}function E(){return l.isNode?"NodeJS":"Browser"}}).call(this,n(11))},function(e,t,n){"use strict";n.r(t),n.d(t,"AbortError",(function(){return s})),n.d(t,"HttpError",(function(){return i})),n.d(t,"TimeoutError",(function(){return a})),n.d(t,"HttpClient",(function(){return l})),n.d(t,"HttpResponse",(function(){return u})),n.d(t,"DefaultHttpClient",(function(){return S})),n.d(t,"HubConnection",(function(){return R})),n.d(t,"HubConnectionState",(function(){return _})),n.d(t,"HubConnectionBuilder",(function(){return re})),n.d(t,"MessageType",(function(){return b})),n.d(t,"LogLevel",(function(){return f.a})),n.d(t,"HttpTransportType",(function(){return P})),n.d(t,"TransferFormat",(function(){return O})),n.d(t,"NullLogger",(function(){return Z.a})),n.d(t,"JsonHubProtocol",(function(){return ee})),n.d(t,"Subject",(function(){return k})),n.d(t,"VERSION",(function(){return h.e}));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),a=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),s=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),c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=200&&o.status<300?n(new u(o.status,o.statusText,o.response||o.responseText)):r(new i(o.statusText,o.status))},o.onerror=function(){t.logger.log(f.a.Warning,"Error from HTTP request. "+o.status+": "+o.statusText+"."),r(new i(o.statusText,o.status))},o.ontimeout=function(){t.logger.log(f.a.Warning,"Timeout from HTTP request."),r(new a)},o.send(e.content||"")})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))},t}(l),E=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)}}(),S=function(e){function t(t){var n=e.call(this)||this;if("undefined"!=typeof fetch||h.c.isNode)n.httpClient=new v(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");n.httpClient=new w(t)}return n}return E(t,e),t.prototype.send=function(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new s):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}(l),C=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}(),I=function(){function e(){}return e.prototype.writeHandshakeRequest=function(e){return C.write(JSON.stringify(e))},e.prototype.parseHandshakeResponse=function(e){var t,n;if(Object(h.i)(e)){var r=new Uint8Array(e);if(-1===(i=r.indexOf(C.RecordSeparatorCode)))throw new Error("Message is incomplete.");var o=i+1;t=String.fromCharCode.apply(null,r.slice(0,o)),n=r.byteLength>o?r.slice(o).buffer:null}else{var i,a=e;if(-1===(i=a.indexOf(C.RecordSeparator)))throw new Error("Message is incomplete.");o=i+1;t=a.substring(0,o),n=a.length>o?a.substring(o):null}var s=C.parse(t),c=JSON.parse(s[0]);if(c.type)throw new Error("Expected a handshake response from the server.");return[n,c]},e}();!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"}(b||(b={}));var _,k=function(){function e(){this.observers=[]}return e.prototype.next=function(e){for(var t=0,n=this.observers;t0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]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]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]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]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]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 P.WebSockets:if(!this.options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Y(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.WebSocket,this.options.headers||{});case P.ServerSentEvents:if(!this.options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new q(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.EventSource,this.options.withCredentials,this.options.headers||{});case P.LongPolling:return new N(this.httpClient,this.accessTokenFactory,this.logger,this.options.logMessageContent||!1,this.options.withCredentials,this.options.headers||{});default:throw new Error("Unknown transport: "+e+".")}},e.prototype.startTransport=function(e,t){var n=this;return this.transport.onreceive=this.onreceive,this.transport.onclose=function(e){return n.stopConnection(e)},this.transport.connect(e,t)},e.prototype.resolveTransportOrError=function(e,t,n){var r=P[e.transport];if(null==r)return this.logger.log(f.a.Debug,"Skipping transport '"+e.transport+"' because it is not supported by this client."),new Error("Skipping transport '"+e.transport+"' because it is not supported by this client.");if(!function(e,t){return!e||0!=(t&e)}(t,r))return this.logger.log(f.a.Debug,"Skipping transport '"+P[r]+"' because it was disabled by the client."),new Error("'"+P[r]+"' is disabled by the client.");if(!(e.transferFormats.map((function(e){return O[e]})).indexOf(n)>=0))return this.logger.log(f.a.Debug,"Skipping transport '"+P[r]+"' because it does not support the requested transfer format '"+O[n]+"'."),new Error("'"+P[r]+"' does not support "+O[n]+".");if(r===P.WebSockets&&!this.options.WebSocket||r===P.ServerSentEvents&&!this.options.EventSource)return this.logger.log(f.a.Debug,"Skipping transport '"+P[r]+"' because it is not supported in your environment.'"),new Error("'"+P[r]+"' is not supported in your environment.");this.logger.log(f.a.Debug,"Selecting transport '"+P[r]+"'.");try{return this.constructTransport(r)}catch(e){return e}},e.prototype.isITransport=function(e){return e&&"object"==typeof e&&"connect"in e},e.prototype.stopConnection=function(e){var t=this;if(this.logger.log(f.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)throw this.logger.log(f.a.Warning,"Call to HttpConnection.stopConnection("+e+") was ignored because the connection is still in the connecting state."),new Error("HttpConnection.stopConnection("+e+") was called while the connection is still in the connecting state.");if("Disconnecting"===this.connectionState&&this.stopPromiseResolver(),e?this.logger.log(f.a.Error,"Connection disconnected with error '"+e+"'."):this.logger.log(f.a.Information,"Connection disconnected."),this.sendQueue&&(this.sendQueue.stop().catch((function(e){t.logger.log(f.a.Error,"TransportSendQueue.stop() threw error '"+e+"'.")})),this.sendQueue=void 0),this.connectionId=void 0,this.connectionState="Disconnected",this.connectionStarted){this.connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this.logger.log(f.a.Error,"HttpConnection.onclose("+e+") threw error '"+t+"'.")}}}else this.logger.log(f.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(!h.c.isBrowser||!window.document)throw new Error("Cannot resolve '"+e+"'.");var t=window.document.createElement("a");return t.href=e,this.logger.log(f.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",-1===(n+=-1===t?"":e.substring(t)).indexOf("negotiateVersion")&&(n+=-1===t?"?":"&",n+="negotiateVersion="+this.negotiateVersion),n},e}();var Q=function(){function e(e){this.transport=e,this.buffer=[],this.executing=!0,this.sendBufferedData=new $,this.transportResult=new $,this.sendLoopPromise=this.sendLoop()}return e.prototype.send=function(e){return this.bufferData(e),this.transportResult||(this.transportResult=new $),this.transportResult.promise},e.prototype.stop=function(){return this.executing=!1,this.sendBufferedData.resolve(),this.sendLoopPromise},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 K(this,void 0,void 0,(function(){var t,n,r;return X(this,(function(o){switch(o.label){case 0:return[4,this.sendBufferedData.promise];case 1:if(o.sent(),!this.executing)return this.transportResult&&this.transportResult.reject("Connection stopped."),[3,6];this.sendBufferedData=new $,t=this.transportResult,this.transportResult=void 0,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;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0&&!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");return r in e||(e[r]=[]),e}function s(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 a=u(t);if(n0;)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=f(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):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){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(19),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var i=n(17);i.inherits=n(13);var a=n(38),s=n(43);i.inherits(f,a);for(var c=o(s.prototype),u=0;u=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}),n(21),n(15);var r=n(22),o=n(6),i={},a=!1;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(e);if(!r)throw new Error("Could not find any element matching selector '"+e+"'.");s(n||0,o.toLogicalElement(r,!0),t)},t.getRendererer=function(e){return i[e]},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),c=r.count(o),u=t.referenceFrames(),l=r.values(u),f=t.diffReader,h=0;h1)for(var n=1;nthis.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,c=this._offset(n),u=r-n,l=u,f=s&&t||0,h=c[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(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){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 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;e0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,a,s)}}))}),{root:i,rootMargin:o+"px"});a.observe(t),a.observe(n);var s=u(t),c=u(n);function u(e){var t=new MutationObserver((function(){a.unobserve(e),a.observe(e)}));return t.observe(e,{attributes:!0}),t}r[e._id]={intersectionObserver:a,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){var t=r[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete r[e._id])}};var r={}},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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].*)$/;function i(e,t){var n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){var r=new RegExp(o).exec(n.textContent),i=r&&r.groups&&r.groups.descriptor;if(!i)return;try{var s=function(e){var t=JSON.parse(e),n=t.type;if("server"!==n&&"webassembly"!==n)throw new Error("Invalid component type '"+n+"'.");return t}(i);switch(t){case"webassembly":return function(e,t,n){var r=e.type,o=e.assembly,i=e.typeName,s=e.parameterDefinitions,c=e.parameterValues,u=e.prerenderId;if("webassembly"!==r)return;if(!o)throw new Error("assembly must be defined when using a descriptor.");if(!i)throw new Error("typeName must be defined when using a descriptor.");if(u){var l=a(u,n);if(!l)throw new Error("Could not find an end component comment for '"+t+"'");return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:c&&atob(c),start:t,prerenderId:u,end:l}}return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:c&&atob(c),start:t}}(s,n,e);case"server":return function(e,t,n){var r=e.type,o=e.descriptor,i=e.sequence,s=e.prerenderId;if("server"!==r)return;if(!o)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===i)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(i))throw new Error("Error parsing the sequence '"+i+"' for component '"+JSON.stringify(e)+"'");if(s){var c=a(s,n);if(!c)throw new Error("Could not find an end component comment for '"+t+"'");return{type:r,sequence:i,descriptor:o,start:t,prerenderId:s,end:c}}return{type:r,sequence:i,descriptor:o,start:t}}(s,n,e)}}catch(e){throw new Error("Found malformed component comment at "+n.textContent)}}}function a(e,t){for(;t.next()&&t.currentElement;){var n=t.currentElement;if(n.nodeType===Node.COMMENT_NODE&&n.textContent){var r=new RegExp(o).exec(n.textContent),i=r&&r[1];if(i)return s(i,e),n}}}function s(e,t){var n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error("Invalid end of component comment: '"+e+"'");var r=n.prerenderId;if(!r)throw new Error("End of component comment must have a value for the prerendered property: '"+e+"'");if(r!==t)throw new Error("End of component comment prerendered property must match the start comment prerender id: '"+t+"', '"+r+"'")}var c=function(){function e(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}return e.prototype.next=function(){return this.currentIndex++,this.currentIndex0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1] * @license MIT */ -var r=n(55),o=n(56),i=n(57);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=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(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 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=!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 P(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return _(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}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(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:b(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):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){var i,a=1,s=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;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){for(var f=!0,h=0;ho&&(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>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function _(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;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){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],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}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<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(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),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n),f=0;fo)&&(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 w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(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)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.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>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function j(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 A(e,t,n,r,i){return i||j(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||j(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),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(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||R(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||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(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||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(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||R(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||R(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||R(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||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(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)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=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||D(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||D(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||D(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||D(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):M(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(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):M(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);D(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&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);D(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},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(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||D(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||D(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||D(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):M(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(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):M(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return A(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return A(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=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=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&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=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(8))},function(e,t,n){"use strict";var r=n(14).Buffer,o=n(58),i=n(20),a=n(71),s=n(74),c=n(75);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: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}),n(23),n(17);var r=n(24),o=n(7),i={},a=!1;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(e);if(!r)throw new Error("Could not find any element matching selector '"+e+"'.");s(n||0,o.toLogicalElement(r,!0),t)},t.getRendererer=function(e){return i[e]},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),c=r.count(o),u=t.referenceFrames(),l=r.values(u),f=t.diffReader,h=0;h1)for(var n=1;nthis.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,c=this._offset(n),u=r-n,l=u,f=s&&t||0,h=c[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(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){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 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;e0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,a,s)}}))}),{root:i,rootMargin:o+"px"});a.observe(t),a.observe(n);var s=u(t),c=u(n);function u(e){var t=new MutationObserver((function(){a.unobserve(e),a.observe(e)}));return t.observe(e,{attributes:!0}),t}r[e._id]={intersectionObserver:a,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){var t=r[e._id];t&&(t.intersectionObserver.disconnect(),t.mutationObserverBefore.disconnect(),t.mutationObserverAfter.disconnect(),e.dispose(),delete r[e._id])}};var r={}},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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].*)$/;function i(e,t){var n=e.currentElement;if(n&&n.nodeType===Node.COMMENT_NODE&&n.textContent){var r=new RegExp(o).exec(n.textContent),i=r&&r.groups&&r.groups.descriptor;if(!i)return;try{var s=function(e){var t=JSON.parse(e),n=t.type;if("server"!==n&&"webassembly"!==n)throw new Error("Invalid component type '"+n+"'.");return t}(i);switch(t){case"webassembly":return function(e,t,n){var r=e.type,o=e.assembly,i=e.typeName,s=e.parameterDefinitions,c=e.parameterValues,u=e.prerenderId;if("webassembly"!==r)return;if(!o)throw new Error("assembly must be defined when using a descriptor.");if(!i)throw new Error("typeName must be defined when using a descriptor.");if(u){var l=a(u,n);if(!l)throw new Error("Could not find an end component comment for '"+t+"'");return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:c&&atob(c),start:t,prerenderId:u,end:l}}return{type:r,assembly:o,typeName:i,parameterDefinitions:s&&atob(s),parameterValues:c&&atob(c),start:t}}(s,n,e);case"server":return function(e,t,n){var r=e.type,o=e.descriptor,i=e.sequence,s=e.prerenderId;if("server"!==r)return;if(!o)throw new Error("descriptor must be defined when using a descriptor.");if(void 0===i)throw new Error("sequence must be defined when using a descriptor.");if(!Number.isInteger(i))throw new Error("Error parsing the sequence '"+i+"' for component '"+JSON.stringify(e)+"'");if(s){var c=a(s,n);if(!c)throw new Error("Could not find an end component comment for '"+t+"'");return{type:r,sequence:i,descriptor:o,start:t,prerenderId:s,end:c}}return{type:r,sequence:i,descriptor:o,start:t}}(s,n,e)}}catch(e){throw new Error("Found malformed component comment at "+n.textContent)}}}function a(e,t){for(;t.next()&&t.currentElement;){var n=t.currentElement;if(n.nodeType===Node.COMMENT_NODE&&n.textContent){var r=new RegExp(o).exec(n.textContent),i=r&&r[1];if(i)return s(i,e),n}}}function s(e,t){var n=JSON.parse(e);if(1!==Object.keys(n).length)throw new Error("Invalid end of component comment: '"+e+"'");var r=n.prerenderId;if(!r)throw new Error("End of component comment must have a value for the prerendered property: '"+e+"'");if(r!==t)throw new Error("End of component comment prerendered property must match the start comment prerender id: '"+t+"', '"+r+"'")}var c=function(){function e(e){this.childNodes=e,this.currentIndex=-1,this.length=e.length}return e.prototype.next=function(){return this.currentIndex++,this.currentIndex0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=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=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=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.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 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(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(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return f(n)}var u,w="",I=!1,_=["{","}"];(p(n)&&(I=!0,_=["[","]"]),C(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return m(n)&&(w=" "+RegExp.prototype.toString.call(n)),E(n)&&(w=" "+Date.prototype.toUTCString.call(n)),S(n)&&(w=" "+f(n)),0!==a.length||I&&0!=n.length?r<0?m(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=I?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a=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,_)):_[0]+w+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),x(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=g(n)?l(e,c.value,null):l(e,c.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")),b(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 b(e){return void 0===e}function m(e){return w(e)&&"[object RegExp]"===I(e)}function w(e){return"object"==typeof e&&null!==e}function E(e){return w(e)&&"[object Date]"===I(e)}function S(e){return w(e)&&("[object Error]"===I(e)||e instanceof Error)}function C(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function _(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(),!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=b,t.isRegExp=m,t.isObject=w,t.isDate=E,t.isError=S,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(60);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=n(61),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 O(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;i0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.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):_(e,a)):E(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(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 C(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"),P(e)}function _(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=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;ei.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=u.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 R(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(D,t,e))}function D(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):C(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(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",f),e.removeListener("error",y),e.removeListener("unpipe",u),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",g),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(c):n.once("end",c),e.on("unpipe",u);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,P(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!==L(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),m(),e.removeListener("error",y),0===s(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]?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",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||(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;i0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=h.bind(r);return o.listener=n,r.wrapFn=o,o}function d(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;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=y(c,u);for(n=0;n=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=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){e.exports=n(40).EventEmitter},function(e,t,n){"use strict";var r=n(21);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";var r=n(67).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=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 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 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=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--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(21);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=b;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;b.WritableState=v;var u=n(19);u.inherits=n(15);var l={deprecate:n(70)},f=n(41),h=n(14).Buffer,p=o.Uint8Array||function(){};var d,g=n(42);function y(){}function v(e,t){s=s||n(9),e=e||{};var r=t instanceof s;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 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(I,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),I(e,t))}(e,n,r,t,o);else{var a=S(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||E(e,n),r?c(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 b(e){if(s=s||n(9),!(d.call(b,this)||this instanceof s))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)),f.call(this)}function m(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(),I(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,c=!0;n;)o[s]=n,n.isBuf||(c=!1),n=n.next,s+=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 a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,f=n.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,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 C(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(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(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(b,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(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,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 c=t.length-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,I(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(13),n(68).setImmediate,n(8))},function(e,t,n){"use strict";e.exports=a;var r=n(9),o=n(19);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.lengths?a.slice(s).buffer:null}else{var c,u=t;if(-1===(c=u.indexOf(r.a.RecordSeparator)))throw new Error("Message is incomplete.");s=c+1;n=u.substring(0,s),i=u.length>s?u.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(10).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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]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},a=this&&this.__spread||function(){for(var e=[],t=0;t0?a-4:a;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?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,c=a.length;s0)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>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,c=(1<>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-u;else{if(i===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=u}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<>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*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-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<0;e[n+p]=255&a,p+=d,a/=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(59); +var r=n(53),o=n(54),i=n(55);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=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(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 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=!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 P(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return _(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}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(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:b(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):b(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,o){var i,a=1,s=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;a=2,s/=2,c/=2,n/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var l=-1;for(i=n;is&&(n=s-c),i=n;i>=0;i--){for(var f=!0,h=0;ho&&(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>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function _(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;o239?4:u>223?3:u>191?2:1;if(o+f<=n)switch(f){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],a=e[o+2],128==(192&i)&&128==(192&a)&&(c=(15&u)<<12|(63&i)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],128==(192&i)&&128==(192&a)&&128==(192&s)&&(c=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}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<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(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),a=(n>>>=0)-(t>>>=0),s=Math.min(i,a),u=this.slice(r,o),l=e.slice(t,n),f=0;fo)&&(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 w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return C(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(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)}};function T(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;or)&&(n=r);for(var o="",i=t;in)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,n,r,o,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.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>>8*(r?o:1-o)}function M(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o>>8*(r?o:3-o)&255}function j(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 A(e,t,n,r,i){return i||j(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function B(e,t,n,r,i){return i||j(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),t0&&(o*=256);)r+=this[e+--t]*o;return r},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(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||R(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||R(e,t,this.length);for(var r=this[e],o=1,i=0;++i=(o*=128)&&(r-=Math.pow(2,8*t)),r},c.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(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||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(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||R(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||R(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||R(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||R(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(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)||D(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i=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||D(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||D(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||D(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||D(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):M(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||D(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):M(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);D(this,e,t,n,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&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);D(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},c.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||D(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||D(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||D(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||D(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):M(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||D(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):M(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,n){return A(this,e,t,!0,n)},c.prototype.writeFloatBE=function(e,t,n){return A(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=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=0;--o)e[o+t]=this[o+n];else if(i<1e3||!c.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i55295&&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=t.length||o>=e.length);++o)t[o+n]=e[o];return o}}).call(this,n(7))},function(e,t,n){(function(e){var r=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r=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=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=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.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 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(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(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return f(n)}var u,w="",I=!1,_=["{","}"];(p(n)&&(I=!0,_=["[","]"]),C(n))&&(w=" [Function"+(n.name?": "+n.name:"")+"]");return m(n)&&(w=" "+RegExp.prototype.toString.call(n)),E(n)&&(w=" "+Date.prototype.toUTCString.call(n)),S(n)&&(w=" "+f(n)),0!==a.length||I&&0!=n.length?r<0?m(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=I?function(e,t,n,r,o){for(var i=[],a=0,s=t.length;a=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,_)):_[0]+w+_[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),x(r,o)||(a="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=g(n)?l(e,c.value,null):l(e,c.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")),b(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 b(e){return void 0===e}function m(e){return w(e)&&"[object RegExp]"===I(e)}function w(e){return"object"==typeof e&&null!==e}function E(e){return w(e)&&"[object Date]"===I(e)}function S(e){return w(e)&&("[object Error]"===I(e)||e instanceof Error)}function C(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function _(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(),!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=b,t.isRegExp=m,t.isObject=w,t.isDate=E,t.isError=S,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(58);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[_(e.getHours()),_(e.getMinutes()),_(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",T(),t.format.apply(t,arguments))},t.inherits=n(59),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 O(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;i0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.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):_(e,a)):E(e,a,t,!1))):r||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(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 C(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"),P(e)}function _(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(k,e,t))}function k(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=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;ei.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=u.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 R(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(D,t,e))}function D(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function L(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?R(this):C(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&R(this),null;var r,o=t.needReadable;return p("need readable",o),(0===t.length||t.length-e0?O(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&R(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",f),e.removeListener("error",y),e.removeListener("unpipe",u),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",g),h=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function l(){p("onend"),e.end()}i.endEmitted?o.nextTick(c):n.once("end",c),e.on("unpipe",u);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,P(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!==L(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),m(),e.removeListener("error",y),0===s(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]?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",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||(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;i0&&a.length>o&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,s=c,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=h.bind(r);return o.listener=n,r.wrapFn=o,o}function d(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;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=y(c,u);for(n=0;n=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=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.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(19);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";var r=n(65).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=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 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 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=0)return o>0&&(e.lastNeed=o-1),o;if(--r=0)return o>0&&(e.lastNeed=o-2),o;if(--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(19);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=b;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:i.nextTick;b.WritableState=v;var u=n(17);u.inherits=n(13);var l={deprecate:n(68)},f=n(40),h=n(12).Buffer,p=o.Uint8Array||function(){};var d,g=n(41);function y(){}function v(e,t){s=s||n(8),e=e||{};var r=t instanceof s;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 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(I,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),I(e,t))}(e,n,r,t,o);else{var a=S(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||E(e,n),r?c(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 b(e){if(s=s||n(8),!(d.call(b,this)||this instanceof s))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)),f.call(this)}function m(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(),I(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,c=!0;n;)o[s]=n,n.isBuf||(c=!1),n=n.next,s+=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 a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,l=n.encoding,f=n.callback;if(m(e,t,!1,t.objectMode?1:u.length,u,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 C(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(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(C,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(b,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(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,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 c=t.length-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,I(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(11),n(66).setImmediate,n(7))},function(e,t,n){"use strict";e.exports=a;var r=n(8),o=n(17);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.length0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]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},a=this&&this.__spread||function(){for(var e=[],t=0;t0?a-4:a;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?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,c=a.length;s0)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>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,c=(1<>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-u;else{if(i===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),i-=u}return(p?-1:1)*a*Math.pow(2,i-r)},t.write=function(e,t,n,r,o,i){var a,s,c,u=8*i-o-1,l=(1<>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*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+f>=1?h/c:h*Math.pow(2,1-f))*c>=2&&(a++,c/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(t*c-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<0;e[n+p]=255&a,p+=d,a/=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(57); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(s=l[u],!m(e[s],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function E(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&&v(o,n,"Missing expected exception"+r);var i="string"==typeof r,s=!e&&o&&!n;if((!e&&a.isError(o)&&i&&E(o,n)||s)&&v(o,n,"Got unwanted exception"+r),e&&o&&n&&!E(o,n)||!e&&o)throw o}h.AssertionError=function(e){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=function(e){return g(y(e.actual),128)+" "+e.operator+" "+g(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=d(t),i=r.indexOf("\n"+o);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(h.AssertionError,Error),h.fail=v,h.ok=b,h.equal=function(e,t,n){e!=t&&v(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&v(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){m(e,t,!1)||v(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){m(e,t,!0)||v(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){m(e,t,!1)&&v(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){m(t,n,!0)&&v(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&v(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&v(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},h.strict=r((function e(t,n){t||v(t,!0,n,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var C=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(8))},function(e,t,n){"use strict"; + */function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o=0;u--)if(l[u]!==f[u])return!1;for(u=l.length-1;u>=0;u--)if(s=l[u],!m(e[s],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function E(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&&v(o,n,"Missing expected exception"+r);var i="string"==typeof r,s=!e&&o&&!n;if((!e&&a.isError(o)&&i&&E(o,n)||s)&&v(o,n,"Got unwanted exception"+r),e&&o&&n&&!E(o,n)||!e&&o)throw o}h.AssertionError=function(e){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=function(e){return g(y(e.actual),128)+" "+e.operator+" "+g(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=d(t),i=r.indexOf("\n"+o);if(i>=0){var a=r.indexOf("\n",i+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(h.AssertionError,Error),h.fail=v,h.ok=b,h.equal=function(e,t,n){e!=t&&v(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&v(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){m(e,t,!1)||v(e,t,n,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,n){m(e,t,!0)||v(e,t,n,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,n){m(e,t,!1)&&v(e,t,n,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,n,r){m(t,n,!0)&&v(t,n,r,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,n){e!==t&&v(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&v(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},h.strict=r((function e(t,n){t||v(t,!0,n,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var C=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(7))},function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u0?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){var r=n(10),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),a.prototype=Object.create(o.prototype),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,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(69),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(8))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},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;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(39)).Stream=t,t.Readable=t,t.Writable=n(44),t.Duplex=n(9),t.Transform=n(45),t.PassThrough=n(73)},function(e,t,n){"use strict";e.exports=i;var r=n(45),o=n(19);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(15),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(20);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(36).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=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: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&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=[],c=0;for(t+=o,a=0;a.1)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,a){function s(c,u){var l,f,h;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)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,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(s(t,!0)),e}),o().append(l));else{if(!a&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+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,a,s=[];for(n=0;n>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)}(c)||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:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce((function(e,t){return e.append(t)}),o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return i(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 i(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 i(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 a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]this.nextBatchId?this.fatalError?(this.logger.log(s.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}}))}))},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}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(78),o=n(79),i=function(){function e(e){this.batchData=e;var t=new u(e);this.arrayRangeReader=new l(e),this.arrayBuilderSegmentReader=new f(e),this.diffReader=new a(e),this.editReader=new s(e,t),this.frameReader=new c(e,t)}return e.prototype.updatedComponents=function(){return o.readInt32LE(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return o.readInt32LE(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return o.readUint64LE(this.batchData,n)},e}();t.OutOfProcessRenderBatch=i;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return o.readInt32LE(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 o.readInt32LE(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return o.readUint64LE(this.batchDataUint8,e+12)},e}(),u=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=o.readInt32LE(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t=o.readInt32LE(this.batchDataUint8,this.stringTableStartIndex+4*e),n=o.readLEB128(this.batchDataUint8,t),i=t+o.numLEB128Bytes(n),a=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,n);return r.decodeUtf8(a)},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),f=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}()},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(;t65535&&(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=Math.pow(2,32),o=Math.pow(2,21)-1;function i(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}t.readInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},t.readUint32LE=i,t.readUint64LE=function(e,t){var n=i(e,t+4);if(n>o)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*r+i(e,t)},t.readLEB128=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<=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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]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]e.MaximumFirstRetryInterval?e.MaximumFirstRetryInterval:t.retryIntervalMilliseconds,[4,this.delay(r)]):[3,7];case 2:if(o.sent(),this.isDisposed)return[3,7];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.reconnectCallback()];case 4:return o.sent()||this.reconnectDisplay.rejected(),[2];case 5:return i=o.sent(),this.logger.log(s.LogLevel.Error,i),[3,6];case 6:return n++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}}))}))},e.prototype.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.MaximumFirstRetryInterval=3e3,e}()},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.getLoader=function(){var e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e},e}();t.DefaultReconnectDisplay=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,n,r){this.dialog=t,this.maxRetries=n,this.document=r,this.document=r;var o=this.document.getElementById(e.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.update=function(t){var n=this.document.getElementById(e.CurrentAttemptId);n&&(n.innerText=t.toString())},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.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e.MaxRetriesId="components-reconnect-max-retries",e.CurrentAttemptId="components-reconnect-current-attempt",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return l})),n.d(t,"MessagePackHubProtocol",(function(){return u}));var r=n(10),o=n(11),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;o7)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=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=3?e[2]:void 0,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,streamIds:[],target:t[3],type:i.MessageType.Invocation}:{arguments:t[4],headers:e,streamIds:[],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(o!==this.voidResult&&t.length<5)throw new Error("Invalid payload for Completion message.");switch(o){case this.errorResult:n=t[4];break;case this.nonVoidResult:r=t[4]}return{error:n,headers:e,invocationId:t[2],result:r,type:i.MessageType.Completion}},e.prototype.writeInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t,n=o(this.messagePackOptions);return t=e.streamIds?n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):n.encode([i.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),a.write(t.slice())},e.prototype.writeStreamItem=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.StreamItem,e.headers||{},e.invocationId,e.item]);return a.write(t.slice())},e.prototype.writeCompletion=function(e){var t,n=o(this.messagePackOptions),r=e.error?this.errorResult:e.result?this.nonVoidResult:this.voidResult;switch(r){case this.errorResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.error]);break;case this.voidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r]);break;case this.nonVoidResult:t=n.encode([i.MessageType.Completion,e.headers||{},e.invocationId,r,e.result])}return a.write(t.slice())},e.prototype.writeCancelInvocation=function(e){var t=o(this.messagePackOptions).encode([i.MessageType.CancelInvocation,e.headers||{},e.invocationId]);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}(),l="6.0.0-dev"}]); \ No newline at end of file +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=a(e),u=1;u0?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){var r=n(34),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),a.prototype=Object.create(o.prototype),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,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(67),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(7))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,o,i,a,s,c=1,u={},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;n0?this._transform(null,t,n):n()},e.exports.decoder=c,e.exports.encoder=s},function(e,t,n){(t=e.exports=n(38)).Stream=t,t.Readable=t,t.Writable=n(43),t.Duplex=n(8),t.Transform=n(44),t.PassThrough=n(71)},function(e,t,n){"use strict";e.exports=i;var r=n(44),o=n(17);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}o.inherits=n(13),o.inherits(i,r),i.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){var r=n(18);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(35).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=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: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&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=[],c=0;for(t+=o,a=0;a.1)&&((n=r.allocUnsafe(9))[0]=203,n.writeDoubleBE(e,1)),n}e.exports=function(e,t,n,a){function s(c,u){var l,f,h;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)(f=r.byteLength(c))<32?((l=r.allocUnsafe(1+f))[0]=160|f,f>0&&l.write(c,1)):f<=255&&!n?((l=r.allocUnsafe(2+f))[0]=217,l[1]=f,l.write(c,2)):f<=65535?((l=r.allocUnsafe(3+f))[0]=218,l.writeUInt16BE(f,1),l.write(c,3)):((l=r.allocUnsafe(5+f))[0]=219,l.writeUInt32BE(f,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(s(t,!0)),e}),o().append(l));else{if(!a&&"function"==typeof c.getDate)return function(e){var t,n=1*e,i=Math.floor(n/1e3),a=1e6*(n-1e3*i);if(a||i>4294967295){(t=new r(10))[0]=215,t[1]=-1;var s=4*a,c=i/Math.pow(2,32),u=s+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,a,s=[];for(n=0;n>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)}(c)||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:((n=r.allocUnsafe(3))[0]=222,n.writeUInt16BE(a,1));return i.unshift(n),i.reduce((function(e,t){return e.append(t)}),o())}(c);else if("number"==typeof c){if((h=c)!==Math.floor(h))return i(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 i(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 i(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 a=1,s=t+7;s>=t;s--){var c=(255^e[s])+a;e[s]=255&c,a=c>>8}}(l,1,c)}}}if(!l)throw new Error("not implemented yet");return u?l:l.slice()}return s}},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]this.nextBatchId?this.fatalError?(this.logger.log(s.LogLevel.Debug,"Received a new batch "+e+" but errored out on a previous batch "+(this.nextBatchId-1)),[4,n.send("OnRenderCompleted",this.nextBatchId-1,this.fatalError.toString())]):[3,4]:[3,5];case 3:return o.sent(),[2];case 4:return this.logger.log(s.LogLevel.Debug,"Waiting for batch "+this.nextBatchId+". Batch "+e+" not processed."),[2];case 5:return o.trys.push([5,7,,8]),this.nextBatchId++,this.logger.log(s.LogLevel.Debug,"Applying batch "+e+"."),i.renderBatch(this.browserRendererId,new a.OutOfProcessRenderBatch(t)),[4,this.completeBatch(n,e)];case 6:return o.sent(),[3,8];case 7:throw r=o.sent(),this.fatalError=r.toString(),this.logger.log(s.LogLevel.Error,"There was an error applying batch "+e+"."),n.send("OnRenderCompleted",e,r.toString()),r;case 8:return[2]}}))}))},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}();t.RenderQueue=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(76),o=n(77),i=function(){function e(e){this.batchData=e;var t=new u(e);this.arrayRangeReader=new l(e),this.arrayBuilderSegmentReader=new f(e),this.diffReader=new a(e),this.editReader=new s(e,t),this.frameReader=new c(e,t)}return e.prototype.updatedComponents=function(){return o.readInt32LE(this.batchData,this.batchData.length-20)},e.prototype.referenceFrames=function(){return o.readInt32LE(this.batchData,this.batchData.length-16)},e.prototype.disposedComponentIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-12)},e.prototype.disposedEventHandlerIds=function(){return o.readInt32LE(this.batchData,this.batchData.length-8)},e.prototype.updatedComponentsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.referenceFramesEntry=function(e,t){return e+20*t},e.prototype.disposedComponentIdsEntry=function(e,t){var n=e+4*t;return o.readInt32LE(this.batchData,n)},e.prototype.disposedEventHandlerIdsEntry=function(e,t){var n=e+8*t;return o.readUint64LE(this.batchData,n)},e}();t.OutOfProcessRenderBatch=i;var a=function(){function e(e){this.batchDataUint8=e}return e.prototype.componentId=function(e){return o.readInt32LE(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 o.readInt32LE(this.batchDataUint8,e)},e.prototype.siblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.newTreeIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.moveToSiblingIndex=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.removedAttributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+12);return this.stringReader.readString(t)},e}(),c=function(){function e(e,t){this.batchDataUint8=e,this.stringReader=t}return e.prototype.frameType=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.subtreeLength=function(e){return o.readInt32LE(this.batchDataUint8,e+4)},e.prototype.elementReferenceCaptureId=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.componentId=function(e){return o.readInt32LE(this.batchDataUint8,e+8)},e.prototype.elementName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.textContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.markupContent=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeName=function(e){var t=o.readInt32LE(this.batchDataUint8,e+4);return this.stringReader.readString(t)},e.prototype.attributeValue=function(e){var t=o.readInt32LE(this.batchDataUint8,e+8);return this.stringReader.readString(t)},e.prototype.attributeEventHandlerId=function(e){return o.readUint64LE(this.batchDataUint8,e+12)},e}(),u=function(){function e(e){this.batchDataUint8=e,this.stringTableStartIndex=o.readInt32LE(e,e.length-4)}return e.prototype.readString=function(e){if(-1===e)return null;var t=o.readInt32LE(this.batchDataUint8,this.stringTableStartIndex+4*e),n=o.readLEB128(this.batchDataUint8,t),i=t+o.numLEB128Bytes(n),a=new Uint8Array(this.batchDataUint8.buffer,this.batchDataUint8.byteOffset+i,n);return r.decodeUtf8(a)},e}(),l=function(){function e(e){this.batchDataUint8=e}return e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}(),f=function(){function e(e){this.batchDataUint8=e}return e.prototype.offset=function(e){return 0},e.prototype.count=function(e){return o.readInt32LE(this.batchDataUint8,e)},e.prototype.values=function(e){return e+4},e}()},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(;t65535&&(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=Math.pow(2,32),o=Math.pow(2,21)-1;function i(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}t.readInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24},t.readUint32LE=i,t.readUint64LE=function(e,t){var n=i(e,t+4);if(n>o)throw new Error("Cannot read uint64 with high order part "+n+", because the result would exceed Number.MAX_SAFE_INTEGER.");return n*r+i(e,t)},t.readLEB128=function(e,t){for(var n=0,r=0,o=0;o<4;o++){var i=e[t+o];if(n|=(127&i)<=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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]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]e.MaximumFirstRetryInterval?e.MaximumFirstRetryInterval:t.retryIntervalMilliseconds,[4,this.delay(r)]):[3,7];case 2:if(o.sent(),this.isDisposed)return[3,7];o.label=3;case 3:return o.trys.push([3,5,,6]),[4,this.reconnectCallback()];case 4:return o.sent()||this.reconnectDisplay.rejected(),[2];case 5:return i=o.sent(),this.logger.log(s.LogLevel.Error,i),[3,6];case 6:return n++,[3,1];case 7:return this.reconnectDisplay.failed(),[2]}}))}))},e.prototype.delay=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.MaximumFirstRetryInterval=3e3,e}()},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{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((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=a.trys,(o=o.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]reloading the page if you're unable to reconnect.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.rejected=function(){this.button.style.display="none",this.reloadParagraph.style.display="none",this.loader.style.display="none",this.message.innerHTML="Could not reconnect to the server. Reload the page to restore functionality.",this.message.querySelector("a").addEventListener("click",(function(){return location.reload()}))},e.prototype.getLoader=function(){var e=this.document.createElement("div");return e.style.cssText=["border: 0.3em solid #f3f3f3","border-top: 0.3em solid #3498db","border-radius: 50%","width: 2em","height: 2em","display: inline-block"].join(";"),e.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:2e3,iterations:1/0}),e},e}();t.DefaultReconnectDisplay=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,n,r){this.dialog=t,this.maxRetries=n,this.document=r,this.document=r;var o=this.document.getElementById(e.MaxRetriesId);o&&(o.innerText=this.maxRetries.toString())}return e.prototype.show=function(){this.removeClasses(),this.dialog.classList.add(e.ShowClassName)},e.prototype.update=function(t){var n=this.document.getElementById(e.CurrentAttemptId);n&&(n.innerText=t.toString())},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.rejected=function(){this.removeClasses(),this.dialog.classList.add(e.RejectedClassName)},e.prototype.removeClasses=function(){this.dialog.classList.remove(e.ShowClassName,e.HideClassName,e.FailedClassName,e.RejectedClassName)},e.ShowClassName="components-reconnect-show",e.HideClassName="components-reconnect-hide",e.FailedClassName="components-reconnect-failed",e.RejectedClassName="components-reconnect-rejected",e.MaxRetriesId="components-reconnect-max-retries",e.CurrentAttemptId="components-reconnect-current-attempt",e}();t.UserSpecifiedDisplay=r},function(e,t,n){"use strict";n.r(t),n.d(t,"VERSION",(function(){return u})),n.d(t,"MessagePackHubProtocol",(function(){return c}));var r=n(9),o=n(2),i=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;o7)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 a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=3?e[2]:void 0,error:e[1],type:o.MessageType.Close}},e.prototype.createPingMessage=function(e){if(e.length<1)throw new Error("Invalid payload for Ping message.");return{type:o.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,streamIds:[],target:t[3],type:o.MessageType.Invocation}:{arguments:t[4],headers:e,streamIds:[],target:t[3],type:o.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:o.MessageType.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.MessageType.Completion}},e.prototype.writeInvocation=function(e){var t,n=r(this.messagePackOptions);return t=e.streamIds?n.encode([o.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments,e.streamIds]):n.encode([o.MessageType.Invocation,e.headers||{},e.invocationId||null,e.target,e.arguments]),i.write(t.slice())},e.prototype.writeStreamInvocation=function(e){var t,n=r(this.messagePackOptions);return t=e.streamIds?n.encode([o.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments,e.streamIds]):n.encode([o.MessageType.StreamInvocation,e.headers||{},e.invocationId,e.target,e.arguments]),i.write(t.slice())},e.prototype.writeStreamItem=function(e){var t=r(this.messagePackOptions).encode([o.MessageType.StreamItem,e.headers||{},e.invocationId,e.item]);return i.write(t.slice())},e.prototype.writeCompletion=function(e){var t,n=r(this.messagePackOptions),a=e.error?this.errorResult:e.result?this.nonVoidResult:this.voidResult;switch(a){case this.errorResult:t=n.encode([o.MessageType.Completion,e.headers||{},e.invocationId,a,e.error]);break;case this.voidResult:t=n.encode([o.MessageType.Completion,e.headers||{},e.invocationId,a]);break;case this.nonVoidResult:t=n.encode([o.MessageType.Completion,e.headers||{},e.invocationId,a,e.result])}return i.write(t.slice())},e.prototype.writeCancelInvocation=function(e){var t=r(this.messagePackOptions).encode([o.MessageType.CancelInvocation,e.headers||{},e.invocationId]);return i.write(t.slice())},e.prototype.readHeaders=function(e){var t=e[1];if("object"!=typeof t)throw new Error("Invalid headers.");return t},e}(),u="6.0.0-dev"}]); \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/integrationtests/Directory.Build.props b/src/Components/WebAssembly/Sdk/integrationtests/Directory.Build.props deleted file mode 100644 index aa329a3810e0..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/Directory.Build.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - true - $(TestRunnerAdditionalArguments) --blame "CollectHangDump;TestTimeout=6m" - - - - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/integrationtests/Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj b/src/Components/WebAssembly/Sdk/integrationtests/Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj deleted file mode 100644 index 37b1cf84bdf1..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - - - $(DefaultNetCoreTargetFramework) - true - - - false - $(MSBuildProjectDirectory)\..\testassets\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\Current\Bin\msbuild.exe - <_DesktopMSBuildPath Condition="'$(OS)' == 'Windows_NT' and Exists('$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe')">$(_VSInstallDir)\MSBuild\15.0\Bin\msbuild.exe - - - - - - - <_Parameter1>DesktopMSBuildPath - <_Parameter2>$(_DesktopMSBuildPath) - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/integrationtests/ServiceWorkerAssert.cs b/src/Components/WebAssembly/Sdk/integrationtests/ServiceWorkerAssert.cs deleted file mode 100644 index 95dbdaa4fd81..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/ServiceWorkerAssert.cs +++ /dev/null @@ -1,85 +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. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text.Json; -using Microsoft.NET.Sdk.BlazorWebAssembly; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - internal static class ServiceWorkerAssert - { - internal static void VerifyServiceWorkerFiles(MSBuildResult result, - string outputDirectory, - string serviceWorkerPath, - string serviceWorkerContent, - string assetsManifestPath, - string staticWebAssetsBasePath = "") - { - // Check the expected files are there - var serviceWorkerResolvedPath = Assert.FileExists(result, outputDirectory, staticWebAssetsBasePath, serviceWorkerPath); - var assetsManifestResolvedPath = Assert.FileExists(result, outputDirectory, staticWebAssetsBasePath, assetsManifestPath); - - // Check the service worker contains the expected content (which comes from the PublishedContent file) - Assert.FileContains(result, serviceWorkerResolvedPath, serviceWorkerContent); - - // Check the assets manifest version was added to the published service worker - var assetsManifest = ReadServiceWorkerAssetsManifest(assetsManifestResolvedPath); - Assert.FileContains(result, serviceWorkerResolvedPath, $"/* Manifest version: {assetsManifest.version} */"); - - // Check the assets manifest contains correct entries for all static content we're publishing - var resolvedPublishDirectory = Path.Combine(result.Project.DirectoryPath, outputDirectory); - var outputFiles = Directory.GetFiles(resolvedPublishDirectory, "*", new EnumerationOptions { RecurseSubdirectories = true }); - var assetsManifestHashesByUrl = (IReadOnlyDictionary)assetsManifest.assets.ToDictionary(x => x.url, x => x.hash); - foreach (var filePath in outputFiles) - { - var relativePath = Path.GetRelativePath(resolvedPublishDirectory, filePath); - - // We don't list compressed files in the SWAM, as these are transparent to the client, - // nor do we list the service worker itself or its assets manifest, as these don't need to be fetched in the same way - if (IsCompressedFile(relativePath) - || string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, serviceWorkerPath), StringComparison.Ordinal) - || string.Equals(relativePath, Path.Combine(staticWebAssetsBasePath, assetsManifestPath), StringComparison.Ordinal)) - { - continue; - } - - // Verify hash - var fileUrl = relativePath.Replace('\\', '/'); - var expectedHash = ParseWebFormattedHash(assetsManifestHashesByUrl[fileUrl]); - Assert.Contains(fileUrl, assetsManifestHashesByUrl); - Assert.FileHashEquals(result, filePath, expectedHash); - } - } - - private static string ParseWebFormattedHash(string webFormattedHash) - { - Assert.StartsWith("sha256-", webFormattedHash); - return webFormattedHash.Substring(7); - } - - private static bool IsCompressedFile(string path) - { - switch (Path.GetExtension(path)) - { - case ".br": - case ".gz": - return true; - default: - return false; - } - } - - private static AssetsManifestFile ReadServiceWorkerAssetsManifest(string assetsManifestResolvedPath) - { - var jsContents = File.ReadAllText(assetsManifestResolvedPath); - var jsonStart = jsContents.IndexOf('{'); - var jsonLength = jsContents.LastIndexOf('}') - jsonStart + 1; - var json = jsContents.Substring(jsonStart, jsonLength); - return JsonSerializer.Deserialize(json); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIncrementalismTest.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIncrementalismTest.cs deleted file mode 100644 index 218567fcc543..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIncrementalismTest.cs +++ /dev/null @@ -1,191 +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. - -using System.IO; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.NET.Sdk.BlazorWebAssembly; -using Xunit; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmBuildIncrementalismTest - { - [Fact] - public async Task Build_IsIncremental() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - // Act - var thumbPrint = FileThumbPrint.CreateFolderThumbprint(project, project.BuildOutputDirectory); - - // Assert - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - var newThumbPrint = FileThumbPrint.CreateFolderThumbprint(project, project.BuildOutputDirectory); - Assert.Equal(thumbPrint.Count, newThumbPrint.Count); - for (var j = 0; j < thumbPrint.Count; j++) - { - Assert.Equal(thumbPrint[j], newThumbPrint[j]); - } - } - } - - [Fact] - public async Task Build_GzipCompression_IsIncremental() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var gzipCompressionDirectory = Path.Combine(project.IntermediateOutputDirectory, "build-gz"); - - Assert.DirectoryExists(result, gzipCompressionDirectory); - - // Act - var thumbPrint = FileThumbPrint.CreateFolderThumbprint(project, gzipCompressionDirectory); - - // Assert - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - var newThumbPrint = FileThumbPrint.CreateFolderThumbprint(project, gzipCompressionDirectory); - Assert.Equal(thumbPrint.Count, newThumbPrint.Count); - for (var j = 0; j < thumbPrint.Count; j++) - { - Assert.Equal(thumbPrint[j], newThumbPrint[j]); - } - } - } - - [Fact] - public async Task Build_SatelliteAssembliesFileIsPreserved() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - File.Move(Path.Combine(project.DirectoryPath, "Resources.ja.resx.txt"), Path.Combine(project.DirectoryPath, "Resource.ja.resx")); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var satelliteAssemblyCacheFile = Path.Combine(project.IntermediateOutputDirectory, "blazor.satelliteasm.props"); - var satelliteAssemblyFile = Path.Combine(project.BuildOutputDirectory, "wwwroot", "_framework", "ja", "blazorwasm.resources.dll"); - var bootJson = Path.Combine(project.DirectoryPath, project.BuildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - - // Assert - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - Verify(); - } - - // Assert - incremental builds with BuildingProject=false - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project, args: "/p:BuildingProject=false"); - Assert.BuildPassed(result); - - Verify(); - } - - void Verify() - { - Assert.FileExists(result, satelliteAssemblyCacheFile); - Assert.FileExists(result, satelliteAssemblyFile); - - var bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - var satelliteResources = bootJsonFile.resources.satelliteResources; - var kvp = Assert.Single(satelliteResources); - Assert.Equal("ja", kvp.Key); - Assert.Equal("ja/blazorwasm.resources.dll", Assert.Single(kvp.Value).Key); - } - } - - [Fact] - public async Task Build_SatelliteAssembliesFileIsCreated_IfNewFileIsAdded() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var satelliteAssemblyCacheFile = Path.Combine(project.IntermediateOutputDirectory, "blazor.satelliteasm.props"); - var satelliteAssemblyFile = Path.Combine(project.BuildOutputDirectory, "wwwroot", "_framework", "ja", "blazorwasm.resources.dll"); - var bootJson = Path.Combine(project.DirectoryPath, project.BuildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - Assert.FileDoesNotExist(result, satelliteAssemblyCacheFile); - Assert.FileDoesNotExist(result, satelliteAssemblyFile); - var bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - var satelliteResources = bootJsonFile.resources.satelliteResources; - Assert.Null(satelliteResources); - - File.Move(Path.Combine(project.DirectoryPath, "Resources.ja.resx.txt"), Path.Combine(project.DirectoryPath, "Resource.ja.resx")); - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - Assert.FileExists(result, satelliteAssemblyCacheFile); - Assert.FileExists(result, satelliteAssemblyFile); - bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - satelliteResources = bootJsonFile.resources.satelliteResources; - var kvp = Assert.Single(satelliteResources); - Assert.Equal("ja", kvp.Key); - Assert.Equal("ja/blazorwasm.resources.dll", Assert.Single(kvp.Value).Key); - } - - [Fact] - public async Task Build_SatelliteAssembliesFileIsDeleted_IfAllSatelliteFilesAreRemoved() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - File.Move(Path.Combine(project.DirectoryPath, "Resources.ja.resx.txt"), Path.Combine(project.DirectoryPath, "Resource.ja.resx")); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var satelliteAssemblyCacheFile = Path.Combine(project.IntermediateOutputDirectory, "blazor.satelliteasm.props"); - var satelliteAssemblyFile = Path.Combine(project.BuildOutputDirectory, "wwwroot", "_framework", "ja", "blazorwasm.resources.dll"); - var bootJson = Path.Combine(project.DirectoryPath, project.BuildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - Assert.FileExists(result, satelliteAssemblyCacheFile); - Assert.FileExists(result, satelliteAssemblyFile); - var bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - var satelliteResources = bootJsonFile.resources.satelliteResources; - var kvp = Assert.Single(satelliteResources); - Assert.Equal("ja", kvp.Key); - Assert.Equal("ja/blazorwasm.resources.dll", Assert.Single(kvp.Value).Key); - - - File.Delete(Path.Combine(project.DirectoryPath, "Resource.ja.resx")); - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - Assert.FileDoesNotExist(result, satelliteAssemblyCacheFile); - bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - satelliteResources = bootJsonFile.resources.satelliteResources; - Assert.Null(satelliteResources); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs deleted file mode 100644 index 04df19bce8cc..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildIntegrationTest.cs +++ /dev/null @@ -1,354 +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. - -using System.IO; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.NET.Sdk.BlazorWebAssembly; -using Microsoft.AspNetCore.Testing; -using Xunit; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmBuildIntegrationTest - { - private static readonly string DotNetJsFileName = $"dotnet.{BuildVariables.MicrosoftNETCoreAppRuntimeVersion}.js"; - - [Fact] - public async Task BuildMinimal_Works() - { - // Arrange - // Minimal has no project references, service worker etc. This is pretty close to the project template. - using var project = ProjectDirectory.Create("blazorwasm-minimal"); - File.WriteAllText(Path.Combine(project.DirectoryPath, "App.razor.css"), "h1 { font-size: 16px; }"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.timezones.blat"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", DotNetJsFileName); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm-minimal.dll"); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm-minimal.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot")); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "scopedcss")); - } - - [Fact] - public async Task Build_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", DotNetJsFileName); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.dll.gz"); // Verify dependencies are part of the output. - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.dll.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.pdb"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.pdb"); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot")); - Assert.FileContains(result, staticWebAssets, Path.GetFullPath(Path.Combine(project.SolutionPath, "razorclasslibrary", "wwwroot"))); - } - - [Fact] - public async Task Build_InRelease_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", DotNetJsFileName); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.Text.Json.dll.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "System.dll.gz"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.pdb"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.pdb"); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot")); - Assert.FileContains(result, staticWebAssets, Path.GetFullPath(Path.Combine(project.SolutionPath, "razorclasslibrary", "wwwroot"))); - } - - [Fact] - public async Task Build_ProducesBootJsonDataWithExpectedContent() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Debug"; - var wwwroot = Path.Combine(project.DirectoryPath, "wwwroot"); - File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); - File.WriteAllText(Path.Combine(wwwroot, "appsettings.development.json"), "Development settings"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains(DotNetJsFileName, runtime); - Assert.Contains("dotnet.wasm", runtime); - - var assemblies = bootJsonData.resources.assembly.Keys; - Assert.Contains("blazorwasm.dll", assemblies); - Assert.Contains("RazorClassLibrary.dll", assemblies); - Assert.Contains("System.Text.Json.dll", assemblies); - - var pdb = bootJsonData.resources.pdb.Keys; - Assert.Contains("blazorwasm.pdb", pdb); - Assert.Contains("RazorClassLibrary.pdb", pdb); - - Assert.Null(bootJsonData.resources.satelliteResources); - - Assert.Contains("appsettings.json", bootJsonData.config); - Assert.Contains("appsettings.development.json", bootJsonData.config); - } - - [Fact] - public async Task Build_InRelease_ProducesBootJsonDataWithExpectedContent() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains(DotNetJsFileName, runtime); - Assert.Contains("dotnet.wasm", runtime); - - var assemblies = bootJsonData.resources.assembly.Keys; - Assert.Contains("blazorwasm.dll", assemblies); - Assert.Contains("RazorClassLibrary.dll", assemblies); - Assert.Contains("System.Text.Json.dll", assemblies); - - var pdb = bootJsonData.resources.pdb.Keys; - Assert.Contains("blazorwasm.pdb", pdb); - Assert.Contains("RazorClassLibrary.pdb", pdb); - Assert.Null(bootJsonData.resources.satelliteResources); - } - - [Fact] - public async Task Build_WithBlazorEnableTimeZoneSupportDisabled_DoesNotCopyTimeZoneInfo() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - project.AddProjectFileContent( -@" - - false -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains("dotnet.wasm", runtime); - Assert.DoesNotContain("dotnet.timezones.blat", runtime); - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.timezones.blat"); - } - - [Fact] - public async Task Build_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationData() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm-minimal"); - project.AddProjectFileContent( -@" - - true -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - Assert.Equal(ICUDataMode.Invariant, bootJsonData.icuDataMode); - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains("dotnet.wasm", runtime); - Assert.Contains("dotnet.timezones.blat", runtime); - Assert.DoesNotContain("icudt.dat", runtime); - Assert.DoesNotContain("icudt_EFIGS.dat", runtime); - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt.dat"); - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat"); - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat"); - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat"); - } - - [Fact] - public async Task Build_WithBlazorWebAssemblyLoadAllGlobalizationData_SetsICUDataMode() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm-minimal"); - project.AddProjectFileContent( -@" - - true -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - Assert.Equal(ICUDataMode.All, bootJsonData.icuDataMode); - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains("dotnet.wasm", runtime); - Assert.Contains("dotnet.timezones.blat", runtime); - Assert.Contains("icudt.dat", runtime); - Assert.Contains("icudt_EFIGS.dat", runtime); - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt.dat"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat"); - } - - [Fact] - public async Task Build_Hosted_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileDoesNotExist(result, buildOutputDirectory, "wwwroot", "_framework", "_bin", "blazorwasm.dll"); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorhosted.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine("net6.0", "wwwroot")); - Assert.FileContains(result, staticWebAssets, Path.Combine("razorclasslibrary", "wwwroot")); - Assert.FileContains(result, staticWebAssets, Path.Combine("blazorwasm", "wwwroot")); - } - - [Fact] - public async Task Build_SatelliteAssembliesAreCopiedToBuildOutput() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "classlibrarywithsatelliteassemblies" }); - project.AddProjectFileContent( -@" - - $(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies - - - -"); - var resxfileInProject = Path.Combine(project.DirectoryPath, "Resources.ja.resx.txt"); - File.Move(resxfileInProject, Path.Combine(project.DirectoryPath, "Resource.ja.resx")); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, args: "/restore"); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "Microsoft.CodeAnalysis.CSharp.dll"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "fr", "Microsoft.CodeAnalysis.CSharp.resources.dll"); // Verify satellite assemblies are present in the build output. - - var bootJsonPath = Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - Assert.FileContains(result, bootJsonPath, "\"Microsoft.CodeAnalysis.CSharp.dll\""); - Assert.FileContains(result, bootJsonPath, "\"fr\\/Microsoft.CodeAnalysis.CSharp.resources.dll\""); - } - - [Fact] - public async Task Build_WithCustomOutputPath_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - - project.AddDirectoryBuildContent( -@" - $(MSBuildThisFileDirectory)build\bin\ - $(MSBuildThisFileDirectory)build\obj\ -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, args: "/restore"); - Assert.BuildPassed(result); - } - - [Fact] - public async Task Build_WithAspNetCoreFrameworkReference_Fails() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm-fxref"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildError(result, "BLAZORSDK1001"); - } - - private static BootJsonData ReadBootJsonData(MSBuildResult result, string path) - { - return JsonSerializer.Deserialize( - File.ReadAllText(Path.Combine(result.Project.DirectoryPath, path)), - new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildLazyLoadTest.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildLazyLoadTest.cs deleted file mode 100644 index 943dd003d844..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmBuildLazyLoadTest.cs +++ /dev/null @@ -1,216 +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. - -using System.IO; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing; -using Microsoft.NET.Sdk.BlazorWebAssembly; -using Xunit; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmBuildLazyLoadTest - { - [Fact] - public async Task Build_LazyLoadExplicitAssembly_Debug_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Debug"; - - project.AddProjectFileContent( -@" - - - -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - var buildOutputDirectory = project.BuildOutputDirectory; - - // Verify that a blazor.boot.json file has been created - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - // And that the assembly is in the output - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - - var bootJson = ReadBootJsonData(result, Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json")); - - // And that it has been labelled as a dynamic assembly in the boot.json - var lazyAssemblies = bootJson.resources.lazyAssembly; - var assemblies = bootJson.resources.assembly; - - Assert.NotNull(lazyAssemblies); - Assert.Contains("RazorClassLibrary.dll", lazyAssemblies.Keys); - Assert.DoesNotContain("RazorClassLibrary.dll", assemblies.Keys); - - // App assembly should not be lazy loaded - Assert.DoesNotContain("blazorwasm.dll", lazyAssemblies.Keys); - Assert.Contains("blazorwasm.dll", assemblies.Keys); - } - - [Fact] - public async Task Build_LazyLoadExplicitAssembly_Release_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - - project.AddProjectFileContent( -@" - - - -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - var buildOutputDirectory = project.BuildOutputDirectory; - - // Verify that a blazor.boot.json file has been created - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - // And that the assembly is in the output - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - - var bootJson = ReadBootJsonData(result, Path.Combine(buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json")); - - // And that it has been labelled as a dynamic assembly in the boot.json - var lazyAssemblies = bootJson.resources.lazyAssembly; - var assemblies = bootJson.resources.assembly; - - Assert.NotNull(lazyAssemblies); - Assert.Contains("RazorClassLibrary.dll", lazyAssemblies.Keys); - Assert.DoesNotContain("RazorClassLibrary.dll", assemblies.Keys); - - // App assembly should not be lazy loaded - Assert.DoesNotContain("blazorwasm.dll", lazyAssemblies.Keys); - Assert.Contains("blazorwasm.dll", assemblies.Keys); - } - - [Fact] - public async Task Publish_LazyLoadExplicitAssembly_Debug_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Debug"; - - project.AddProjectFileContent( -@" - - - -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - var publishDirectory = project.PublishOutputDirectory; - - // Verify that a blazor.boot.json file has been created - Assert.FileExists(result, publishDirectory, "wwwroot", "_framework", "blazor.boot.json"); - // And that the assembly is in the output - Assert.FileExists(result, publishDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - - var bootJson = ReadBootJsonData(result, Path.Combine(publishDirectory, "wwwroot", "_framework", "blazor.boot.json")); - - // And that it has been labelled as a dynamic assembly in the boot.json - var lazyAssemblies = bootJson.resources.lazyAssembly; - var assemblies = bootJson.resources.assembly; - - Assert.NotNull(lazyAssemblies); - Assert.Contains("RazorClassLibrary.dll", lazyAssemblies.Keys); - Assert.DoesNotContain("RazorClassLibrary.dll", assemblies.Keys); - - // App assembly should not be lazy loaded - Assert.DoesNotContain("blazorwasm.dll", lazyAssemblies.Keys); - Assert.Contains("blazorwasm.dll", assemblies.Keys); - } - - [Fact] - public async Task Publish_LazyLoadExplicitAssembly_Release_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - - project.AddProjectFileContent( -@" - - - -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - var publishDirectory = project.PublishOutputDirectory; - - // Verify that a blazor.boot.json file has been created - Assert.FileExists(result, publishDirectory, "wwwroot", "_framework", "blazor.boot.json"); - // And that the assembly is in the output - Assert.FileExists(result, publishDirectory, "wwwroot", "_framework", "RazorClassLibrary.dll"); - - var bootJson = ReadBootJsonData(result, Path.Combine(publishDirectory, "wwwroot", "_framework", "blazor.boot.json")); - - // And that it has been labelled as a dynamic assembly in the boot.json - var lazyAssemblies = bootJson.resources.lazyAssembly; - var assemblies = bootJson.resources.assembly; - - Assert.NotNull(lazyAssemblies); - Assert.Contains("RazorClassLibrary.dll", lazyAssemblies.Keys); - Assert.DoesNotContain("RazorClassLibrary.dll", assemblies.Keys); - - // App assembly should not be lazy loaded - Assert.DoesNotContain("blazorwasm.dll", lazyAssemblies.Keys); - Assert.Contains("blazorwasm.dll", assemblies.Keys); - } - - [Fact] - public async Task Build_LazyLoadExplicitAssembly_InvalidAssembly() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - - project.AddProjectFileContent( -@" - - - -"); - // Act - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - // Assert - Assert.BuildError(result, "BLAZORSDK1001"); - Assert.BuildFailed(result); - } - - [Fact] - public async Task Publish_LazyLoadExplicitAssembly_InvalidAssembly() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.Configuration = "Release"; - - project.AddProjectFileContent( -@" - - - -"); - // Act - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - // Assert - Assert.BuildError(result, "BLAZORSDK1001"); - Assert.BuildFailed(result); - } - - private static BootJsonData ReadBootJsonData(MSBuildResult result, string path) - { - return JsonSerializer.Deserialize( - File.ReadAllText(Path.Combine(result.Project.DirectoryPath, path)), - new JsonSerializerOptions(JsonSerializerDefaults.Web)); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmCompressionTests.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmCompressionTests.cs deleted file mode 100644 index cc543b3982ad..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmCompressionTests.cs +++ /dev/null @@ -1,168 +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. - -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing; -using Xunit; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmCompressionTests - { - [Fact] - public async Task Publish_UpdatesFilesWhenSourcesChange() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish"); - - Assert.BuildPassed(result); - - // Act - var mainAppDll = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - var mainAppDllThumbPrint = FileThumbPrint.Create(mainAppDll); - var mainAppCompressedDll = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll.br"); - var mainAppCompressedDllThumbPrint = FileThumbPrint.Create(mainAppCompressedDll); - - var blazorBootJson = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var blazorBootJsonThumbPrint = FileThumbPrint.Create(blazorBootJson); - var blazorBootJsonCompressed = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json.br"); - var blazorBootJsonCompressedThumbPrint = FileThumbPrint.Create(blazorBootJsonCompressed); - - var programFile = Path.Combine(project.DirectoryPath, "..", "blazorwasm", "Program.cs"); - var programFileContents = File.ReadAllText(programFile); - File.WriteAllText(programFile, programFileContents.Replace("args", "arguments")); - - // Assert - result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish"); - Assert.BuildPassed(result); - var newMainAppDllThumbPrint = FileThumbPrint.Create(mainAppDll); - var newMainAppCompressedDllThumbPrint = FileThumbPrint.Create(mainAppCompressedDll); - var newBlazorBootJsonThumbPrint = FileThumbPrint.Create(blazorBootJson); - var newBlazorBootJsonCompressedThumbPrint = FileThumbPrint.Create(blazorBootJsonCompressed); - - Assert.NotEqual(mainAppDllThumbPrint, newMainAppDllThumbPrint); - Assert.NotEqual(mainAppCompressedDllThumbPrint, newMainAppCompressedDllThumbPrint); - - Assert.NotEqual(blazorBootJsonThumbPrint, newBlazorBootJsonThumbPrint); - Assert.NotEqual(blazorBootJsonCompressedThumbPrint, newBlazorBootJsonCompressedThumbPrint); - } - - [Fact] - public async Task Publish_WithoutLinkerAndCompression_UpdatesFilesWhenSourcesChange() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish", args: "/p:BlazorWebAssemblyEnableLinking=false"); - - Assert.BuildPassed(result); - - // Act - var mainAppDll = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - var mainAppDllThumbPrint = FileThumbPrint.Create(mainAppDll); - - var mainAppCompressedDll = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll.br"); - var mainAppCompressedDllThumbPrint = FileThumbPrint.Create(mainAppCompressedDll); - - var programFile = Path.Combine(project.DirectoryPath, "..", "blazorwasm", "Program.cs"); - var programFileContents = File.ReadAllText(programFile); - File.WriteAllText(programFile, programFileContents.Replace("args", "arguments")); - - // Assert - result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish", args: "/p:BlazorWebAssemblyEnableLinking=false"); - Assert.BuildPassed(result); - var newMainAppDllThumbPrint = FileThumbPrint.Create(mainAppDll); - var newMainAppCompressedDllThumbPrint = FileThumbPrint.Create(mainAppCompressedDll); - - Assert.NotEqual(mainAppDllThumbPrint, newMainAppDllThumbPrint); - Assert.NotEqual(mainAppCompressedDllThumbPrint, newMainAppCompressedDllThumbPrint); - } - - [Fact] - public async Task Publish_WithLinkerAndCompression_IsIncremental() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish"); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - // Act - var compressedFilesFolder = Path.Combine("..", "blazorwasm", project.IntermediateOutputDirectory, "compress"); - var thumbPrint = FileThumbPrint.CreateFolderThumbprint(project, compressedFilesFolder); - - // Assert - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project); - Assert.BuildPassed(result); - - var newThumbPrint = FileThumbPrint.CreateFolderThumbprint(project, compressedFilesFolder); - Assert.Equal(thumbPrint.Count, newThumbPrint.Count); - for (var j = 0; j < thumbPrint.Count; j++) - { - Assert.Equal(thumbPrint[j], newThumbPrint[j]); - } - } - } - - [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23756")] - public async Task Publish_WithoutLinkerAndCompression_IsIncremental() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish", args: "/p:BlazorWebAssemblyEnableLinking=false"); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - // Act - var compressedFilesFolder = Path.Combine("..", "blazorwasm", project.IntermediateOutputDirectory, "compress"); - var thumbPrint = FileThumbPrint.CreateFolderThumbprint(project, compressedFilesFolder); - - // Assert - for (var i = 0; i < 3; i++) - { - result = await MSBuildProcessManager.DotnetMSBuild(project, args: "/p:BlazorWebAssemblyEnableLinking=false"); - Assert.BuildPassed(result); - - var newThumbPrint = FileThumbPrint.CreateFolderThumbprint(project, compressedFilesFolder); - Assert.Equal(thumbPrint.Count, newThumbPrint.Count); - for (var j = 0; j < thumbPrint.Count; j++) - { - Assert.Equal(thumbPrint[j], newThumbPrint[j]); - } - } - } - - [Fact] - public async Task Publish_CompressesAllFrameworkFiles() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "publish"); - - Assert.BuildPassed(result); - - var extensions = new[] { ".dll", ".js", ".pdb", ".wasm", ".map", ".json", ".dat" }; - - // Act - var frameworkFilesPath = Path.Combine(project.DirectoryPath, project.PublishOutputDirectory, "wwwroot", "_framework"); - - foreach (var file in Directory.EnumerateFiles(frameworkFilesPath, "*", new EnumerationOptions { RecurseSubdirectories = true, })) - { - var extension = Path.GetExtension(file); - if (extension != ".br" && extension != ".gz") - { - Assert.FileExists(result, file + ".gz"); - Assert.FileExists(result, file + ".br"); - } - } - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs deleted file mode 100644 index 784be23b6958..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs +++ /dev/null @@ -1,1044 +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. - -using System.IO; -using System.IO.Compression; -using System.Text.Json; -using System.Threading.Tasks; -using Microsoft.NET.Sdk.BlazorWebAssembly; -using Microsoft.AspNetCore.Testing; -using Xunit; -using static Microsoft.AspNetCore.Razor.Design.IntegrationTests.ServiceWorkerAssert; -using ResourceHashesByNameDictionary = System.Collections.Generic.Dictionary; - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmPublishIntegrationTest - { - private static readonly string DotNetJsFileName = $"dotnet.{BuildVariables.MicrosoftNETCoreAppRuntimeVersion}.js"; - - [Fact] - public async Task Publish_MinimalApp_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm-minimal"); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm-minimal.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - var webConfigContent = new StreamReader(GetType().Assembly.GetManifestResourceStream("Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.BlazorWasm.web.config")).ReadToEnd(); - Assert.FileContentEquals(result, Path.Combine(publishDirectory, "web.config"), webConfigContent); - Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - } - - [Fact] - public async Task Publish_WithDefaultSettings_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "LinkBaseToWebRoot" }); - project.Configuration = "Debug"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify referenced static web assets - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify link item assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "js", "LinkedScript.js"); - var cssFile = Assert.FileExists(result, blazorPublishDirectory, "css", "app.css"); - Assert.FileContains(result, cssFile, ".publish"); - Assert.FileDoesNotExist(result, "dist", "Fake-License.txt"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - - VerifyTypeGranularTrimming(result, blazorPublishDirectory); - } - - [Fact] - public async Task Publish_WithScopedCss_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "LinkBaseToWebRoot" }); - File.WriteAllText(Path.Combine(project.DirectoryPath, "App.razor.css"), "h1 { font-size: 16px; }"); - - project.Configuration = "Debug"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify scoped css - Assert.FileExists(result, blazorPublishDirectory, "blazorwasm.styles.css"); - - // Verify referenced static web assets - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify link item assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "js", "LinkedScript.js"); - var cssFile = Assert.FileExists(result, blazorPublishDirectory, "css", "app.css"); - Assert.FileContains(result, cssFile, ".publish"); - Assert.FileDoesNotExist(result, "dist", "Fake-License.txt"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_InRelease_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "LinkBaseToWebRoot" }); - project.Configuration = "Release"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", ""); - - Assert.BuildPassed(result); - - - var publishDirectory = project.PublishOutputDirectory; - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify referenced static web assets - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify link item assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "js", "LinkedScript.js"); - var cssFile = Assert.FileExists(result, blazorPublishDirectory, "css", "app.css"); - Assert.FileContains(result, cssFile, ".publish"); - Assert.FileDoesNotExist(result, "dist", "Fake-License.txt"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly); - } - - [Fact] - public async Task Publish_WithExistingWebConfig_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "LinkBaseToWebRoot" }); - project.Configuration = "Release"; - - var webConfigContents = "test webconfig contents"; - AddFileToProject(project, "web.config", webConfigContents); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", $"/p:PublishIISAssets=true"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - Assert.FileContains(result, Path.Combine(publishDirectory, "web.config"), webConfigContents); - } - - [Fact] - public async Task Publish_WithNoBuild_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build"); - - Assert.BuildPassed(result); - - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:NoBuild=true"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - - VerifyCompression(result, blazorPublishDirectory); - } - - [Theory] - [InlineData("different-path")] - [InlineData("/different-path")] - [InlineData("different-path/")] - [InlineData("/different-path/")] - public async Task Publish_WithStaticWebBasePathWorks(string basePath) - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", "razorclasslibrary"); - project.AddProjectFileContent( -$@" - {basePath} -"); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - - // Verify nothing is published directly to the wwwroot directory - Assert.FileCountEquals(result, 0, Path.Combine(publishDirectory, "wwwroot"), "*", SearchOption.TopDirectoryOnly); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot", "different-path"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - var webConfigContent = new StreamReader(GetType().Assembly.GetManifestResourceStream("Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.BlazorWasm.web.config")).ReadToEnd(); - Assert.FileContentEquals(result, Path.Combine(publishDirectory, "web.config"), webConfigContent); - Assert.FileCountEquals(result, 1, publishDirectory, "*", SearchOption.TopDirectoryOnly); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, - Path.Combine(publishDirectory, "wwwroot"), - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js", - staticWebAssetsBasePath: "different-path"); - } - - [Theory] - [InlineData("different-path")] - [InlineData("/different-path")] - [InlineData("different-path/")] - [InlineData("/different-path/")] - public async Task Publish_Hosted_WithStaticWebBasePathWorks(string basePath) - { - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - var wasmProject = project.GetSibling("blazorwasm"); - wasmProject.AddProjectFileContent( -$@" - {basePath} -"); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - Assert.FileExists(result, publishDirectory, "blazorwasm.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot", "different-path"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify project references appear as static web assets - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll"); - // Also verify project references to the server project appear in the publish output - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.gz"); - } - - private static void VerifyCompression(MSBuildResult result, string blazorPublishDirectory) - { - var original = Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - var compressed = Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json.br"); - using var brotliStream = new BrotliStream(File.OpenRead(compressed), CompressionMode.Decompress); - using var textReader = new StreamReader(brotliStream); - var uncompressedText = textReader.ReadToEnd(); - var originalText = File.ReadAllText(original); - - Assert.Equal(originalText, uncompressedText); - } - - [Fact] - public async Task Publish_WithTrimmingdDisabled_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - project.AddProjectFileContent( -@" - false -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); // - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify referenced static web assets - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, blazorPublishDirectory, "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - - // Verify assemblies are not trimmed - var loggingAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.Extensions.Logging.Abstractions.dll"); - Assert.AssemblyContainsType(result, loggingAssemblyPath, "Microsoft.Extensions.Logging.Abstractions.NullLogger"); - } - - [Fact] - public async Task Publish_SatelliteAssemblies_AreCopiedToBuildOutput() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary", "classlibrarywithsatelliteassemblies" }); - project.AddProjectFileContent( -@" - - - false - $(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies - - - -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", args: "/restore"); - - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "Microsoft.CodeAnalysis.CSharp.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "fr", "Microsoft.CodeAnalysis.CSharp.resources.dll"); // Verify satellite assemblies are present in the build output. - - var bootJsonPath = Path.Combine(blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileContains(result, bootJsonPath, "\"Microsoft.CodeAnalysis.CSharp.dll\""); - Assert.FileContains(result, bootJsonPath, "\"fr\\/Microsoft.CodeAnalysis.CSharp.resources.dll\""); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - } - - [Fact] - public async Task Publish_HostedApp_DefaultSettings_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - // Verification for https://github.com/dotnet/aspnetcore/issues/19926. Verify binaries for projects - // referenced by the Hosted project appear in the publish directory - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - Assert.FileExists(result, publishDirectory, "blazorwasm.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify project references appear as static web assets - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll"); - // Also verify project references to the server project appear in the publish output - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.gz"); - - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - - VerifyTypeGranularTrimming(result, blazorPublishDirectory); - } - - [Fact] - public async Task Publish_HostedApp_ProducesBootJsonDataWithExpectedContent() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - var wwwroot = Path.Combine(project.DirectoryPath, "..", "blazorwasm", "wwwroot"); - File.WriteAllText(Path.Combine(wwwroot, "appsettings.json"), "Default settings"); - File.WriteAllText(Path.Combine(wwwroot, "appsettings.development.json"), "Development settings"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - Assert.BuildPassed(result); - - var bootJsonPath = Path.Combine(project.PublishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains(DotNetJsFileName, runtime); - Assert.Contains("dotnet.wasm", runtime); - - var assemblies = bootJsonData.resources.assembly.Keys; - Assert.Contains("blazorwasm.dll", assemblies); - Assert.Contains("RazorClassLibrary.dll", assemblies); - Assert.Contains("System.Text.Json.dll", assemblies); - - // No pdbs - Assert.Null(bootJsonData.resources.pdb); - Assert.Null(bootJsonData.resources.satelliteResources); - - Assert.Contains("appsettings.json", bootJsonData.config); - Assert.Contains("appsettings.development.json", bootJsonData.config); - } - - [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23397")] - public async Task Publish_HostedApp_WithSatelliteAssemblies() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", "classlibrarywithsatelliteassemblies", }); - var wasmProject = project.GetSibling("blazorwasm"); - - wasmProject.AddProjectFileContent( -@" - - - false - $(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies - - - -"); - var resxfileInProject = Path.Combine(wasmProject.DirectoryPath, "Resources.ja.resx.txt"); - File.Move(resxfileInProject, Path.Combine(wasmProject.DirectoryPath, "Resource.ja.resx")); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/restore"); - Assert.BuildPassed(result); - - var bootJsonPath = Path.Combine(project.PublishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - var publishOutputDirectory = project.PublishOutputDirectory; - - Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "classlibrarywithsatelliteassemblies.dll"); - Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "Microsoft.CodeAnalysis.CSharp.dll"); - Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "fr", "Microsoft.CodeAnalysis.CSharp.resources.dll"); // Verify satellite assemblies are present in the build output. - - Assert.FileContains(result, bootJsonPath, "\"Microsoft.CodeAnalysis.CSharp.dll\""); - Assert.FileContains(result, bootJsonPath, "\"fr\\/Microsoft.CodeAnalysis.CSharp.resources.dll\""); - } - - [Fact] - // Regression test for https://github.com/dotnet/aspnetcore/issues/18752 - public async Task Publish_HostedApp_WithoutTrimming_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - AddWasmProjectContent(project, @" - - false - "); - - // VS builds projects individually and then a publish with BuildDependencies=false, but building the main project is a close enough approximation for this test. - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build"); - - Assert.BuildPassed(result); - - // Publish - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:BuildDependencies=false"); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - // Verification for https://github.com/dotnet/aspnetcore/issues/19926. Verify binaries for projects - // referenced by the Hosted project appear in the publish directory - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - Assert.FileExists(result, publishDirectory, "blazorwasm.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify project references appear as static web assets - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll"); - // Also verify project references to the server project appear in the publish output - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.gz"); - - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_HostedApp_WithNoBuild_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build"); - - Assert.BuildPassed(result); - - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:NoBuild=true"); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_HostedApp_VisualStudio() - { - // Simulates publishing the same way VS does by setting BuildProjectReferences=false. - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - project.Configuration = "Release"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build", "/p:BuildInsideVisualStudio=true"); - - Assert.BuildPassed(result); - - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:BuildProjectReferences=false /p:BuildInsideVisualStudio=true"); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_HostedAppWithScopedCss_VisualStudio() - { - // Simulates publishing the same way VS does by setting BuildProjectReferences=false. - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - File.WriteAllText(Path.Combine(project.SolutionPath, "blazorwasm", "App.razor.css"), "h1 { font-size: 16px; }"); - - project.Configuration = "Release"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build", "/p:BuildInsideVisualStudio=true"); - - Assert.BuildPassed(result); - - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:BuildProjectReferences=false /p:BuildInsideVisualStudio=true"); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify scoped css - Assert.FileExists(result, blazorPublishDirectory, "blazorwasm.styles.css"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - // Regression test to verify satellite assemblies from the blazor app are copied to the published app's wwwroot output directory as - // part of publishing in VS - [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23397")] - public async Task Publish_HostedApp_VisualStudio_WithSatelliteAssemblies() - { - // Simulates publishing the same way VS does by setting BuildProjectReferences=false. - // Arrange - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", "classlibrarywithsatelliteassemblies" }); - var blazorwasmProjectDirectory = Path.Combine(project.DirectoryPath, "..", "blazorwasm"); - - // Setup the blazorwasm app to have it's own satellite assemblies as well as transitively imported satellite assemblies. - var resxfileInProject = Path.Combine(blazorwasmProjectDirectory, "Resources.ja.resx.txt"); - File.Move(resxfileInProject, Path.Combine(blazorwasmProjectDirectory, "Resource.ja.resx")); - - var blazorwasmProjFile = Path.Combine(blazorwasmProjectDirectory, "blazorwasm.csproj"); - var existing = File.ReadAllText(blazorwasmProjFile); - var updatedContent = @" - - - false - $(DefineConstants);REFERENCE_classlibrarywithsatelliteassemblies - - - - "; - var updated = existing.Replace("", updatedContent); - File.WriteAllText(blazorwasmProjFile, updated); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Build", $"/restore"); - - Assert.BuildPassed(result); - - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:BuildProjectReferences=false"); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "ja", "blazorwasm.resources.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "fr", "Microsoft.CodeAnalysis.resources.dll"); - - var bootJson = Path.Combine(project.DirectoryPath, blazorPublishDirectory, "_framework", "blazor.boot.json"); - var bootJsonFile = JsonSerializer.Deserialize(File.ReadAllText(bootJson), new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - var satelliteResources = bootJsonFile.resources.satelliteResources; - - Assert.Contains("es-ES", satelliteResources.Keys); - Assert.Contains("es-ES/classlibrarywithsatelliteassemblies.resources.dll", satelliteResources["es-ES"].Keys); - Assert.Contains("fr", satelliteResources.Keys); - Assert.Contains("fr/Microsoft.CodeAnalysis.CSharp.resources.dll", satelliteResources["fr"].Keys); - Assert.Contains("ja", satelliteResources.Keys); - Assert.Contains("ja/blazorwasm.resources.dll", satelliteResources["ja"].Keys); - - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_HostedApp_WithRidSpecifiedInCLI_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted-rid", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - project.RuntimeIdentifier = "linux-x64"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", "/p:RuntimeIdentifier=linux-x64"); - - AssertRIDPublishOuput(project, result); - } - - [Fact] - public async Task Publish_HostedApp_WithRid_Works() - { - // Arrange - using var project = ProjectDirectory.Create("blazorhosted-rid", additionalProjects: new[] { "blazorwasm", "razorclasslibrary", }); - project.RuntimeIdentifier = "linux-x64"; - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - AssertRIDPublishOuput(project, result); - } - - private static void AssertRIDPublishOuput(ProjectDirectory project, MSBuildResult result) - { - Assert.BuildPassed(result); - - var publishDirectory = project.PublishOutputDirectory; - // Make sure the main project exists - Assert.FileExists(result, publishDirectory, "blazorhosted-rid.dll"); - Assert.FileExists(result, publishDirectory, "libhostfxr.so"); // Verify that we're doing a self-contained deployment - - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - Assert.FileExists(result, publishDirectory, "blazorwasm.dll"); - - var blazorPublishDirectory = Path.Combine(publishDirectory, "wwwroot"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.webassembly.js"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", DotNetJsFileName); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll"); // Verify dependencies are part of the output. - - // Verify project references appear as static web assets - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll"); - // Also verify project references to the server project appear in the publish output - Assert.FileExists(result, publishDirectory, "RazorClassLibrary.dll"); - - // Verify static assets are in the publish directory - Assert.FileExists(result, blazorPublishDirectory, "index.html"); - - // Verify static web assets from referenced projects are copied. - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "wwwroot", "exampleJsInterop.js"); - Assert.FileExists(result, publishDirectory, "wwwroot", "_content", "RazorClassLibrary", "styles.css"); - - // Verify web.config - Assert.FileExists(result, publishDirectory, "web.config"); - - VerifyBootManifestHashes(result, blazorPublishDirectory); - - // Verify compression works - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.br"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.br"); - - Assert.FileExists(result, blazorPublishDirectory, "_framework", "dotnet.wasm.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazorwasm.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "RazorClassLibrary.dll.gz"); - Assert.FileExists(result, blazorPublishDirectory, "_framework", "System.Text.Json.dll.gz"); - - VerifyServiceWorkerFiles(result, blazorPublishDirectory, - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the production service worker", - assetsManifestPath: "custom-service-worker-assets.js"); - } - - [Fact] - public async Task Publish_WithInvariantGlobalizationEnabled_DoesNotCopyGlobalizationData() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm-minimal"); - project.AddProjectFileContent( -@" - - true -"); - - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish"); - - Assert.BuildPassed(result); - - var publishOutputDirectory = project.PublishOutputDirectory; - - var bootJsonPath = Path.Combine(publishOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - var bootJsonData = ReadBootJsonData(result, bootJsonPath); - - Assert.Equal(ICUDataMode.Invariant, bootJsonData.icuDataMode); - var runtime = bootJsonData.resources.runtime.Keys; - Assert.Contains("dotnet.wasm", runtime); - Assert.DoesNotContain("icudt.dat", runtime); - Assert.DoesNotContain("icudt_EFIGS.dat", runtime); - - Assert.FileExists(result, publishOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt.dat"); - Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_CJK.dat"); - Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_EFIGS.dat"); - Assert.FileDoesNotExist(result, publishOutputDirectory, "wwwroot", "_framework", "icudt_no_CJK.dat"); - } - - private static void AddWasmProjectContent(ProjectDirectory project, string content) - { - var path = Path.Combine(project.SolutionPath, "blazorwasm", "blazorwasm.csproj"); - var existing = File.ReadAllText(path); - var updated = existing.Replace("", content); - File.WriteAllText(path, updated); - } - - private static void AddFileToProject(ProjectDirectory project, string filename, string content) - { - var path = Path.Combine(project.DirectoryPath, filename); - File.WriteAllText(path, content); - } - - private static void VerifyBootManifestHashes(MSBuildResult result, string blazorPublishDirectory) - { - var bootManifestResolvedPath = Assert.FileExists(result, blazorPublishDirectory, "_framework", "blazor.boot.json"); - var bootManifestJson = File.ReadAllText(bootManifestResolvedPath); - var bootManifest = JsonSerializer.Deserialize(bootManifestJson); - - VerifyBootManifestHashes(result, blazorPublishDirectory, bootManifest.resources.assembly); - VerifyBootManifestHashes(result, blazorPublishDirectory, bootManifest.resources.runtime); - - if (bootManifest.resources.pdb != null) - { - VerifyBootManifestHashes(result, blazorPublishDirectory, bootManifest.resources.pdb); - } - - if (bootManifest.resources.satelliteResources != null) - { - foreach (var resourcesForCulture in bootManifest.resources.satelliteResources.Values) - { - VerifyBootManifestHashes(result, blazorPublishDirectory, resourcesForCulture); - } - } - - static void VerifyBootManifestHashes(MSBuildResult result, string blazorPublishDirectory, ResourceHashesByNameDictionary resources) - { - foreach (var (name, hash) in resources) - { - var relativePath = Path.Combine(blazorPublishDirectory, "_framework", name); - Assert.FileHashEquals(result, relativePath, ParseWebFormattedHash(hash)); - } - } - - static string ParseWebFormattedHash(string webFormattedHash) - { - Assert.StartsWith("sha256-", webFormattedHash); - return webFormattedHash.Substring(7); - } - } - - - private void VerifyTypeGranularTrimming(MSBuildResult result, string blazorPublishDirectory) - { - var componentsShimAssemblyPath = Path.Combine(blazorPublishDirectory, "_framework", "Microsoft.AspNetCore.Razor.Test.ComponentShim.dll"); - Assert.FileExists(result, componentsShimAssemblyPath); - - // RouteView is referenced by the app, so we expect it to be preserved - Assert.AssemblyContainsType(result, componentsShimAssemblyPath, "Microsoft.AspNetCore.Components.RouteView"); - - // RouteData is referenced by RouteView so we expect it to be preserved. - Assert.AssemblyContainsType(result, componentsShimAssemblyPath, "Microsoft.AspNetCore.Components.RouteData"); - - // CascadingParameterAttribute is not referenced by the app, and should be trimmed. - Assert.AssemblyDoesNotContainType(result, componentsShimAssemblyPath, "Microsoft.AspNetCore.Components.CascadingParameterAttribute"); - } - - private static BootJsonData ReadBootJsonData(MSBuildResult result, string path) - { - return JsonSerializer.Deserialize( - File.ReadAllText(Path.Combine(result.Project.DirectoryPath, path)), - new JsonSerializerOptions { PropertyNameCaseInsensitive = true }); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/WasmPwaManifestTests.cs b/src/Components/WebAssembly/Sdk/integrationtests/WasmPwaManifestTests.cs deleted file mode 100644 index 02423540bb91..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/WasmPwaManifestTests.cs +++ /dev/null @@ -1,213 +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. - -using System.IO; -using System.Linq; -using System.Text.Json; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Testing; -using Xunit; -using static Microsoft.AspNetCore.Razor.Design.IntegrationTests.ServiceWorkerAssert; - - -namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests -{ - public class WasmPwaManifestTests - { - private static readonly string DotNetJsFileName = $"dotnet.{BuildVariables.MicrosoftNETCoreAppRuntimeVersion}.js"; - - [Fact] - public async Task Build_ServiceWorkerAssetsManifest_Works() - { - // Arrange - var expectedExtensions = new[] { ".dll", ".pdb", ".js", ".wasm" }; - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, args: "/p:ServiceWorkerAssetsManifest=service-worker-assets.js"); - - Assert.BuildPassed(result); - - var buildOutputDirectory = project.BuildOutputDirectory; - - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazor.boot.json"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "dotnet.wasm"); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", DotNetJsFileName); - Assert.FileExists(result, buildOutputDirectory, "wwwroot", "_framework", "blazorwasm.dll"); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot")); - - var serviceWorkerAssetsManifest = Assert.FileExists(result, buildOutputDirectory, "wwwroot", "service-worker-assets.js"); - // Trim prefix 'self.assetsManifest = ' and suffix ';' - var manifestContents = File.ReadAllText(serviceWorkerAssetsManifest).TrimEnd()[22..^1]; - - var manifestContentsJson = JsonDocument.Parse(manifestContents); - Assert.True(manifestContentsJson.RootElement.TryGetProperty("assets", out var assets)); - Assert.Equal(JsonValueKind.Array, assets.ValueKind); - - var entries = assets.EnumerateArray().Select(e => e.GetProperty("url").GetString()).OrderBy(e => e).ToArray(); - Assert.All(entries, e => expectedExtensions.Contains(Path.GetExtension(e))); - - VerifyServiceWorkerFiles(result, - Path.Combine(buildOutputDirectory, "wwwroot"), - serviceWorkerPath: Path.Combine("serviceworkers", "my-service-worker.js"), - serviceWorkerContent: "// This is the development service worker", - assetsManifestPath: "service-worker-assets.js"); - } - - [Fact] - public async Task Build_HostedAppWithServiceWorker_Works() - { - // Arrange - var expectedExtensions = new[] { ".dll", ".pdb", ".js", ".wasm" }; - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project); - - Assert.BuildPassed(result); - - var wasmProject = project.GetSibling("blazorwasm"); - var buildOutputDirectory = Path.Combine(wasmProject.DirectoryPath, wasmProject.BuildOutputDirectory); - - var staticWebAssets = Assert.FileExists(result, buildOutputDirectory, "blazorwasm.StaticWebAssets.xml"); - Assert.FileContains(result, staticWebAssets, Path.Combine(project.TargetFramework, "wwwroot")); - - var serviceWorkerAssetsManifest = Assert.FileExists(result, buildOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); - // Trim prefix 'self.assetsManifest = ' and suffix ';' - var manifestContents = File.ReadAllText(serviceWorkerAssetsManifest).TrimEnd()[22..^1]; - - var manifestContentsJson = JsonDocument.Parse(manifestContents); - Assert.True(manifestContentsJson.RootElement.TryGetProperty("assets", out var assets)); - Assert.Equal(JsonValueKind.Array, assets.ValueKind); - - var entries = assets.EnumerateArray().Select(e => e.GetProperty("url").GetString()).OrderBy(e => e).ToArray(); - Assert.All(entries, e => expectedExtensions.Contains(Path.GetExtension(e))); - } - - [Fact] - public async Task PublishWithPWA_ProducesAssets() - { - // Arrange - var expectedExtensions = new[] { ".dll", ".pdb", ".js", ".wasm" }; - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "Publish"); - - Assert.BuildPassed(result); - - var publishOutputDirectory = project.PublishOutputDirectory; - - var serviceWorkerAssetsManifest = Assert.FileExists(result, publishOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); - // Trim prefix 'self.assetsManifest = ' and suffix ';' - var manifestContents = File.ReadAllText(serviceWorkerAssetsManifest).TrimEnd()[22..^1]; - - var manifestContentsJson = JsonDocument.Parse(manifestContents); - Assert.True(manifestContentsJson.RootElement.TryGetProperty("assets", out var assets)); - Assert.Equal(JsonValueKind.Array, assets.ValueKind); - - var entries = assets.EnumerateArray().Select(e => e.GetProperty("url").GetString()).OrderBy(e => e).ToArray(); - Assert.All(entries, e => expectedExtensions.Contains(Path.GetExtension(e))); - - var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); - Assert.FileContainsLine(result, serviceWorkerFile, "// This is the production service worker"); - } - - [Fact] - [QuarantinedTest("https://github.com/dotnet/aspnetcore/issues/23756")] - public async Task PublishHostedWithPWA_ProducesAssets() - { - // Arrange - var expectedExtensions = new[] { ".dll", ".pdb", ".js", ".wasm" }; - using var project = ProjectDirectory.Create("blazorhosted", additionalProjects: new[] { "blazorwasm", "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, target: "Publish"); - - Assert.BuildPassed(result); - - var publishOutputDirectory = project.PublishOutputDirectory; - - var serviceWorkerAssetsManifest = Assert.FileExists(result, publishOutputDirectory, "wwwroot", "custom-service-worker-assets.js"); - // Trim prefix 'self.assetsManifest = ' and suffix ';' - var manifestContents = File.ReadAllText(serviceWorkerAssetsManifest).TrimEnd()[22..^1]; - - var manifestContentsJson = JsonDocument.Parse(manifestContents); - Assert.True(manifestContentsJson.RootElement.TryGetProperty("assets", out var assets)); - Assert.Equal(JsonValueKind.Array, assets.ValueKind); - - var entries = assets.EnumerateArray().Select(e => e.GetProperty("url").GetString()).OrderBy(e => e).ToArray(); - Assert.All(entries, e => expectedExtensions.Contains(Path.GetExtension(e))); - - var serviceWorkerFile = Path.Combine(publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); - Assert.FileContainsLine(result, serviceWorkerFile, "// This is the production service worker"); - } - - [Fact] - public async Task Publish_UpdatesServiceWorkerVersionHash_WhenSourcesChange() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", args: "/bl:initial.binlog /p:ServiceWorkerAssetsManifest=service-worker-assets.js"); - - Assert.BuildPassed(result); - - var publishOutputDirectory = project.PublishOutputDirectory; - - var serviceWorkerFile = Assert.FileExists(result, publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); - var version = File.ReadAllLines(serviceWorkerFile).Last(); - var match = Regex.Match(version, "\\/\\* Manifest version: (.{8}) \\*\\/"); - Assert.True(match.Success); - Assert.Equal(2, match.Groups.Count); - Assert.NotNull(match.Groups[1].Value); - var capture = match.Groups[1].Value; - - // Act - var cssFile = Path.Combine(project.DirectoryPath, "LinkToWebRoot", "css", "app.css"); - File.WriteAllText(cssFile, ".updated { }"); - - // Assert - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", args: "/bl:updated.binlog /p:ServiceWorkerAssetsManifest=service-worker-assets.js"); - - Assert.BuildPassed(result); - - var updatedVersion = File.ReadAllLines(serviceWorkerFile).Last(); - var updatedMatch = Regex.Match(updatedVersion, "\\/\\* Manifest version: (.{8}) \\*\\/"); - Assert.True(updatedMatch.Success); - Assert.Equal(2, updatedMatch.Groups.Count); - Assert.NotNull(updatedMatch.Groups[1].Value); - var updatedCapture = updatedMatch.Groups[1].Value; - - Assert.NotEqual(capture, updatedCapture); - } - - [Fact] - public async Task Publish_DeterministicAcrossBuilds_WhenNoSourcesChange() - { - // Arrange - using var project = ProjectDirectory.Create("blazorwasm", additionalProjects: new[] { "razorclasslibrary" }); - var result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", args: "/bl:initial.binlog /p:ServiceWorkerAssetsManifest=service-worker-assets.js"); - - Assert.BuildPassed(result); - - var publishOutputDirectory = project.PublishOutputDirectory; - - var serviceWorkerFile = Assert.FileExists(result, publishOutputDirectory, "wwwroot", "serviceworkers", "my-service-worker.js"); - var version = File.ReadAllLines(serviceWorkerFile).Last(); - var match = Regex.Match(version, "\\/\\* Manifest version: (.{8}) \\*\\/"); - Assert.True(match.Success, $"No match found for manifest version regex in line: {version}"); - Assert.Equal(2, match.Groups.Count); - Assert.NotNull(match.Groups[1].Value); - var capture = match.Groups[1].Value; - - // Act && Assert - result = await MSBuildProcessManager.DotnetMSBuild(project, "Publish", args: "/bl:updated.binlog /p:ServiceWorkerAssetsManifest=service-worker-assets.js"); - - Assert.BuildPassed(result); - - var updatedVersion = File.ReadAllLines(serviceWorkerFile).Last(); - var updatedMatch = Regex.Match(updatedVersion, "\\/\\* Manifest version: (.{8}) \\*\\/"); - Assert.True(updatedMatch.Success); - Assert.Equal(2, updatedMatch.Groups.Count); - Assert.NotNull(updatedMatch.Groups[1].Value); - var updatedCapture = updatedMatch.Groups[1].Value; - - Assert.Equal(capture, updatedCapture); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/integrationtests/xunit.runner.json b/src/Components/WebAssembly/Sdk/integrationtests/xunit.runner.json deleted file mode 100644 index d00e4ae90744..000000000000 --- a/src/Components/WebAssembly/Sdk/integrationtests/xunit.runner.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "methodDisplay": "method", - "shadowCopy": false, - "maxParallelThreads": -1 -} \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/src/AssetsManifestFile.cs b/src/Components/WebAssembly/Sdk/src/AssetsManifestFile.cs deleted file mode 100644 index 872b17aae220..000000000000 --- a/src/Components/WebAssembly/Sdk/src/AssetsManifestFile.cs +++ /dev/null @@ -1,33 +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. - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ -#pragma warning disable IDE1006 // Naming Styles - public class AssetsManifestFile - { - /// - /// Gets or sets a version string. - /// - public string version { get; set; } - - /// - /// Gets or sets the assets. Keys are URLs; values are base-64-formatted SHA256 content hashes. - /// - public AssetsManifestFileEntry[] assets { get; set; } - } - - public class AssetsManifestFileEntry - { - /// - /// Gets or sets the asset URL. Normally this will be relative to the application's base href. - /// - public string url { get; set; } - - /// - /// Gets or sets the file content hash. This should be the base-64-formatted SHA256 value. - /// - public string hash { get; set; } - } -#pragma warning restore IDE1006 // Naming Styles -} diff --git a/src/Components/WebAssembly/Sdk/src/BlazorReadSatelliteAssemblyFile.cs b/src/Components/WebAssembly/Sdk/src/BlazorReadSatelliteAssemblyFile.cs deleted file mode 100644 index f6bf0c88f8d0..000000000000 --- a/src/Components/WebAssembly/Sdk/src/BlazorReadSatelliteAssemblyFile.cs +++ /dev/null @@ -1,38 +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. - -using System.Linq; -using System.Xml.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class BlazorReadSatelliteAssemblyFile : Task - { - [Output] - public ITaskItem[] SatelliteAssembly { get; set; } - - [Required] - public ITaskItem ReadFile { get; set; } - - public override bool Execute() - { - var document = XDocument.Load(ReadFile.ItemSpec); - SatelliteAssembly = document.Root - .Elements() - .Select(e => - { - // - - var taskItem = new TaskItem(e.Attribute("Name").Value); - taskItem.SetMetadata("Culture", e.Attribute("Culture").Value); - taskItem.SetMetadata("DestinationSubDirectory", e.Attribute("DestinationSubDirectory").Value); - - return taskItem; - }).ToArray(); - - return true; - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/BlazorWriteSatelliteAssemblyFile.cs b/src/Components/WebAssembly/Sdk/src/BlazorWriteSatelliteAssemblyFile.cs deleted file mode 100644 index 92fd8d33e874..000000000000 --- a/src/Components/WebAssembly/Sdk/src/BlazorWriteSatelliteAssemblyFile.cs +++ /dev/null @@ -1,53 +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. - -using System.IO; -using System.Xml; -using System.Xml.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class BlazorWriteSatelliteAssemblyFile : Task - { - [Required] - public ITaskItem[] SatelliteAssembly { get; set; } - - [Required] - public ITaskItem WriteFile { get; set; } - - public override bool Execute() - { - using var fileStream = File.Create(WriteFile.ItemSpec); - WriteSatelliteAssemblyFile(fileStream); - return true; - } - - internal void WriteSatelliteAssemblyFile(Stream stream) - { - var root = new XElement("SatelliteAssembly"); - - foreach (var item in SatelliteAssembly) - { - // - - root.Add(new XElement("Assembly", - new XAttribute("Name", item.ItemSpec), - new XAttribute("Culture", item.GetMetadata("Culture")), - new XAttribute("DestinationSubDirectory", item.GetMetadata("DestinationSubDirectory")))); - } - - var xmlWriterSettings = new XmlWriterSettings - { - Indent = true, - OmitXmlDeclaration = true - }; - - using var writer = XmlWriter.Create(stream, xmlWriterSettings); - var xDocument = new XDocument(root); - - xDocument.Save(writer); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/BootJsonData.cs b/src/Components/WebAssembly/Sdk/src/BootJsonData.cs deleted file mode 100644 index 61fa83886fe7..000000000000 --- a/src/Components/WebAssembly/Sdk/src/BootJsonData.cs +++ /dev/null @@ -1,108 +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. - -using System.Collections.Generic; -using System.Runtime.Serialization; -using ResourceHashesByNameDictionary = System.Collections.Generic.Dictionary; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ -#pragma warning disable IDE1006 // Naming Styles - /// - /// Defines the structure of a Blazor boot JSON file - /// - public class BootJsonData - { - /// - /// Gets the name of the assembly with the application entry point - /// - public string entryAssembly { get; set; } - - /// - /// Gets the set of resources needed to boot the application. This includes the transitive - /// closure of .NET assemblies (including the entrypoint assembly), the dotnet.wasm file, - /// and any PDBs to be loaded. - /// - /// Within , dictionary keys are resource names, - /// and values are SHA-256 hashes formatted in prefixed base-64 style (e.g., 'sha256-abcdefg...') - /// as used for subresource integrity checking. - /// - public ResourcesData resources { get; set; } = new ResourcesData(); - - /// - /// Gets a value that determines whether to enable caching of the - /// inside a CacheStorage instance within the browser. - /// - public bool cacheBootResources { get; set; } - - /// - /// Gets a value that determines if this is a debug build. - /// - public bool debugBuild { get; set; } - - /// - /// Gets a value that determines if the linker is enabled. - /// - public bool linkerEnabled { get; set; } - - /// - /// Config files for the application - /// - public List config { get; set; } - - /// - /// Gets or sets the that determines how icu files are loaded. - /// - public ICUDataMode icuDataMode { get; set; } - } - - public class ResourcesData - { - /// - /// .NET Wasm runtime resources (dotnet.wasm, dotnet.js) etc. - /// - public ResourceHashesByNameDictionary runtime { get; set; } = new ResourceHashesByNameDictionary(); - - /// - /// "assembly" (.dll) resources - /// - public ResourceHashesByNameDictionary assembly { get; set; } = new ResourceHashesByNameDictionary(); - - /// - /// "debug" (.pdb) resources - /// - [DataMember(EmitDefaultValue = false)] - public ResourceHashesByNameDictionary pdb { get; set; } - - /// - /// localization (.satellite resx) resources - /// - [DataMember(EmitDefaultValue = false)] - public Dictionary satelliteResources { get; set; } - - /// - /// Assembly (.dll) resources that are loaded lazily during runtime - /// - [DataMember(EmitDefaultValue = false)] - public ResourceHashesByNameDictionary lazyAssembly { get; set; } - } - - public enum ICUDataMode - { - /// - /// Load optimized icu data file based on the user's locale - /// - Sharded, - - /// - /// Use the combined icudt.dat file - /// - All, - - /// - /// Do not load any icu data files. - /// - Invariant, - } -#pragma warning restore IDE1006 // Naming Styles -} diff --git a/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs b/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs deleted file mode 100644 index 9518e81188f2..000000000000 --- a/src/Components/WebAssembly/Sdk/src/BrotliCompress.cs +++ /dev/null @@ -1,136 +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. - -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class BrotliCompress : ToolTask - { - private static readonly char[] InvalidPathChars = Path.GetInvalidFileNameChars(); - private string _dotnetPath; - - [Required] - public ITaskItem[] FilesToCompress { get; set; } - - [Output] - public ITaskItem[] CompressedFiles { get; set; } - - [Required] - public string OutputDirectory { get; set; } - - public string CompressionLevel { get; set; } - - public bool SkipIfOutputIsNewer { get; set; } - - [Required] - public string ToolAssembly { get; set; } - - protected override string ToolName => Path.GetDirectoryName(DotNetPath); - - private string DotNetPath - { - get - { - if (!string.IsNullOrEmpty(_dotnetPath)) - { - return _dotnetPath; - } - - _dotnetPath = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"); - if (string.IsNullOrEmpty(_dotnetPath)) - { - throw new InvalidOperationException("DOTNET_HOST_PATH is not set"); - } - - return _dotnetPath; - } - } - - private static string Quote(string path) - { - if (string.IsNullOrEmpty(path) || (path[0] == '\"' && path[path.Length - 1] == '\"')) - { - // it's already quoted - return path; - } - - return $"\"{path}\""; - } - - protected override string GenerateCommandLineCommands() => Quote(ToolAssembly); - - protected override string GenerateResponseFileCommands() - { - var builder = new StringBuilder(); - - - builder.AppendLine("brotli"); - - if (!string.IsNullOrEmpty(CompressionLevel)) - { - builder.AppendLine("-c"); - builder.AppendLine(CompressionLevel); - } - - CompressedFiles = new ITaskItem[FilesToCompress.Length]; - - for (var i = 0; i < FilesToCompress.Length; i++) - { - var input = FilesToCompress[i]; - var inputFullPath = input.GetMetadata("FullPath"); - var relativePath = input.GetMetadata("RelativePath"); - var outputRelativePath = Path.Combine(OutputDirectory, CalculateTargetPath(inputFullPath, ".br")); - var outputFullPath = Path.GetFullPath(outputRelativePath); - - var outputItem = new TaskItem(outputRelativePath); - outputItem.SetMetadata("RelativePath", relativePath + ".br"); - CompressedFiles[i] = outputItem; - - if (SkipIfOutputIsNewer && File.Exists(outputFullPath) && File.GetLastWriteTimeUtc(inputFullPath) < File.GetLastWriteTimeUtc(outputFullPath)) - { - Log.LogMessage(MessageImportance.Low, $"Skipping compression for '{input.ItemSpec}' because '{outputRelativePath}' is newer than '{input.ItemSpec}'."); - continue; - } - - builder.AppendLine("-s"); - builder.AppendLine(inputFullPath); - - builder.AppendLine("-o"); - builder.AppendLine(outputFullPath); - } - - return builder.ToString(); - } - - internal static string CalculateTargetPath(string relativePath, string extension) - { - // RelativePath can be long and if used as-is to write the output, might result in long path issues on Windows. - // Instead we'll calculate a fixed length path by hashing the input file name. This uses SHA1 similar to the Hash task in MSBuild - // since it has no crytographic significance. - using var hash = SHA1.Create(); - var bytes = Encoding.UTF8.GetBytes(relativePath); - var hashString = Convert.ToBase64String(hash.ComputeHash(bytes)); - - var builder = new StringBuilder(); - - for (var i = 0; i < 8; i++) - { - var c = hashString[i]; - builder.Append(InvalidPathChars.Contains(c) ? '+' : c); - } - - builder.Append(extension); - return builder.ToString(); - } - - protected override string GenerateFullPathToTool() => DotNetPath; - } -} diff --git a/src/Components/WebAssembly/Sdk/src/CreateBlazorTrimmerRootDescriptorFile.cs b/src/Components/WebAssembly/Sdk/src/CreateBlazorTrimmerRootDescriptorFile.cs deleted file mode 100644 index f14ffad2219a..000000000000 --- a/src/Components/WebAssembly/Sdk/src/CreateBlazorTrimmerRootDescriptorFile.cs +++ /dev/null @@ -1,79 +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. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Xml; -using System.Xml.Linq; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - // Based on https://github.com/mono/linker/blob/3b329b9481e300bcf4fb88a2eebf8cb5ef8b323b/src/ILLink.Tasks/CreateRootDescriptorFile.cs - public class CreateBlazorTrimmerRootDescriptorFile : Task - { - [Required] - public ITaskItem[] Assemblies { get; set; } - - [Required] - public ITaskItem TrimmerFile { get; set; } - - public override bool Execute() - { - var rootDescriptor = CreateRootDescriptorContents(); - if (File.Exists(TrimmerFile.ItemSpec)) - { - var existing = File.ReadAllText(TrimmerFile.ItemSpec); - - if (string.Equals(rootDescriptor, existing, StringComparison.Ordinal)) - { - Log.LogMessage(MessageImportance.Low, "Skipping write to file {0} because contents would not change.", TrimmerFile.ItemSpec); - // Avoid writing if the file contents are identical. This is required for build incrementalism. - return !Log.HasLoggedErrors; - } - } - - File.WriteAllText(TrimmerFile.ItemSpec, rootDescriptor); - return !Log.HasLoggedErrors; - } - - internal string CreateRootDescriptorContents() - { - var roots = new XElement("linker"); - foreach (var assembly in Assemblies.OrderBy(a => a.ItemSpec)) - { - // NOTE: Descriptor files don't include the file extension - // in the assemblyName. - var assemblyName = assembly.GetMetadata("FileName"); - var typePreserved = assembly.GetMetadata("Preserve"); - var typeRequired = assembly.GetMetadata("Required"); - - var attributes = new List - { - new XAttribute("fullname", "*"), - new XAttribute("required", typeRequired), - }; - - if (!string.IsNullOrEmpty(typePreserved)) - { - attributes.Add(new XAttribute("preserve", typePreserved)); - } - - roots.Add(new XElement("assembly", - new XAttribute("fullname", assemblyName), - new XElement("type", attributes))); - } - - var xmlWriterSettings = new XmlWriterSettings - { - Indent = true, - OmitXmlDeclaration = true - }; - - return new XDocument(roots).Root.ToString(); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/GZipCompress.cs b/src/Components/WebAssembly/Sdk/src/GZipCompress.cs deleted file mode 100644 index 14ae1ae1c88f..000000000000 --- a/src/Components/WebAssembly/Sdk/src/GZipCompress.cs +++ /dev/null @@ -1,70 +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. - -using System; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class GZipCompress : Task - { - [Required] - public ITaskItem[] FilesToCompress { get; set; } - - [Output] - public ITaskItem[] CompressedFiles { get; set; } - - [Required] - public string OutputDirectory { get; set; } - - public override bool Execute() - { - CompressedFiles = new ITaskItem[FilesToCompress.Length]; - - Directory.CreateDirectory(OutputDirectory); - - System.Threading.Tasks.Parallel.For(0, FilesToCompress.Length, i => - { - var file = FilesToCompress[i]; - var inputFullPath = file.GetMetadata("FullPath"); - var relativePath = file.GetMetadata("RelativePath"); - var outputRelativePath = Path.Combine( - OutputDirectory, - BrotliCompress.CalculateTargetPath(inputFullPath, ".gz")); - - var outputItem = new TaskItem(outputRelativePath); - outputItem.SetMetadata("RelativePath", relativePath + ".gz"); - CompressedFiles[i] = outputItem; - - if (File.Exists(outputRelativePath) && File.GetLastWriteTimeUtc(inputFullPath) < File.GetLastWriteTimeUtc(outputRelativePath)) - { - // Incrementalism. If input source doesn't exist or it exists and is not newer than the expected output, do nothing. - Log.LogMessage(MessageImportance.Low, $"Skipping '{file.ItemSpec}' because '{outputRelativePath}' is newer than '{file.ItemSpec}'."); - return; - } - - try - { - using var sourceStream = File.OpenRead(file.ItemSpec); - using var fileStream = File.Create(outputRelativePath); - using var stream = new GZipStream(fileStream, CompressionLevel.Optimal); - - sourceStream.CopyTo(stream); - } - catch (Exception e) - { - Log.LogErrorFromException(e); - return; - } - }); - - return !Log.HasLoggedErrors; - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/GenerateBlazorWebAssemblyBootJson.cs b/src/Components/WebAssembly/Sdk/src/GenerateBlazorWebAssemblyBootJson.cs deleted file mode 100644 index 5bc88610e133..000000000000 --- a/src/Components/WebAssembly/Sdk/src/GenerateBlazorWebAssemblyBootJson.cs +++ /dev/null @@ -1,176 +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. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Runtime.Serialization.Json; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using ResourceHashesByNameDictionary = System.Collections.Generic.Dictionary; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class GenerateBlazorWebAssemblyBootJson : Task - { - [Required] - public string AssemblyPath { get; set; } - - [Required] - public ITaskItem[] Resources { get; set; } - - [Required] - public bool DebugBuild { get; set; } - - [Required] - public bool LinkerEnabled { get; set; } - - [Required] - public bool CacheBootResources { get; set; } - - public bool LoadAllICUData { get; set; } - - public string InvariantGlobalization { get; set; } - - public ITaskItem[] ConfigurationFiles { get; set; } - - [Required] - public string OutputPath { get; set; } - - public ITaskItem[] LazyLoadedAssemblies { get; set; } - - public override bool Execute() - { - using var fileStream = File.Create(OutputPath); - var entryAssemblyName = AssemblyName.GetAssemblyName(AssemblyPath).Name; - - try - { - WriteBootJson(fileStream, entryAssemblyName); - } - catch (Exception ex) - { - Log.LogErrorFromException(ex); - } - - return !Log.HasLoggedErrors; - } - - // Internal for tests - public void WriteBootJson(Stream output, string entryAssemblyName) - { - var icuDataMode = ICUDataMode.Sharded; - - if (string.Equals(InvariantGlobalization, "true", StringComparison.OrdinalIgnoreCase)) - { - icuDataMode = ICUDataMode.Invariant; - } - else if (LoadAllICUData) - { - icuDataMode = ICUDataMode.All; - } - - var result = new BootJsonData - { - entryAssembly = entryAssemblyName, - cacheBootResources = CacheBootResources, - debugBuild = DebugBuild, - linkerEnabled = LinkerEnabled, - resources = new ResourcesData(), - config = new List(), - icuDataMode = icuDataMode, - }; - - // Build a two-level dictionary of the form: - // - assembly: - // - UriPath (e.g., "System.Text.Json.dll") - // - ContentHash (e.g., "4548fa2e9cf52986") - // - runtime: - // - UriPath (e.g., "dotnet.js") - // - ContentHash (e.g., "3448f339acf512448") - if (Resources != null) - { - var resourceData = result.resources; - foreach (var resource in Resources) - { - ResourceHashesByNameDictionary resourceList; - - var fileName = resource.GetMetadata("FileName"); - var extension = resource.GetMetadata("Extension"); - var resourceCulture = resource.GetMetadata("Culture"); - var assetType = resource.GetMetadata("AssetType"); - var resourceName = $"{fileName}{extension}"; - - if (IsLazyLoadedAssembly(resourceName)) - { - resourceData.lazyAssembly ??= new ResourceHashesByNameDictionary(); - resourceList = resourceData.lazyAssembly; - } - else if (!string.IsNullOrEmpty(resourceCulture)) - { - resourceData.satelliteResources ??= new Dictionary(StringComparer.OrdinalIgnoreCase); - resourceName = resourceCulture + "/" + resourceName; - - if (!resourceData.satelliteResources.TryGetValue(resourceCulture, out resourceList)) - { - resourceList = new ResourceHashesByNameDictionary(); - resourceData.satelliteResources.Add(resourceCulture, resourceList); - } - } - else if (string.Equals(extension, ".pdb", StringComparison.OrdinalIgnoreCase)) - { - resourceData.pdb ??= new ResourceHashesByNameDictionary(); - if (IsLazyLoadedAssembly($"{fileName}.dll")) - { - resourceList = resourceData.lazyAssembly; - } else { - resourceList = resourceData.pdb; - } - } - else if (string.Equals(extension, ".dll", StringComparison.OrdinalIgnoreCase)) - { - resourceList = resourceData.assembly; - } - else if (string.Equals(assetType, "native", StringComparison.OrdinalIgnoreCase)) - { - resourceList = resourceData.runtime; - } - else - { - // This should include items such as XML doc files, which do not need to be recorded in the manifest. - continue; - } - - if (!resourceList.ContainsKey(resourceName)) - { - resourceList.Add(resourceName, $"sha256-{resource.GetMetadata("FileHash")}"); - } - } - } - - if (ConfigurationFiles != null) - { - foreach (var configFile in ConfigurationFiles) - { - result.config.Add(Path.GetFileName(configFile.ItemSpec)); - } - } - - var serializer = new DataContractJsonSerializer(typeof(BootJsonData), new DataContractJsonSerializerSettings - { - UseSimpleDictionaryFormat = true - }); - - using var writer = JsonReaderWriterFactory.CreateJsonWriter(output, Encoding.UTF8, ownsStream: false, indent: true); - serializer.WriteObject(writer, result); - } - - private bool IsLazyLoadedAssembly(string fileName) - { - return LazyLoadedAssemblies != null && LazyLoadedAssemblies.Any(a => a.ItemSpec == fileName); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/GenerateServiceWorkerAssetsManifest.cs b/src/Components/WebAssembly/Sdk/src/GenerateServiceWorkerAssetsManifest.cs deleted file mode 100644 index 08c75a927af7..000000000000 --- a/src/Components/WebAssembly/Sdk/src/GenerateServiceWorkerAssetsManifest.cs +++ /dev/null @@ -1,97 +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. - -using System; -using System.IO; -using System.Linq; -using System.Runtime.Serialization.Json; -using System.Security.Cryptography; -using System.Text; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public partial class GenerateServiceWorkerAssetsManifest : Task - { - [Required] - public ITaskItem[] Assets { get; set; } - - public string Version { get; set; } - - [Required] - public string OutputPath { get; set; } - - [Output] - public string CalculatedVersion { get; set; } - - public override bool Execute() - { - using var fileStream = File.Create(OutputPath); - CalculatedVersion = GenerateAssetManifest(fileStream); - - return true; - } - - internal string GenerateAssetManifest(Stream stream) - { - var assets = new AssetsManifestFileEntry[Assets.Length]; - System.Threading.Tasks.Parallel.For(0, assets.Length, i => - { - var item = Assets[i]; - var hash = item.GetMetadata("FileHash"); - var url = item.GetMetadata("AssetUrl"); - - if (string.IsNullOrEmpty(hash)) - { - // Some files that are part of the service worker manifest may not have their hashes previously - // calcualted. Calculate them at this time. - using var sha = SHA256.Create(); - using var file = File.OpenRead(item.ItemSpec); - var bytes = sha.ComputeHash(file); - - hash = Convert.ToBase64String(bytes); - } - - assets[i] = new AssetsManifestFileEntry - { - hash = "sha256-" + hash, - url = url, - }; - }); - - var version = Version; - if (string.IsNullOrEmpty(version)) - { - // If a version isn't specified (which is likely the most common case), construct a Version by combining - // the file names + hashes of all the inputs. - - var combinedHash = string.Join( - Environment.NewLine, - assets.OrderBy(f => f.url, StringComparer.Ordinal).Select(f => f.hash)); - - using var sha = SHA256.Create(); - var bytes = sha.ComputeHash(Encoding.UTF8.GetBytes(combinedHash)); - version = Convert.ToBase64String(bytes).Substring(0, 8); - } - - var data = new AssetsManifestFile - { - version = version, - assets = assets, - }; - - using var streamWriter = new StreamWriter(stream, Encoding.UTF8, bufferSize: 50, leaveOpen: true); - streamWriter.Write("self.assetsManifest = "); - streamWriter.Flush(); - - using var jsonWriter = JsonReaderWriterFactory.CreateJsonWriter(stream, Encoding.UTF8, ownsStream: false, indent: true); - new DataContractJsonSerializer(typeof(AssetsManifestFile)).WriteObject(jsonWriter, data); - jsonWriter.Flush(); - - streamWriter.WriteLine(";"); - - return version; - } - } -} diff --git a/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.csproj b/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.csproj deleted file mode 100644 index bf1642976905..000000000000 --- a/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - MSBuild support for building Blazor WebAssembly apps. - $(DefaultNetCoreTargetFramework);net46 - - Microsoft.NET.Sdk.BlazorWebAssembly.Tasks - $(MSBuildProjectName).nuspec - true - $(ArtifactsBinDir)Microsoft.NET.Sdk.BlazorWebAssembly\$(Configuration)\sdk-output\ - - - $(NoWarn);NU5100 - - false - - false - - - false - - false - - - - - - - - - - - - - - - - - - <_ContinueOnError>true - <_Retries>1 - - - - <_ContinueOnError>false - <_Retries>10 - - - - <_WebAssemblyToolsOutput Include="$(ArtifactsBinDir)Microsoft.NET.Sdk.BlazorWebAssembly.Tools\$(Configuration)\$(DefaultNetCoreTargetFramework)\publish\Microsoft.*" /> - - - - - - - - - - - - - - - - - - - - - $(PackageTags.Replace(';',' ')) - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.nuspec b/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.nuspec deleted file mode 100644 index f14e24f7c810..000000000000 --- a/src/Components/WebAssembly/Sdk/src/Microsoft.NET.Sdk.BlazorWebAssembly.nuspec +++ /dev/null @@ -1,19 +0,0 @@ - - - - $CommonMetadataElements$ - - - - - - - $CommonFileElements$ - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.props b/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.props deleted file mode 100644 index 3f6870441f48..000000000000 --- a/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.props +++ /dev/null @@ -1,22 +0,0 @@ - - - - true - - - - <_BlazorWebAssemblyPropsFile Condition="'$(_BlazorWebAssemblyPropsFile)' == ''">$(MSBuildThisFileDirectory)..\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.props - - - - diff --git a/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.targets b/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.targets deleted file mode 100644 index bc79142b2478..000000000000 --- a/src/Components/WebAssembly/Sdk/src/Sdk/Sdk.targets +++ /dev/null @@ -1,24 +0,0 @@ - - - - - <_BlazorWebAssemblyTargetsFile Condition="'$(_BlazorWebAssemblyTargetsFile)' == ''">$(MSBuildThisFileDirectory)..\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/_._ b/src/Components/WebAssembly/Sdk/src/_._ deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/Components/WebAssembly/Sdk/src/build/net6.0/Microsoft.NET.Sdk.BlazorWebAssembly.props b/src/Components/WebAssembly/Sdk/src/build/net6.0/Microsoft.NET.Sdk.BlazorWebAssembly.props deleted file mode 100644 index 6204aa513fff..000000000000 --- a/src/Components/WebAssembly/Sdk/src/build/net6.0/Microsoft.NET.Sdk.BlazorWebAssembly.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - <_BlazorWebAssemblyPropsFile>$(MSBuildThisFileDirectory)..\..\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.props - <_BlazorWebAssemblyTargetsFile>$(MSBuildThisFileDirectory)..\..\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets - - diff --git a/src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config b/src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config deleted file mode 100644 index c461dc0b3d06..000000000000 --- a/src/Components/WebAssembly/Sdk/src/targets/BlazorWasm.web.config +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props b/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props deleted file mode 100644 index 4ec923c2b15b..000000000000 --- a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props +++ /dev/null @@ -1,34 +0,0 @@ - - - - - browser-wasm - - - false - - exe - - false - - false - - - false - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets b/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets deleted file mode 100644 index 39be2b25e7b6..000000000000 --- a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets +++ /dev/null @@ -1,661 +0,0 @@ - - - - - true - - - - - - - - - - - - - - $(MSBuildThisFileDirectory)..\ - <_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' == 'Core'">net6.0 - <_BlazorWebAssemblySdkTasksTFM Condition=" '$(MSBuildRuntimeType)' != 'Core'">net46 - <_BlazorWebAssemblySdkTasksAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tasks\$(_BlazorWebAssemblySdkTasksTFM)\Microsoft.NET.Sdk.BlazorWebAssembly.Tasks.dll - <_BlazorWebAssemblySdkToolAssembly>$(BlazorWebAssemblySdkDirectoryRoot)tools\net6.0\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.dll - - - - - - - - - - - true - true - - - true - link - false - - - false - true - false - false - false - - / - true - - - false - false - false - false - true - - - <_BlazorOutputPath>wwwroot\_framework\ - - - - - - - - - - - - - - <_DotNetJsVersion>$(BundledNETCoreAppPackageVersion) - <_DotNetJsVersion Condition="'$(RuntimeFrameworkVersion)' != ''">$(RuntimeFrameworkVersion) - <_BlazorDotnetJsFileName>dotnet.$(_DotNetJsVersion).js - <_BlazorDotNetJsFilePath>$(IntermediateOutputPath)$(_BlazorDotnetJsFileName) - - - - <_DotNetJsItem Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.DestinationSubPath)' == 'dotnet.js' AND '%(ReferenceCopyLocalPaths.AssetType)' == 'native'" /> - - - - - - - - - - - - - - - - <_BlazorSatelliteAssemblyCacheFile>$(IntermediateOutputPath)blazor.satelliteasm.props - - $(OutputPath)$(PublishDirName)\ - - <_BlazorWebAssemblyLoadAllGlobalizationData>$(BlazorWebAssemblyLoadAllGlobalizationData) - <_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(_BlazorWebAssemblyLoadAllGlobalizationData)' == ''">false - - - - <_BlazorJSFile Include="$(BlazorWebAssemblyJSPath)" /> - <_BlazorJSFile Include="$(BlazorWebAssemblyJSMapPath)" Condition="Exists('$(BlazorWebAssemblyJSMapPath)')" /> - - <_BlazorConfigFile Include="wwwroot\appsettings*.json" /> - - - - - - - - - - - <_BlazorCopyLocalPath - Include="@(ReferenceCopyLocalPaths)" - Exclude="@(ReferenceSatellitePaths)"/> - - <_BlazorCopyLocalPath Include="@(IntermediateSatelliteAssembliesWithTargetPath)"> - %(IntermediateSatelliteAssembliesWithTargetPath.Culture)\ - - - <_BlazorOutputWithTargetPath Include=" - @(_BlazorCopyLocalPath); - @(IntermediateAssembly); - @(_DebugSymbolsIntermediatePath); - @(_BlazorJSFile)" /> - - <_BlazorOutputWithTargetPath Include="@(ReferenceSatellitePaths)"> - $([System.String]::Copy('%(ReferenceSatellitePaths.DestinationSubDirectory)').Trim('\').Trim('/')) - - - - - - - - - - - <_BlazorOutputWithTargetPath - Include="@(_BlazorReadSatelliteAssembly)" - Exclude="@(_BlazorOutputWithTargetPath)" - Condition="'@(_BlazorReadSatelliteAssembly->Count())' != '0'" /> - - - <_BlazorOutputWithTargetPath - TargetPath="$(_BlazorOutputPath)%(_BlazorOutputWithTargetPath.DestinationSubDirectory)%(FileName)%(Extension)" - Condition="'%(__BlazorOutputWithTargetPath.TargetPath)' == ''" /> - - - - - - <_BlazorBuildGZipCompressDirectory>$(IntermediateOutputPath)build-gz\ - - - - - <_GzipFileToCompressForBuild - Include="@(ReferenceCopyLocalPaths)" - RelativePath="$(_BlazorOutputPath)%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(FileName)%(Extension)" - Condition="'%(Extension)' == '.dll' or '%(ReferenceCopyLocalPaths.AssetType)' == 'native'" /> - - - - - - - - - - <_BlazorWriteSatelliteAssembly Include="@(_BlazorOutputWithTargetPath->HasMetadata('Culture'))" /> - - - - - - - - - - - - - - - - - - - - - - - - - - _BlazorWasmPrepareForRun; - $(PrepareForRunDependsOn) - - - - $(GetCurrentProjectStaticWebAssetsDependsOn); - _BlazorWasmReplaceBundle; - _BlazorWasmPrepareForRun; - - - - - - - - - - - - - <_BlazorBuildBootJsonPath>$(IntermediateOutputPath)blazor.boot.json - <_BlazorOutputContent>@(_BlazorOutputWithHash) - <_BlazorWebAssemblyLoadAllGlobalizationData Condition="'$(BlazorWebAssemblyLoadAllGlobalizationData)' == ''">false - - - - - - - - - - - - <_BlazorWebAssemblyStaticWebAsset Include="$(_BlazorBuildBootJsonPath)"> - $(PackageId) - - $([MSBuild]::NormalizeDirectory('$(TargetDir)wwwroot\')) - $(StaticWebAssetBasePath) - _framework/blazor.boot.json - Never - - - <_BlazorWebAssemblyStaticWebAsset Include="@(_BlazorOutputWithHash)"> - $(PackageId) - - $([MSBuild]::NormalizeDirectory('$(TargetDir)wwwroot\')) - $(StaticWebAssetBasePath) - $([System.String]::Copy('%(_BlazorOutputWithHash.TargetPath)').Replace('\','/').Substring(8)) - Never - - - <_BlazorWebAssemblyStaticWebAsset Include="@(_BlazorBuildGZipCompressedFile)"> - $(PackageId) - - $([MSBuild]::NormalizeDirectory('$(TargetDir)wwwroot\')) - $(StaticWebAssetBasePath) - $([System.String]::Copy('%(_BlazorBuildGZipCompressedFile.RelativePath)').Replace('\','/').Substring(8)) - Never - - - - <_ExternalStaticWebAsset Include="@(_BlazorWebAssemblyStaticWebAsset)" SourceType="Generated" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_BlazorTypeGranularTrimmerDescriptorFile>$(IntermediateOutputPath)typegranularity.trimmerdescriptor.xml - - - - <_BlazorTypeGranularAssembly - Include="@(ManagedAssemblyToLink)" - Condition="'%(Extension)' == '.dll' AND $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.AspNetCore.'))"> - false - all - - - - - - - - - - - - - - - - - - - - - - - <_BlazorPublishOutputPath Condition="'$(StaticWebAssetBasePath)' != '/'">wwwroot\$(StaticWebAssetBasePath.Replace('/', '\').Trim('\'))\ - <_BlazorPublishOutputPath Condition="'$(StaticWebAssetBasePath)' == '/'">wwwroot\ - <_BlazorFrameworkPublishPath>$(_BlazorPublishOutputPath)_framework\ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_BlazorPublishBootResource - Include="@(ResolvedFileToPublish)" - Condition="$([System.String]::Copy('%(RelativePath)').Replace('\','/').StartsWith('wwwroot/_framework')) AND '%(Extension)' != '.a'" /> - - - - - - - - <_BlazorOutputContent>@(_BlazorPublishBootResourceWithHash) - - - - - - - - - - - - - - - - <_CompressedFileOutputPath>$(IntermediateOutputPath)compress\ - <_BlazorWebAssemblyBrotliIncremental>true - - - - <_FileToCompress - Include="@(ResolvedFileToPublish)" - Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').StartsWith('wwwroot/'))" /> - - - - - - - - <_DotNetHostDirectory>$(NetCoreRoot) - <_DotNetHostFileName>dotnet - <_DotNetHostFileName Condition="'$(OS)' == 'Windows_NT'">dotnet.exe - - - - - - - - - - - - - - - - - - - - - - - - <_PublishingBlazorWasmProject>true - - - - - - - - - - - - - - %(RelativePath) - PreserveNewest - - - - - - - - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets b/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets deleted file mode 100644 index 88969337c431..000000000000 --- a/src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.ServiceWorkerAssetsManifest.targets +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - <_ServiceWorkerAssetsManifestIntermediateOutputPath Condition="'$([System.IO.Path]::IsPathRooted($(BaseIntermediateOutputPath)))' == 'true'">obj\$(Configuration)\$(TargetFramework)\$(ServiceWorkerAssetsManifest) - <_ServiceWorkerAssetsManifestIntermediateOutputPath Condition="'$([System.IO.Path]::IsPathRooted($(BaseIntermediateOutputPath)))' != 'true'">$(IntermediateOutputPath)$(ServiceWorkerAssetsManifest) - <_ServiceWorkerAssetsManifestFullPath>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)/$(_ServiceWorkerAssetsManifestIntermediateOutputPath)')) - - - - <_ManifestStaticWebAsset Include="$(_ServiceWorkerAssetsManifestFullPath)"> - - $(PackageId) - $([MSBuild]::NormalizeDirectory('$(TargetDir)wwwroot\')) - $(StaticWebAssetBasePath) - $(ServiceWorkerAssetsManifest) - Never - - - - <_ServiceWorkerIntermediateFile Include="@(ServiceWorker->'$(IntermediateOutputPath)serviceworkers\%(Identity)')"> - %(ServiceWorker.PublishedContent) - %(ServiceWorker.Identity) - %(ServiceWorker.Identity) - %(ServiceWorker.Identity) - $([System.String]::Copy('%(ServiceWorker.Identity)').Substring(8)) - - - <_ServiceWorkerStaticWebAsset Include="%(_ServiceWorkerIntermediateFile.FullPath)"> - - $(PackageId) - $([MSBuild]::NormalizeDirectory('$(TargetDir)wwwroot\')) - $(StaticWebAssetBasePath) - %(TargetOutputPath) - Never - - - - - - - - - - - <_ServiceWorkItem Include="@(StaticWebAsset)" Exclude="$(_ServiceWorkerAssetsManifestFullPath);@(_ServiceWorkerStaticWebAsset)"> - $([System.String]::Copy('$([System.String]::Copy('%(StaticWebAsset.BasePath)').TrimEnd('/'))/%(StaticWebAsset.RelativePath)').Replace('\','/').TrimStart('/')) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ServiceWorkerAssetsManifestPublishIntermediateOutputPath>$(IntermediateOutputPath)publish-$(ServiceWorkerAssetsManifest) - - - - <_ServiceWorkerIntermediatePublishFile Include="$(IntermediateOutputPath)serviceworkers\%(FileName).publish%(Extension)"> - %(ServiceWorker.PublishedContent) - %(ServiceWorker.Identity) - %(ServiceWorker.Identity) - $(_BlazorPublishOutputPath)$([System.String]::Copy('%(ServiceWorker.Identity)').Substring(8)) - - - <_ServiceWorkerPublishFile Include="@(ResolvedFileToPublish)" Condition="$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').StartsWith('wwwroot/'))"> - $([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').TrimStart('/')) - $([System.String]::Copy('%(RelativePath)').Replace('\','/').Substring(8)) - - - - - - - - - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/test/BlazorReadSatelliteAssemblyFileTest.cs b/src/Components/WebAssembly/Sdk/test/BlazorReadSatelliteAssemblyFileTest.cs deleted file mode 100644 index b95a6154b663..000000000000 --- a/src/Components/WebAssembly/Sdk/test/BlazorReadSatelliteAssemblyFileTest.cs +++ /dev/null @@ -1,68 +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. - -using System.Collections.Generic; -using System.IO; -using Microsoft.Build.Framework; -using Microsoft.Build.Utilities; -using Moq; -using Xunit; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class BlazorReadSatelliteAssemblyFileTest - { - [Fact] - public void WritesAndReadsRoundTrip() - { - // Arrange/Act - var tempFile = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - - var writer = new BlazorWriteSatelliteAssemblyFile - { - BuildEngine = Mock.Of(), - WriteFile = new TaskItem(tempFile), - SatelliteAssembly = new[] - { - new TaskItem("Resources.fr.dll", new Dictionary - { - ["Culture"] = "fr", - ["DestinationSubDirectory"] = "fr\\", - }), - new TaskItem("Resources.ja-jp.dll", new Dictionary - { - ["Culture"] = "ja-jp", - ["DestinationSubDirectory"] = "ja-jp\\", - }), - }, - }; - - var reader = new BlazorReadSatelliteAssemblyFile - { - BuildEngine = Mock.Of(), - ReadFile = new TaskItem(tempFile), - }; - - writer.Execute(); - - Assert.True(File.Exists(tempFile), "Write should have succeeded."); - - reader.Execute(); - - Assert.Collection( - reader.SatelliteAssembly, - assembly => - { - Assert.Equal("Resources.fr.dll", assembly.ItemSpec); - Assert.Equal("fr", assembly.GetMetadata("Culture")); - Assert.Equal("fr\\", assembly.GetMetadata("DestinationSubDirectory")); - }, - assembly => - { - Assert.Equal("Resources.ja-jp.dll", assembly.ItemSpec); - Assert.Equal("ja-jp", assembly.GetMetadata("Culture")); - Assert.Equal("ja-jp\\", assembly.GetMetadata("DestinationSubDirectory")); - }); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/test/GenerateBlazorBootJsonTest.cs b/src/Components/WebAssembly/Sdk/test/GenerateBlazorBootJsonTest.cs deleted file mode 100644 index 139f22f27fbc..000000000000 --- a/src/Components/WebAssembly/Sdk/test/GenerateBlazorBootJsonTest.cs +++ /dev/null @@ -1,195 +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. - -using System.IO; -using System.Linq; -using System.Runtime.Serialization.Json; -using Microsoft.Build.Framework; -using Moq; -using Xunit; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly -{ - public class GenerateBlazorWebAssemblyBootJsonTest - { - [Fact] - public void GroupsResourcesByType() - { - // Arrange - var taskInstance = new GenerateBlazorWebAssemblyBootJson - { - AssemblyPath = "MyApp.Entrypoint.dll", - Resources = new[] - { - CreateResourceTaskItem( - ("FileName", "My.Assembly1"), - ("Extension", ".dll"), - ("FileHash", "abcdefghikjlmnopqrstuvwxyz")), - - CreateResourceTaskItem( - ("FileName", "My.Assembly2"), - ("Extension", ".dll"), - ("FileHash", "012345678901234567890123456789")), - - CreateResourceTaskItem( - ("FileName", "SomePdb"), - ("Extension", ".pdb"), - ("FileHash", "pdbhashpdbhashpdbhash")), - - CreateResourceTaskItem( - ("FileName", "My.Assembly1"), - ("Extension", ".pdb"), - ("FileHash", "pdbdefghikjlmnopqrstuvwxyz")), - - CreateResourceTaskItem( - ("FileName", "some-runtime-file"), - ("FileHash", "runtimehashruntimehash"), - ("AssetType", "native")), - - CreateResourceTaskItem( - ("FileName", "satellite-assembly1"), - ("Extension", ".dll"), - ("FileHash", "hashsatelliteassembly1"), - ("Culture", "en-GB")), - - CreateResourceTaskItem( - ("FileName", "satellite-assembly2"), - ("Extension", ".dll"), - ("FileHash", "hashsatelliteassembly2"), - ("Culture", "fr")), - - CreateResourceTaskItem( - ("FileName", "satellite-assembly3"), - ("Extension", ".dll"), - ("FileHash", "hashsatelliteassembly3"), - ("Culture", "en-GB")), - } - }; - - using var stream = new MemoryStream(); - - // Act - taskInstance.WriteBootJson(stream, "MyEntrypointAssembly"); - - // Assert - var parsedContent = ParseBootData(stream); - Assert.Equal("MyEntrypointAssembly", parsedContent.entryAssembly); - - var resources = parsedContent.resources.assembly; - Assert.Equal(2, resources.Count); - Assert.Equal("sha256-abcdefghikjlmnopqrstuvwxyz", resources["My.Assembly1.dll"]); - Assert.Equal("sha256-012345678901234567890123456789", resources["My.Assembly2.dll"]); - - resources = parsedContent.resources.pdb; - Assert.Equal(2, resources.Count); - Assert.Equal("sha256-pdbhashpdbhashpdbhash", resources["SomePdb.pdb"]); - Assert.Equal("sha256-pdbdefghikjlmnopqrstuvwxyz", resources["My.Assembly1.pdb"]); - - resources = parsedContent.resources.runtime; - Assert.Single(resources); - Assert.Equal("sha256-runtimehashruntimehash", resources["some-runtime-file"]); - - var satelliteResources = parsedContent.resources.satelliteResources; - Assert.Collection( - satelliteResources.OrderBy(kvp => kvp.Key), - kvp => - { - Assert.Equal("en-GB", kvp.Key); - Assert.Collection( - kvp.Value.OrderBy(item => item.Key), - item => - { - Assert.Equal("en-GB/satellite-assembly1.dll", item.Key); - Assert.Equal("sha256-hashsatelliteassembly1", item.Value); - }, - item => - { - Assert.Equal("en-GB/satellite-assembly3.dll", item.Key); - Assert.Equal("sha256-hashsatelliteassembly3", item.Value); - }); - }, - kvp => - { - Assert.Equal("fr", kvp.Key); - Assert.Collection( - kvp.Value.OrderBy(item => item.Key), - item => - { - Assert.Equal("fr/satellite-assembly2.dll", item.Key); - Assert.Equal("sha256-hashsatelliteassembly2", item.Value); - }); - }); - } - - [Theory] - [InlineData(false)] - [InlineData(true)] - public void CanSpecifyCacheBootResources(bool flagValue) - { - // Arrange - var taskInstance = new GenerateBlazorWebAssemblyBootJson { CacheBootResources = flagValue }; - using var stream = new MemoryStream(); - - // Act - taskInstance.WriteBootJson(stream, "MyEntrypointAssembly"); - - // Assert - var parsedContent = ParseBootData(stream); - Assert.Equal(flagValue, parsedContent.cacheBootResources); - } - - [Theory] - [InlineData(false)] - [InlineData(true)] - public void CanSpecifyDebugBuild(bool flagValue) - { - // Arrange - var taskInstance = new GenerateBlazorWebAssemblyBootJson { DebugBuild = flagValue }; - using var stream = new MemoryStream(); - - // Act - taskInstance.WriteBootJson(stream, "MyEntrypointAssembly"); - - // Assert - var parsedContent = ParseBootData(stream); - Assert.Equal(flagValue, parsedContent.debugBuild); - } - - [Theory] - [InlineData(false)] - [InlineData(true)] - public void CanSpecifyLinkerEnabled(bool flagValue) - { - // Arrange - var taskInstance = new GenerateBlazorWebAssemblyBootJson { LinkerEnabled = flagValue }; - using var stream = new MemoryStream(); - - // Act - taskInstance.WriteBootJson(stream, "MyEntrypointAssembly"); - - // Assert - var parsedContent = ParseBootData(stream); - Assert.Equal(flagValue, parsedContent.linkerEnabled); - } - - private static BootJsonData ParseBootData(Stream stream) - { - stream.Position = 0; - var serializer = new DataContractJsonSerializer( - typeof(BootJsonData), - new DataContractJsonSerializerSettings { UseSimpleDictionaryFormat = true }); - return (BootJsonData)serializer.ReadObject(stream); - } - - private static ITaskItem CreateResourceTaskItem(params (string key, string value)[] values) - { - var mock = new Mock(); - - foreach (var (key, value) in values) - { - mock.Setup(m => m.GetMetadata(key)).Returns(value); - } - return mock.Object; - } - } -} diff --git a/src/Components/WebAssembly/Sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj b/src/Components/WebAssembly/Sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj deleted file mode 100644 index 5d30b4f7814a..000000000000 --- a/src/Components/WebAssembly/Sdk/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/Directory.Build.props b/src/Components/WebAssembly/Sdk/testassets/Directory.Build.props deleted file mode 100644 index fe3e5fd9eb3b..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/Directory.Build.props +++ /dev/null @@ -1,40 +0,0 @@ - - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, 'AspNetCore.sln'))\ - $([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin')) - - - - - - false - - $(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Sdk.Razor.CurrentVersion.props - $(RepoRoot)src\Razor\Microsoft.NET.Sdk.Razor\src\build\netstandard2.0\Sdk.Razor.CurrentVersion.targets - $(RepoRoot)artifacts\bin\Microsoft.NET.Sdk.Razor\ - $(RepoRoot)artifacts\bin\Microsoft.NET.Sdk.BlazorWebAssembly\ - <_BlazorWebAssemblyTargetsFile>$(RepoRoot)src\Components\WebAssembly\Sdk\src\targets\Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets - $(MSBuildThisFileDirectory)blazor.webassembly.js - - - - - - - 1.0.0 - - - <_BlazorBrotliCompressionLevel>NoCompression - - - - - <_MvcAssemblyName Include="Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib" /> - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/Directory.Build.targets b/src/Components/WebAssembly/Sdk/testassets/Directory.Build.targets deleted file mode 100644 index b26ef8789250..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/Directory.Build.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - $(MicrosoftNETCoreAppRuntimeVersion) - - diff --git a/src/Components/WebAssembly/Sdk/testassets/LinkBaseToWebRoot/js/LinkedScript.js b/src/Components/WebAssembly/Sdk/testassets/LinkBaseToWebRoot/js/LinkedScript.js deleted file mode 100644 index 5f282702bb03..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/LinkBaseToWebRoot/js/LinkedScript.js +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj b/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj deleted file mode 100644 index 2af6c265d48c..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/RestoreBlazorWasmTestProjects/RestoreBlazorWasmTestProjects.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - $(DefaultNetCoreTargetFramework) - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazor.webassembly.js b/src/Components/WebAssembly/Sdk/testassets/blazor.webassembly.js deleted file mode 100644 index 84362ca046b1..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazor.webassembly.js +++ /dev/null @@ -1 +0,0 @@ -Test file \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/Program.cs deleted file mode 100644 index cb0046ec11ca..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace blazorhosted.Server -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine(typeof(string)); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/blazorhosted-rid.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/blazorhosted-rid.csproj deleted file mode 100644 index 1e14923fb31e..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorhosted-rid/blazorhosted-rid.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - - linux-x64 - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorhosted/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorhosted/Program.cs deleted file mode 100644 index a90f4db291e1..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorhosted/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; - -namespace blazorhosted.Server -{ - public class Program - { - public static void Main(string[] args) - { - Console.WriteLine(typeof(IWebHost)); - GC.KeepAlive(typeof(RazorClassLibrary.Class1)); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorhosted/blazorhosted.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorhosted/blazorhosted.csproj deleted file mode 100644 index 28c8a47ce592..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorhosted/blazorhosted.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor deleted file mode 100644 index 0c55cf88d235..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/App.razor +++ /dev/null @@ -1 +0,0 @@ -Hello from App \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs deleted file mode 100644 index 3ebadb8b76c0..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace standalone -{ - public class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj deleted file mode 100644 index b9708e7e153b..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-fxref/blazorwasm-fxref.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - net5.0 - browser-wasm - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - $(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\ - - - - - - - false - - - - - $(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\ - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/App.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/App.razor deleted file mode 100644 index 13f3043f0c49..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/App.razor +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Sorry, there's nothing at this address.

-
-
diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Pages/Index.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Pages/Index.razor deleted file mode 100644 index 16dac3192520..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Pages/Index.razor +++ /dev/null @@ -1,5 +0,0 @@ -@page "/" - -

Hello, world!

- -Welcome to your new app. diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Program.cs deleted file mode 100644 index 3ebadb8b76c0..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace standalone -{ - public class Program - { - public static void Main(string[] args) - { - } - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/_Imports.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/_Imports.razor deleted file mode 100644 index 129b440e8600..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/_Imports.razor +++ /dev/null @@ -1,2 +0,0 @@ -@using Microsoft.AspNetCore.Components.Routing -@using standalone diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/blazorwasm-minimal.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/blazorwasm-minimal.csproj deleted file mode 100644 index 21dc1505a067..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/blazorwasm-minimal.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - browser-wasm - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - $(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\ - - - - - - - false - - - - - $(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\ - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/css/app.css b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/css/app.css deleted file mode 100644 index fc64a1237602..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/css/app.css +++ /dev/null @@ -1 +0,0 @@ -.build { } diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/index.html b/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/index.html deleted file mode 100644 index bbfa66c41abc..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm-minimal/wwwroot/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - standalone - - - - - - - Loading... - -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/App.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/App.razor deleted file mode 100644 index 13f3043f0c49..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/App.razor +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

Sorry, there's nothing at this address.

-
-
diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/LinkToWebRoot/css/app.css b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/LinkToWebRoot/css/app.css deleted file mode 100644 index 6c9631b4e1dd..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/LinkToWebRoot/css/app.css +++ /dev/null @@ -1 +0,0 @@ -.publish { } diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Pages/Index.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Pages/Index.razor deleted file mode 100644 index 16dac3192520..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Pages/Index.razor +++ /dev/null @@ -1,5 +0,0 @@ -@page "/" - -

Hello, world!

- -Welcome to your new app. diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Program.cs b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Program.cs deleted file mode 100644 index 4b20dea9ded0..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Program.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace standalone -{ - public class Program - { - public static void Main(string[] args) - { - GC.KeepAlive(typeof(System.Text.Json.JsonSerializer)); - GC.KeepAlive(typeof(RazorClassLibrary.Class1)); -#if REFERENCE_classlibrarywithsatelliteassemblies - GC.KeepAlive(typeof(classlibrarywithsatelliteassemblies.Class1)); -#endif - } - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Resources.ja.resx.txt b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Resources.ja.resx.txt deleted file mode 100644 index aabe84e3c053..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/Resources.ja.resx.txt +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Konnichiwa - - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/_Imports.razor b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/_Imports.razor deleted file mode 100644 index 129b440e8600..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/_Imports.razor +++ /dev/null @@ -1,2 +0,0 @@ -@using Microsoft.AspNetCore.Components.Routing -@using standalone diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/blazorwasm.csproj b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/blazorwasm.csproj deleted file mode 100644 index d489b534b956..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/blazorwasm.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - $(DefaultNetCoreTargetFramework) - browser-wasm - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - $(BlazorWebAssemblySdkArtifactsDirectory)$(Configuration)\sdk-output\ - custom-service-worker-assets.js - - - - - - - false - - - - - $(RepoRoot)artifacts\bin\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\$(Configuration)\netstandard2.0\ - - - - - - - - - - - - - - - - - wwwroot\ - - - - - - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/Fake-License.txt b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/Fake-License.txt deleted file mode 100644 index 5f282702bb03..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/Fake-License.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/css/app.css b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/css/app.css deleted file mode 100644 index fc64a1237602..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/css/app.css +++ /dev/null @@ -1 +0,0 @@ -.build { } diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/index.html b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/index.html deleted file mode 100644 index bbfa66c41abc..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - standalone - - - - - - - Loading... - -
- An unhandled error has occurred. - Reload - 🗙 -
- - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-prod-service-worker.js b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-prod-service-worker.js deleted file mode 100644 index a2ecc1b349c2..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-prod-service-worker.js +++ /dev/null @@ -1 +0,0 @@ -// This is the production service worker diff --git a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-service-worker.js b/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-service-worker.js deleted file mode 100644 index c42d1c84755f..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/blazorwasm/wwwroot/serviceworkers/my-service-worker.js +++ /dev/null @@ -1 +0,0 @@ -// This is the development service worker diff --git a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Class1.cs b/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Class1.cs deleted file mode 100644 index 944699cdb327..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Class1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace classlibrarywithsatelliteassemblies -{ - public class Class1 - { - public static void Test() - { - GC.KeepAlive(typeof(Microsoft.CodeAnalysis.CSharp.CSharpCompilation)); - } - } -} \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Resources.es-ES.resx b/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Resources.es-ES.resx deleted file mode 100644 index 0ab8f0ddfb32..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/Resources.es-ES.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Hola - - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/classlibrarywithsatelliteassemblies.csproj b/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/classlibrarywithsatelliteassemblies.csproj deleted file mode 100644 index f1a186fb940a..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/classlibrarywithsatelliteassemblies/classlibrarywithsatelliteassemblies.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - netstandard2.1 - 3.0 - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/Class1.cs b/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/Class1.cs deleted file mode 100644 index fb55605ff46f..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace RazorClassLibrary -{ - public class Class1 - { - } -} diff --git a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/RazorClassLibrary.csproj b/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/RazorClassLibrary.csproj deleted file mode 100644 index 9480a0542e17..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/RazorClassLibrary.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - - netstandard2.1 - 3.0 - $(RazorSdkArtifactsDirectory)$(Configuration)\sdk-output\ - - - diff --git a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/styles.css b/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/styles.css deleted file mode 100644 index 5f282702bb03..000000000000 --- a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/styles.css +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/wwwroot/exampleJsInterop.js b/src/Components/WebAssembly/Sdk/testassets/razorclasslibrary/wwwroot/wwwroot/exampleJsInterop.js deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/src/Components/WebAssembly/Sdk/tools/Application.cs b/src/Components/WebAssembly/Sdk/tools/Application.cs deleted file mode 100644 index 34ea90e7c3e5..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/Application.cs +++ /dev/null @@ -1,98 +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. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Threading; -using Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tools -{ - internal class Application : CommandLineApplication - { - public Application( - CancellationToken cancellationToken, - TextWriter output = null, - TextWriter error = null) - { - CancellationToken = cancellationToken; - Out = output ?? Out; - Error = error ?? Error; - - Name = "BlazorWebAssembly.Tools"; - FullName = "Microsoft Blazor WebAssembly SDK tool"; - Description = "CLI for Blazor WebAssembly operations."; - ShortVersionGetter = GetInformationalVersion; - - HelpOption("-?|-h|--help"); - - Commands.Add(new BrotliCompressCommand(this)); - } - - public CancellationToken CancellationToken { get; } - - public new int Execute(params string[] args) - { - try - { - return base.Execute(ExpandResponseFiles(args)); - } - catch (AggregateException ex) when (ex.InnerException != null) - { - foreach (var innerException in ex.Flatten().InnerExceptions) - { - Error.WriteLine(innerException.Message); - Error.WriteLine(innerException.StackTrace); - } - return 1; - } - catch (CommandParsingException ex) - { - // Don't show a call stack when we have unneeded arguments, just print the error message. - // The code that throws this exception will print help, so no need to do it here. - Error.WriteLine(ex.Message); - return 1; - } - catch (OperationCanceledException) - { - // This is a cancellation, not a failure. - Error.WriteLine("Cancelled"); - return 1; - } - catch (Exception ex) - { - Error.WriteLine(ex.Message); - Error.WriteLine(ex.StackTrace); - return 1; - } - } - - private string GetInformationalVersion() - { - var assembly = typeof(Application).Assembly; - var attribute = assembly.GetCustomAttribute(); - return attribute.InformationalVersion; - } - - private static string[] ExpandResponseFiles(string[] args) - { - var expandedArgs = new List(); - foreach (var arg in args) - { - if (!arg.StartsWith("@", StringComparison.Ordinal)) - { - expandedArgs.Add(arg); - } - else - { - var fileName = arg.Substring(1); - expandedArgs.AddRange(File.ReadLines(fileName)); - } - } - - return expandedArgs.ToArray(); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/tools/BrotliCompressCommand.cs b/src/Components/WebAssembly/Sdk/tools/BrotliCompressCommand.cs deleted file mode 100644 index 136c2fc660ee..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/BrotliCompressCommand.cs +++ /dev/null @@ -1,85 +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. - -using System; -using System.IO; -using System.IO.Compression; -using System.Threading.Tasks; -using Microsoft.Extensions.CommandLineUtils; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tools -{ - internal class BrotliCompressCommand : CommandLineApplication - { - public BrotliCompressCommand(Application parent) - : base(throwOnUnexpectedArg: true) - { - base.Parent = parent; - Name = "brotli"; - Sources = Option("-s", "files to compress", CommandOptionType.MultipleValue); - Outputs = Option("-o", "Output file path", CommandOptionType.MultipleValue); - CompressionLevelOption = Option("-c", "Compression level", CommandOptionType.SingleValue); - - Invoke = () => Execute().GetAwaiter().GetResult(); - } - - public CommandOption Sources { get; } - - public CommandOption Outputs { get; } - - public CommandOption CompressionLevelOption { get; } - - public CompressionLevel CompressionLevel { get; private set; } = CompressionLevel.Optimal; - - private Task Execute() - { - if (!ValidateArguments()) - { - ShowHelp(); - return Task.FromResult(1); - } - - return ExecuteCoreAsync(); - } - - private bool ValidateArguments() - { - if (Sources.Values.Count != Outputs.Values.Count) - { - Error.WriteLine($"{Sources.Description} has {Sources.Values.Count}, but {Outputs.Description} has {Outputs.Values.Count} values."); - return false; - } - - if (CompressionLevelOption.HasValue()) - { - if (!Enum.TryParse(CompressionLevelOption.Value(), out var value)) - { - Error.WriteLine($"Invalid option {CompressionLevelOption.Value()} for {CompressionLevelOption.Template}."); - return false; - } - - CompressionLevel = value; - } - - return true; - } - - private Task ExecuteCoreAsync() - { - Parallel.For(0, Sources.Values.Count, i => - { - var source = Sources.Values[i]; - var output = Outputs.Values[i]; - - using var sourceStream = File.OpenRead(source); - using var fileStream = new FileStream(output, FileMode.Create); - - using var stream = new BrotliStream(fileStream, CompressionLevel); - - sourceStream.CopyTo(stream); - }); - - return Task.FromResult(0); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/tools/DebugMode.cs b/src/Components/WebAssembly/Sdk/tools/DebugMode.cs deleted file mode 100644 index 816bb4a78355..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/DebugMode.cs +++ /dev/null @@ -1,27 +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. - -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tools -{ - internal static class DebugMode - { - public static void HandleDebugSwitch(ref string[] args) - { - if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase)) - { - args = args.Skip(1).ToArray(); - - Console.WriteLine("Waiting for debugger in pid: {0}", Process.GetCurrentProcess().Id); - while (!Debugger.IsAttached) - { - Thread.Sleep(TimeSpan.FromSeconds(3)); - } - } - } - } -} \ No newline at end of file diff --git a/src/Components/WebAssembly/Sdk/tools/Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj b/src/Components/WebAssembly/Sdk/tools/Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj deleted file mode 100644 index 42aba51c2c20..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Exe - $(DefaultNetCoreTargetFramework) - - false - false - - false - - - - false - - - - - - - diff --git a/src/Components/WebAssembly/Sdk/tools/Program.cs b/src/Components/WebAssembly/Sdk/tools/Program.cs deleted file mode 100644 index b00093323d09..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/Program.cs +++ /dev/null @@ -1,30 +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. - -using System; -using System.IO; -using System.Threading; -using Microsoft.CodeAnalysis; - -namespace Microsoft.NET.Sdk.BlazorWebAssembly.Tools -{ - internal static class Program - { - public static int Main(string[] args) - { - DebugMode.HandleDebugSwitch(ref args); - - var cancel = new CancellationTokenSource(); - Console.CancelKeyPress += (sender, e) => { cancel.Cancel(); }; - - var application = new Application( - cancel.Token, - Console.Out, - Console.Error); - - application.Commands.Add(new BrotliCompressCommand(application)); - - return application.Execute(args); - } - } -} diff --git a/src/Components/WebAssembly/Sdk/tools/runtimeconfig.template.json b/src/Components/WebAssembly/Sdk/tools/runtimeconfig.template.json deleted file mode 100644 index 2c73f3989069..000000000000 --- a/src/Components/WebAssembly/Sdk/tools/runtimeconfig.template.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rollForwardOnNoCandidateFx": 2 -} \ No newline at end of file diff --git a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in index 89802c2b59f4..a2f7a41bd7e0 100644 --- a/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in +++ b/src/ProjectTemplates/TestInfrastructure/Directory.Build.props.in @@ -7,6 +7,4 @@ - From 555c4010789a4df01536a9c2990d36267927b535 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 10:23:45 -0800 Subject: [PATCH 02/11] Bump dotnet and fix platform compat issues --- global.json | 2 +- ...taProtectionServiceCollectionExtensions.cs | 5 ++++ .../src/EphemeralDataProtectionProvider.cs | 3 +++ .../src/KeyManagement/XmlKeyManager.cs | 1 + .../DataProtection/src/LoggingExtensions.cs | 23 ++++++++++++++----- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/global.json b/global.json index 0022ce95d48a..bad2eec167f4 100644 --- a/global.json +++ b/global.json @@ -3,7 +3,7 @@ "version": "6.0.100-alpha.1.21063.4" }, "tools": { - "dotnet": "6.0.100-alpha.1.20523.3", + "dotnet": "6.0.100-alpha.1.21063.4", "runtimes": { "dotnet/x64": [ "2.1.23", diff --git a/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs b/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs index e6a3d2ceee90..e0709255442e 100644 --- a/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs +++ b/src/DataProtection/DataProtection/src/DataProtectionServiceCollectionExtensions.cs @@ -2,6 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Diagnostics; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; using Microsoft.AspNetCore.Cryptography.Cng; using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection.Infrastructure; @@ -67,6 +70,8 @@ private static void AddDataProtectionServices(IServiceCollection services) { if (OSVersionUtil.IsWindows()) { + // Assertion for platform compat analyzer + Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); services.TryAddSingleton(); } diff --git a/src/DataProtection/DataProtection/src/EphemeralDataProtectionProvider.cs b/src/DataProtection/DataProtection/src/EphemeralDataProtectionProvider.cs index 8faae175fedc..348a41b92521 100644 --- a/src/DataProtection/DataProtection/src/EphemeralDataProtectionProvider.cs +++ b/src/DataProtection/DataProtection/src/EphemeralDataProtectionProvider.cs @@ -4,6 +4,7 @@ using System; using System.Diagnostics; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using Microsoft.AspNetCore.Cryptography.Cng; using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption; using Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ConfigurationModel; @@ -47,6 +48,8 @@ public EphemeralDataProtectionProvider(ILoggerFactory loggerFactory) IKeyRingProvider keyringProvider; if (OSVersionUtil.IsWindows()) { + // Assertion for platform compat analyzer + Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Fastest implementation: AES-256-GCM [CNG] keyringProvider = new EphemeralKeyRing(loggerFactory); } diff --git a/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs b/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs index a72735e13762..3d6e07657896 100644 --- a/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs +++ b/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs @@ -8,6 +8,7 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Threading; using System.Xml; using System.Xml.Linq; diff --git a/src/DataProtection/DataProtection/src/LoggingExtensions.cs b/src/DataProtection/DataProtection/src/LoggingExtensions.cs index 9978de1bc08e..f1706541123f 100644 --- a/src/DataProtection/DataProtection/src/LoggingExtensions.cs +++ b/src/DataProtection/DataProtection/src/LoggingExtensions.cs @@ -4,6 +4,8 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Xml.Linq; using Microsoft.AspNetCore.DataProtection; using Microsoft.Win32; @@ -95,7 +97,7 @@ internal static class LoggingExtensions private static Action _writingDataToFile; - private static Action _readingDataFromRegistryKeyValue; + private static Action? _readingDataFromRegistryKeyValue; private static Action _nameIsNotSafeRegistryValueName; @@ -305,10 +307,15 @@ static LoggingExtensions() eventId: new EventId(39, "WritingDataToFile"), logLevel: LogLevel.Information, formatString: "Writing data to file '{FileName}'."); - _readingDataFromRegistryKeyValue = LoggerMessage.Define( - eventId: new EventId(40, "ReadingDataFromRegistryKeyValue"), - logLevel: LogLevel.Debug, - formatString: "Reading data from registry key '{RegistryKeyName}', value '{Value}'."); + + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + _readingDataFromRegistryKeyValue = LoggerMessage.Define( + eventId: new EventId(40, "ReadingDataFromRegistryKeyValue"), + logLevel: LogLevel.Debug, + formatString: "Reading data from registry key '{RegistryKeyName}', value '{Value}'."); + } + _nameIsNotSafeRegistryValueName = LoggerMessage.Define( eventId: new EventId(41, "NameIsNotSafeRegistryValueName"), logLevel: LogLevel.Debug, @@ -662,9 +669,13 @@ public static void WritingDataToFile(this ILogger logger, string finalFilename) _writingDataToFile(logger, finalFilename, null); } + [SupportedOSPlatform("windows")] public static void ReadingDataFromRegistryKeyValue(this ILogger logger, RegistryKey regKey, string valueName) { - _readingDataFromRegistryKeyValue(logger, regKey, valueName, null); + if (_readingDataFromRegistryKeyValue != null) + { + _readingDataFromRegistryKeyValue(logger, regKey, valueName, null); + } } public static void NameIsNotSafeRegistryValueName(this ILogger logger, string friendlyName, string newFriendlyName) From fbe1288ca7ccb5bd886210c85973ff2f22d07672 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 11:16:03 -0800 Subject: [PATCH 03/11] Remove Blazor WASM SDK from solution files --- AspNetCore.sln | 60 ---------------------------- src/Components/Components.slnf | 5 +-- src/Components/ComponentsNoDeps.slnf | 6 +-- 3 files changed, 2 insertions(+), 69 deletions(-) diff --git a/AspNetCore.sln b/AspNetCore.sln index 1954cda59cd9..0b72d2764f98 100644 --- a/AspNetCore.sln +++ b/AspNetCore.sln @@ -1385,14 +1385,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Testin EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sdk", "Sdk", "{FED4267E-E5E4-49C5-98DB-8B3F203596EE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.BlazorWebAssembly", "src\Components\WebAssembly\Sdk\src\Microsoft.NET.Sdk.BlazorWebAssembly.csproj", "{6B2734BF-C61D-4889-ABBF-456A4075D59B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.BlazorWebAssembly.Tests", "src\Components\WebAssembly\Sdk\test\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj", "{83371889-9A3E-4D16-AE77-EB4F83BC6374}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests", "src\Components\WebAssembly\Sdk\integrationtests\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj", "{525EBCB4-A870-470B-BC90-845306C337D1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.NET.Sdk.BlazorWebAssembly.Tools", "src\Components\WebAssembly\Sdk\tools\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj", "{175E5CD8-92D4-46BB-882E-3A930D3302D4}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{6126DCE4-9692-4EE2-B240-C65743572995}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BasicTestApp", "src\Components\test\testassets\BasicTestApp\BasicTestApp.csproj", "{46FB7E93-1294-4068-B80A-D4864F78277A}" @@ -6693,54 +6685,6 @@ Global {1542DC58-1836-4191-A9C5-51D1716D2543}.Release|x64.Build.0 = Release|Any CPU {1542DC58-1836-4191-A9C5-51D1716D2543}.Release|x86.ActiveCfg = Release|Any CPU {1542DC58-1836-4191-A9C5-51D1716D2543}.Release|x86.Build.0 = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x64.ActiveCfg = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x64.Build.0 = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x86.ActiveCfg = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Debug|x86.Build.0 = Debug|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|Any CPU.Build.0 = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x64.ActiveCfg = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x64.Build.0 = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x86.ActiveCfg = Release|Any CPU - {6B2734BF-C61D-4889-ABBF-456A4075D59B}.Release|x86.Build.0 = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x64.ActiveCfg = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x64.Build.0 = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x86.ActiveCfg = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Debug|x86.Build.0 = Debug|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|Any CPU.Build.0 = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x64.ActiveCfg = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x64.Build.0 = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x86.ActiveCfg = Release|Any CPU - {83371889-9A3E-4D16-AE77-EB4F83BC6374}.Release|x86.Build.0 = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x64.ActiveCfg = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x64.Build.0 = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x86.ActiveCfg = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Debug|x86.Build.0 = Debug|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|Any CPU.Build.0 = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|x64.ActiveCfg = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|x64.Build.0 = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|x86.ActiveCfg = Release|Any CPU - {525EBCB4-A870-470B-BC90-845306C337D1}.Release|x86.Build.0 = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x64.ActiveCfg = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x64.Build.0 = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x86.ActiveCfg = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Debug|x86.Build.0 = Debug|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|Any CPU.Build.0 = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x64.ActiveCfg = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x64.Build.0 = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x86.ActiveCfg = Release|Any CPU - {175E5CD8-92D4-46BB-882E-3A930D3302D4}.Release|x86.Build.0 = Release|Any CPU {46FB7E93-1294-4068-B80A-D4864F78277A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {46FB7E93-1294-4068-B80A-D4864F78277A}.Debug|Any CPU.Build.0 = Debug|Any CPU {46FB7E93-1294-4068-B80A-D4864F78277A}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -8223,10 +8167,6 @@ Global {48E64014-B249-4644-8AEB-CDEE8ABA0DC2} = {3CBC4802-E9B8-48B7-BC8C-B0AFB9EEC643} {1542DC58-1836-4191-A9C5-51D1716D2543} = {05A169C7-4F20-4516-B10A-B13C5649D346} {FED4267E-E5E4-49C5-98DB-8B3F203596EE} = {562D5067-8CD8-4F19-BCBB-873204932C61} - {6B2734BF-C61D-4889-ABBF-456A4075D59B} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE} - {83371889-9A3E-4D16-AE77-EB4F83BC6374} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE} - {525EBCB4-A870-470B-BC90-845306C337D1} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE} - {175E5CD8-92D4-46BB-882E-3A930D3302D4} = {FED4267E-E5E4-49C5-98DB-8B3F203596EE} {6126DCE4-9692-4EE2-B240-C65743572995} = {0508E463-0269-40C9-B5C2-3B600FB2A28B} {46FB7E93-1294-4068-B80A-D4864F78277A} = {6126DCE4-9692-4EE2-B240-C65743572995} {25FA84DB-EEA7-4068-8E2D-F3D48B281C16} = {6126DCE4-9692-4EE2-B240-C65743572995} diff --git a/src/Components/Components.slnf b/src/Components/Components.slnf index fe11396bafda..252fbeeafb3e 100644 --- a/src/Components/Components.slnf +++ b/src/Components/Components.slnf @@ -21,9 +21,6 @@ "src\\Components\\WebAssembly\\Authentication.Msal\\src\\Microsoft.Authentication.WebAssembly.Msal.csproj", "src\\Components\\WebAssembly\\DevServer\\src\\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj", "src\\Components\\WebAssembly\\JSInterop\\src\\Microsoft.JSInterop.WebAssembly.csproj", - "src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj", - "src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj", - "src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj", "src\\Components\\WebAssembly\\Server\\src\\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj", "src\\Components\\WebAssembly\\Server\\test\\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj", "src\\Components\\WebAssembly\\WebAssembly.Authentication\\src\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj", @@ -114,4 +111,4 @@ "src\\Testing\\src\\Microsoft.AspNetCore.Testing.csproj" ] } -} \ No newline at end of file +} diff --git a/src/Components/ComponentsNoDeps.slnf b/src/Components/ComponentsNoDeps.slnf index 4b1acd62b43c..6855d855db57 100644 --- a/src/Components/ComponentsNoDeps.slnf +++ b/src/Components/ComponentsNoDeps.slnf @@ -20,10 +20,6 @@ "src\\Components\\WebAssembly\\Authentication.Msal\\src\\Microsoft.Authentication.WebAssembly.Msal.csproj", "src\\Components\\WebAssembly\\DevServer\\src\\Microsoft.AspNetCore.Components.WebAssembly.DevServer.csproj", "src\\Components\\WebAssembly\\JSInterop\\src\\Microsoft.JSInterop.WebAssembly.csproj", - "src\\Components\\WebAssembly\\Sdk\\integrationtests\\Microsoft.NET.Sdk.BlazorWebAssembly.IntegrationTests.csproj", - "src\\Components\\WebAssembly\\Sdk\\src\\Microsoft.NET.Sdk.BlazorWebAssembly.csproj", - "src\\Components\\WebAssembly\\Sdk\\test\\Microsoft.NET.Sdk.BlazorWebAssembly.Tests.csproj", - "src\\Components\\WebAssembly\\Sdk\\tools\\Microsoft.NET.Sdk.BlazorWebAssembly.Tools.csproj", "src\\Components\\WebAssembly\\Server\\src\\Microsoft.AspNetCore.Components.WebAssembly.Server.csproj", "src\\Components\\WebAssembly\\Server\\test\\Microsoft.AspNetCore.Components.WebAssembly.Server.Tests.csproj", "src\\Components\\WebAssembly\\WebAssembly.Authentication\\src\\Microsoft.AspNetCore.Components.WebAssembly.Authentication.csproj", @@ -50,4 +46,4 @@ "src\\Components\\test\\testassets\\TestServer\\Components.TestServer.csproj" ] } -} \ No newline at end of file +} From 6807ab2e2b864563ebfc8054dd9550e72d6a6da6 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 15:57:55 -0800 Subject: [PATCH 04/11] Disable removal of Web.Spa 6.0 templates --- src/ProjectTemplates/Shared/TemplatePackageInstaller.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs index 645f41d88381..1d0736e4894c 100644 --- a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs +++ b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs @@ -38,7 +38,7 @@ internal static class TemplatePackageInstaller "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.1", "Microsoft.DotNet.Web.Spa.ProjectTemplates.5.0", - "Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0", + // "Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates", "Microsoft.AspNetCore.Blazor.Templates", }; From 0f7c67489640de51cc39f20b55aa411dad53244b Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 16:33:05 -0800 Subject: [PATCH 05/11] Update check for uninstalled templates --- src/ProjectTemplates/Shared/TemplatePackageInstaller.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs index 1d0736e4894c..8f885c592086 100644 --- a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs +++ b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs @@ -38,7 +38,7 @@ internal static class TemplatePackageInstaller "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates.3.1", "Microsoft.DotNet.Web.Spa.ProjectTemplates.5.0", - // "Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0", + "Microsoft.DotNet.Web.Spa.ProjectTemplates.6.0", "Microsoft.DotNet.Web.Spa.ProjectTemplates", "Microsoft.AspNetCore.Blazor.Templates", }; @@ -177,7 +177,7 @@ private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output { var proc = await RunDotNetNew(output, $"\"{templateName}\""); - if (!proc.Output.Contains("Couldn't find an installed template that matches the input, searching online for one that does...")) + if (!proc.Output.Contains("No templates found matching:")) { throw new InvalidOperationException($"Failed to uninstall previous templates. The template '{templateName}' could still be found."); } From 5cd2bda64e1c9606dbdb7d89910cedda9b9b9d20 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 19:51:08 -0800 Subject: [PATCH 06/11] Commit broken tests and fix installer check --- src/ProjectTemplates/Shared/TemplatePackageInstaller.cs | 2 +- .../integrationtests/StaticWebAssetsIntegrationTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs index 8f885c592086..f920e0240355 100644 --- a/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs +++ b/src/ProjectTemplates/Shared/TemplatePackageInstaller.cs @@ -177,7 +177,7 @@ private static async Task VerifyCannotFindTemplateAsync(ITestOutputHelper output { var proc = await RunDotNetNew(output, $"\"{templateName}\""); - if (!proc.Output.Contains("No templates found matching:")) + if (!proc.Error.Contains("No templates found matching:")) { throw new InvalidOperationException($"Failed to uninstall previous templates. The template '{templateName}' could still be found."); } diff --git a/src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/StaticWebAssetsIntegrationTest.cs b/src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/StaticWebAssetsIntegrationTest.cs index 1a4282371950..5cb2a6518a21 100644 --- a/src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/StaticWebAssetsIntegrationTest.cs +++ b/src/Razor/Microsoft.NET.Sdk.Razor/integrationtests/StaticWebAssetsIntegrationTest.cs @@ -132,7 +132,7 @@ public async Task Publish_WithBuildReferencesDisabled_CopiesStaticWebAssetsToDes Assert.FileExists(publish, PublishOutputPath, Path.Combine("wwwroot", "AppWithPackageAndP2PReference.styles.css")); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/aspnetcore/issues/29224")] [InitializeTestProject("AppWithPackageAndP2PReference", additionalProjects: new[] { "ClassLibrary", "ClassLibrary2" })] public async Task Publish_NoBuild_CopiesStaticWebAssetsToDestinationFolder() { From 193c562779f64e4e41a4893f74c3fe4b6d11b7c5 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 20:51:03 -0800 Subject: [PATCH 07/11] Remove BlazorWebAssemblySdkDirectoryRoot references --- .../TestInfrastructure/Directory.Build.targets.in | 1 - src/Shared/MSBuild.Testing/BuildVariables.cs | 2 -- src/Shared/MSBuild.Testing/MSBuild.Testing.targets | 5 ----- src/Shared/MSBuild.Testing/MSBuildProcessManager.cs | 1 - 4 files changed, 9 deletions(-) diff --git a/src/ProjectTemplates/TestInfrastructure/Directory.Build.targets.in b/src/ProjectTemplates/TestInfrastructure/Directory.Build.targets.in index 1f7ed2465d76..4bde976fefd2 100644 --- a/src/ProjectTemplates/TestInfrastructure/Directory.Build.targets.in +++ b/src/ProjectTemplates/TestInfrastructure/Directory.Build.targets.in @@ -15,7 +15,6 @@ --> $(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\${Configuration}\sdk-output\ - $(ArtifactsBinDir)Microsoft.NET.Sdk.BlazorWebAssembly\${Configuration}\sdk-output\ diff --git a/src/Shared/MSBuild.Testing/BuildVariables.cs b/src/Shared/MSBuild.Testing/BuildVariables.cs index eb6389c104c8..20e5111c4d59 100644 --- a/src/Shared/MSBuild.Testing/BuildVariables.cs +++ b/src/Shared/MSBuild.Testing/BuildVariables.cs @@ -19,8 +19,6 @@ internal static partial class BuildVariables public static string RazorSdkDirectoryRoot => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "RazorSdkDirectoryRoot").Value; - public static string BlazorWebAssemblySdkDirectoryRoot => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "BlazorWebAssemblySdkDirectoryRoot").Value; - public static string RepoRoot => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "Testing.RepoRoot").Value; public static string DefaultNetCoreTargetFramework => TestAssemblyMetadata.SingleOrDefault(a => a.Key == "DefaultNetCoreTargetFramework").Value; diff --git a/src/Shared/MSBuild.Testing/MSBuild.Testing.targets b/src/Shared/MSBuild.Testing/MSBuild.Testing.targets index b1003dee592c..7d500d805161 100644 --- a/src/Shared/MSBuild.Testing/MSBuild.Testing.targets +++ b/src/Shared/MSBuild.Testing/MSBuild.Testing.targets @@ -36,11 +36,6 @@ <_Parameter2>$(ArtifactsBinDir)Microsoft.NET.Sdk.Razor\$(Configuration)\sdk-output\ - - <_Parameter1>BlazorWebAssemblySdkDirectoryRoot - <_Parameter2>$(ArtifactsBinDir)Microsoft.NET.Sdk.BlazorWebAssembly\$(Configuration)\sdk-output\ - - <_Parameter1>TestAppsRoot <_Parameter2>$(TestAppsRoot) diff --git a/src/Shared/MSBuild.Testing/MSBuildProcessManager.cs b/src/Shared/MSBuild.Testing/MSBuildProcessManager.cs index e77295952ab0..bada8d02f1bd 100644 --- a/src/Shared/MSBuild.Testing/MSBuildProcessManager.cs +++ b/src/Shared/MSBuild.Testing/MSBuildProcessManager.cs @@ -37,7 +37,6 @@ internal static Task DotnetMSBuild( $"/p:MicrosoftNETCoreAppRuntimeVersion={BuildVariables.MicrosoftNETCoreAppRuntimeVersion}", $"/p:MicrosoftNetCompilersToolsetVersion={BuildVariables.MicrosoftNetCompilersToolsetVersion}", $"/p:RazorSdkDirectoryRoot={BuildVariables.RazorSdkDirectoryRoot}", - $"/p:BlazorWebAssemblySdkDirectoryRoot={BuildVariables.BlazorWebAssemblySdkDirectoryRoot}", $"/p:RepoRoot={BuildVariables.RepoRoot}", $"/p:Configuration={project.Configuration}", $"/t:{target}", From 959b987c103062df24d04bca21e452b66dd6bd6c Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 20:58:11 -0800 Subject: [PATCH 08/11] Try to resolve Helix publish issues --- eng/targets/Helix.targets | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index b37916800f30..8fde50ebd48c 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -21,14 +21,6 @@
- - - - - - @@ -103,6 +95,14 @@ + + + + + + <_HelixFriendlyNameTargetQueue>$(HelixTargetQueue) From 5eedf684349c1abd34881052c187825c901da504 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Tue, 19 Jan 2021 21:45:53 -0800 Subject: [PATCH 09/11] Disable ErrorOnDuplicatePublishOutputFiles property --- eng/Workarounds.props | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/Workarounds.props b/eng/Workarounds.props index 916761855790..e5cdb0d60a21 100644 --- a/eng/Workarounds.props +++ b/eng/Workarounds.props @@ -29,4 +29,8 @@ false + + + false + From 0c5305ccdecfcd6ccb3eb646c86b903841c373a7 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 20 Jan 2021 08:51:18 -0800 Subject: [PATCH 10/11] Bump tfm in Helix test project --- eng/helix/content/RunTests/RunTests.csproj | 2 +- eng/targets/Helix.targets | 16 ++++++++-------- .../src/KeyManagement/XmlKeyManager.cs | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/eng/helix/content/RunTests/RunTests.csproj b/eng/helix/content/RunTests/RunTests.csproj index 8a9533ae43b9..7fc0c8c63888 100644 --- a/eng/helix/content/RunTests/RunTests.csproj +++ b/eng/helix/content/RunTests/RunTests.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 diff --git a/eng/targets/Helix.targets b/eng/targets/Helix.targets index 8fde50ebd48c..b37916800f30 100644 --- a/eng/targets/Helix.targets +++ b/eng/targets/Helix.targets @@ -21,6 +21,14 @@ + + + + + + @@ -95,14 +103,6 @@ - - - - - - <_HelixFriendlyNameTargetQueue>$(HelixTargetQueue) diff --git a/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs b/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs index 3d6e07657896..a72735e13762 100644 --- a/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs +++ b/src/DataProtection/DataProtection/src/KeyManagement/XmlKeyManager.cs @@ -8,7 +8,6 @@ using System.Linq; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using System.Runtime.Versioning; using System.Threading; using System.Xml; using System.Xml.Linq; From 686fb0bd215adbb3f6a8437d57af218c4fe55b20 Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Wed, 20 Jan 2021 12:42:54 -0800 Subject: [PATCH 11/11] Add explainer note in Workaround.props --- eng/Workarounds.props | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eng/Workarounds.props b/eng/Workarounds.props index e5cdb0d60a21..1008b6a25575 100644 --- a/eng/Workarounds.props +++ b/eng/Workarounds.props @@ -30,6 +30,9 @@ false + false