From 0ea2f253ceb94504ae285c1e899cb31cb56783a5 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Fri, 22 Nov 2024 13:59:29 -0800 Subject: [PATCH 1/8] Check in blazor.webview.js --- src/Components/Web.JS/.gitignore | 4 +++- src/Components/Web.JS/dist/Release/blazor.webview.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 src/Components/Web.JS/dist/Release/blazor.webview.js diff --git a/src/Components/Web.JS/.gitignore b/src/Components/Web.JS/.gitignore index afce87ca650e..b1312f24cb96 100644 --- a/src/Components/Web.JS/.gitignore +++ b/src/Components/Web.JS/.gitignore @@ -1,2 +1,4 @@ node_modules/ -dist/ +dist/Debug/ +dist/Release/* +!dist/Release/blazor.webview.js diff --git a/src/Components/Web.JS/dist/Release/blazor.webview.js b/src/Components/Web.JS/dist/Release/blazor.webview.js new file mode 100644 index 000000000000..09ee6b3e4f7b --- /dev/null +++ b/src/Components/Web.JS/dist/Release/blazor.webview.js @@ -0,0 +1,2 @@ +!function(e){"use strict";var t,n,r;!function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",a="__dotNetStream",i="__jsStreamReferenceLength";let s,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const u=0,d={[u]:new l(window)};d[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substring(2),document.baseURI).toString()),import(e))));let h,f=1;function m(e){t.push(e)}function p(e){if(e&&"object"==typeof e){d[f]=new l(e);const t={[n]:f};return f++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function b(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=p(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function g(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===s)throw new Error("No call dispatcher has been set.");if(null===s)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return s}e.attachDispatcher=function(e){const t=new y(e);return void 0===s?s=t:s&&(s=null),t},e.attachReviver=m,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=p,e.createJSStreamReference=b,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&S(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(h=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=g(this,t),a=A(E(e,r)(...o||[]),n);return null==a?null:R(this,a)}beginInvokeJSFromDotNet(e,t,n,r,o){const a=new Promise((e=>{const r=g(this,n);e(E(t,o)(...r||[]))}));e&&a.then((t=>R(this,[e,!0,A(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?g(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=R(this,r),a=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return a?g(this,a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,a=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const a=R(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,a)}catch(e){this.completePendingCall(o,!1,e)}return a}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new D;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new D;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function E(e,t){const n=d[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function S(e){delete d[e]}e.findJSFunction=E,e.disposeJSObjectReferenceById=S;class I{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=I,m((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new I(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=d[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(a)){const e=t[a],n=c.getDotNetStreamPromise(e);return new C(n)}}return t}));class C{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class D{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function A(e,t){switch(t){case h.Default:return e;case h.JSObjectReference:return p(e);case h.JSStreamReference:return b(e);case h.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let N=0;function R(e,t){N=0,c=e;const n=JSON.stringify(t,k);return c=void 0,n}function k(e,t){if(t instanceof I)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(N,t);const e={[o]:N};return N++,e}return t}}(t||(t={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(n||(n={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(r||(r={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const a=new Map,i=new Map,s=[];function c(e){return a.get(e)}function l(e){const t=a.get(e);return t?.browserEventName||e}function u(e,t){e.forEach((e=>a.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),u(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...h(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),u(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),u(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type,isComposing:t.isComposing};var t}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>h(e)}),u(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...h(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),u(["wheel","mousewheel"],{createEventArgs:e=>{return{...h(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),u(["cancel","close","toggle"],{createEventArgs:()=>({})});const f=["date","datetime-local","month","time","week"],m=new Map;let p,b,g=0;const v={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++g).toString();m.set(r,e);const o=await E().invokeMethodAsync("AddRootComponent",t,r),a=new w(o,b[t]);return await a.setParameters(n),a}};class y{invoke(e){return this._callback(e)}setCallback(e){this._selfJSObjectReference||(this._selfJSObjectReference=t.createJSObjectReference(this)),this._callback=e}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&t.disposeJSObjectReference(this._selfJSObjectReference)}}class w{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new y)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const S=new Map,I=[],C=new Map;function D(e,t,n){return N(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let N=(e,t,n)=>n();const R=x(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),k={submit:!0},T=x(["click","dblclick","mousedown","mousemove","mouseup"]);class _{static{this.nextEventDelegatorId=0}constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++_.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new O(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),a=o.getHandler(t);if(a)this.eventInfoStore.update(a.eventHandlerId,n);else{const a={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(a),o.setHandler(t,a)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),a=null,i=!1;const s=Object.prototype.hasOwnProperty.call(R,e);let l=!1;for(;r;){const h=r,f=this.getEventHandlerInfosForElement(h,!1);if(f){const n=f.getHandler(e);if(n&&(u=h,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(T,d)&&u.disabled))){if(!i){const n=c(e);a=n?.createEventArgs?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(k,t.type)&&t.preventDefault(),D(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},a)}f.stopPropagation(e)&&(l=!0),f.preventDefault(e)&&t.preventDefault()}r=s||l?void 0:n.shift()}var u,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}class O{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},s.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(R,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function x(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const F=Symbol(),M=Symbol();function P(e,t){if(F in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=P(t,!0);r[M]=e,n.push(r)}))}return e[F]=n,e}function B(e){const t=W(e);for(;t.length;)J(e,0)}function j(e,t){const n=document.createComment("!");return H(n,e,t),n}function H(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=W(r);if(t?.length>0){const t=G(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const a=U(r);if(a){const e=W(a),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[M]}const i=W(t);if(n0;)J(n,0)}const r=n;r.parentNode.removeChild(r)}function U(e){return e[M]||null}function $(e,t){return W(e)[t]}function z(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function W(e){return e[F]}function K(e){const t=W(U(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function V(e,t){const n=W(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=G(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let a=r;for(;a;){const e=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=K(t);n?n.parentNode.insertBefore(e,n):Y(e,U(t))}}}function G(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=K(e);if(t)return t.previousSibling;{const t=U(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:G(t)}}function q(e){return`_bl_${e}`}const Z="__internalId";t.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,Z)&&"string"==typeof t[Z]?function(e){const t=`[${q(e)}]`;return document.querySelector(t)}(t[Z]):t));const Q="_blazorDeferredValue";function ee(e){return"select-multiple"===e.type}function te(e,t){e.value=t||""}function ne(e,t){e instanceof HTMLSelectElement?ee(e)?function(e,t){t||=[];for(let n=0;n{we()&&function(e){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const t=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),oe.content));var i;let s=0;for(;a.firstChild;)H(a.firstChild,o,s++)}applyAttribute(e,t,n,r){const o=e.frameReader,a=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=he(a);return void this.eventDelegator.setListener(n,e,i,t)}const s=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,a,s)}insertFrameRange(e,t,n,r,o,a,i){const s=r;for(let s=a;sdocument.baseURI,getLocationHref:()=>location.href,scrollToElement:ve};function ke(e,t,n=!1){const r=ye(e);!t.forceLoad&&ge(r)?Be()?Te(r,!1,t.replaceHistoryEntry,t.historyEntryState,n):function(){throw new Error("No enhanced programmatic navigation handler has been attached")}():function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry)}async function Te(e,t,n,r=void 0,o=!1){if(Le(),function(e){const t=new URL(e);return""!==t.hash&&location.origin===t.origin&&location.pathname===t.pathname&&location.search===t.search}(e))return _e(e,n,r),void function(e){const t=e.indexOf("#");t!==e.length-1&&ve(e.substring(t+1))}(e);const a=Pe();(o||!a?.hasLocationChangingEventListeners||await xe(e,r,t,a))&&(be=!0,_e(e,n,r),await Fe(t))}function _e(e,t,n=void 0){t?history.replaceState({userState:n,_index:Ie},"",e):(Ie++,history.pushState({userState:n,_index:Ie},"",e))}function Oe(e){return new Promise((t=>{const n=Ae;Ae=()=>{Ae=n,t()},history.go(e)}))}function Le(){Ne&&(Ne(!1),Ne=null)}function xe(e,t,n,r){return new Promise((o=>{Le(),Ce++,Ne=o,r.locationChanging(Ce,e,t,n)}))}async function Fe(e,t){const n=location.href;await Promise.all(Array.from(De,(async([t,r])=>{var o;o=t,S.has(o)&&await r.locationChanged(n,history.state?.userState,e)})))}async function Me(e){Ae&&Be()&&await Ae(e),Ie=history.state?._index??0}function Pe(){const e=Ee();if(void 0!==e)return De.get(e)}function Be(){return we()||!0}const je={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e){const t=document.querySelector(e);t&&(t.hasAttribute("tabindex")||(t.tabIndex=-1),t.focus({preventScroll:!0}))}},He={init:function(e,t,n,r=50){const o=Ue(t);(o||document.documentElement).style.overflowAnchor="none";const a=document.createRange();h(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{if(!r.isIntersecting)return;a.setStartAfter(t),a.setEndBefore(n);const o=a.getBoundingClientRect().height,i=r.rootBounds?.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,o,i):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,o,i)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const s=d(t),c=d(n),{observersByDotNetObjectId:l,id:u}=$e(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{h(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function h(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[u]={intersectionObserver:i,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=$e(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},Je=Symbol();function Ue(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ue(e.parentElement):null}function $e(e){const t=e._callDispatcher,n=e._id;return t[Je]??={},{observersByDotNetObjectId:t[Je],id:n}}const ze={getAndRemoveExistingTitle:function(){const e=document.head?document.head.getElementsByTagName("title"):[];if(0===e.length)return null;let t=null;for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.previousSibling;o instanceof Comment&&null!==U(o)||(null===t&&(t=r.textContent),r.parentNode?.removeChild(r))}return t}},We={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const a=Ke(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(a.blob)})),s=await new Promise((function(e){const t=Math.min(1,r/i.width),a=Math.min(1,o/i.height),s=Math.min(t,a),c=document.createElement("canvas");c.width=Math.round(i.width*s),c.height=Math.round(i.height*s),c.getContext("2d")?.drawImage(i,0,0,c.width,c.height),c.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:a.lastModified,name:a.name,size:s?.size||0,contentType:n,blob:s||a.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Ke(e,t).blob}};function Ke(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Ve=new Set,Xe={enableNavigationPrompt:function(e){0===Ve.size&&window.addEventListener("beforeunload",Ye),Ve.add(e)},disableNavigationPrompt:function(e){Ve.delete(e),0===Ve.size&&window.removeEventListener("beforeunload",Ye)}};function Ye(e){e.preventDefault(),e.returnValue=!0}const Ge=new Map,qe={navigateTo:function(e,t,n=!1){ke(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(a.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),s.forEach((n=>n(e,t.browserEventName)))}a.set(e,t)},rootComponents:v,runtime:{},_internal:{navigationManager:Re,domWrapper:je,Virtualize:He,PageTitle:ze,InputFile:We,NavigationLock:Xe,getJSDataStreamChunk:async function(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)},attachWebRendererInterop:function(e,n,r,o){if(S.has(e))throw new Error(`Interop methods are already registered for renderer ${e}`);S.set(e,n),r&&o&&Object.keys(r).length>0&&function(e,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=e,b=n;for(const[e,o]of Object.entries(r)){const r=t.findJSFunction(e,0);for(const e of o)r(e,n[e])}}(A(e),r,o),C.get(e)?.[0]?.(),function(e){for(const t of I)t(e)}(e)}}};window.Blazor=qe;let Ze=!1;const Qe="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,et=Qe?Qe.decode.bind(Qe):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}else r.push(n);r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},tt=Math.pow(2,32),nt=Math.pow(2,21)-1;function rt(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ot(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function at(e,t){const n=ot(e,t+4);if(n>nt)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*tt+ot(e,t)}class it{constructor(e){this.batchData=e;const t=new ut(e);this.arrayRangeReader=new dt(e),this.arrayBuilderSegmentReader=new ht(e),this.diffReader=new st(e),this.editReader=new ct(e,t),this.frameReader=new lt(e,t)}updatedComponents(){return rt(this.batchData,this.batchData.length-20)}referenceFrames(){return rt(this.batchData,this.batchData.length-16)}disposedComponentIds(){return rt(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return rt(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return rt(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return rt(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return at(this.batchData,n)}}class st{constructor(e){this.batchDataUint8=e}componentId(e){return rt(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class ct{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return rt(this.batchDataUint8,e)}siblingIndex(e){return rt(this.batchDataUint8,e+4)}newTreeIndex(e){return rt(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return rt(this.batchDataUint8,e+8)}removedAttributeName(e){const t=rt(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class lt{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return rt(this.batchDataUint8,e)}subtreeLength(e){return rt(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return rt(this.batchDataUint8,e+8)}elementName(e){const t=rt(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=rt(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return at(this.batchDataUint8,e+12)}}class ut{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=rt(e,e.length-4)}readString(e){if(-1===e)return null;{const n=rt(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const a=e[t+o];if(n|=(127&a)<async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:s,beforeServerStart:c,afterServerStarted:l}=o;let u=n;e.webRendererId===St.Server&&c&&(u=c),e.webRendererId===St.WebAssembly&&i&&(u=i);let d=r;return e.webRendererId===St.Server&&l&&(d=l),e.webRendererId===St.WebAssembly&&s&&(d=s),a(e,u,d,t)}return function(e,t,n){const o=n[0],{beforeStart:i,afterStarted:s,beforeWebStart:c,afterWebStarted:l,beforeWebAssemblyStart:u,afterWebAssemblyStarted:d,beforeServerStart:h,afterServerStarted:f}=t,m=!(c||l||u||d||h||f||!i&&!s),p=m&&o.enableClassicInitializers;if(m&&!o.enableClassicInitializers)e.logger?.log(It.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead.`);else if(p)return a(e,i,s,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(o),u&&o.webAssembly.initializers.beforeStart.push(u),d&&o.webAssembly.initializers.afterStarted.push(d),h&&o.circuit.initializers.beforeStart.push(h),f&&o.circuit.initializers.afterStarted.push(f),l&&e.afterStartedCallbacks.push(l),c)return c(o)}(e,o,t)}function a(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=(n=this.webRendererId,C.get(n)?.[1]);var n;t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Nt=!1;async function Rt(){if(Nt)throw new Error("Blazor has already started.");Nt=!0,e.dispatcher=t.attachDispatcher({beginInvokeDotNetFromJS:bt,endInvokeJSFromDotNet:gt,sendByteArray:vt});const n=await async function(){const e=await fetch("_framework/blazor.modules.json",{method:"GET",credentials:"include",cache:"no-cache"}),t=await e.json(),n=new At;return await n.importInitializersAsync(t,[]),n}();(function(){const t={AttachToDocument:(e,t)=>{!function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const a=function(e){const t=m.get(e);if(t)return m.delete(e),t}(e)||document.querySelector(e);if(!a)throw new Error(`Could not find any element matching selector '${e}'.`);!function(e,t,n,r){let o=fe[e];o||(o=new le(e),fe[e]=o),o.attachRootComponentToLogicalElement(n,t,r)}(n,P(a,!0),t,o)}(t,e,St.WebView)},RenderBatch:(e,t)=>{try{const n=Dt(t);(function(e,t){const n=fe[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),i=r.count(o),s=t.referenceFrames(),c=r.values(s),l=t.diffReader;for(let e=0;e{mt=!0,console.error(`${e}\n${t}`),function(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Ze||(Ze=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}()},BeginInvokeJS:e.dispatcher.beginInvokeJSFromDotNet.bind(e.dispatcher),EndInvokeDotNet:e.dispatcher.endInvokeDotNetFromJS.bind(e.dispatcher),SendByteArrayToJS:Ct,Navigate:Re.navigateTo,Refresh:Re.refresh,SetHasLocationChangingListeners:e=>{Re.setHasLocationChangingListeners(St.WebView,e)},EndLocationChanging:Re.endLocationChanging};window.external.receiveMessage((e=>{const n=function(e){if(mt||!e||!e.startsWith(ft))return null;const t=e.substring(6),[n,...r]=JSON.parse(t);return{messageType:n,args:r}}(e);if(n){if(!Object.prototype.hasOwnProperty.call(t,n.messageType))throw new Error(`Unsupported IPC message type '${n.messageType}'`);t[n.messageType].apply(null,n.args)}}))})(),qe._internal.receiveWebViewDotNetDataStream=kt,Re.enableNavigationInterception(St.WebView),Re.listenForNavigationEvents(St.WebView,yt,wt),Et("AttachPage",Re.getBaseURI(),Re.getLocationHref()),await n.invokeAfterStartedCallbacks(qe)}function kt(t,n,r,o){!function(e,t,n,r,o){let a=Ge.get(t);if(!a){const n=new ReadableStream({start(e){Ge.set(t,e),a=e}});e.supplyDotNetStream(t,n)}o?(a.error(o),Ge.delete(t)):0===r?(a.close(),Ge.delete(t)):a.enqueue(n.length===r?n:n.subarray(0,r))}(e.dispatcher,t,n,r,o)}e.dispatcher=void 0,qe.start=Rt,window.DotNet=t,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Rt()}({}); +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaW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vdyBpdCB0aHJvdWdoIG5lc3RlZCBmdW5jdGlvbiBjYWxscy5cbiAgICBsZXQgY3VycmVudENhbGxEaXNwYXRjaGVyO1xuICAgIGNsYXNzIEpTT2JqZWN0IHtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby1leHBsaWNpdC1hbnlcbiAgICAgICAgY29uc3RydWN0b3IoX2pzT2JqZWN0KSB7XG4gICAgICAgICAgICB0aGlzLl9qc09iamVjdCA9IF9qc09iamVjdDtcbiAgICAgICAgICAgIHRoaXMuX2NhY2hlZEZ1bmN0aW9ucyA9IG5ldyBNYXAoKTtcbiAgICAgICAgfVxuICAgICAgICBmaW5kRnVuY3Rpb24oaWRlbnRpZmllcikge1xuICAgICAgICAgICAgY29uc3QgY2FjaGVkRnVuY3Rpb24gPSB0aGlzLl9jYWNoZWRGdW5jdGlvbnMuZ2V0KGlkZW50aWZpZXIpO1xuICAgICAgICAgICAgaWYgKGNhY2hlZEZ1bmN0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlZEZ1bmN0aW9uO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHRoaXMuX2pzT2JqZWN0O1xuICAgICAgICAgICAgbGV0IGxhc3RTZWdtZW50VmFsdWU7XG4gICAgICAgICAgICBpZGVudGlmaWVyLnNwbGl0KFwiLlwiKS5mb3JFYWNoKHNlZ21lbnQgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChzZWdtZW50IGluIHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICBsYXN0U2VnbWVudFZhbHVlID0gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN1bHRbc2VnbWVudF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYENvd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29uLCByZXN1bHRUeXBlLCB0YXJnZXRJbnN0YW5jZUlkKSB7XG4gICAgICAgICAgICBjb25zdCBhcmdzID0gcGFyc2VKc29uV2l0aFJldml2ZXJzKHRoaXMsIGFyZ3NKc29uKTtcbiAgICAgICAgICAgIGNvbnN0IGpzRnVuY3Rpb24gPSBmaW5kSlNGdW5jdGlvbihpZGVudGlmaWVyLCB0YXJnZXRJbnN0YW5jZUlkKTtcbiAgICAgICAgICAgIGNvbnN0IHJldHVyblZhbHVlID0ganNGdW5jdGlvbiguLi4oYXJncyB8fCBbXSkpO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gY3JlYXRlSlNDYWxsUmVzdWx0KHJldHVyblZhbHVlLCByZXN1bHRUeXBlKTtcbiAgICAgICAgICAgIHJldHVybiByZXN1bHQgPT09IG51bGwgfHwgcmVzdWx0ID09PSB1bmRlZmluZWRcbiAgICAgICAgICAgICAgICA/IG51bGxcbiAgICAgICAgICAgICAgICA6IHN0cmluZ2lmeUFyZ3ModGhpcywgcmVzdWx0KTtcbiAgICAgICAgfVxuICAgICAgICBiZWdpbkludm9rZUpTRnJvbURvdE5ldChhc3luY0hhbmRsZSwgaWRlbnRpZmllciwgYXJnc0pzb24sIHJlc3VsdFR5cGUsIHRhcmdldEluc3RhbmNlSWQpIHtcbiAgICAgICAgICAgIC8vIENvZXJjZSBzeW5jaHJvbm91cyBmdW5jdGlvbnMgaW50byBhc3luYyBvbmVzLCBwbHVzIHRyZWF0XG4gICAgICAgICAgICAvLyBzeW5jaHJvbm91cyBleGNlcHRpb25zIHRoZSBzYW1lIGFzIGFzeW5jIG9uZXNcbiAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSBuZXcgUHJvbWlzZShyZXNvbHZlID0+IHtcbiAgICAgICAgICAgICAgICBjb25zdCBhcmdzID0gcGFyc2VKc29uV2l0aFJldml2ZXJzKHRoaXMsIGFyZ3NKc29uKTtcbiAgICAgICAgICAgICAgICBjb25zdCBqc0Z1bmN0aW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TmV0T2JqZWN0SWQpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEZvciBpbnN0YW5jZSBtZXRob2QgY2FsbHMsIGFzc2VtYmx5TmFtZSBzaG91bGQgYmUgbnVsbC4gUmVjZWl2ZWQgJyR7YXNzZW1ibHlOYW1lfScuYCk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25zdCBhc3luY0NhbGxJZCA9IHRoaXMuX25leHRBc3luY0NhbGxJZCsrO1xuICAgICAgICAgICAgY29uc3QgcmVzdWx0UHJvbWlzZSA9IG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLl9wZW5kaW5nQXN5bmNDYWxsc1thc3luY0NhbGxJZF0gPSB7IHJlc29sdmUsIHJlamVjdCB9O1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGFyZ3NKc29uID0gc3RyaW5naWZ5QXJncyh0aGlzLCBhcmdzKTtcbiAgICAgICAgICAgICAgICB0aGlzLl9kb3ROZXRDYWxsRGlzcGF0Y2hlci5iZWdpbkludm9rZURvdE5ldEZyb21KUyhhc3luY0NhbGxJZCwgYXNzZW1ibHlOYW1lLCBtZXRob2RJZGVudGlmaWVyLCBkb3ROZXRPYmplY3RJZCwgYXJnc0pzb24pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY2F0Y2ggKGV4KSB7XG4gICAgICAgICAgICAgICAgLy8gU3luY2hyb25vdXMgZmFpbHVyZVxuICAgICAgICAgICAgICAgIHRoaXMuY29tcGxldGVQZW5kaW5nQ2FsbChhc3luY0NhbGxJZCwgZmFsc2UsIGV4KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiByZXN1bHRQcm9taXNlO1xuICAgICAgICB9XG4gICAgICAgIHJlY2VpdmVCeXRlQXJyYXkoaWQsIGRhdGEpIHtcbiAgICAgICAgIC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zcGF0Y2hlci5pbnZva2VEb3ROZXRNZXRob2RBc3luYyhudWxsLCBcIl9fRGlzcG9zZVwiLCB0aGlzLl9pZCwgbnVsbCk7XG4gICAgICAgICAgICBwcm9taXNlLmNhdGNoKGVycm9yID0+IGNvbnNvbGUuZXJyb3IoZXJyb3IpKTtcbiAgICAgICAgfVxuICAgICAgICBzZXJpYWxpemVBc0FyZygpIHtcbiAgICAgICAgICAgIHJldHVybiB7IFtkb3ROZXRPYmplY3RSZWZLZXldOiB0aGlzLl9pZCB9O1xuICAgICAgICB9XG4gICAgfVxuICAgIERvdE5ldC5Eb3ROZXRPYmplY3QgPSBEb3ROZXRPYmplY3Q7XG4gICAgYXR0YWNoUmV2aXZlcihmdW5jdGlvbiByZXZpdmVSZWZlcmVuY2Uoa2V5LCB2YWx1ZSkge1xuICAgICAgICBpZiAodmFsdWUgJiYgdHlwZW9mIHZhbHVlID09PSBcIm9iamVjdFwiKSB7XG4gICAgICAgICAgICBpZiAodmFsdWUuaGFzT3duUHJvcGVydHkoZG90TmV0T2JqZWN0UmVmS2V5KSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRG90TmV0T2JqZWN0KHZhbHVlW2RvdE5ldE9iamVjdFJlZktleV0sIGN1cnJlbnRDYWxsRGlzcGF0Y2hlcik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShqc09iamVjdElkS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gdmFsdWVbanNPYmplY3RJZEtleV07XG4gICAgICAgICAgICAgICAgY29uc3QganNPYmplY3QgPSBjYWNoZWRKU09iamVjdHNCeUlkW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAoanNPYmplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGpzT2JqZWN0LmdldFdyYXBwZWRPYmplY3QoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBKUyBvYmplY3QgaW5zdGFuY2Ugd2l0aCBJZCAnJHtpZH0nIGRvZXMgbm90IGV4aXN0LiBJdCBtYXkgaGF2ZSBiZWVuIGRpc3Bvc2VkLmApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUuaGFzT3duUHJvcGVydHkoYnl0ZUFycmF5UmVmS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gdmFsdWVbYnl0ZUFycmF5UmVmS2V5XTtcbiAgICAgICAgICAgICAgICBjb25zdCBieXRlQXJyYXkgPSBjdXJyZW50Q2FsbERpc3BhdGNoZXIucHJvY2Vzc0J5dGVBcnJheShpbmRleCk7XG4gICAgICAgICAgICAgICAgaWYgKGJ5dGVBcnJheSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQnl0ZSBhcnJheSBpbmRleCAnJHtpbmRleH0nIGRvZXMgbm90IGV4aXN0LmApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gYnl0ZUFycmF5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUuaGFzT3duUHJvcGVydHkoZG90TmV0U3RyZWFtUmVmS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbUlkID0gdmFsdWVbZG90TmV0U3RyZWFtUmVmS2V5XTtcbiAgICAgICAgICAgICAgICBjb25zdCBzdHJlYW1Qcm9taXNlID0gY3VycmVudENhbGxEaXNwYXRjaGVyLmdldERvdE5ldFN0cmVhbVByb21pc2Uoc3RyZWFtSWQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRG90TmV0U3RyZWFtKHN0cmVhbVByb21pc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFVucmVjb2duaXplZCAtIGxldCBh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RpdFJlYWRlci5zaWJsaW5nSW5kZXgoZWRpdCk7XHJcbiAgICAgICAgICBwYXJlbnQgPSBnZXRMb2dpY2FsQ2hpbGQocGFyZW50LCBjaGlsZEluZGV4QXRDdXJyZW50RGVwdGggKyBzaWJsaW5nSW5kZXgpO1xyXG4gICAgICAgICAgY3VycmVudERlcHRoKys7XHJcbiAgICAgICAgICBjaGlsZEluZGV4QXRDdXJyZW50RGVwdGggPSAwO1xyXG4gICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgRWRpdFR5cGUuc3RlcE91dDoge1xyXG4gICAgICAgICAgcGFyZW50ID0gZ2V0TG9naWNhbFBhcmVudChwYXJlbnQpITtcclxuICAgICAgICAgIGN1cnJlbnREZXB0aC0tO1xyXG4gICAgICAgICAgY2hpbGRJbmRleEF0Q3VycmVudERlcHRoID0gY3VycmVudERlcHRoID09PSAwID8gY2hpbGRJbmRleCA6IDA7IC8vIFRoZSBjaGlsZEluZGV4IGlzIG9ubHkgZXZlciBub256ZXJvIGF0IHplcm8gZGVwdGhcclxuICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIEVkaXRUeXBlLnBlcm11dGF0aW9uTGlzdEVudHJ5OiB7XHJcbiAgICAgICAgICBwZXJtdXRhdGlvbkxpc3QgPSBwZXJtdXRhdGlvbkxpc3QgfHwgW107XHJcbiAgICAgICAgICBwZXJtdXRhdGlvbkxpc3QucHVzaCh7XHJcbiAgICAgICAgICAgIGZyb21TaWJsaW5nSW5kZXg6IGNoaWxkSW5kZXhBdEN1cnJlbnREZXB0aCArIGVkaXRSZWFkZXIuc2libGluZ0luZGV4KGVkaXQpLFxyXG4gICAgICAgICAgICB0b1NpYmxpbmdJbmRleDogY2hpbGRJbmRleEF0Q3VycmVudERlcHRoICsgZWRpdFJlYWRlci5tb3ZlVG9TaWJsaW5nSW5kZXgoZWRpdCksXHJcbiAgICAgICAgICB9KTtcclxuICAg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Tg0QixFQUFXQyxFQUNqRSxDQTdCOENVLEVBQUE5RyxnQkFBQSxFQStCOUNoSCxHQUFPd04sTUFBUXhELEdBQ2Z0N0IsT0FBZSxPQUFJakMsRUUxQ1BzQyxVQUNSQSxTQUFTZy9CLGVBQzRDLFVBQXJEaC9CLFNBQVNnL0IsY0FBYzV6QixhQUFhLGNGMkN0QzZ2QiJ9 From dd9fbd74bf2c82b79f531be0634ef648ed8605ca Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Fri, 22 Nov 2024 15:01:24 -0800 Subject: [PATCH 2/8] Don't include framework assets when NodeJS is disabled --- .../Microsoft.AspNetCore.App.Internal.Assets.csproj | 2 +- .../Microsoft.AspNetCore.App.Internal.Assets.targets | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj b/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj index 4ed1e5cc771c..bdb335eba896 100644 --- a/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj +++ b/src/Assets/Microsoft.AspNetCore.App.Internal.Assets.csproj @@ -21,7 +21,7 @@ <_BlazorJSContentRoot Condition="'$(Configuration)' == 'Release'">$(RepoRoot)src\Components\Web.JS\dist\Release - + <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.web.js" /> <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.server.js" /> <_BlazorJSFile Include="$(_BlazorJSContentRoot)\blazor.webassembly.js" /> diff --git a/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets index 1d52352c6cbd..b0199f2eeed7 100644 --- a/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets +++ b/src/Assets/build/Microsoft.AspNetCore.App.Internal.Assets.targets @@ -33,13 +33,22 @@ <_FrameworkStaticWebAssetCandidate Include="$(BlazorFrameworkStaticWebAssetRoot)\blazor.webassembly.js.map" /> + + <_MissingFrameworkStaticWebAssetCandidate + Include="@(_FrameworkStaticWebAssetCandidate)" + Condition="!EXISTS('%(Identity)')" /> + <_FrameworkStaticWebAssetCandidate Remove="@(_MissingFrameworkStaticWebAssetCandidate)" /> + + + + <_FrameworkAssetsPath>$(IntermediateOutputPath)frameworkassets + Condition="!EXISTS('$(_FrameworkAssetsPath)')" /> Date: Mon, 25 Nov 2024 14:00:05 +0100 Subject: [PATCH 3/8] Switch to use staticwebassets for webview --- .../PhotinoTestApp/PhotinoTestApp.csproj | 2 + ...osoft.AspNetCore.Components.WebView.csproj | 9 ++-- .../WebView/src/StaticContentProvider.cs | 38 ++++++++--------- ...rosoft.AspNetCore.Components.WebView.props | 42 ++++++++++++++++++- 4 files changed, 67 insertions(+), 24 deletions(-) diff --git a/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj b/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj index a1e10bdc677c..b006f79206a7 100644 --- a/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj +++ b/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj @@ -5,6 +5,8 @@ Exe false false + <_WebViewAssetsBasePath>..\..\..\..\..\Web.JS\dist\Release\ + <_BlazorModulesFilePath>..\..\..\..\WebView\src\blazor.modules.json diff --git a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj index 36045adf9ebd..2a3de09e531f 100644 --- a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj +++ b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj @@ -3,7 +3,6 @@ $(DefaultNetCoreTargetFramework) Build desktop applications with Blazor and a webview. - true Microsoft.Extensions.FileProviders.Embedded.Manifest.xml true $(DefineConstants);BLAZOR_WEBVIEW @@ -73,9 +72,11 @@ - - - + + + + diff --git a/src/Components/WebView/WebView/src/StaticContentProvider.cs b/src/Components/WebView/WebView/src/StaticContentProvider.cs index a2283943a182..026dbcc47560 100644 --- a/src/Components/WebView/WebView/src/StaticContentProvider.cs +++ b/src/Components/WebView/WebView/src/StaticContentProvider.cs @@ -12,8 +12,8 @@ internal sealed class StaticContentProvider private readonly Uri _appBaseUri; private readonly string _hostPageRelativePath; private static readonly FileExtensionContentTypeProvider ContentTypeProvider = new(); - private static readonly ManifestEmbeddedFileProvider _manifestProvider = - new ManifestEmbeddedFileProvider(typeof(StaticContentProvider).Assembly); + //private static readonly ManifestEmbeddedFileProvider _manifestProvider = + // new ManifestEmbeddedFileProvider(typeof(StaticContentProvider).Assembly); public StaticContentProvider(IFileProvider fileProvider, Uri appBaseUri, string hostPageRelativePath) { @@ -34,8 +34,8 @@ public bool TryGetResponseContent(string requestUri, bool allowFallbackOnHostPag // If there's no match, fall back on serving embedded framework content string contentType; var found = TryGetFromFileProvider(relativePath, out content, out contentType) - || (allowFallbackOnHostPage && TryGetFromFileProvider(_hostPageRelativePath, out content, out contentType)) - || TryGetFrameworkFile(relativePath, out content, out contentType); + || (allowFallbackOnHostPage && TryGetFromFileProvider(_hostPageRelativePath, out content, out contentType)); + //|| TryGetFrameworkFile(relativePath, out content, out contentType); if (found) { @@ -83,22 +83,22 @@ private bool TryGetFromFileProvider(string relativePath, out Stream content, out return false; } - private static bool TryGetFrameworkFile(string relativePath, out Stream content, out string contentType) - { - // We're not trying to simulate everything a real webserver does. We don't need to - // support querystring parameters, for example. It's enough to require an exact match. - var file = _manifestProvider.GetFileInfo(relativePath); - if (file.Exists) - { - content = file.CreateReadStream(); - contentType = GetResponseContentTypeOrDefault(relativePath); - return true; - } + //private static bool TryGetFrameworkFile(string relativePath, out Stream content, out string contentType) + //{ + // // We're not trying to simulate everything a real webserver does. We don't need to + // // support querystring parameters, for example. It's enough to require an exact match. + // var file = _manifestProvider.GetFileInfo(relativePath); + // if (file.Exists) + // { + // content = file.CreateReadStream(); + // contentType = GetResponseContentTypeOrDefault(relativePath); + // return true; + // } - content = default; - contentType = default; - return false; - } + // content = default; + // contentType = default; + // return false; + //} private static string GetResponseContentTypeOrDefault(string path) => ContentTypeProvider.TryGetContentType(path, out var matchedContentType) diff --git a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props index f43c2047fb31..760bba3e973b 100644 --- a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props +++ b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props @@ -1,5 +1,45 @@ - _framework/blazor.modules.json + _framework/blazor.modules.json + false + + + $(ResolveStaticWebAssetsInputsDependsOn); + _AddBlazorWebViewAssets; + + + + + + <_WebViewAssetsBasePath Condition="'$(_WebViewAssetsBasePath)' == ''">$(MSBuildThisFileDirectory)..\staticwebassets\ + <_BlazorModulesFilePath Condition="'$(_WebViewAssetsBasePath)' == ''">$(MSBuildThisFileDirectory)..\staticwebassets\blazor.modules.json + + + <_WebViewAssetCandidates Include="$(_WebViewAssetsBasePath)blazor.webview.js"> + _framework/blazor.webview.js + + <_WebViewAssetCandidates Include="$(_BlazorModulesFilePath)" Condition="'@(_ExistingBuildJSModules)' == ''"> + _framework/blazor.modules.json + + + + + + + + + + + + From c6e0874be5b32a991e7d5f37c0c67de1615c9543 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Mon, 25 Nov 2024 10:10:32 -0800 Subject: [PATCH 4/8] Some cleanup --- ...osoft.AspNetCore.Components.WebView.csproj | 3 --- .../WebView/src/StaticContentProvider.cs | 20 ------------------- ...rosoft.AspNetCore.Components.WebView.props | 2 +- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj index 2a3de09e531f..6cdb8b3b88b2 100644 --- a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj +++ b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj @@ -72,9 +72,6 @@ - - diff --git a/src/Components/WebView/WebView/src/StaticContentProvider.cs b/src/Components/WebView/WebView/src/StaticContentProvider.cs index 026dbcc47560..8fb7fd80cc8b 100644 --- a/src/Components/WebView/WebView/src/StaticContentProvider.cs +++ b/src/Components/WebView/WebView/src/StaticContentProvider.cs @@ -12,8 +12,6 @@ internal sealed class StaticContentProvider private readonly Uri _appBaseUri; private readonly string _hostPageRelativePath; private static readonly FileExtensionContentTypeProvider ContentTypeProvider = new(); - //private static readonly ManifestEmbeddedFileProvider _manifestProvider = - // new ManifestEmbeddedFileProvider(typeof(StaticContentProvider).Assembly); public StaticContentProvider(IFileProvider fileProvider, Uri appBaseUri, string hostPageRelativePath) { @@ -35,7 +33,6 @@ public bool TryGetResponseContent(string requestUri, bool allowFallbackOnHostPag string contentType; var found = TryGetFromFileProvider(relativePath, out content, out contentType) || (allowFallbackOnHostPage && TryGetFromFileProvider(_hostPageRelativePath, out content, out contentType)); - //|| TryGetFrameworkFile(relativePath, out content, out contentType); if (found) { @@ -83,23 +80,6 @@ private bool TryGetFromFileProvider(string relativePath, out Stream content, out return false; } - //private static bool TryGetFrameworkFile(string relativePath, out Stream content, out string contentType) - //{ - // // We're not trying to simulate everything a real webserver does. We don't need to - // // support querystring parameters, for example. It's enough to require an exact match. - // var file = _manifestProvider.GetFileInfo(relativePath); - // if (file.Exists) - // { - // content = file.CreateReadStream(); - // contentType = GetResponseContentTypeOrDefault(relativePath); - // return true; - // } - - // content = default; - // contentType = default; - // return false; - //} - private static string GetResponseContentTypeOrDefault(string path) => ContentTypeProvider.TryGetContentType(path, out var matchedContentType) ? matchedContentType diff --git a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props index 760bba3e973b..c11bc3b1380c 100644 --- a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props +++ b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props @@ -14,7 +14,7 @@ <_WebViewAssetsBasePath Condition="'$(_WebViewAssetsBasePath)' == ''">$(MSBuildThisFileDirectory)..\staticwebassets\ <_BlazorModulesFilePath Condition="'$(_WebViewAssetsBasePath)' == ''">$(MSBuildThisFileDirectory)..\staticwebassets\blazor.modules.json - + <_WebViewAssetCandidates Include="$(_WebViewAssetsBasePath)blazor.webview.js"> _framework/blazor.webview.js From 2347b7f05a535d3899d184511dbf3baf10fa6550 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Tue, 26 Nov 2024 10:05:10 -0800 Subject: [PATCH 5/8] Remove checked-in blazor.webview.js file --- src/Components/Web.JS/.gitignore | 4 +--- src/Components/Web.JS/dist/Release/blazor.webview.js | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 src/Components/Web.JS/dist/Release/blazor.webview.js diff --git a/src/Components/Web.JS/.gitignore b/src/Components/Web.JS/.gitignore index b1312f24cb96..afce87ca650e 100644 --- a/src/Components/Web.JS/.gitignore +++ b/src/Components/Web.JS/.gitignore @@ -1,4 +1,2 @@ node_modules/ -dist/Debug/ -dist/Release/* -!dist/Release/blazor.webview.js +dist/ diff --git a/src/Components/Web.JS/dist/Release/blazor.webview.js b/src/Components/Web.JS/dist/Release/blazor.webview.js deleted file mode 100644 index 09ee6b3e4f7b..000000000000 --- a/src/Components/Web.JS/dist/Release/blazor.webview.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(e){"use strict";var t,n,r;!function(e){const t=[],n="__jsObjectId",r="__dotNetObject",o="__byte[]",a="__dotNetStream",i="__jsStreamReferenceLength";let s,c;class l{constructor(e){this._jsObject=e,this._cachedFunctions=new Map}findFunction(e){const t=this._cachedFunctions.get(e);if(t)return t;let n,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(t in r))throw new Error(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),r instanceof Function)return r=r.bind(n),this._cachedFunctions.set(e,r),r;throw new Error(`The value '${e}' is not a function.`)}getWrappedObject(){return this._jsObject}}const u=0,d={[u]:new l(window)};d[0]._cachedFunctions.set("import",(e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substring(2),document.baseURI).toString()),import(e))));let h,f=1;function m(e){t.push(e)}function p(e){if(e&&"object"==typeof e){d[f]=new l(e);const t={[n]:f};return f++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function b(e){let t=-1;if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Blob)t=e.size;else{if(!(e.buffer instanceof ArrayBuffer))throw new Error("Supplied value is not a typed array or blob.");if(void 0===e.byteLength)throw new Error(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}const r={[i]:t};try{const t=p(e);r[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return r}function g(e,n){c=e;const r=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,r}function v(){if(void 0===s)throw new Error("No call dispatcher has been set.");if(null===s)throw new Error("There are multiple .NET runtimes present, so a default dispatcher could not be resolved. Use DotNetObject to invoke .NET instance methods.");return s}e.attachDispatcher=function(e){const t=new y(e);return void 0===s?s=t:s&&(s=null),t},e.attachReviver=m,e.invokeMethod=function(e,t,...n){return v().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return v().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=p,e.createJSStreamReference=b,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&S(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(h=e.JSCallResultType||(e.JSCallResultType={}));class y{constructor(e){this._dotNetCallDispatcher=e,this._byteArraysToBeRevived=new Map,this._pendingDotNetToJSStreams=new Map,this._pendingAsyncCalls={},this._nextAsyncCallId=1}getDotNetCallDispatcher(){return this._dotNetCallDispatcher}invokeJSFromDotNet(e,t,n,r){const o=g(this,t),a=A(E(e,r)(...o||[]),n);return null==a?null:R(this,a)}beginInvokeJSFromDotNet(e,t,n,r,o){const a=new Promise((e=>{const r=g(this,n);e(E(t,o)(...r||[]))}));e&&a.then((t=>R(this,[e,!0,A(t,r)]))).then((t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!0,t)),(t=>this._dotNetCallDispatcher.endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,w(t)]))))}endInvokeDotNetFromJS(e,t,n){const r=t?g(this,n):new Error(n);this.completePendingCall(parseInt(e,10),t,r)}invokeDotNetStaticMethod(e,t,...n){return this.invokeDotNetMethod(e,t,null,n)}invokeDotNetStaticMethodAsync(e,t,...n){return this.invokeDotNetMethodAsync(e,t,null,n)}invokeDotNetMethod(e,t,n,r){if(this._dotNetCallDispatcher.invokeDotNetFromJS){const o=R(this,r),a=this._dotNetCallDispatcher.invokeDotNetFromJS(e,t,n,o);return a?g(this,a):null}throw new Error("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeDotNetMethodAsync instead.")}invokeDotNetMethodAsync(e,t,n,r){if(e&&n)throw new Error(`For instance method calls, assemblyName should be null. Received '${e}'.`);const o=this._nextAsyncCallId++,a=new Promise(((e,t)=>{this._pendingAsyncCalls[o]={resolve:e,reject:t}}));try{const a=R(this,r);this._dotNetCallDispatcher.beginInvokeDotNetFromJS(o,e,t,n,a)}catch(e){this.completePendingCall(o,!1,e)}return a}receiveByteArray(e,t){this._byteArraysToBeRevived.set(e,t)}processByteArray(e){const t=this._byteArraysToBeRevived.get(e);return t?(this._byteArraysToBeRevived.delete(e),t):null}supplyDotNetStream(e,t){if(this._pendingDotNetToJSStreams.has(e)){const n=this._pendingDotNetToJSStreams.get(e);this._pendingDotNetToJSStreams.delete(e),n.resolve(t)}else{const n=new D;n.resolve(t),this._pendingDotNetToJSStreams.set(e,n)}}getDotNetStreamPromise(e){let t;if(this._pendingDotNetToJSStreams.has(e))t=this._pendingDotNetToJSStreams.get(e).streamPromise,this._pendingDotNetToJSStreams.delete(e);else{const n=new D;this._pendingDotNetToJSStreams.set(e,n),t=n.streamPromise}return t}completePendingCall(e,t,n){if(!this._pendingAsyncCalls.hasOwnProperty(e))throw new Error(`There is no pending async call with ID ${e}.`);const r=this._pendingAsyncCalls[e];delete this._pendingAsyncCalls[e],t?r.resolve(n):r.reject(n)}}function w(e){return e instanceof Error?`${e.message}\n${e.stack}`:e?e.toString():"null"}function E(e,t){const n=d[t];if(n)return n.findFunction(e);throw new Error(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}function S(e){delete d[e]}e.findJSFunction=E,e.disposeJSObjectReferenceById=S;class I{constructor(e,t){this._id=e,this._callDispatcher=t}invokeMethod(e,...t){return this._callDispatcher.invokeDotNetMethod(null,e,this._id,t)}invokeMethodAsync(e,...t){return this._callDispatcher.invokeDotNetMethodAsync(null,e,this._id,t)}dispose(){this._callDispatcher.invokeDotNetMethodAsync(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{[r]:this._id}}}e.DotNetObject=I,m((function(e,t){if(t&&"object"==typeof t){if(t.hasOwnProperty(r))return new I(t[r],c);if(t.hasOwnProperty(n)){const e=t[n],r=d[e];if(r)return r.getWrappedObject();throw new Error(`JS object instance with Id '${e}' does not exist. It may have been disposed.`)}if(t.hasOwnProperty(o)){const e=t[o],n=c.processByteArray(e);if(void 0===n)throw new Error(`Byte array index '${e}' does not exist.`);return n}if(t.hasOwnProperty(a)){const e=t[a],n=c.getDotNetStreamPromise(e);return new C(n)}}return t}));class C{constructor(e){this._streamPromise=e}stream(){return this._streamPromise}async arrayBuffer(){return new Response(await this.stream()).arrayBuffer()}}class D{constructor(){this.streamPromise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}function A(e,t){switch(t){case h.Default:return e;case h.JSObjectReference:return p(e);case h.JSStreamReference:return b(e);case h.JSVoidResult:return null;default:throw new Error(`Invalid JS call result type '${t}'.`)}}let N=0;function R(e,t){N=0,c=e;const n=JSON.stringify(t,k);return c=void 0,n}function k(e,t){if(t instanceof I)return t.serializeAsArg();if(t instanceof Uint8Array){c.getDotNetCallDispatcher().sendByteArray(N,t);const e={[o]:N};return N++,e}return t}}(t||(t={})),function(e){e[e.prependFrame=1]="prependFrame",e[e.removeFrame=2]="removeFrame",e[e.setAttribute=3]="setAttribute",e[e.removeAttribute=4]="removeAttribute",e[e.updateText=5]="updateText",e[e.stepIn=6]="stepIn",e[e.stepOut=7]="stepOut",e[e.updateMarkup=8]="updateMarkup",e[e.permutationListEntry=9]="permutationListEntry",e[e.permutationListEnd=10]="permutationListEnd"}(n||(n={})),function(e){e[e.element=1]="element",e[e.text=2]="text",e[e.attribute=3]="attribute",e[e.component=4]="component",e[e.region=5]="region",e[e.elementReferenceCapture=6]="elementReferenceCapture",e[e.markup=8]="markup",e[e.namedEvent=10]="namedEvent"}(r||(r={}));class o{constructor(e,t){this.componentId=e,this.fieldValue=t}static fromEvent(e,t){const n=t.target;if(n instanceof Element){const t=function(e){return e instanceof HTMLInputElement?e.type&&"checkbox"===e.type.toLowerCase()?{value:e.checked}:{value:e.value}:e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement?{value:e.value}:null}(n);if(t)return new o(e,t.value)}return null}}const a=new Map,i=new Map,s=[];function c(e){return a.get(e)}function l(e){const t=a.get(e);return t?.browserEventName||e}function u(e,t){e.forEach((e=>a.set(e,t)))}function d(e){const t=[];for(let n=0;ne.selected)).map((e=>e.value))}}{const e=function(e){return!!e&&"INPUT"===e.tagName&&"checkbox"===e.getAttribute("type")}(t);return{value:e?!!t.checked:t.value}}}}),u(["copy","cut","paste"],{createEventArgs:e=>({type:e.type})}),u(["drag","dragend","dragenter","dragleave","dragover","dragstart","drop"],{createEventArgs:e=>{return{...h(t=e),dataTransfer:t.dataTransfer?{dropEffect:t.dataTransfer.dropEffect,effectAllowed:t.dataTransfer.effectAllowed,files:Array.from(t.dataTransfer.files).map((e=>e.name)),items:Array.from(t.dataTransfer.items).map((e=>({kind:e.kind,type:e.type}))),types:t.dataTransfer.types}:null};var t}}),u(["focus","blur","focusin","focusout"],{createEventArgs:e=>({type:e.type})}),u(["keydown","keyup","keypress"],{createEventArgs:e=>{return{key:(t=e).key,code:t.code,location:t.location,repeat:t.repeat,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type,isComposing:t.isComposing};var t}}),u(["contextmenu","click","mouseover","mouseout","mousemove","mousedown","mouseup","mouseleave","mouseenter","dblclick"],{createEventArgs:e=>h(e)}),u(["error"],{createEventArgs:e=>{return{message:(t=e).message,filename:t.filename,lineno:t.lineno,colno:t.colno,type:t.type};var t}}),u(["loadstart","timeout","abort","load","loadend","progress"],{createEventArgs:e=>{return{lengthComputable:(t=e).lengthComputable,loaded:t.loaded,total:t.total,type:t.type};var t}}),u(["touchcancel","touchend","touchmove","touchenter","touchleave","touchstart"],{createEventArgs:e=>{return{detail:(t=e).detail,touches:d(t.touches),targetTouches:d(t.targetTouches),changedTouches:d(t.changedTouches),ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey,type:t.type};var t}}),u(["gotpointercapture","lostpointercapture","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup"],{createEventArgs:e=>{return{...h(t=e),pointerId:t.pointerId,width:t.width,height:t.height,pressure:t.pressure,tiltX:t.tiltX,tiltY:t.tiltY,pointerType:t.pointerType,isPrimary:t.isPrimary};var t}}),u(["wheel","mousewheel"],{createEventArgs:e=>{return{...h(t=e),deltaX:t.deltaX,deltaY:t.deltaY,deltaZ:t.deltaZ,deltaMode:t.deltaMode};var t}}),u(["cancel","close","toggle"],{createEventArgs:()=>({})});const f=["date","datetime-local","month","time","week"],m=new Map;let p,b,g=0;const v={async add(e,t,n){if(!n)throw new Error("initialParameters must be an object, even if empty.");const r="__bl-dynamic-root:"+(++g).toString();m.set(r,e);const o=await E().invokeMethodAsync("AddRootComponent",t,r),a=new w(o,b[t]);return await a.setParameters(n),a}};class y{invoke(e){return this._callback(e)}setCallback(e){this._selfJSObjectReference||(this._selfJSObjectReference=t.createJSObjectReference(this)),this._callback=e}getJSObjectReference(){return this._selfJSObjectReference}dispose(){this._selfJSObjectReference&&t.disposeJSObjectReference(this._selfJSObjectReference)}}class w{constructor(e,t){this._jsEventCallbackWrappers=new Map,this._componentId=e;for(const e of t)"eventcallback"===e.type&&this._jsEventCallbackWrappers.set(e.name.toLowerCase(),new y)}setParameters(e){const t={},n=Object.entries(e||{}),r=n.length;for(const[e,r]of n){const n=this._jsEventCallbackWrappers.get(e.toLowerCase());n&&r?(n.setCallback(r),t[e]=n.getJSObjectReference()):t[e]=r}return E().invokeMethodAsync("SetRootComponentParameters",this._componentId,r,t)}async dispose(){if(null!==this._componentId){await E().invokeMethodAsync("RemoveRootComponent",this._componentId),this._componentId=null;for(const e of this._jsEventCallbackWrappers.values())e.dispose()}}}function E(){if(!p)throw new Error("Dynamic root components have not been enabled in this application.");return p}const S=new Map,I=[],C=new Map;function D(e,t,n){return N(e,t.eventHandlerId,(()=>A(e).invokeMethodAsync("DispatchEventAsync",t,n)))}function A(e){const t=S.get(e);if(!t)throw new Error(`No interop methods are registered for renderer ${e}`);return t}let N=(e,t,n)=>n();const R=x(["abort","blur","cancel","canplay","canplaythrough","change","close","cuechange","durationchange","emptied","ended","error","focus","load","loadeddata","loadedmetadata","loadend","loadstart","mouseenter","mouseleave","pointerenter","pointerleave","pause","play","playing","progress","ratechange","reset","scroll","seeked","seeking","stalled","submit","suspend","timeupdate","toggle","unload","volumechange","waiting","DOMNodeInsertedIntoDocument","DOMNodeRemovedFromDocument"]),k={submit:!0},T=x(["click","dblclick","mousedown","mousemove","mouseup"]);class _{static{this.nextEventDelegatorId=0}constructor(e){this.browserRendererId=e,this.afterClickCallbacks=[];const t=++_.nextEventDelegatorId;this.eventsCollectionKey=`_blazorEvents_${t}`,this.eventInfoStore=new O(this.onGlobalEvent.bind(this))}setListener(e,t,n,r){const o=this.getEventHandlerInfosForElement(e,!0),a=o.getHandler(t);if(a)this.eventInfoStore.update(a.eventHandlerId,n);else{const a={element:e,eventName:t,eventHandlerId:n,renderingComponentId:r};this.eventInfoStore.add(a),o.setHandler(t,a)}}getHandler(e){return this.eventInfoStore.get(e)}removeListener(e){const t=this.eventInfoStore.remove(e);if(t){const e=t.element,n=this.getEventHandlerInfosForElement(e,!1);n&&n.removeHandler(t.eventName)}}notifyAfterClick(e){this.afterClickCallbacks.push(e),this.eventInfoStore.addGlobalListener("click")}setStopPropagation(e,t,n){this.getEventHandlerInfosForElement(e,!0).stopPropagation(t,n)}setPreventDefault(e,t,n){this.getEventHandlerInfosForElement(e,!0).preventDefault(t,n)}onGlobalEvent(e){if(!(e.target instanceof Element))return;this.dispatchGlobalEventToAllElements(e.type,e);const t=(n=e.type,i.get(n));var n;t&&t.forEach((t=>this.dispatchGlobalEventToAllElements(t,e))),"click"===e.type&&this.afterClickCallbacks.forEach((t=>t(e)))}dispatchGlobalEventToAllElements(e,t){const n=t.composedPath();let r=n.shift(),a=null,i=!1;const s=Object.prototype.hasOwnProperty.call(R,e);let l=!1;for(;r;){const h=r,f=this.getEventHandlerInfosForElement(h,!1);if(f){const n=f.getHandler(e);if(n&&(u=h,d=t.type,!((u instanceof HTMLButtonElement||u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement||u instanceof HTMLSelectElement)&&Object.prototype.hasOwnProperty.call(T,d)&&u.disabled))){if(!i){const n=c(e);a=n?.createEventArgs?n.createEventArgs(t):{},i=!0}Object.prototype.hasOwnProperty.call(k,t.type)&&t.preventDefault(),D(this.browserRendererId,{eventHandlerId:n.eventHandlerId,eventName:e,eventFieldInfo:o.fromEvent(n.renderingComponentId,t)},a)}f.stopPropagation(e)&&(l=!0),f.preventDefault(e)&&t.preventDefault()}r=s||l?void 0:n.shift()}var u,d}getEventHandlerInfosForElement(e,t){return Object.prototype.hasOwnProperty.call(e,this.eventsCollectionKey)?e[this.eventsCollectionKey]:t?e[this.eventsCollectionKey]=new L:null}}class O{constructor(e){this.globalListener=e,this.infosByEventHandlerId={},this.countByEventName={},s.push(this.handleEventNameAliasAdded.bind(this))}add(e){if(this.infosByEventHandlerId[e.eventHandlerId])throw new Error(`Event ${e.eventHandlerId} is already tracked`);this.infosByEventHandlerId[e.eventHandlerId]=e,this.addGlobalListener(e.eventName)}get(e){return this.infosByEventHandlerId[e]}addGlobalListener(e){if(e=l(e),Object.prototype.hasOwnProperty.call(this.countByEventName,e))this.countByEventName[e]++;else{this.countByEventName[e]=1;const t=Object.prototype.hasOwnProperty.call(R,e);document.addEventListener(e,this.globalListener,t)}}update(e,t){if(Object.prototype.hasOwnProperty.call(this.infosByEventHandlerId,t))throw new Error(`Event ${t} is already tracked`);const n=this.infosByEventHandlerId[e];delete this.infosByEventHandlerId[e],n.eventHandlerId=t,this.infosByEventHandlerId[t]=n}remove(e){const t=this.infosByEventHandlerId[e];if(t){delete this.infosByEventHandlerId[e];const n=l(t.eventName);0==--this.countByEventName[n]&&(delete this.countByEventName[n],document.removeEventListener(n,this.globalListener))}return t}handleEventNameAliasAdded(e,t){if(Object.prototype.hasOwnProperty.call(this.countByEventName,e)){const n=this.countByEventName[e];delete this.countByEventName[e],document.removeEventListener(e,this.globalListener),this.addGlobalListener(t),this.countByEventName[t]+=n-1}}}class L{constructor(){this.handlers={},this.preventDefaultFlags=null,this.stopPropagationFlags=null}getHandler(e){return Object.prototype.hasOwnProperty.call(this.handlers,e)?this.handlers[e]:null}setHandler(e,t){this.handlers[e]=t}removeHandler(e){delete this.handlers[e]}preventDefault(e,t){return void 0!==t&&(this.preventDefaultFlags=this.preventDefaultFlags||{},this.preventDefaultFlags[e]=t),!!this.preventDefaultFlags&&this.preventDefaultFlags[e]}stopPropagation(e,t){return void 0!==t&&(this.stopPropagationFlags=this.stopPropagationFlags||{},this.stopPropagationFlags[e]=t),!!this.stopPropagationFlags&&this.stopPropagationFlags[e]}}function x(e){const t={};return e.forEach((e=>{t[e]=!0})),t}const F=Symbol(),M=Symbol();function P(e,t){if(F in e)return e;const n=[];if(e.childNodes.length>0){if(!t)throw new Error("New logical elements must start empty, or allowExistingContents must be true");e.childNodes.forEach((t=>{const r=P(t,!0);r[M]=e,n.push(r)}))}return e[F]=n,e}function B(e){const t=W(e);for(;t.length;)J(e,0)}function j(e,t){const n=document.createComment("!");return H(n,e,t),n}function H(e,t,n){const r=e;let o=e;if(e instanceof Comment){const t=W(r);if(t?.length>0){const t=G(r),n=new Range;n.setStartBefore(e),n.setEndAfter(t),o=n.extractContents()}}const a=U(r);if(a){const e=W(a),t=Array.prototype.indexOf.call(e,r);e.splice(t,1),delete r[M]}const i=W(t);if(n0;)J(n,0)}const r=n;r.parentNode.removeChild(r)}function U(e){return e[M]||null}function $(e,t){return W(e)[t]}function z(e){const t=X(e);return"http://www.w3.org/2000/svg"===t.namespaceURI&&"foreignObject"!==t.tagName}function W(e){return e[F]}function K(e){const t=W(U(e));return t[Array.prototype.indexOf.call(t,e)+1]||null}function V(e,t){const n=W(e);t.forEach((e=>{e.moveRangeStart=n[e.fromSiblingIndex],e.moveRangeEnd=G(e.moveRangeStart)})),t.forEach((t=>{const r=document.createComment("marker");t.moveToBeforeMarker=r;const o=n[t.toSiblingIndex+1];o?o.parentNode.insertBefore(r,o):Y(r,e)})),t.forEach((e=>{const t=e.moveToBeforeMarker,n=t.parentNode,r=e.moveRangeStart,o=e.moveRangeEnd;let a=r;for(;a;){const e=a.nextSibling;if(n.insertBefore(a,t),a===o)break;a=e}n.removeChild(t)})),t.forEach((e=>{n[e.toSiblingIndex]=e.moveRangeStart}))}function X(e){if(e instanceof Element||e instanceof DocumentFragment)return e;if(e instanceof Comment)return e.parentNode;throw new Error("Not a valid logical element")}function Y(e,t){if(t instanceof Element||t instanceof DocumentFragment)t.appendChild(e);else{if(!(t instanceof Comment))throw new Error(`Cannot append node because the parent is not a valid logical element. Parent: ${t}`);{const n=K(t);n?n.parentNode.insertBefore(e,n):Y(e,U(t))}}}function G(e){if(e instanceof Element||e instanceof DocumentFragment)return e;const t=K(e);if(t)return t.previousSibling;{const t=U(e);return t instanceof Element||t instanceof DocumentFragment?t.lastChild:G(t)}}function q(e){return`_bl_${e}`}const Z="__internalId";t.attachReviver(((e,t)=>t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,Z)&&"string"==typeof t[Z]?function(e){const t=`[${q(e)}]`;return document.querySelector(t)}(t[Z]):t));const Q="_blazorDeferredValue";function ee(e){return"select-multiple"===e.type}function te(e,t){e.value=t||""}function ne(e,t){e instanceof HTMLSelectElement?ee(e)?function(e,t){t||=[];for(let n=0;n{we()&&function(e){if(0!==e.button||function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey}(e))return;if(e.defaultPrevented)return;const t=function(e){const t=e.composedPath&&e.composedPath();if(t)for(let e=0;e{const t=document.createElement("script");t.textContent=e.textContent,e.getAttributeNames().forEach((n=>{t.setAttribute(n,e.getAttribute(n))})),e.parentNode.replaceChild(t,e)})),oe.content));var i;let s=0;for(;a.firstChild;)H(a.firstChild,o,s++)}applyAttribute(e,t,n,r){const o=e.frameReader,a=o.attributeName(r),i=o.attributeEventHandlerId(r);if(i){const e=he(a);return void this.eventDelegator.setListener(n,e,i,t)}const s=o.attributeValue(r);this.setOrRemoveAttributeOrProperty(n,a,s)}insertFrameRange(e,t,n,r,o,a,i){const s=r;for(let s=a;sdocument.baseURI,getLocationHref:()=>location.href,scrollToElement:ve};function ke(e,t,n=!1){const r=ye(e);!t.forceLoad&&ge(r)?Be()?Te(r,!1,t.replaceHistoryEntry,t.historyEntryState,n):function(){throw new Error("No enhanced programmatic navigation handler has been attached")}():function(e,t){if(location.href===e){const t=e+"?";history.replaceState(null,"",t),location.replace(e)}else t?location.replace(e):location.href=e}(e,t.replaceHistoryEntry)}async function Te(e,t,n,r=void 0,o=!1){if(Le(),function(e){const t=new URL(e);return""!==t.hash&&location.origin===t.origin&&location.pathname===t.pathname&&location.search===t.search}(e))return _e(e,n,r),void function(e){const t=e.indexOf("#");t!==e.length-1&&ve(e.substring(t+1))}(e);const a=Pe();(o||!a?.hasLocationChangingEventListeners||await xe(e,r,t,a))&&(be=!0,_e(e,n,r),await Fe(t))}function _e(e,t,n=void 0){t?history.replaceState({userState:n,_index:Ie},"",e):(Ie++,history.pushState({userState:n,_index:Ie},"",e))}function Oe(e){return new Promise((t=>{const n=Ae;Ae=()=>{Ae=n,t()},history.go(e)}))}function Le(){Ne&&(Ne(!1),Ne=null)}function xe(e,t,n,r){return new Promise((o=>{Le(),Ce++,Ne=o,r.locationChanging(Ce,e,t,n)}))}async function Fe(e,t){const n=location.href;await Promise.all(Array.from(De,(async([t,r])=>{var o;o=t,S.has(o)&&await r.locationChanged(n,history.state?.userState,e)})))}async function Me(e){Ae&&Be()&&await Ae(e),Ie=history.state?._index??0}function Pe(){const e=Ee();if(void 0!==e)return De.get(e)}function Be(){return we()||!0}const je={focus:function(e,t){if(e instanceof HTMLElement)e.focus({preventScroll:t});else{if(!(e instanceof SVGElement))throw new Error("Unable to focus an invalid element.");if(!e.hasAttribute("tabindex"))throw new Error("Unable to focus an SVG element that does not have a tabindex.");e.focus({preventScroll:t})}},focusBySelector:function(e){const t=document.querySelector(e);t&&(t.hasAttribute("tabindex")||(t.tabIndex=-1),t.focus({preventScroll:!0}))}},He={init:function(e,t,n,r=50){const o=Ue(t);(o||document.documentElement).style.overflowAnchor="none";const a=document.createRange();h(n.parentElement)&&(t.style.display="table-row",n.style.display="table-row");const i=new IntersectionObserver((function(r){r.forEach((r=>{if(!r.isIntersecting)return;a.setStartAfter(t),a.setEndBefore(n);const o=a.getBoundingClientRect().height,i=r.rootBounds?.height;r.target===t?e.invokeMethodAsync("OnSpacerBeforeVisible",r.intersectionRect.top-r.boundingClientRect.top,o,i):r.target===n&&n.offsetHeight>0&&e.invokeMethodAsync("OnSpacerAfterVisible",r.boundingClientRect.bottom-r.intersectionRect.bottom,o,i)}))}),{root:o,rootMargin:`${r}px`});i.observe(t),i.observe(n);const s=d(t),c=d(n),{observersByDotNetObjectId:l,id:u}=$e(e);function d(e){const t={attributes:!0},n=new MutationObserver(((n,r)=>{h(e.parentElement)&&(r.disconnect(),e.style.display="table-row",r.observe(e,t)),i.unobserve(e),i.observe(e)}));return n.observe(e,t),n}function h(e){return null!==e&&(e instanceof HTMLTableElement&&""===e.style.display||"table"===e.style.display||e instanceof HTMLTableSectionElement&&""===e.style.display||"table-row-group"===e.style.display)}l[u]={intersectionObserver:i,mutationObserverBefore:s,mutationObserverAfter:c}},dispose:function(e){const{observersByDotNetObjectId:t,id:n}=$e(e),r=t[n];r&&(r.intersectionObserver.disconnect(),r.mutationObserverBefore.disconnect(),r.mutationObserverAfter.disconnect(),e.dispose(),delete t[n])}},Je=Symbol();function Ue(e){return e&&e!==document.body&&e!==document.documentElement?"visible"!==getComputedStyle(e).overflowY?e:Ue(e.parentElement):null}function $e(e){const t=e._callDispatcher,n=e._id;return t[Je]??={},{observersByDotNetObjectId:t[Je],id:n}}const ze={getAndRemoveExistingTitle:function(){const e=document.head?document.head.getElementsByTagName("title"):[];if(0===e.length)return null;let t=null;for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.previousSibling;o instanceof Comment&&null!==U(o)||(null===t&&(t=r.textContent),r.parentNode?.removeChild(r))}return t}},We={init:function(e,t){t._blazorInputFileNextFileId=0,t.addEventListener("click",(function(){t.value=""})),t.addEventListener("change",(function(){t._blazorFilesById={};const n=Array.prototype.map.call(t.files,(function(e){const n={id:++t._blazorInputFileNextFileId,lastModified:new Date(e.lastModified).toISOString(),name:e.name,size:e.size,contentType:e.type,readPromise:void 0,arrayBuffer:void 0,blob:e};return t._blazorFilesById[n.id]=n,n}));e.invokeMethodAsync("NotifyChange",n)}))},toImageFile:async function(e,t,n,r,o){const a=Ke(e,t),i=await new Promise((function(e){const t=new Image;t.onload=function(){URL.revokeObjectURL(t.src),e(t)},t.onerror=function(){t.onerror=null,URL.revokeObjectURL(t.src)},t.src=URL.createObjectURL(a.blob)})),s=await new Promise((function(e){const t=Math.min(1,r/i.width),a=Math.min(1,o/i.height),s=Math.min(t,a),c=document.createElement("canvas");c.width=Math.round(i.width*s),c.height=Math.round(i.height*s),c.getContext("2d")?.drawImage(i,0,0,c.width,c.height),c.toBlob(e,n)})),c={id:++e._blazorInputFileNextFileId,lastModified:a.lastModified,name:a.name,size:s?.size||0,contentType:n,blob:s||a.blob};return e._blazorFilesById[c.id]=c,c},readFileData:async function(e,t){return Ke(e,t).blob}};function Ke(e,t){const n=e._blazorFilesById[t];if(!n)throw new Error(`There is no file with ID ${t}. The file list may have changed. See https://aka.ms/aspnet/blazor-input-file-multiple-selections.`);return n}const Ve=new Set,Xe={enableNavigationPrompt:function(e){0===Ve.size&&window.addEventListener("beforeunload",Ye),Ve.add(e)},disableNavigationPrompt:function(e){Ve.delete(e),0===Ve.size&&window.removeEventListener("beforeunload",Ye)}};function Ye(e){e.preventDefault(),e.returnValue=!0}const Ge=new Map,qe={navigateTo:function(e,t,n=!1){ke(e,t instanceof Object?t:{forceLoad:t,replaceHistoryEntry:n})},registerCustomEventType:function(e,t){if(!t)throw new Error("The options parameter is required.");if(a.has(e))throw new Error(`The event '${e}' is already registered.`);if(t.browserEventName){const n=i.get(t.browserEventName);n?n.push(e):i.set(t.browserEventName,[e]),s.forEach((n=>n(e,t.browserEventName)))}a.set(e,t)},rootComponents:v,runtime:{},_internal:{navigationManager:Re,domWrapper:je,Virtualize:He,PageTitle:ze,InputFile:We,NavigationLock:Xe,getJSDataStreamChunk:async function(e,t,n){return e instanceof Blob?await async function(e,t,n){const r=e.slice(t,t+n),o=await r.arrayBuffer();return new Uint8Array(o)}(e,t,n):function(e,t,n){return new Uint8Array(e.buffer,e.byteOffset+t,n)}(e,t,n)},attachWebRendererInterop:function(e,n,r,o){if(S.has(e))throw new Error(`Interop methods are already registered for renderer ${e}`);S.set(e,n),r&&o&&Object.keys(r).length>0&&function(e,n,r){if(p)throw new Error("Dynamic root components have already been enabled.");p=e,b=n;for(const[e,o]of Object.entries(r)){const r=t.findJSFunction(e,0);for(const e of o)r(e,n[e])}}(A(e),r,o),C.get(e)?.[0]?.(),function(e){for(const t of I)t(e)}(e)}}};window.Blazor=qe;let Ze=!1;const Qe="function"==typeof TextDecoder?new TextDecoder("utf-8"):null,et=Qe?Qe.decode.bind(Qe):function(e){let t=0;const n=e.length,r=[],o=[];for(;t65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o)}}else r.push(n);r.length>1024&&(o.push(String.fromCharCode.apply(null,r)),r.length=0)}return o.push(String.fromCharCode.apply(null,r)),o.join("")},tt=Math.pow(2,32),nt=Math.pow(2,21)-1;function rt(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24}function ot(e,t){return e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24>>>0)}function at(e,t){const n=ot(e,t+4);if(n>nt)throw new Error(`Cannot read uint64 with high order part ${n}, because the result would exceed Number.MAX_SAFE_INTEGER.`);return n*tt+ot(e,t)}class it{constructor(e){this.batchData=e;const t=new ut(e);this.arrayRangeReader=new dt(e),this.arrayBuilderSegmentReader=new ht(e),this.diffReader=new st(e),this.editReader=new ct(e,t),this.frameReader=new lt(e,t)}updatedComponents(){return rt(this.batchData,this.batchData.length-20)}referenceFrames(){return rt(this.batchData,this.batchData.length-16)}disposedComponentIds(){return rt(this.batchData,this.batchData.length-12)}disposedEventHandlerIds(){return rt(this.batchData,this.batchData.length-8)}updatedComponentsEntry(e,t){const n=e+4*t;return rt(this.batchData,n)}referenceFramesEntry(e,t){return e+20*t}disposedComponentIdsEntry(e,t){const n=e+4*t;return rt(this.batchData,n)}disposedEventHandlerIdsEntry(e,t){const n=e+8*t;return at(this.batchData,n)}}class st{constructor(e){this.batchDataUint8=e}componentId(e){return rt(this.batchDataUint8,e)}edits(e){return e+4}editsEntry(e,t){return e+16*t}}class ct{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}editType(e){return rt(this.batchDataUint8,e)}siblingIndex(e){return rt(this.batchDataUint8,e+4)}newTreeIndex(e){return rt(this.batchDataUint8,e+8)}moveToSiblingIndex(e){return rt(this.batchDataUint8,e+8)}removedAttributeName(e){const t=rt(this.batchDataUint8,e+12);return this.stringReader.readString(t)}}class lt{constructor(e,t){this.batchDataUint8=e,this.stringReader=t}frameType(e){return rt(this.batchDataUint8,e)}subtreeLength(e){return rt(this.batchDataUint8,e+4)}elementReferenceCaptureId(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}componentId(e){return rt(this.batchDataUint8,e+8)}elementName(e){const t=rt(this.batchDataUint8,e+8);return this.stringReader.readString(t)}textContent(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}markupContent(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeName(e){const t=rt(this.batchDataUint8,e+4);return this.stringReader.readString(t)}attributeValue(e){const t=rt(this.batchDataUint8,e+8);return this.stringReader.readString(t)}attributeEventHandlerId(e){return at(this.batchDataUint8,e+12)}}class ut{constructor(e){this.batchDataUint8=e,this.stringTableStartIndex=rt(e,e.length-4)}readString(e){if(-1===e)return null;{const n=rt(this.batchDataUint8,this.stringTableStartIndex+4*e),r=function(e,t){let n=0,r=0;for(let o=0;o<4;o++){const a=e[t+o];if(n|=(127&a)<async function(e,n){const r=function(e){const t=document.baseURI;return t.endsWith("/")?`${t}${e}`:`${t}/${e}`}(n),o=await import(r);if(void 0!==o){if(e.singleRuntime){const{beforeStart:n,afterStarted:r,beforeWebAssemblyStart:i,afterWebAssemblyStarted:s,beforeServerStart:c,afterServerStarted:l}=o;let u=n;e.webRendererId===St.Server&&c&&(u=c),e.webRendererId===St.WebAssembly&&i&&(u=i);let d=r;return e.webRendererId===St.Server&&l&&(d=l),e.webRendererId===St.WebAssembly&&s&&(d=s),a(e,u,d,t)}return function(e,t,n){const o=n[0],{beforeStart:i,afterStarted:s,beforeWebStart:c,afterWebStarted:l,beforeWebAssemblyStart:u,afterWebAssemblyStarted:d,beforeServerStart:h,afterServerStarted:f}=t,m=!(c||l||u||d||h||f||!i&&!s),p=m&&o.enableClassicInitializers;if(m&&!o.enableClassicInitializers)e.logger?.log(It.Warning,`Initializer '${r}' will be ignored because multiple runtimes are available. Use 'before(Web|WebAssembly|Server)Start' and 'after(Web|WebAssembly|Server)Started' instead.`);else if(p)return a(e,i,s,n);if(function(e){e.webAssembly?e.webAssembly.initializers||(e.webAssembly.initializers={beforeStart:[],afterStarted:[]}):e.webAssembly={initializers:{beforeStart:[],afterStarted:[]}},e.circuit?e.circuit.initializers||(e.circuit.initializers={beforeStart:[],afterStarted:[]}):e.circuit={initializers:{beforeStart:[],afterStarted:[]}}}(o),u&&o.webAssembly.initializers.beforeStart.push(u),d&&o.webAssembly.initializers.afterStarted.push(d),h&&o.circuit.initializers.beforeStart.push(h),f&&o.circuit.initializers.afterStarted.push(f),l&&e.afterStartedCallbacks.push(l),c)return c(o)}(e,o,t)}function a(e,t,n,r){if(n&&e.afterStartedCallbacks.push(n),t)return t(...r)}}(this,e))))}async invokeAfterStartedCallbacks(e){const t=(n=this.webRendererId,C.get(n)?.[1]);var n;t&&await t,await Promise.all(this.afterStartedCallbacks.map((t=>t(e))))}}let Nt=!1;async function Rt(){if(Nt)throw new Error("Blazor has already started.");Nt=!0,e.dispatcher=t.attachDispatcher({beginInvokeDotNetFromJS:bt,endInvokeJSFromDotNet:gt,sendByteArray:vt});const n=await async function(){const e=await fetch("_framework/blazor.modules.json",{method:"GET",credentials:"include",cache:"no-cache"}),t=await e.json(),n=new At;return await n.importInitializersAsync(t,[]),n}();(function(){const t={AttachToDocument:(e,t)=>{!function(e,t,n){const r="::before";let o=!1;if(e.endsWith("::after"))e=e.slice(0,-7),o=!0;else if(e.endsWith(r))throw new Error(`The '${r}' selector is not supported.`);const a=function(e){const t=m.get(e);if(t)return m.delete(e),t}(e)||document.querySelector(e);if(!a)throw new Error(`Could not find any element matching selector '${e}'.`);!function(e,t,n,r){let o=fe[e];o||(o=new le(e),fe[e]=o),o.attachRootComponentToLogicalElement(n,t,r)}(n,P(a,!0),t,o)}(t,e,St.WebView)},RenderBatch:(e,t)=>{try{const n=Dt(t);(function(e,t){const n=fe[e];if(!n)throw new Error(`There is no browser renderer with ID ${e}.`);const r=t.arrayRangeReader,o=t.updatedComponents(),a=r.values(o),i=r.count(o),s=t.referenceFrames(),c=r.values(s),l=t.diffReader;for(let e=0;e{mt=!0,console.error(`${e}\n${t}`),function(){const e=document.querySelector("#blazor-error-ui");e&&(e.style.display="block"),Ze||(Ze=!0,document.querySelectorAll("#blazor-error-ui .reload").forEach((e=>{e.onclick=function(e){location.reload(),e.preventDefault()}})),document.querySelectorAll("#blazor-error-ui .dismiss").forEach((e=>{e.onclick=function(e){const t=document.querySelector("#blazor-error-ui");t&&(t.style.display="none"),e.preventDefault()}})))}()},BeginInvokeJS:e.dispatcher.beginInvokeJSFromDotNet.bind(e.dispatcher),EndInvokeDotNet:e.dispatcher.endInvokeDotNetFromJS.bind(e.dispatcher),SendByteArrayToJS:Ct,Navigate:Re.navigateTo,Refresh:Re.refresh,SetHasLocationChangingListeners:e=>{Re.setHasLocationChangingListeners(St.WebView,e)},EndLocationChanging:Re.endLocationChanging};window.external.receiveMessage((e=>{const n=function(e){if(mt||!e||!e.startsWith(ft))return null;const t=e.substring(6),[n,...r]=JSON.parse(t);return{messageType:n,args:r}}(e);if(n){if(!Object.prototype.hasOwnProperty.call(t,n.messageType))throw new Error(`Unsupported IPC message type '${n.messageType}'`);t[n.messageType].apply(null,n.args)}}))})(),qe._internal.receiveWebViewDotNetDataStream=kt,Re.enableNavigationInterception(St.WebView),Re.listenForNavigationEvents(St.WebView,yt,wt),Et("AttachPage",Re.getBaseURI(),Re.getLocationHref()),await n.invokeAfterStartedCallbacks(qe)}function kt(t,n,r,o){!function(e,t,n,r,o){let a=Ge.get(t);if(!a){const n=new ReadableStream({start(e){Ge.set(t,e),a=e}});e.supplyDotNetStream(t,n)}o?(a.error(o),Ge.delete(t)):0===r?(a.close(),Ge.delete(t)):a.enqueue(n.length===r?n:n.subarray(0,r))}(e.dispatcher,t,n,r,o)}e.dispatcher=void 0,qe.start=Rt,window.DotNet=t,document&&document.currentScript&&"false"!==document.currentScript.getAttribute("autostart")&&Rt()}({}); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxhem9yLndlYnZpZXcuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL0pTSW50ZXJvcC9NaWNyb3NvZnQuSlNJbnRlcm9wLkpTL3NyYy9kaXN0L3NyYy9NaWNyb3NvZnQuSlNJbnRlcm9wLmpzIiwiLi4vLi4vc3JjL1JlbmRlcmluZy9SZW5kZXJCYXRjaC9SZW5kZXJCYXRjaC50cyIsIi4uLy4uL3NyYy9SZW5kZXJpbmcvRXZlbnRzL0V2ZW50RmllbGRJbmZvLnRzIiwiLi4vLi4vc3JjL1JlbmRlcmluZy9FdmVudHMvRXZlbnRUeXBlcy50cyIsIi4uLy4uL3NyYy9SZW5kZXJpbmcvSlNSb290Q29tcG9uZW50cy50cyIsIi4uLy4uL3NyYy9SZW5kZXJpbmcvV2ViUmVuZGVyZXJJbnRlcm9wTWV0aG9kcy50cyIsIi4uLy4uL3NyYy9SZW5kZXJpbmcvRXZlbnRzL0V2ZW50RGVsZWdhdG9yLnRzIiwiLi4vLi4vc3JjL1JlbmRlcmluZy9Mb2dpY2FsRWxlbWVudHMudHMiLCIuLi8uLi9zcmMvUmVuZGVyaW5nL0VsZW1lbnRSZWZlcmVuY2VDYXB0dXJlLnRzIiwiLi4vLi4vc3JjL1JlbmRlcmluZy9Eb21TcGVjaWF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gICAgbGV0IGxhc3RTZWdtZW50VmFsdWU7XG4gICAgICAgICAgICBpZGVudGlmaWVyLnNwbGl0KFwiLlwiKS5mb3JFYWNoKHNlZ21lbnQgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChzZWdtZW50IGluIHJlc3VsdCkge1xuICAgICAgICAgICAgICAgICAgICBsYXN0U2VnbWVudFZhbHVlID0gcmVzdWx0O1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN1bHRbc2VnbWVudF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYENvdWxkIG5vdCBmaW5kICcke2lkZW50aWZpZXJ9JyAoJyR7c2VnbWVudH0nIHdhcyB1bmRlZmluZWQpLmApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKHJlc3VsdCBpbnN0YW5jZW9mIEZ1bmN0aW9uKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0LmJpbmQobGFzdFNlZ21lbnRWYWx1ZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5fY2FjaGVkRnVuY3Rpb25zLnNldChpZGVudGlmaWVyLCByZXN1bHQpO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFRoZSB2YWx1ZSAnJHtpZGVudGlmaWVyfScgaXMgbm90IGEgZnVuY3Rpb24uYCk7XG4gICAgICAgIH1cbiAgICAgICAgZ2V0V3JhcHBlZE9iamVjdCgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9qc09iamVjdDtcbiAgICAgICAgfVxuICAgIH1cbiAgICBjb25zdCB3aW5kb3dKU09iamVjdElkID0gMDtcbiAgICBjb25zdCBjYWNoZWRKU09iamVjdHNCeUlkID0ge1xuICAgICA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BbXG4gICAgICAgICAgICAgICAgICAgIGFzeW5jSGFuZGxlLFxuICAgICAgICAgICAgICAgICAgICB0cnVlLFxuICAgICAgICAgICAgICAgICAgICBjcmVhdGVKU0NhbGxSZXN1bHQocmVzdWx0LCByZXN1bHRUeXBlKVxuICAgICAgICAgICAgICAgIF0pKS5cbiAgICAgICAgICAgICAgICAgICAgdGhlbihyZXN1bHQgPT4gdGhpcy5fZG90TmV0Q2FsbERpc3BhdGNoZXIuZW5kSW52b2tlSlNGcm9tRG90TmV0KGFzeW5jSGFuZGxlLCB0cnVlLCByZXN1bHQpLCBlcnJvciA9PiB0aGlzLl9kb3ROZXRDYWxsRGlzcGF0Y2hlci5lbmRJbnZva2VKU0Zyb21Eb3ROZXQoYXN5bmNIYW5kbGUsIGZhbHNlLCBKU09OLnN0cmluZ2lmeShbXG4gICAgICAgICAgICAgICAgICAgIGFzeW5jSGFuZGxlLFxuICAgICAgICAgICAgICAgICAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgZm9ybWF0RXJyb3IoZXJyb3IpXG4gICAgICAgICAgICAgICAgXSkpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbmRJbnZva2VEb3ROZXRGcm9tSlMoYXN5bmNDYWxsSWQsIHN1Y2Nlc3MsIHJlc3VsdEpzb25PckV4Y2VwdGlvbk1lc3NhZ2UpIHtcbiAgICAgICAgICAgIGNvbnN0IHJlc3VsdE9yRXJyb3IgPSBzdWNjZXNzXG4gICAgICAgICAgICAgICAgPyBwYXJzZUpzb25XaXRoUmV2aXZlcnModGhpcywgcmVzdWx0SnNvbk9yRXhjZXB0aW9uTWVzc2FnZSlcbiAgICAgICAgICAgICAgICA6IG5ldyBFcnJvcihyZXN1bHRKc29uT3JFeGNlcHRpb25NZXNzYWdlKTtcbiAgICAgICAgICAgIHRoaXMuY29tcGxldGVQZW5kaW5nQ2FsbChwYXJzZUludChhc3luY0NhbGxJZCwgMTApLCBzdWNjZXNzLCByZ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gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNlIGlmICh2YWx1ZS5oYXNPd25Qcm9wZXJ0eShqc09iamVjdElkS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGlkID0gdmFsdWVbanNPYmplY3RJZEtleV07XG4gICAgICAgICAgICAgICAgY29uc3QganNPYmplY3QgPSBjYWNoZWRKU09iamVjdHNCeUlkW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAoanNPYmplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGpzT2JqZWN0LmdldFdyYXBwZWRPYmplY3QoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBKUyBvYmplY3QgaW5zdGFuY2Ugd2l0aCBJZCAnJHtpZH0nIGRvZXMgbm90IGV4aXN0LiBJdCBtYXkgaGF2ZSBiZWVuIGRpc3Bvc2VkLmApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUuaGFzT3duUHJvcGVydHkoYnl0ZUFycmF5UmVmS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gdmFsdWVbYnl0ZUFycmF5UmVmS2V5XTtcbiAgICAgICAgICAgICAgICBjb25zdCBieXRlQXJyYXkgPSBjdXJyZW50Q2FsbERpc3BhdGNoZXIucHJvY2Vzc0J5dGVBcnJheShpbmRleCk7XG4gICAgICAgICAgICAgICAgaWYgKGJ5dGVBcnJheSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgQnl0ZSBhcnJheSBpbmRleCAnJHtpbmRleH0nIGRvZXMgbm90IGV4aXN0LmApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gYnl0ZUFycmF5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSBpZiAodmFsdWUuaGFzT3duUHJvcGVydHkoZG90TmV0U3RyZWFtUmVmS2V5KSkge1xuICAgICAgICAgICAgICAgIGNvbnN0IHN0cmVhbUlkID0gdmFsdWVbZG90TmV0U3RyZWFtUmVmS2V5XTtcbiAgICAgICAgICAgICAgICBjb25zdCBzdHJlYW1Qcm9taXNlID0gY3VycmVudENhbGxEaXNwYXRjaGVyLmdldERvdE5ldFN0cmVhbVByb21pc2Uoc3RyZWFtSWQpO1xuICAgICAgICAgICAgICAgIHJldHVybiBuZXcgRG90TmV0U3RyZWFtKHN0cmVhbVByb21pc2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIFVucmVjb2duaXplZCAtIGxldCBhbm90aGVyIHJldml2ZXIgaGFuZGxlIGl0XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICB9KTtcbiAgICBjbGFzcyBEb3ROZXRTdHJlYW0ge1xuICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tZW1wdHktZnVuY3Rpb25cbiAgICAgICAgY29uc3RydWN0b3IoX3N0cmVhbVByb21pc2UpIHtcbiAgICAgICAgICAgIHRoaXMuX3N0cmVhbVByb21pc2UgPSBfc3RyZWFtUHJvbWlzZTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogU3VwcGxpZXMgYSByZWFkYWJsZSBzdHJlYW0gb2YgZGF0YSBiZWluZyBzZW50IGZyb20gLk5FVC5cbiAgICAgICAgICovXG4gICAgICAgIHN0cmVhbSgpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLl9zdHJlYW1Qcm9taXNlO1xuICAgICAgICB9XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBTdXBwbGllcyBhIGFycmF5IGJ1ZmZlciBvZiBkYXRhIGJlaW5nIHNlbnQgZnJvbSAuTkVULlxuICAgICAgICAgKiBOb3RlIHRoZXJlIGlzIGEgSmF2YVNjcmlwdCBsaW1pdCBvbiB0aGUgc2l6ZSBvZiB0aGU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leChlZGl0KTtcclxuICAgICAgICAgIHJlbW92ZUxvZ2ljYWxDaGlsZChwYXJlbnQsIGNoaWxkSW5kZXhBdEN1cnJlbnREZXB0aCArIHNpYmxpbmdJbmRleCk7XHJcbiAgICAgICAgICB0aGlzLmluc2VydE1hcmt1cChiYXRjaCwgcGFyZW50LCBjaGlsZEluZGV4QXRDdXJyZW50RGVwdGggKyBzaWJsaW5nSW5kZXgsIGZyYW1lKTtcclxuICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIEVkaXRUeXBlLnN0ZXBJbjoge1xyXG4gICAgICAgICAgY29uc3Qgc2libGluZ0luZGV4ID0gZWRpdFJlYWRlci5zaWJsaW5nSW5kZXgoZWRpdCk7XHJcbiAgICAgICAgICBwYXJlbnQgPSBnZXRMb2dpY2FsQ2hpbGQocGFyZW50LCBjaGlsZEluZGV4QXRDdXJyZW50RGVwdGggKyBzaWJsaW5nSW5kZXgpO1xyXG4gICAgICAgICAgY3VycmVudERlcHRoKys7XHJcbiAgICAgICAgICBjaGlsZEluZGV4QXRDdXJyZW50RGVwdGggPSAwO1xyXG4gICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGNhc2UgRWRpdFR5cGUuc3RlcE91dDoge1xyXG4gICAgICAgICAgcGFyZW50ID0gZ2V0TG9naWNhbFBhcmVudChwYXJlbnQpITtcclxuICAgICAgICAgIGN1cnJlbnREZXB0aC0tO1xyXG4gICAgICAgICAgY2hpbGRJbmRleEF0Q3VycmVudERlcHRoID0gY3VycmVudERlcHRoID09PSAwID8gY2hpbGRJbmRleCA6IDA7IC8vIFRoZSBjaGlsZEluZGV4IGlzIG9ubHkgZXZlciBub256ZXJvIGF0IHplcm8gZGVwdGhcclxuICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIH1cclxuICAgICAgICBjYXNlIEVkaXRUeXBlLnBlcm11dGF0aW9uTGlzdEVudHJ5OiB7XHJcbiAgICAgICAg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sR0FDNUNKLEVBQW1CSSxDQUNwQixJQUdIekcsRUFBV3h5QixtQkFBbUJDLEVBQVU2NEIsRUFDekMsQ0FFR0YsR0FDRkMsRUFBa0JoOUIsTUFBTSs4QixHQUN4QnJOLEdBQThCeHJCLE9BQU9FLElBQ2QsSUFBZDA0QixHQUNURSxFQUFrQkssUUFDbEIzTixHQUE4QnhyQixPQUFPRSxJQUVyQzQ0QixFQUFrQk0sUUFBUXQ1QixFQUFLekUsU0FBV3U5QixFQUFZOTRCLEVBQU9BLEVBQUt1NUIsU0FBUyxFQUFHVCxHQUVsRixDWUxFVSxDQUF3QjdHLEVBQVVBLFdBQUV2eUIsRUFBVUosRUFBTTg0QixFQUFXQyxFQUNqRSxDQTdCOENVLEVBQUE5RyxnQkFBQSxFQStCOUNoSCxHQUFPd04sTUFBUXhELEdBQ2Z0N0IsT0FBZSxPQUFJakMsRUUxQ1BzQyxVQUNSQSxTQUFTZy9CLGVBQzRDLFVBQXJEaC9CLFNBQVNnL0IsY0FBYzV6QixhQUFhLGNGMkN0QzZ2QiJ9 From 4d9398be46649426f34c01937a90a63231367305 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Wed, 27 Nov 2024 10:09:43 -0800 Subject: [PATCH 6/8] Don't fail build when blazor.webview.js does not exist --- .azure/pipelines/ci-public.yml | 2 ++ .azure/pipelines/ci.yml | 2 ++ .../src/Microsoft.AspNetCore.Components.WebView.csproj | 9 +++------ .../build/Microsoft.AspNetCore.Components.WebView.props | 8 ++++++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.azure/pipelines/ci-public.yml b/.azure/pipelines/ci-public.yml index a261f21aa78d..2ef9ba8fc297 100644 --- a/.azure/pipelines/ci-public.yml +++ b/.azure/pipelines/ci-public.yml @@ -653,6 +653,8 @@ stages: displayName: Update submodules - script: ./restore.cmd displayName: Run restore.cmd + - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS + displayName: Build (No NodeJS) - script: npm run build displayName: Build JS - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index a6d27309e446..3952b81304a8 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -719,6 +719,8 @@ extends: displayName: Update submodules - script: ./restore.cmd displayName: Run restore.cmd + - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS + displayName: Build (No NodeJS) - script: npm run build displayName: Build JS - script: ./eng/build.cmd -all -noBuildJava -pack -c Debug diff --git a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj index 6cdb8b3b88b2..b7885017574a 100644 --- a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj +++ b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj @@ -62,17 +62,14 @@ ..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename) - + - - - ..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename) - + - + diff --git a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props index c11bc3b1380c..15ea80456007 100644 --- a/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props +++ b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props @@ -22,7 +22,15 @@ <_WebViewAssetCandidates Include="$(_BlazorModulesFilePath)" Condition="'@(_ExistingBuildJSModules)' == ''"> _framework/blazor.modules.json + + <_MissingWebViewAssetCandidates + Include="@(_WebViewAssetCandidates)" + Condition="!EXISTS('%(Identity)')" /> + <_WebViewAssetCandidates Remove="@(_MissingWebViewAssetCandidates)" /> + + + Date: Wed, 27 Nov 2024 11:24:06 -0800 Subject: [PATCH 7/8] Fix -NoNodeJS validation --- .azure/pipelines/ci-public.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/ci-public.yml b/.azure/pipelines/ci-public.yml index 2ef9ba8fc297..858bb1d3af96 100644 --- a/.azure/pipelines/ci-public.yml +++ b/.azure/pipelines/ci-public.yml @@ -653,7 +653,7 @@ stages: displayName: Update submodules - script: ./restore.cmd displayName: Run restore.cmd - - script: ./eng/build.cmd -all -noBuildJava -noBuildNodeJS + - script: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" displayName: Build (No NodeJS) - script: npm run build displayName: Build JS From 225d612c0a42f7b2e825c0bfd8e079bfb1237d63 Mon Sep 17 00:00:00 2001 From: Mackinnon Buck Date: Wed, 27 Nov 2024 11:41:39 -0800 Subject: [PATCH 8/8] Another fix --- .azure/pipelines/ci-public.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure/pipelines/ci-public.yml b/.azure/pipelines/ci-public.yml index 858bb1d3af96..eafc8b86f0e4 100644 --- a/.azure/pipelines/ci-public.yml +++ b/.azure/pipelines/ci-public.yml @@ -653,7 +653,7 @@ stages: displayName: Update submodules - script: ./restore.cmd displayName: Run restore.cmd - - script: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" + - powershell: ./eng/build.ps1 -all -noBuildJava -noBuildNodeJS "-WarnAsError:false" displayName: Build (No NodeJS) - script: npm run build displayName: Build JS