Files
Leader.TeaShop.SG/bin/wwwroot/_framework/blazor.web.js

2 lines
196 KiB
JavaScript
Raw Normal View History

2026-04-17 17:28:37 +08:00
!function(){"use strict";var e;let t;var n,o;!function(e){const t=[],n="__jsObjectId",o="__dotNetObject",r="__byte[]",i="__dotNetStream",s="__jsStreamReferenceLength";let a,c,l;class h{constructor(e){this._jsObject=e,this._cachedHandlers=new Map}resolveInvocationHandler(e,t){var n;const o=null===(n=this._cachedHandlers.get(e))||void 0===n?void 0:n[t];if(o)return o;const[r,i]=E(this._jsObject,e),s=function(e,t,n,o){switch(n){case l.FunctionCall:const n=e[t];if(n instanceof Function)return n.bind(e);throw new Error(`The value '${o}' is not a function.`);case l.ConstructorCall:const r=e[t];if(r instanceof Function){const t=r.bind(e);return(...e)=>new t(...e)}throw new Error(`The value '${o}' is not a function.`);case l.GetValue:if(!function(e,t){if(!(t in e))return!1;for(;void 0!==e;){const n=Object.getOwnPropertyDescriptor(e,t);if(n)return!!n.hasOwnProperty("value")||n.hasOwnProperty("get")&&"function"==typeof n.get;e=Object.getPrototypeOf(e)}return!1}(e,t))throw new Error(`The property '${o}' is not defined or is not readable.`);return()=>e[t];case l.SetValue:if(!function(e,t){if(!(t in e))return Object.isExtensible(e);for(;void 0!==e;){const n=Object.getOwnPropertyDescriptor(e,t);if(n)return!(!n.hasOwnProperty("value")||!n.writable)||n.hasOwnProperty("set")&&"function"==typeof n.set;e=Object.getPrototypeOf(e)}return!1}(e,t))throw new Error(`The property '${o}' is not writable.`);return(...n)=>e[t]=n[0]}}(r,i,t,e);return this.addHandlerToCache(e,s,t),s}getWrappedObject(){return this._jsObject}addHandlerToCache(e,t,n){const o=this._cachedHandlers.get(e);o?o[n]=t:this._cachedHandlers.set(e,{[n]:t})}}!function(e){e[e.FunctionCall=1]="FunctionCall",e[e.ConstructorCall=2]="ConstructorCall",e[e.GetValue=3]="GetValue",e[e.SetValue=4]="SetValue"}(l=e.JSCallType||(e.JSCallType={}));const d=0,u={[d]:new h(window)};u[0]._cachedHandlers.set("import",{[l.FunctionCall]:e=>("string"==typeof e&&e.startsWith("./")&&(e=new URL(e.substring(2),document.baseURI).toString()),import(e))});let p,f=1;function g(e){t.push(e)}function m(e){if(null==e)return{[n]:-1};if(e&&("object"==typeof e||e instanceof Function)){u[f]=new h(e);const t={[n]:f};return f++,t}throw new Error(`Cannot create a JSObjectReference from the value '${e}'.`)}function y(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 o={[s]:t};try{const t=m(e);o[n]=t[n]}catch(t){throw new Error(`Cannot create a JSStreamReference from the value '${e}'.`)}return o}function v(e,n){c=e;const o=n?JSON.parse(n,((e,n)=>t.reduce(((t,n)=>n(e,t)),n))):null;return c=void 0,o}function w(){if(void 0===a)throw new Error("No call dispatcher has been set.");if(null===a)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 a}e.attachDispatcher=function(e){const t=new b(e);return void 0===a?a=t:a&&(a=null),t},e.attachReviver=g,e.invokeMethod=function(e,t,...n){return w().invokeDotNetStaticMethod(e,t,...n)},e.invokeMethodAsync=function(e,t,...n){return w().invokeDotNetStaticMethodAsync(e,t,...n)},e.createJSObjectReference=m,e.createJSStreamReference=y,e.disposeJSObjectReference=function(e){const t=e&&e[n];"number"==typeof t&&-1!==t&&C(t)},function(e){e[e.Default=0]="Default",e[e.JSObjectReference=1]="JSObjectReference",e[e.JSStreamReference=2]="JSStreamReference",e[e.JSVoidResult=3]="JSVoidResult"}(p=e.JSCallResultType||(e.JSCallResultType={}));class b{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,o,r){const i=T(this.processJSCall(o,e,r,t),n);return null==i?null:D(this,i)}async beginInvokeJSFromDotN