(()=>{"use strict";vare,t,n;!function(e){window.DotNet=e;constt=[],n=newMap,r=newMap,o="__jsObjectId",s="__byte[]";classa{constructor(e){this._jsObject=e,this._cachedFunctions=newMap}findFunction(e){constt=this._cachedFunctions.get(e);if(t)returnt;letn,r=this._jsObject;if(e.split(".").forEach((t=>{if(!(tinr))thrownewError(`Could not find '${e}' ('${t}' was undefined).`);n=r,r=r[t]})),rinstanceofFunction)returnr=r.bind(n),this._cachedFunctions.set(e,r),r;thrownewError(`The value '${e}' is not a function.`)}getWrappedObject(){returnthis._jsObject}}consti={},c={0:newa(window)};c[0]._cachedFunctions.set("import",(e=>("string"==typeofe&&e.startsWith("./")&&(e=document.baseURI+e.substr(2)),import(e))));letl,u=1,d=1,f=null;functionm(e){t.push(e)}functionh(e){if(e&&"object"==typeofe){c[d]=newa(e);constt={[o]:d};returnd++,t}thrownewError(`Cannot create a JSObjectReference from the value '${e}'.`)}functionp(e){lett=-1;if(einstanceofArrayBuffer&&(e=newUint8Array(e)),einstanceofBlob)t=e.size;else{if(!(e.bufferinstanceofArrayBuffer))thrownewError("Supplied value is not a typed array or blob.");if(void0===e.byteLength)thrownewError(`Cannot create a JSStreamReference from the value '${e}' as it doesn't have a byteLength.`);t=e.byteLength}constn={__jsStreamReferenceLength:t};try{constt=h(e);n.__jsObjectId=t.__jsObjectId}catch(t){thrownewError(`Cannot create a JSStreamReference from the value '${e}'.`)}returnn}functiony(e){returne?JSON.parse(e,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null}functiong(e,t,n,r){consto=w();if(o.invokeDotNetFromJS){consts=k(r),a=o.invokeDotNetFromJS(e,t,n,s);returna?y(a):null}thrownewError("The current dispatcher does not support synchronous calls from JS to .NET. Use invokeMethodAsync instead.")}functionb(e,t,n,r){if(e&&n)thrownewError(`For instance method calls, assemblyName should be null. Received '${e}'.`);consto=u++,s=newPromise(((e,t)=>{i[o]={resolve:e,reject:t}}));try{consts=k(r);w().beginInvokeDotNetFromJS(o,e,t,n,s)}catch(e){v(o,!1,e)}returns}functionw(){if(null!==f)returnf;thrownewError("No .NET call dispatcher has been set.")}functionv(e,t,n){if(!i.hasOwnProperty(e))thrownewError(`There is no pending async call with ID ${e}.`);constr=i[e];deletei[e],t?r.resolve(n):r.reject(n)}functionE(e){returneinstanceofError?`${e.message}\n${e.stack}`:e?e.toString():"null"}function_(e,t){constn=c[t];if(n)returnn.findFunction(e);thrownewError(`JS object instance with ID ${t} does not exist (has it been disposed?).`)}functionC(e){deletec[e]}e.attachDispatcher=function(e){f=e},e.attachReviver=m,e.invokeMethod=function(e,t,...n){returng(e,t,null,n)},e.invokeMethodAsync=function(e,t,...n){returnb(e,t,null,n)},e.createJSObjectReference=h,e.createJSStreamReference=p,e.disposeJSObjectReference=function(e){constt=e&&e.__jsObjectId;"number"==typeoft&&C(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(l=e.JSCallResultType||(e.JSCallResultType={})),e.jsCallDispatcher={findJSFunction:_,disposeJSObjectReferenceById:C,invokeJSFromDotNet:(e,t,n,r)=>{consto=R(_(e,r).apply(null,y(t)),n);returnnull==o?null:k(o)},beginInvokeJSFromDotNet:(e,t,n,r,o)=>{consts=newPromise((e=>{e(_(t,o).apply(null,y(n)))}));e&&s.then((t=>k([e,!0,R(t,r)]))).then((t=>w().endInvokeJSFromDotNet(e,!0,t)),(t=>w().endInvokeJSFromDotNet(e,!1,JSON.stringify([e,!1,E(t)]))))},endInvokeDotNetFromJS:(e,t,n)=>{constr=t?y(n):newError(n);v(parseInt(e,10),t,r)},receiveByteArray:(e,t)=>{n.set(e,t)},supplyDotNetStream:(e,t)=>{if(r.has(e)){constn=r.get(e);r.delete(e),n.resolve(t)}else{constn=newS;n.resolve(t),r.set(e,n)}}};classA{constructor(e){this._id=e}invokeMethod(e,...t){returng(null,e,this._id,t)}invokeMethodAsync(e,...t){returnb(null,e,this._id,t)}dispose(){b(null,"__Dispose",this._id,null).catch((e=>console.error(e)))}serializeAsArg(){return{__dotNetObject:this._id}}}e.DotNetObject=A,m((function(e,t){if(t&&"object"==typeoft){if(t.hasOwnProperty("__dot