async function ortWasmThreaded(moduleArg={}){var moduleRtn;var g=moduleArg,aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope,l=globalThis.process?.versions?.node&&"renderer"!=globalThis.process?.type,n=ba&&self.name?.startsWith("em-pthread");if(l){const {createRequire:a}=await import("module");var require=a(import.meta.url),ca=require("worker_threads");global.Worker=ca.Worker;n=(ba=!ca.me)&&"em-pthread"==ca.workerData}g.mountExternalData=(a,b)=>{a.startsWith("./")&&(a=a.substring(2));(g.Uc||(g.Uc=new Map)).set(a,b)};
g.unmountExternalData=()=>{delete g.Uc};var SharedArrayBuffer=globalThis.SharedArrayBuffer??(new WebAssembly.Memory({initial:0,maximum:0,shared:!0})).buffer.constructor;
let ea=()=>{const a=b=>(...c)=>{const d=q;c=b(...c);return q!=d?da():c};(b=>{for(const c of b)g[c]=a(g[c])})(["_OrtAppendExecutionProvider","_OrtCreateSession","_OrtRun","_OrtRunWithBinding","_OrtBindInput"]);"undefined"!==typeof jsepRunAsync&&(g._OrtRun=jsepRunAsync(g._OrtRun),g._OrtRunWithBinding=jsepRunAsync(g._OrtRunWithBinding));ea=void 0};g.asyncInit=()=>{ea?.()};var fa="./this.program",ha=(a,b)=>{throw b;},ia=import.meta.url,ja="",ka,la;
if(l){var fs=require("fs");ia.startsWith("file:")&&(ja=require("path").dirname(require("url").fileURLToPath(ia))+"/");la=a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a)};ka=async a=>{a=ma(a)?new URL(a):a;return fs.readFileSync(a,void 0)};1<process.argv.length&&(fa=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);ha=(a,b)=>{process.exitCode=a;throw b;}}else if(aa||ba){try{ja=(new URL(".",ia)).href}catch{}l||(ba&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";
b.send(null);return new Uint8Array(b.response)}),ka=async a=>{if(ma(a))return new Promise((c,d)=>{var e=new XMLHttpRequest;e.open("GET",a,!0);e.responseType="arraybuffer";e.onload=()=>{200==e.status||0==e.status&&e.response?c(e.response):d(e.status)};e.onerror=d;e.send(null)});var b=await fetch(a,{credentials:"same-origin"});if(b.ok)return b.arrayBuffer();throw Error(b.status+" : "+b.url);})}var na=console.log.bind(console),oa=console.error.bind(console);
if(l){var pa=require("util"),qa=a=>"object"==typeof a?pa.inspect(a):a;na=(...a)=>fs.writeSync(1,a.map(qa).join(" ")+"\n");oa=(...a)=>fs.writeSync(2,a.map(qa).join(" ")+"\n")}var ra=na,t=oa,sa,ta,ua=!1,va,ma=a=>a.startsWith("file://");function u(){v.buffer!=w.buffer&&wa()}var xa,ya;
if(l&&n){var Aa=ca.parentPort;Aa.on("message",a=>global.onmessage?.({data:a}));Object.assign(globalThis,{self:global,postMessage:a=>Aa.postMessage(a)});process.on("uncaughtException",a=>{postMessage({Oc:"uncaughtException",error:a});process.exit(1)})}var Ba;
if(n){var Ca=!1;self.onunhandledrejection=b=>{throw b.reason||b;};function a(b){try{var c=b.data,d=c.Oc;if("load"===d){let e=[];self.onmessage=f=>e.push(f);Ba=()=>{postMessage({Oc:"loaded"});for(let f of e)a(f);self.onmessage=a};for(const f of c.ce)if(!g[f]||g[f].proxy)g[f]=(...h)=>{postMessage({Oc:"callHandler",be:f,args:h})},"print"==f&&(ra=g[f]),"printErr"==f&&(t=g[f]);v=c.ie;wa();ta=c.je;Da();Ea()}else if("run"===d){Fa(c.Nc);Ga(c.Nc,0,0,1,0,0);Ha();Ia(c.Nc);Ca||(Ja(),Ca=!0);try{Ka(c.ge,c.Wc)}catch(e){if("unwind"!=
e)throw e;}}else"setimmediate"!==c.target&&("checkMailbox"===d?Ca&&La():d&&(t(`worker: received unknown command ${d}`),t(c)))}catch(e){throw Ma(),e;}}self.onmessage=a}var w,x,Na,Oa,A,B,Pa,E,F,Qa,Ra=!1;function wa(){var a=v.buffer;g.HEAP8=w=new Int8Array(a);Na=new Int16Array(a);g.HEAPU8=x=new Uint8Array(a);Oa=new Uint16Array(a);g.HEAP32=A=new Int32Array(a);g.HEAPU32=B=new Uint32Array(a);Pa=new Float32Array(a);E=new Float64Array(a);F=new BigInt64Array(a);Qa=new BigUint64Array(a)}
function Sa(){Ra=!0;n?Ba():G._b()}function Ta(a){a="Aborted("+a+")";t(a);ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ya?.(a);throw a;}var Ua;async function Va(a){if(!sa)try{var b=await ka(a);return new Uint8Array(b)}catch{}if(a==Ua&&sa)a=new Uint8Array(sa);else if(la)a=la(a);else throw"both async and sync fetching of the wasm failed";return a}
async function Wa(a,b){try{var c=await Va(a);return await WebAssembly.instantiate(c,b)}catch(d){t(`failed to asynchronously prepare wasm: ${d}`),Ta(d)}}async function Xa(a){var b=Ua;if(!sa&&!ma(b)&&!l)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){t(`wasm streaming compile failed: ${d}`),t("falling back to ArrayBuffer instantiation")}return Wa(b,a)}
function Ya(){Za={f:$a,J:ab,k:bb,p:cb,l:db,sa:eb,b:fb,ca:gb,Ja:hb,q:ib,da:jb,Za:kb,Fa:lb,Ha:mb,_a:nb,Xa:ob,Qa:pb,Wa:qb,oa:rb,Ga:sb,Xb:tb,Ya:ub,Yb:vb,db:wb,Da:xb,Sb:zb,Qb:Ab,Ca:Cb,M:Db,I:Eb,Rb:Fb,ja:Gb,Tb:Hb,Ta:Ib,Vb:Jb,Ka:Kb,Ob:Lb,ka:Mb,Sa:Ia,ab:Nb,U:Ob,n:Pb,c:Qb,rb:Rb,w:Sb,L:Tb,z:Ub,j:Vb,o:Wb,sb:Xb,G:Yb,T:Zb,h:$b,u:ac,m:bc,i:cc,Na:dc,Oa:ec,Pa:fc,La:gc,Ma:hc,Pb:ic,eb:jc,cb:kc,Y:lc,qb:mc,la:nc,bb:oc,fb:pc,$a:qc,Wb:rc,N:sc,gb:tc,X:uc,Ub:vc,nb:wc,C:xc,ra:yc,qa:zc,pb:Ac,W:Bc,v:Cc,mb:Dc,lb:Ec,kb:Fc,ob:Gc,
jb:Hc,ib:Ic,hb:Jc,Ua:Kc,Va:Lc,Ia:Mc,V:Nc,na:Oc,Ra:Pc,ma:Qc,Cb:Rc,xa:Sc,Db:Tc,ya:Uc,F:Vc,e:Wc,s:Xc,x:Yc,B:Zc,Fb:$c,ba:ad,D:bd,za:cd,$:dd,ga:ed,Gb:fd,Hb:gd,Ba:hd,Aa:jd,Ib:kd,wa:ld,aa:md,d:nd,A:od,r:pd,Bb:qd,t:rd,y:sd,H:td,E:ud,K:vd,R:wd,ia:xd,_:yd,Jb:zd,Kb:Ad,g:Bd,a:v,Nb:Cd,Eb:Dd,ha:Ed,O:Fd,pa:Gd,Lb:Hd,ta:Id,Q:Jd,yb:Kd,zb:Ld,ua:Md,ea:Nd,P:Od,Ea:Pd,va:Qd,Z:Rd,wb:Sd,Zb:Td,S:Ud,Ab:Vd,tb:Wd,ub:Xd,vb:Yd,fa:Zd,xb:$d,Mb:ae};return{a:Za}}
async function Da(){function a(d,e){var f=G=d.exports;d={};for(let [h,k]of Object.entries(f))"function"==typeof k?(f=be(k),d[h]=f):d[h]=k;G=d;G=ce();de.push(G.id);d=G;ee=d.$b;Ja=d.ac;g._OrtInit=d.bc;g._OrtGetLastError=d.cc;g._OrtCreateSessionOptions=d.dc;g._OrtAppendExecutionProvider=d.ec;g._OrtAddFreeDimensionOverride=d.fc;g._OrtAddSessionConfigEntry=d.gc;g._OrtReleaseSessionOptions=d.hc;g._OrtCreateSession=d.ic;g._OrtReleaseSession=d.jc;g._OrtGetInputOutputCount=d.kc;g._OrtGetInputOutputMetadata=
d.lc;g._OrtFree=d.mc;g._OrtCreateTensor=d.nc;g._OrtGetTensorData=d.oc;g._OrtReleaseTensor=d.pc;g._OrtCreateRunOptions=d.qc;g._OrtAddRunConfigEntry=d.rc;g._OrtReleaseRunOptions=d.sc;g._OrtCreateBinding=d.tc;g._OrtBindInput=d.uc;g._OrtBindOutput=d.vc;g._OrtClearBoundOutputs=d.wc;g._OrtReleaseBinding=d.xc;g._OrtRunWithBinding=d.yc;g._OrtRun=d.zc;g._OrtEndProfiling=d.Ac;fe=g._OrtGetWebGpuDevice=d.Bc;ge=d.Cc;H=g._free=d.Dc;he=g._malloc=d.Ec;ie=g._wgpuBufferRelease=d.Fc;je=g._wgpuCreateInstance=d.Gc;ke=
d.Hc;le=d.Ic;me=d.Jc;ne=d.Kc;oe=d.Lc;pe=d.Pc;qe=d.Zc;re=d._c;se=d.$c;te=d.bd;ue=d.cd;ve=d.dd;we=d.ed;xe=d.fd;ye=d.gd;ze=d.hd;Ga=d.kd;Ma=d.ld;Ae=d.md;Be=d.nd;Ce=d.od;De=d.pd;Ee=d.qd;Fe=d.rd;I=d.sd;Ge=d.td;He=d.ud;J=d.vd;Ie=d.wd;K=d.xd;Je=d.yd;Ke=d.zd;Le=d.Ad;Me=d.Bd;dynCall_vii=d.Cd;Ne=d.Dd;dynCall_v=d.Ed;Oe=d.Fd;Pe=d.Gd;Qe=d.Hd;dynCall_iii=d.Id;Re=d.Jd;Se=d.Kd;Te=d.Ld;dynCall_vi=d.Md;Ue=d.Nd;Ve=d.Od;We=d.Pd;Xe=d.Qd;Ye=d.Rd;Ze=d.Td;$e=d.Ud;af=d.Vd;bf=d.Wd;cf=d.Yd;df=d.Zd;ef=d._d;ff=d.$d;gf=d.ae;hf=
d.oe;jf=d.pe;kf=d.qe;lf=d.re;mf=d.se;nf=d.te;of=d.ue;pf=d.ve;qf=d.we;rf=d.xe;sf=d.ye;tf=d.Ye;uf=d.Ze;vf=d._e;wf=d.$e;ta=e;return G}var b=Ya();if(g.instantiateWasm)return new Promise(d=>{g.instantiateWasm(b,(e,f)=>{d(a(e,f))})});if(n){var c=new WebAssembly.Instance(ta,Ya());return a(c,ta)}Ua??=g.locateFile?g.locateFile?g.locateFile("ort-wasm-simd-threaded.asyncify.wasm",ja):ja+"ort-wasm-simd-threaded.asyncify.wasm":(new URL("ort-wasm-simd-threaded.asyncify.wasm",import.meta.url)).href;return function(d){return a(d.instance,
d.module)}(await Xa(b))}class xf{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var yf=a=>{a.terminate();a.onmessage=()=>{}},zf=[],Af=0,Bf=null,Hf=a=>{0==Cf.length&&(Df(),Ef(Cf[0]));var b=Cf.pop();if(!b)return 6;Ff.push(b);Gf[a.Nc]=b;b.Nc=a.Nc;var c={Oc:"run",ge:a.fe,Wc:a.Wc,Nc:a.Nc};l&&b.unref();b.postMessage(c,a.Yc);return 0},L=0,M=(a,b,...c)=>{var d=16*c.length,e=K(),f=Ie(d),h=f>>>3,k;for(k of c)"bigint"==typeof k?((u(),F)[h++>>>0]=1n,(u(),F)[h++>>>0]=k):((u(),F)[h++>>>0]=0n,(u(),E)[h++>>>0]=k);a=Ae(a,0,d,f,b);J(e);return a};
function Cd(a){if(n)return M(0,1,a);va=a;if(!(0<L)){for(var b of Ff)yf(b);for(b of Cf)yf(b);Cf=[];Ff=[];Gf={};ua=!0}ha(a,new xf(a))}function If(a){if(n)return M(1,0,a);Mc(a)}var Mc=a=>{va=a;if(n)throw If(a),"unwind";Cd(a)},Cf=[],Ff=[],de=[],Gf={};function Jf(){for(var a=g.numThreads-1;a--;)Df();zf.push(async()=>{var b=Kf();Af++;await b;Af--;0==Af&&Bf&&(b=Bf,Bf=null,b())})}var Lf=a=>{var b=a.Nc;delete Gf[b];Cf.push(a);Ff.splice(Ff.indexOf(a),1);a.Nc=0;Be(b)};function Ha(){de.forEach(a=>a())}
var Ef=a=>new Promise(b=>{a.onmessage=f=>{var h=f.data;f=h.Oc;if(h.Vc&&h.Vc!=ge()){var k=Gf[h.Vc];k?k.postMessage(h,h.Yc):t(`Internal error! Worker sent a message "${f}" to target pthread ${h.Vc}, but that thread no longer exists!`)}else if("checkMailbox"===f)La();else if("spawnThread"===f)Hf(h);else if("cleanupThread"===f)N(()=>{Lf(Gf[h.he])});else if("loaded"===f)a.loaded=!0,l&&!a.Nc&&a.unref(),b(a);else if("setimmediate"===h.target)a.postMessage(h);else if("uncaughtException"===f)a.onerror(h.error);
else if("callHandler"===f)g[h.be](...h.args);else f&&t(`worker sent an unknown command ${f}`)};a.onerror=f=>{t(`${"worker sent an error!"} ${f.filename}:${f.lineno}: ${f.message}`);throw f;};l&&(a.on("message",f=>a.onmessage({data:f})),a.on("error",f=>a.onerror(f)));var c=[],d=[],e;for(e of d)g.propertyIsEnumerable(e)&&c.push(e);a.postMessage({Oc:"load",ce:c,ie:v,je:ta})});async function Kf(){if(!n)return Promise.all(Cf.map(Ef))}
function Df(){var a=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});Cf.push(a)}function Fa(a){var b=(u(),B)[a+52>>>2>>>0];a=(u(),B)[a+56>>>2>>>0];He(b,b-a);J(b)}var Ka=(a,b)=>{L=0;a=Ne(a,b);0<L?va=a:Ce(a)},v,Mf=[],Nf=0,O=a=>-9007199254740992>a||9007199254740992<a?NaN:Number(a);function $a(a){a>>>=0;var b=new Of(a);0==(u(),w)[b.Qc+12>>>0]&&(Pf(b,!0),Nf--);Qf(b,!1);Mf.push(b);return Me(a)}
var Rf=0,ab=()=>{I(0,0);var a=Mf.pop();Je(a.Xc);Rf=0};function Pf(a,b){b=b?1:0;(u(),w)[a.Qc+12>>>0]=b}function Qf(a,b){b=b?1:0;(u(),w)[a.Qc+13>>>0]=b}class Of{constructor(a){this.Xc=a;this.Qc=a-24}}var Sf=a=>{var b=Rf;if(!b)return Ge(0),0;var c=new Of(b);(u(),B)[c.Qc+16>>>2>>>0]=b;var d=(u(),B)[c.Qc+4>>>2>>>0];if(!d)return Ge(0),b;for(var e of a){if(0===e||e===d)break;if(Le(e,d,c.Qc+16))return Ge(e),b}Ge(d);return b};function bb(){return Sf([])}function cb(a){return Sf([a>>>0])}
function db(a,b,c,d){return Sf([a>>>0,b>>>0,c>>>0,d>>>0])}var eb=()=>{var a=Mf.pop();a||Ta("no exception to throw");var b=a.Xc;0==(u(),w)[a.Qc+13>>>0]&&(Mf.push(a),Qf(a,!0),Pf(a,!1),Nf++);Ke(b);Rf=b;throw Rf;};function fb(a,b,c){a>>>=0;var d=new Of(a);b>>>=0;c>>>=0;(u(),B)[d.Qc+16>>>2>>>0]=0;(u(),B)[d.Qc+4>>>2>>>0]=b;(u(),B)[d.Qc+8>>>2>>>0]=c;Ke(a);Rf=a;Nf++;throw Rf;}var gb=()=>Nf;function Tf(a,b,c,d){return n?M(2,1,a,b,c,d):hb(a,b,c,d)}
function hb(a,b,c,d){a>>>=0;b>>>=0;c>>>=0;d>>>=0;if(!globalThis.SharedArrayBuffer)return 6;var e=[];if(n&&0===e.length)return Tf(a,b,c,d);a={fe:c,Nc:a,Wc:d,Yc:e};return n?(a.Oc="spawnThread",postMessage(a,e),0):Hf(a)}function ib(a){Rf||=a>>>0;throw Rf;}
var Uf=globalThis.TextDecoder&&new TextDecoder,Vf=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},Wf=(a,b=0,c,d)=>{b>>>=0;c=Vf(a,b,c,d);if(16<c-b&&a.buffer&&Uf)return Uf.decode(a.buffer instanceof ArrayBuffer?a.subarray(b,c):a.slice(b,c));for(d="";b<c;){var e=a[b++];if(e&128){var f=a[b++]&63;if(192==(e&224))d+=String.fromCharCode((e&31)<<6|f);else{var h=a[b++]&63;e=224==(e&240)?(e&15)<<12|f<<6|h:(e&7)<<18|f<<12|h<<6|a[b++]&63;65536>e?d+=String.fromCharCode(e):(e-=65536,d+=String.fromCharCode(55296|
e>>10,56320|e&1023))}}else d+=String.fromCharCode(e)}return d},Xf=(a,b,c)=>(a>>>=0)?Wf((u(),x),a,b,c):"";function jb(a,b,c){return n?M(3,1,a,b,c):0}function kb(a,b){if(n)return M(4,1,a,b)}function lb(a,b){if(n)return M(5,1,a,b)}function mb(a,b,c){if(n)return M(6,1,a,b,c)}function nb(a,b,c){return n?M(7,1,a,b,c):0}function ob(a,b){if(n)return M(8,1,a,b)}function pb(a,b,c){if(n)return M(9,1,a,b,c)}function qb(a,b,c,d){if(n)return M(10,1,a,b,c,d)}function rb(a,b,c,d){if(n)return M(11,1,a,b,c,d)}
function sb(a,b,c,d){if(n)return M(12,1,a,b,c,d)}function tb(a){if(n)return M(13,1,a)}function ub(a,b){if(n)return M(14,1,a,b)}function vb(a,b,c){if(n)return M(15,1,a,b,c)}var wb=()=>Ta(""),P=a=>{a>>>=0;for(var b="";;){var c=(u(),x)[a++>>>0];if(!c)return b;b+=String.fromCharCode(c)}},Yf={},Zf={},$f={},ag=class extends Error{constructor(a){super(a);this.name="BindingError"}};
function bg(a,b,c={}){var d=b.name;if(!a)throw new ag(`type "${d}" must have a positive integer typeid pointer`);if(Zf.hasOwnProperty(a)){if(c.de)return;throw new ag(`Cannot register type '${d}' twice`);}Zf[a]=b;delete $f[a];Yf.hasOwnProperty(a)&&(b=Yf[a],delete Yf[a],b.forEach(e=>e()))}function Q(a,b,c={}){return bg(a,b,c)}
var cg=(a,b,c)=>{switch(b){case 1:return c?d=>(u(),w)[d>>>0]:d=>(u(),x)[d>>>0];case 2:return c?d=>(u(),Na)[d>>>1>>>0]:d=>(u(),Oa)[d>>>1>>>0];case 4:return c?d=>(u(),A)[d>>>2>>>0]:d=>(u(),B)[d>>>2>>>0];case 8:return c?d=>(u(),F)[d>>>3>>>0]:d=>(u(),Qa)[d>>>3>>>0];default:throw new TypeError(`invalid integer width (${b}): ${a}`);}};
function xb(a,b,c,d,e){a>>>=0;c>>>=0;b=P(b>>>0);d=0n===d;let f=h=>h;if(d){const h=8*c;f=k=>BigInt.asUintN(h,k);e=f(e)}Q(a,{name:b,Mc:f,Sc:(h,k)=>{"number"==typeof k&&(k=BigInt(k));return k},Rc:cg(b,c,!d),Tc:null})}function zb(a,b,c,d){a>>>=0;b=P(b>>>0);Q(a,{name:b,Mc:function(e){return!!e},Sc:function(e,f){return f?c:d},Rc:function(e){return this.Mc((u(),x)[e>>>0])},Tc:null})}var dg=[],eg=[0,1,,1,null,1,!0,1,!1,1];function Qb(a){a>>>=0;9<a&&0===--eg[a+1]&&(eg[a]=void 0,dg.push(a))}
var R=a=>{if(!a)throw new ag(`Cannot use deleted val. handle = ${a}`);return eg[a]},S=a=>{switch(a){case void 0:return 2;case null:return 4;case !0:return 6;case !1:return 8;default:const b=dg.pop()||eg.length;eg[b]=a;eg[b+1]=1;return b}};function fg(a){return this.Mc((u(),B)[a>>>2>>>0])}var gg={name:"emscripten::val",Mc:a=>{var b=R(a);Qb(a);return b},Sc:(a,b)=>S(b),Rc:fg,Tc:null};function Ab(a){return Q(a>>>0,gg)}
var hg=(a,b)=>{switch(b){case 4:return function(c){return this.Mc((u(),Pa)[c>>>2>>>0])};case 8:return function(c){return this.Mc((u(),E)[c>>>3>>>0])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}};function Cb(a,b,c){a>>>=0;c>>>=0;b=P(b>>>0);Q(a,{name:b,Mc:d=>d,Sc:(d,e)=>e,Rc:hg(b,c),Tc:null})}function Db(a,b,c,d,e){a>>>=0;c>>>=0;b=P(b>>>0);let f=k=>k;if(0===d){var h=32-8*c;f=k=>k<<h>>>h;e=f(e)}Q(a,{name:b,Mc:f,Sc:(k,m)=>m,Rc:cg(b,c,0!==d),Tc:null})}
function Eb(a,b,c){function d(f){var h=(u(),B)[f>>>2>>>0];f=(u(),B)[f+4>>>2>>>0];return new e((u(),w).buffer,f,h)}a>>>=0;var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][b];c=P(c>>>0);Q(a,{name:c,Mc:d,Rc:d},{de:!0})}
var T=(a,b,c)=>{var d=(u(),x);b>>>=0;if(0<c){var e=b;c=b+c-1;for(var f=0;f<a.length;++f){var h=a.codePointAt(f);if(127>=h){if(b>=c)break;d[b++>>>0]=h}else if(2047>=h){if(b+1>=c)break;d[b++>>>0]=192|h>>6;d[b++>>>0]=128|h&63}else if(65535>=h){if(b+2>=c)break;d[b++>>>0]=224|h>>12;d[b++>>>0]=128|h>>6&63;d[b++>>>0]=128|h&63}else{if(b+3>=c)break;d[b++>>>0]=240|h>>18;d[b++>>>0]=128|h>>12&63;d[b++>>>0]=128|h>>6&63;d[b++>>>0]=128|h&63;f++}}d[b>>>0]=0;a=b-e}else a=0;return a},U=a=>{for(var b=0,c=0;c<a.length;++c){var d=
a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b};
function Fb(a,b){a>>>=0;b=P(b>>>0);Q(a,{name:b,Mc(c){var d=(u(),B)[c>>>2>>>0];d=Xf(c+4,d,!0);H(c);return d},Sc(c,d){d instanceof ArrayBuffer&&(d=new Uint8Array(d));var e="string"==typeof d;if(!(e||ArrayBuffer.isView(d)&&1==d.BYTES_PER_ELEMENT))throw new ag("Cannot pass non-string to std::string");var f=e?U(d):d.length;var h=he(4+f+1),k=h+4;(u(),B)[h>>>2>>>0]=f;e?T(d,k,f+1):(u(),x).set(d,k>>>0);null!==c&&c.push(H,h);return h},Rc:fg,Tc(c){H(c)}})}
var ig=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,jg=(a,b,c)=>{a>>>=1;b=Vf((u(),Oa),a,b/2,c);if(16<b-a&&ig)return ig.decode((u(),Oa).slice(a,b));for(c="";a<b;++a){var d=(u(),Oa)[a>>>0];c+=String.fromCharCode(d)}return c},kg=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var d=b;c=c<2*a.length?c/2:a.length;for(var e=0;e<c;++e){var f=a.charCodeAt(e);(u(),Na)[b>>>1>>>0]=f;b+=2}(u(),Na)[b>>>1>>>0]=0;return b-d},lg=a=>2*a.length,mg=(a,b,c)=>{var d="";a>>>=2;for(var e=0;!(e>=b/4);e++){var f=
(u(),B)[a+e>>>0];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},ng=(a,b,c)=>{b>>>=0;c??=2147483647;if(4>c)return 0;var d=b;c=d+c-4;for(var e=0;e<a.length;++e){var f=a.codePointAt(e);65535<f&&e++;(u(),A)[b>>>2>>>0]=f;b+=4;if(b+4>c)break}(u(),A)[b>>>2>>>0]=0;return b-d},og=a=>{for(var b=0,c=0;c<a.length;++c)65535<a.codePointAt(c)&&c++,b+=4;return b};
function Gb(a,b,c){a>>>=0;b>>>=0;c>>>=0;c=P(c);if(2===b){var d=jg;var e=kg;var f=lg}else d=mg,e=ng,f=og;Q(a,{name:c,Mc:h=>{var k=(u(),B)[h>>>2>>>0];k=d(h+4,k*b,!0);H(h);return k},Sc:(h,k)=>{if("string"!=typeof k)throw new ag(`Cannot pass non-string to C++ string type ${c}`);var m=f(k),p=he(4+m+b);(u(),B)[p>>>2>>>0]=m/b;e(k,p+4,m+b);null!==h&&h.push(H,p);return p},Rc:fg,Tc(h){H(h)}})}function Hb(a,b){a>>>=0;b=P(b>>>0);Q(a,{ee:!0,name:b,Mc:()=>{},Sc:()=>{}})}
function Ib(a){Ga(a>>>0,!ba,1,!aa,131072,!1);Ha()}var N=a=>{if(!ua)try{if(a(),!(0<L))try{n?ge()&&Ce(va):Mc(va)}catch(b){b instanceof xf||"unwind"==b||ha(1,b)}}catch(b){b instanceof xf||"unwind"==b||ha(1,b)}},pg=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Ia(a){a>>>=0;pg||(Atomics.waitAsync((u(),A),a>>>2,a).value.then(La),a+=128,Atomics.store((u(),A),a>>>2,1))}var La=()=>N(()=>{var a=ge();a&&(Ia(a),Ee())});
function Jb(a,b){a>>>=0;a==b>>>0?setTimeout(La):n?postMessage({Vc:a,Oc:"checkMailbox"}):(a=Gf[a])&&a.postMessage({Oc:"checkMailbox"})}var qg=[];function Kb(a,b,c,d,e){b>>>=0;e>>>=0;qg.length=0;c=e>>>3;for(d=e+d>>>3;c<d;){var f;(u(),F)[c++>>>0]?f=(u(),F)[c++>>>0]:f=(u(),E)[c++>>>0];qg.push(f)}return(b?rg[b]:sg[a])(...qg)}var Lb=()=>{L=0};function Mb(a){a>>>=0;n?postMessage({Oc:"cleanupThread",he:a}):Lf(Gf[a])}function Nb(a){l&&Gf[a>>>0].ref()}var tg=a=>{try{a()}catch(b){Ta(b)}};
function be(a){var b=(...c)=>{ug.push(a);try{return a(...c)}finally{ua||(ug.pop(),q&&1===vg&&0===ug.length&&(vg=0,L+=1,tg(uf),"undefined"!=typeof Fibers&&Fibers.Be()))}};wg.set(a,b);return b}var vg=0,q=null,xg=0,ug=[],yg=new Map,zg=new Map,wg=new Map,Ag=0,Bg=null,Cg=[];function da(){return new Promise((a,b)=>{Bg={resolve:a,reject:b}})}
function Dg(){var a=he(65548),b=a+12;(u(),B)[a>>>2>>>0]=b;(u(),B)[a+4>>>2>>>0]=b+65536;b=ug[0];if(!yg.has(b)){var c=Ag++;yg.set(b,c);zg.set(c,b)}b=yg.get(b);(u(),A)[a+8>>>2>>>0]=b;return a}function Eg(){var a=(u(),A)[q+8>>>2>>>0];a=zg.get(a);a=wg.get(a);--L;return a()}
function Fg(a){if(!ua){if(0===vg){var b=!1,c=!1;a((d=0)=>{if(!ua&&(xg=d,b=!0,c)){vg=2;tg(()=>vf(q));"undefined"!=typeof MainLoop&&MainLoop.Xd&&MainLoop.resume();d=!1;try{var e=Eg()}catch(k){e=k,d=!0}var f=!1;if(!q){var h=Bg;h&&(Bg=null,(d?h.reject:h.resolve)(e),f=!0)}if(d&&!f)throw e;}});c=!0;b||(vg=1,q=Dg(),"undefined"!=typeof MainLoop&&MainLoop.Xd&&MainLoop.pause(),tg(()=>tf(q)))}else 2===vg?(vg=0,tg(wf),H(q),q=null,Cg.forEach(N)):Ta(`invalid state: ${vg}`);return xg}}var Gg=a=>Fg(b=>{a().then(b)});
function Ob(a){a>>>=0;return Gg(async()=>{var b=await R(a);return S(b)})}var Hg=[],Ig=a=>{var b=Hg.length;Hg.push(a);return b},Jg=(a,b)=>{for(var c=Array(a),d=0;d<a;++d){var e=d,f=(u(),B)[b+4*d>>>2>>>0],h=Zf[f];if(void 0===h)throw a=`parameter ${d}`,f=ee(f),b=P(f),H(f),new ag(`${a} has unknown type ${b}`);c[e]=h}return c},Kg=(a,b,c)=>{var d=[];a=a(d,c);d.length&&((u(),B)[b>>>2>>>0]=S(d));return a},Lg={},Mg=a=>{var b=Lg[a];return void 0===b?P(a):b};
function Pb(a,b,c){var [d,...e]=Jg(a,b>>>0);b=d.Sc.bind(d);var f=e.map(m=>m.Rc.bind(m));a--;var h={toValue:R};a=f.map((m,p)=>{var C=`argFromPtr${p}`;h[C]=m;return`${C}(args${p?"+"+8*p:""})`});switch(c){case 0:var k="toValue(handle)";break;case 2:k="new (toValue(handle))";break;case 3:k="";break;case 1:h.getStringOrSymbol=Mg,k="toValue(handle)[getStringOrSymbol(methodName)]"}k+=`(${a})`;d.ee||(h.toReturnWire=b,h.emval_returnValue=Kg,k=`return emval_returnValue(toReturnWire, destructorsRef, ${k})`);
k=`return function (handle, methodName, destructorsRef, args) {\n  ${k}\n  }`;c=(new Function(Object.keys(h),k))(...Object.values(h));k=`methodCaller<(${e.map(m=>m.name)}) => ${d.name}>`;return Ig(Object.defineProperty(c,"name",{value:k}))}function Rb(a,b){b>>>=0;a=R(a>>>0);b=R(b);return a==b}function Sb(a){a>>>=0;if(!a)return S(globalThis);a=Mg(a);return S(globalThis[a])}function Tb(a){a=Mg(a>>>0);return S(g[a])}function Ub(a,b){b>>>=0;a=R(a>>>0);b=R(b);return S(a[b])}
function Vb(a){a>>>=0;9<a&&(eg[a+1]+=1)}function Wb(a,b,c,d,e){return Hg[a>>>0](b>>>0,c>>>0,d>>>0,e>>>0)}function Xb(a,b,c,d,e){return Wb(a>>>0,b>>>0,c>>>0,d>>>0,e>>>0)}function Yb(){return S([])}function Zb(a){a=R(a>>>0);for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a[c];return S(b)}function $b(a){return S(Mg(a>>>0))}function ac(){return S({})}function bc(a){a>>>=0;for(var b=R(a);b.length;){var c=b.pop();b.pop()(c)}Qb(a)}function cc(a,b,c){b>>>=0;c>>>=0;a=R(a>>>0);b=R(b);c=R(c);a[b]=c}
function dc(a,b){a=O(a);b>>>=0;a=new Date(1E3*a);(u(),A)[b>>>2>>>0]=a.getUTCSeconds();(u(),A)[b+4>>>2>>>0]=a.getUTCMinutes();(u(),A)[b+8>>>2>>>0]=a.getUTCHours();(u(),A)[b+12>>>2>>>0]=a.getUTCDate();(u(),A)[b+16>>>2>>>0]=a.getUTCMonth();(u(),A)[b+20>>>2>>>0]=a.getUTCFullYear()-1900;(u(),A)[b+24>>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;(u(),A)[b+28>>>2>>>0]=a}
var Ng=a=>0===a%4&&(0!==a%100||0===a%400),Og=[0,31,60,91,121,152,182,213,244,274,305,335],Pg=[0,31,59,90,120,151,181,212,243,273,304,334];
function ec(a,b){a=O(a);b>>>=0;a=new Date(1E3*a);(u(),A)[b>>>2>>>0]=a.getSeconds();(u(),A)[b+4>>>2>>>0]=a.getMinutes();(u(),A)[b+8>>>2>>>0]=a.getHours();(u(),A)[b+12>>>2>>>0]=a.getDate();(u(),A)[b+16>>>2>>>0]=a.getMonth();(u(),A)[b+20>>>2>>>0]=a.getFullYear()-1900;(u(),A)[b+24>>>2>>>0]=a.getDay();var c=(Ng(a.getFullYear())?Og:Pg)[a.getMonth()]+a.getDate()-1|0;(u(),A)[b+28>>>2>>>0]=c;(u(),A)[b+36>>>2>>>0]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),
0,1)).getTimezoneOffset();a=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0;(u(),A)[b+32>>>2>>>0]=a}
function fc(a){a>>>=0;var b=new Date((u(),A)[a+20>>>2>>>0]+1900,(u(),A)[a+16>>>2>>>0],(u(),A)[a+12>>>2>>>0],(u(),A)[a+8>>>2>>>0],(u(),A)[a+4>>>2>>>0],(u(),A)[a>>>2>>>0],0),c=(u(),A)[a+32>>>2>>>0],d=b.getTimezoneOffset(),e=(new Date(b.getFullYear(),6,1)).getTimezoneOffset(),f=(new Date(b.getFullYear(),0,1)).getTimezoneOffset(),h=Math.min(f,e);0>c?(u(),A)[a+32>>>2>>>0]=Number(e!=f&&h==d):0<c!=(h==d)&&(e=Math.max(f,e),b.setTime(b.getTime()+6E4*((0<c?h:e)-d)));(u(),A)[a+24>>>2>>>0]=b.getDay();c=(Ng(b.getFullYear())?
Og:Pg)[b.getMonth()]+b.getDate()-1|0;(u(),A)[a+28>>>2>>>0]=c;(u(),A)[a>>>2>>>0]=b.getSeconds();(u(),A)[a+4>>>2>>>0]=b.getMinutes();(u(),A)[a+8>>>2>>>0]=b.getHours();(u(),A)[a+12>>>2>>>0]=b.getDate();(u(),A)[a+16>>>2>>>0]=b.getMonth();(u(),A)[a+20>>>2>>>0]=b.getYear();a=b.getTime();return BigInt(isNaN(a)?-1:a/1E3)}function gc(a,b,c,d,e,f,h){return n?M(16,1,a,b,c,d,e,f,h):-52}function hc(a,b,c,d,e,f){if(n)return M(17,1,a,b,c,d,e,f)}var Qg={},sc=()=>performance.timeOrigin+performance.now();
function ic(a,b){if(n)return M(18,1,a,b);Qg[a]&&(clearTimeout(Qg[a].id),delete Qg[a]);if(!b)return 0;var c=setTimeout(()=>{delete Qg[a];N(()=>De(a,performance.timeOrigin+performance.now()))},b);Qg[a]={id:c,Ae:b};return 0}
function jc(a,b,c,d){a>>>=0;b>>>=0;c>>>=0;d>>>=0;var e=(new Date).getFullYear(),f=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();var h=Math.max(f,e);(u(),B)[a>>>2>>>0]=60*h;(u(),A)[b>>>2>>>0]=Number(f!=e);b=k=>{var m=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(m/60)).padStart(2,"0")}${String(m%60).padStart(2,"0")}`};a=b(f);b=b(e);e<f?(T(a,c,17),T(b,d,17)):(T(a,d,17),T(b,c,17))}var oc=()=>Date.now(),Rg=1;
function kc(a,b,c){c>>>=0;if(!(0<=a&&3>=a))return 28;if(0===a)a=Date.now();else if(Rg)a=performance.timeOrigin+performance.now();else return 52;a=Math.round(1E6*a);(u(),F)[c>>>3>>>0]=BigInt(a);return 0}var Sg=[],Tg=(a,b)=>{Sg.length=0;for(var c;c=(u(),x)[a++>>>0];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;Sg.push(112==c?(u(),B)[b>>>2>>>0]:106==c?(u(),F)[b>>>3>>>0]:105==c?(u(),A)[b>>>2>>>0]:(u(),E)[b>>>3>>>0]);b+=d?8:4}return Sg};function lc(a,b,c){a>>>=0;b=Tg(b>>>0,c>>>0);return rg[a](...b)}
function mc(a,b,c){a>>>=0;b=Tg(b>>>0,c>>>0);return rg[a](...b)}var nc=()=>{};function pc(a,b){return t(Xf(a>>>0,b>>>0))}var qc=()=>{L+=1;throw"unwind";};function rc(){return 4294901760}var tc=()=>1,uc=()=>l?require("os").cpus().length:navigator.hardwareConcurrency;
function vc(a){a>>>=0;var b=(u(),x).length;if(a<=b||4294901760<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(4294901760,65536*Math.ceil(Math.max(a,d)/65536))-v.buffer.byteLength+65535)/65536|0;try{v.grow(d);wa();var e=1;break a}catch(f){}e=void 0}if(e)return!0}return!1}
var V=a=>{var b=U(a)+1,c=Ie(b);T(a,c,b);return c},Ug=(a,b)=>{(u(),B)[a>>>2>>>0]=b;var c=(u(),B)[a>>>2>>>0];(u(),B)[a+4>>>2>>>0]=(b-c)/4294967296},Vg=a=>(u(),B)[a>>>2>>>0]+4294967296*(u(),A)[a+4>>>2>>>0],W=[],Wg=(a,b)=>{W[a>>>0]=b},X=[],Xg=[],Yg=(a,b)=>{Xg[a]=new Promise(c=>b.finally(()=>c(a)))},Y=a=>{if(a)return W[a>>>0]},Zg=(a,b=0)=>{"unmapped"===a.mapState||Ta();b=qe(b);W[b>>>0]=a;return b},$g=(a,b=0)=>{var c=se(b);b=re(b,c);W[c>>>0]=a.queue;W[b>>>0]=a;return b},ah=(a,b)=>{for(a=(u(),B)[a>>>2>>>
0];a;a=(u(),B)[a>>>2>>>0]){var c=(u(),A)[a+4>>>2>>>0];b[c](a)}},bh=(a,b,c)=>{(u(),B)[a>>>2>>>0]=b;(u(),B)[a+4>>>2>>>0]=c},ch=a=>{var b=(u(),B)[a>>>2>>>0];a=(u(),B)[a+4>>>2>>>0];return Xf(b,a)},Z=a=>{var b=(u(),B)[a>>>2>>>0];a=(u(),B)[a+4>>>2>>>0];if(b)return Xf(b,a);if(0===a)return""},dh=a=>{var b=Z(a+4);var c=(c=(u(),B)[a+12>>>2>>>0])?Y(c):"auto";if(a+=16){var d=Y((u(),B)[a+4>>>2>>>0]);var e=(u(),B)[a+16>>>2>>>0];var f=(u(),B)[a+20>>>2>>>0];if(e){for(var h={},k=0;k<e;++k){var m=f+24*k,p=ch(m+4);
h[p]=(u(),E)[m+16>>>3>>>0]}e=h}else e=void 0;a={module:d,constants:e,entryPoint:Z(a+8)}}else a=void 0;return{label:b,layout:c,compute:a}},eh=(a,b)=>{function c(d,e){d=a[d];(u(),B)[b+e>>>2>>>0]=d}c("maxTextureDimension1D",4);c("maxTextureDimension2D",8);c("maxTextureDimension3D",12);c("maxTextureArrayLayers",16);c("maxBindGroups",20);c("maxBindGroupsPlusVertexBuffers",24);c("maxBindingsPerBindGroup",28);c("maxDynamicUniformBuffersPerPipelineLayout",32);c("maxDynamicStorageBuffersPerPipelineLayout",
36);c("maxSampledTexturesPerShaderStage",40);c("maxSamplersPerShaderStage",44);c("maxStorageBuffersPerShaderStage",48);c("maxStorageTexturesPerShaderStage",52);c("maxUniformBuffersPerShaderStage",56);c("minUniformBufferOffsetAlignment",80);c("minStorageBufferOffsetAlignment",84);Ug(b+64,a.maxUniformBufferBindingSize);Ug(b+72,a.maxStorageBufferBindingSize);c("maxVertexBuffers",88);Ug(b+96,a.maxBufferSize);c("maxVertexAttributes",104);c("maxVertexBufferArrayStride",108);c("maxInterStageShaderVariables",
112);c("maxColorAttachments",116);c("maxColorAttachmentBytesPerSample",120);c("maxComputeWorkgroupStorageSize",124);c("maxComputeInvocationsPerWorkgroup",128);c("maxComputeWorkgroupSizeX",132);c("maxComputeWorkgroupSizeY",136);c("maxComputeWorkgroupSizeZ",140);c("maxComputeWorkgroupsPerDimension",144);void 0!==a.ze&&c("maxImmediateSize",148)},fh=[,"validation","out-of-memory","internal"],gh=[,"compatibility","core"],hh={1:"core-features-and-limits",2:"depth-clip-control",3:"depth32float-stencil8",
4:"texture-compression-bc",5:"texture-compression-bc-sliced-3d",6:"texture-compression-etc2",7:"texture-compression-astc",8:"texture-compression-astc-sliced-3d",9:"timestamp-query",10:"indirect-first-instance",11:"shader-f16",12:"rg11b10ufloat-renderable",13:"bgra8unorm-storage",14:"float32-filterable",15:"float32-blendable",16:"clip-distances",17:"dual-source-blending",18:"subgroups",19:"texture-formats-tier1",20:"texture-formats-tier2",21:"primitive-index",22:"texture-component-swizzle",327692:"chromium-experimental-unorm16-texture-formats",
327729:"chromium-experimental-multi-draw-indirect"},ih=[,"low-power","high-performance"],jh=[,"occlusion","timestamp"],kh={undefined:1,unknown:1,destroyed:2};
function wc(a,b,c,d,e,f){b=O(b);c=O(c);d>>>=0;e>>>=0;f>>>=0;var h=Y(a>>>0);a={};if(f){var k=(u(),B)[f+12>>>2>>>0];if(k){var m=(u(),B)[f+16>>>2>>>0];a.requiredFeatures=Array.from((u(),B).subarray(m>>>2>>>0,m+4*k>>>2>>>0),r=>hh[r])}var p=(u(),B)[f+20>>>2>>>0];if(p){var C={};function r(z,D,za=!1){D=p+D;D=(u(),B)[D>>>2>>>0];4294967295==D||za&&0==D||(C[z]=D)}function y(z,D){D=p+D;var za=(u(),B)[D>>>2>>>0],yb=(u(),B)[D+4>>>2>>>0];if(4294967295!=za||4294967295!=yb)C[z]=Vg(D)}r("maxTextureDimension1D",4);
r("maxTextureDimension2D",8);r("maxTextureDimension3D",12);r("maxTextureArrayLayers",16);r("maxBindGroups",20);r("maxBindGroupsPlusVertexBuffers",24);r("maxDynamicUniformBuffersPerPipelineLayout",32);r("maxDynamicStorageBuffersPerPipelineLayout",36);r("maxSampledTexturesPerShaderStage",40);r("maxSamplersPerShaderStage",44);r("maxStorageBuffersPerShaderStage",48);r("maxStorageTexturesPerShaderStage",52);r("maxUniformBuffersPerShaderStage",56);r("minUniformBufferOffsetAlignment",80);r("minStorageBufferOffsetAlignment",
84);y("maxUniformBufferBindingSize",64);y("maxStorageBufferBindingSize",72);r("maxVertexBuffers",88);y("maxBufferSize",96);r("maxVertexAttributes",104);r("maxVertexBufferArrayStride",108);r("maxInterStageShaderVariables",112);r("maxColorAttachments",116);r("maxColorAttachmentBytesPerSample",120);r("maxComputeWorkgroupStorageSize",124);r("maxComputeInvocationsPerWorkgroup",128);r("maxComputeWorkgroupSizeX",132);r("maxComputeWorkgroupSizeY",136);r("maxComputeWorkgroupSizeZ",140);r("maxComputeWorkgroupsPerDimension",
144);r("maxImmediateSize",148,!0);a.requiredLimits=C}if(k=(u(),B)[f+24>>>2>>>0])k={label:Z(k+4)},a.defaultQueue=k;a.label=Z(f+4)}L+=1;Yg(b,h.requestDevice(a).then(r=>{--L;N(()=>{W[e>>>0]=r.queue;W[d>>>0]=r;L+=1;Yg(c,r.lost.then(y=>{N(()=>{r.onuncapturederror=()=>{};var z=K(),D=V(y.message);ue(c,kh[y.reason],D);J(z)});--L}));r.onuncapturederror=y=>{var z=5;y.error instanceof GPUValidationError?z=2:y.error instanceof GPUOutOfMemoryError?z=3:y.error instanceof GPUInternalError&&(z=4);var D=K();y=V(y.error.message);
ze(d,z,y);J(D)};"adapterInfo"in r||(r.adapterInfo=h.info);ye(b,1,d,0)})},r=>{--L;N(()=>{var y=K(),z=V(r.message);ye(b,3,d,z);c&&ue(c,4,z);J(y)})}))}function xc(a){a>>>=0;var b=Y(a),c=X[a];if(c){for(var d=0;d<c.length;++d)c[d]();delete X[a]}b.destroy()}function yc(a,b,c){a>>>=0;c>>>=0;var d=Y(a);4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b>>>0,c)}catch(h){return 0}var f=Fe(16,e.byteLength);(u(),x).set(new Uint8Array(e),f>>>0);X[a].push(()=>H(f));return f}
function zc(a,b,c){a>>>=0;c>>>=0;var d=Y(a);4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b>>>0,c)}catch(h){return 0}var f=Fe(16,e.byteLength);(u(),x).fill(0,f,e.byteLength);X[a].push(()=>{(new Uint8Array(e)).set((u(),x).subarray(f>>>0,f+e.byteLength>>>0));H(f)});return f}
function Ac(a,b,c,d,e){a>>>=0;b=O(b);c=O(c);e>>>=0;var f=Y(a);X[a]=[];4294967295==e&&(e=void 0);L+=1;Yg(b,f.mapAsync(c,d>>>0,e).then(()=>{--L;N(()=>{ve(b,1,0)})},h=>{--L;N(()=>{K();var k=V(h.message);ve(b,"AbortError"===h.name?4:"OperationError"===h.name?3:0,k);delete X[a]})}))}function Bc(a){a>>>=0;var b=Y(a),c=X[a];if(c){for(var d=0;d<c.length;++d)c[d]();delete X[a];b.unmap()}}function Cc(a){delete W[a>>>0]}
function Dc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=!!(u(),B)[b+32>>>2>>>0];b={label:Z(b+4),usage:(u(),B)[b+16>>>2>>>0],size:Vg(b+24),mappedAtCreation:d};a=Y(a);try{var e=a.createBuffer(b)}catch(f){return!1}W[c>>>0]=e;d&&(X[c]=[]);return!0}function Ec(a,b,c,d){a>>>=0;b=O(b);d>>>=0;c=dh(c>>>0);a=Y(a);L+=1;Yg(b,a.createComputePipelineAsync(c).then(e=>{--L;N(()=>{W[d>>>0]=e;te(b,1,d,0)})},e=>{--L;N(()=>{var f=K(),h=V(e.message);te(b,"validation"===e.reason?3:"internal"===e.reason?4:0,d,h);J(f)})}))}
function Fc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=(u(),B)[b>>>2>>>0],e=(u(),A)[d+4>>>2>>>0];b={label:Z(b+4),code:""};switch(e){case 2:b.code=ch(d+8)}a=Y(a).createShaderModule(b);W[c>>>0]=a}var Gc=a=>{a=Y(a);a.onuncapturederror=null;a.destroy()};
function Hc(a,b){b=O(b);a=Y(a>>>0);L+=1;Yg(b,a.popErrorScope().then(c=>{--L;N(()=>{var d=5;c?c instanceof GPUValidationError?d=2:c instanceof GPUOutOfMemoryError?d=3:c instanceof GPUInternalError&&(d=4):d=1;var e=K(),f=c?V(c.message):0;we(b,1,d,f);J(e)})},c=>{--L;N(()=>{var d=K(),e=V(c.message);we(b,1,5,e);J(d)})}))}
function Ic(a,b,c,d){b=O(b);c>>>=0;d>>>=0;if(c){var e={featureLevel:gh[(u(),A)[c+4>>>2>>>0]],powerPreference:ih[(u(),A)[c+8>>>2>>>0]],forceFallbackAdapter:!!(u(),B)[c+12>>>2>>>0]};a=(u(),B)[c>>>2>>>0];0!==a&&(u(),e.De=!!(u(),B)[a+8>>>2>>>0])}"gpu"in navigator?(L+=1,Yg(b,navigator.gpu.requestAdapter(e).then(f=>{--L;N(()=>{if(f)W[d>>>0]=f,xe(b,1,d,0);else{var h=K(),k=V("WebGPU not available on this browser (requestAdapter returned null)");xe(b,3,d,k);J(h)}})},f=>{--L;N(()=>{var h=K(),k=V(f.message);
xe(b,4,d,k);J(h)})}))):(e=K(),a=V("WebGPU not available on this browser (navigator.gpu is not available)"),xe(b,3,d,a),J(e))}function Jc(a,b,c){a>>>=0;b>>>=0;c>>>=0;return Gg(async()=>{var d=[];if(c){var e=(u(),A)[c>>>2>>>0];d.length=b+1;d[b]=new Promise(k=>setTimeout(k,e,0))}else d.length=b;for(var f=0;f<b;++f){var h=Vg(a+8*f);if(!(h in Xg))return h;d[f]=Xg[h]}d=await Promise.race(d);delete Xg[d];return d})}
var lh={},nh=()=>{if(!mh){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:fa||"./this.program"},b;for(b in lh)void 0===lh[b]?delete a[b]:a[b]=lh[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);mh=c}return mh},mh;function Kc(a,b){if(n)return M(19,1,a,b);a>>>=0;b>>>=0;var c=0,d=0,e;for(e of nh()){var f=b+c;(u(),B)[a+d>>>2>>>0]=f;c+=T(e,f,Infinity)+1;d+=4}return 0}
function Lc(a,b){if(n)return M(20,1,a,b);a>>>=0;b>>>=0;var c=nh();(u(),B)[a>>>2>>>0]=c.length;a=0;for(var d of c)a+=U(d)+1;(u(),B)[b>>>2>>>0]=a;return 0}function Nc(a){return n?M(21,1,a):52}function Oc(a,b,c,d){return n?M(22,1,a,b,c,d):52}function Pc(a,b,c,d){return n?M(23,1,a,b,c,d):70}var oh=[null,[],[]];
function Qc(a,b,c,d){if(n)return M(24,1,a,b,c,d);b>>>=0;c>>>=0;d>>>=0;for(var e=0,f=0;f<c;f++){var h=(u(),B)[b>>>2>>>0],k=(u(),B)[b+4>>>2>>>0];b+=8;for(var m=0;m<k;m++){var p=a,C=(u(),x)[h+m>>>0],r=oh[p];0===C||10===C?((1===p?ra:t)(Wf(r)),r.length=0):r.push(C)}e+=k}(u(),B)[d>>>2>>>0]=e;return 0}function Bd(a){return a>>>0}function Dd(a,b){eh(Y(a>>>0).limits,b>>>0);return 1}function Ed(a,b){return Y(a>>>0).features.has(hh[b])}function Fd(a){return BigInt(Y(a>>>0).size)}
function Gd(a){return BigInt(Y(a>>>0).usage)}function Hd(a,b){a>>>=0;b>>>=0;if(b){var c=Z(b+4);b=(u(),B)[b+12>>>2>>>0];b=0!==b?{querySet:Y((u(),B)[b+4>>>2>>>0]),beginningOfPassWriteIndex:(u(),B)[b+8>>>2>>>0],endOfPassWriteIndex:(u(),B)[b+12>>>2>>>0]}:void 0;c={label:c,timestampWrites:b}}b=Y(a);a=oe(0);c=b.beginComputePass(c);W[a>>>0]=c;return a}function Id(a,b,c,d){c=O(c);d=O(d);a=Y(a>>>0);-1==d&&(d=void 0);a.clearBuffer(Y(b>>>0),c,d)}
function Jd(a,b,c,d,e,f){c=O(c);e=O(e);f=O(f);Y(a>>>0).copyBufferToBuffer(Y(b>>>0),c,Y(d>>>0),e,f)}function Kd(a){var b=Y(a>>>0);a=me(0);b=b.finish();W[a>>>0]=b;return a}function Ld(a,b,c,d,e,f){f=O(f);Y(a>>>0).resolveQuerySet(Y(b>>>0),c,d,Y(e>>>0),f)}function Md(a,b,c,d){Y(a>>>0).dispatchWorkgroups(b,c,d)}function Nd(a,b,c){c=O(c);Y(a>>>0).dispatchWorkgroupsIndirect(Y(b>>>0),c)}function Od(a){Y(a>>>0).end()}
function Pd(a,b,c,d,e){d>>>=0;e>>>=0;a=Y(a>>>0);c=Y(c>>>0);0==d?a.setBindGroup(b,c):a.setBindGroup(b,c,(u(),B),e>>>2,d)}function Qd(a,b){Y(a>>>0).setPipeline(Y(b>>>0))}function Rd(a,b,c){Y(a>>>0).Ce(Y(b>>>0),c)}function Sd(a,b){var c=Y(a>>>0);a=le(0);b=c.getBindGroupLayout(b);W[a>>>0]=b;return a}
function Td(a,b){function c(e){var f=(u(),B)[e+8>>>2>>>0],h=(u(),B)[e+32>>>2>>>0],k=(u(),B)[e+36>>>2>>>0],m=0;ah(e,{327681:p=>{m=(u(),B)[p+8>>>2>>>0]}});f?(h=Vg(e+24),-1==h&&(h=void 0),f={buffer:Y(f),offset:Vg(e+16),size:h}):f=Y(h||k||m);return{binding:(u(),B)[e+4>>>2>>>0],resource:f}}a>>>=0;b>>>=0;b={label:Z(b+4),layout:Y((u(),B)[b+12>>>2>>>0]),entries:function(e,f){for(var h=[],k=0;k<e;++k)h.push(c(f+40*k));return h}((u(),B)[b+16>>>2>>>0],(u(),B)[b+20>>>2>>>0])};a=Y(a);var d=ke(0);Wg(d,a.createBindGroup(b));
return d}function Ud(a,b){a>>>=0;b>>>=0;var c;b&&(c={label:Z(b+4)});b=Y(a);a=ne(0);c=b.createCommandEncoder(c);W[a>>>0]=c;return a}function Vd(a,b){a>>>=0;b>>>=0;b={type:jh[(u(),A)[b+12>>>2>>>0]],count:(u(),B)[b+16>>>2>>>0]};var c=Y(a);a=pe(0);b=c.createQuerySet(b);W[a>>>0]=b;return a}
function Wd(a,b){a=Y(a>>>0).adapterInfo;b>>>=0;(u(),B)[b+52>>>2>>>0]=a.subgroupMinSize;(u(),B)[b+56>>>2>>>0]=a.subgroupMaxSize;var c=a.vendor+a.architecture+a.device+a.description;var d=U(c)+1,e=he(d);e&&T(c,e,d);c=e;d=U(a.vendor);bh(b+4,c,d);c+=d;d=U(a.architecture);bh(b+12,c,d);c+=d;d=U(a.device);bh(b+20,c,d);bh(b+28,c+d,U(a.description));(u(),A)[b+36>>>2>>>0]=2;a=a.isFallbackAdapter?3:4;(u(),A)[b+40>>>2>>>0]=a;(u(),B)[b+44>>>2>>>0]=0;(u(),B)[b+48>>>2>>>0]=0;return 1}
var ph={"core-features-and-limits":1,"depth-clip-control":2,"depth32float-stencil8":3,"texture-compression-bc":4,"texture-compression-bc-sliced-3d":5,"texture-compression-etc2":6,"texture-compression-astc":7,"texture-compression-astc-sliced-3d":8,"timestamp-query":9,"indirect-first-instance":10,"shader-f16":11,"rg11b10ufloat-renderable":12,"bgra8unorm-storage":13,"float32-filterable":14,"float32-blendable":15,"clip-distances":16,"dual-source-blending":17,subgroups:18,"texture-formats-tier1":19,"texture-formats-tier2":20,
"primitive-index":21,"texture-component-swizzle":22,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-multi-draw-indirect":327729};function Xd(a,b){b>>>=0;var c=Y(a>>>0);a=he(4*c.features.size);var d=0,e=0;for(const f of c.features)c=ph[f],0<=c&&((u(),A)[a+d>>>2>>>0]=c,d+=4,e++);(u(),B)[b+4>>>2>>>0]=a;(u(),B)[b>>>2>>>0]=e}function Yd(a,b){eh(Y(a>>>0).limits,b>>>0);return 1}function Zd(a,b){Y(a>>>0).pushErrorScope(fh[b])}
function $d(a,b,c){b>>>=0;c>>>=0;a=Y(a>>>0);b=Array.from((u(),A).subarray(c>>>2>>>0,c+4*b>>>2>>>0),d=>Y(d));a.submit(b)}function ae(a,b,c,d,e){c=O(c);d>>>=0;e>>>=0;a=Y(a>>>0);b=Y(b>>>0);d=(u(),x).subarray(d>>>0,d+e>>>0);a.writeBuffer(b,c,d,0,e)}n||Jf();n||(v=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),wa());g.wasmBinary&&(sa=g.wasmBinary);g.stackSave=()=>K();g.stackRestore=a=>J(a);g.stackAlloc=a=>Ie(a);
g.setValue=function(a,b,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":(u(),w)[a>>>0]=b;break;case "i8":(u(),w)[a>>>0]=b;break;case "i16":(u(),Na)[a>>>1>>>0]=b;break;case "i32":(u(),A)[a>>>2>>>0]=b;break;case "i64":(u(),F)[a>>>3>>>0]=BigInt(b);break;case "float":(u(),Pa)[a>>>2>>>0]=b;break;case "double":(u(),E)[a>>>3>>>0]=b;break;case "*":(u(),B)[a>>>2>>>0]=b;break;default:Ta(`invalid type for setValue: ${c}`)}};
g.getValue=function(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return(u(),w)[a>>>0];case "i8":return(u(),w)[a>>>0];case "i16":return(u(),Na)[a>>>1>>>0];case "i32":return(u(),A)[a>>>2>>>0];case "i64":return(u(),F)[a>>>3>>>0];case "float":return(u(),Pa)[a>>>2>>>0];case "double":return(u(),E)[a>>>3>>>0];case "*":return(u(),B)[a>>>2>>>0];default:Ta(`invalid type for getValue: ${b}`)}};g.UTF8ToString=Xf;g.stringToUTF8=T;g.lengthBytesUTF8=U;
var sg=[Cd,If,Tf,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,gc,hc,ic,Kc,Lc,Nc,Oc,Pc,Qc],rg={970348:(a,b,c,d,e)=>{if("undefined"==typeof g||!g.Uc)return 1;a=Xf(Number(a>>>0));a.startsWith("./")&&(a=a.substring(2));a=g.Uc.get(a);if(!a)return 2;b=Number(b>>>0);c=Number(c>>>0);d=Number(d>>>0);if(b+c>a.byteLength)return 3;try{const f=a.subarray(b,b+c);switch(e){case 0:(u(),x).set(f,d>>>0);break;case 1:g.ad?g.ad(d,f):g.ne(d,f);break;default:return 4}return 0}catch{return 4}},971172:(a,b,c)=>{g.Sd(a,(u(),x).subarray(b>>>
0,b+c>>>0))},971236:()=>g.le(),971278:a=>{g.jd(a)},971315:()=>"undefined"!==typeof wasmOffsetConverter},ee,Ja,fe,ge,H,he,ie,je,ke,le,me,ne,oe,pe,qe,re,se,te,ue,ve,we,xe,ye,ze,Ga,Ma,Ae,Be,Ce,De,Ee,Fe,I,Ge,He,J,Ie,K,Je,Ke,Le,Me,dynCall_vii,Ne,dynCall_v,Oe,Pe,Qe,dynCall_iii,Re,Se,Te,dynCall_vi,Ue,Ve,We,Xe,Ye,Ze,$e,af,bf,cf,df,ef,ff,gf,hf,jf,kf,lf,mf,nf,of,pf,qf,rf,sf,tf,uf,vf,wf,Za;function Yc(a,b,c,d){var e=K();try{return Te(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function Xc(a,b,c){var d=K();try{return dynCall_iii(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function nd(a){var b=K();try{dynCall_v(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0)}}function Wc(a,b){var c=K();try{return Ne(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0)}}function pd(a,b,c){var d=K();try{dynCall_vii(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function od(a,b){var c=K();try{dynCall_vi(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0)}}
function bd(a,b,c,d,e,f,h){var k=K();try{return Qe(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}function td(a,b,c,d,e,f){var h=K();try{Oe(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function rd(a,b,c,d){var e=K();try{Se(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function ud(a,b,c,d,e,f,h){var k=K();try{Ve(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}function Ad(a,b,c,d,e,f,h){var k=K();try{We(a,b,c,d,e,f,h)}catch(m){J(k);if(m!==m+0)throw m;I(1,0)}}
function zd(a,b,c,d,e,f,h,k){var m=K();try{ef(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function xd(a,b,c,d,e,f,h,k,m,p,C,r){var y=K();try{Xe(a,b,c,d,e,f,h,k,m,p,C,r)}catch(z){J(y);if(z!==z+0)throw z;I(1,0)}}function Zc(a,b,c,d,e){var f=K();try{return Ue(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}function sd(a,b,c,d,e){var f=K();try{Pe(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}
function vd(a,b,c,d,e,f,h,k){var m=K();try{Re(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function Vc(a){var b=K();try{return ff(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0)}}function hd(a,b,c){var d=K();try{return gf(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function kd(a,b){var c=K();try{return sf(a,b)}catch(d){J(c);if(d!==d+0)throw d;I(1,0);return 0n}}function jd(a){var b=K();try{return Ye(a)}catch(c){J(b);if(c!==c+0)throw c;I(1,0);return 0n}}
function gd(a,b,c,d){var e=K();try{return hf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function fd(a,b,c,d,e){var f=K();try{return jf(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0)}}function ed(a,b,c,d,e,f){var h=K();try{return kf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function ad(a,b,c,d,e,f){var h=K();try{return cf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}
function $c(a,b,c,d,e,f){var h=K();try{return lf(a,b,c,d,e,f)}catch(k){J(h);if(k!==k+0)throw k;I(1,0)}}function cd(a,b,c,d,e,f,h,k){var m=K();try{return df(a,b,c,d,e,f,h,k)}catch(p){J(m);if(p!==p+0)throw p;I(1,0)}}function md(a,b,c,d,e){var f=K();try{return mf(a,b,c,d,e)}catch(h){J(f);if(h!==h+0)throw h;I(1,0);return 0n}}function Uc(a,b,c,d){var e=K();try{return nf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function Sc(a,b,c,d){var e=K();try{return of(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}function dd(a,b,c,d,e,f,h,k,m,p,C,r){var y=K();try{return pf(a,b,c,d,e,f,h,k,m,p,C,r)}catch(z){J(y);if(z!==z+0)throw z;I(1,0)}}function wd(a,b,c,d,e,f,h,k,m,p,C){var r=K();try{qf(a,b,c,d,e,f,h,k,m,p,C)}catch(y){J(r);if(y!==y+0)throw y;I(1,0)}}function yd(a,b,c,d,e,f,h,k,m,p,C,r,y,z,D,za){var yb=K();try{rf(a,b,c,d,e,f,h,k,m,p,C,r,y,z,D,za)}catch(Bb){J(yb);if(Bb!==Bb+0)throw Bb;I(1,0)}}
function ld(a,b,c){var d=K();try{return $e(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0);return 0n}}function Tc(a,b,c){var d=K();try{return Ze(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function Rc(a,b,c){var d=K();try{return af(a,b,c)}catch(e){J(d);if(e!==e+0)throw e;I(1,0)}}function qd(a,b,c,d){var e=K();try{bf(a,b,c,d)}catch(f){J(e);if(f!==f+0)throw f;I(1,0)}}
function ce(){var a=G;a=Object.assign({},a);var b=d=>e=>d(e)>>>0,c=d=>()=>d()>>>0;a.$b=b(a.$b);a.Cc=c(a.Cc);a.Ec=b(a.Ec);a.rd=(d=>(e,f)=>d(e,f)>>>0)(a.rd);a.wd=b(a.wd);a.xd=c(a.xd);a.Bd=b(a.Bd);return a}function Ea(){if(0<Af)Bf=Ea;else if(n)xa?.(g),Sa();else{for(var a=zf;0<a.length;)a.shift()(g);0<Af?Bf=Ea:(g.calledRun=!0,ua||(Sa(),xa?.(g)))}}var G;n||(G=await (Da()),Ea());g.PTR_SIZE=4;
g.webgpuInit=a=>{const b=new WeakMap;let c=1,d=void 0,e=void 0;g.webgpuRegisterDevice=k=>{if(void 0!==e)throw Error("another WebGPU EP inference session is being created.");if(k){var m=b.get(k);if(!m){m=je(0);const p=$g(k,m);m=[c++,m,p];b.set(k,m)}d=k;e=m[0];return m}d=void 0;e=0};const f=new Map;g.webgpuOnCreateSession=k=>{if(void 0!==e){var m=e;e=void 0;if(k){const p=fe(m);f.set(k,p);0===m&&a(d??Y(p))}d=void 0}};g.webgpuOnReleaseSession=k=>{f.delete(k)};const h=Symbol("gpuBufferMetadata");g.webgpuRegisterBuffer=
(k,m,p)=>{if(p)return k[h]=[p,NaN],p;if(p=k[h])return p[1]++,p[0];m=f.get(m);if(void 0===m)throw Error("Invalid session handle passed to webgpuRegisterBuffer");m=Zg(k,m);k[h]=[m,1];return m};g.webgpuUnregisterBuffer=k=>{const m=k[h];if(!m)throw Error("Buffer is not registered");m[1]--;0===m[1]&&(ie(m[0]),delete k[h])};g.webgpuGetBuffer=k=>Y(k);g.webgpuCreateDownloader=(k,m,p)=>{p=f.get(p);if(void 0===p)throw Error("Invalid session handle passed to webgpuRegisterBuffer");const C=Y(p),r=16*Math.ceil(Number(m)/
16);return async()=>{const y=C.createBuffer({size:r,usage:9});try{const z=C.createCommandEncoder();z.copyBufferToBuffer(k,0,y,0,r);C.queue.submit([z.finish()]);await y.mapAsync(GPUMapMode.READ);return y.getMappedRange().slice(0,m)}finally{y.destroy()}}};g.ad=(k,m)=>{var p=m.buffer;const C=m.byteOffset,r=m.byteLength;m=16*Math.ceil(Number(r)/16);k=Y(k);if(!d){var y=fe(e);d=Y(y)}y=d.createBuffer({mappedAtCreation:!0,size:m,usage:6});const z=y.getMappedRange();(new Uint8Array(z)).set(new Uint8Array(p,
C,r));y.unmap();p=d.createCommandEncoder();p.copyBufferToBuffer(y,0,k,0,m);d.queue.submit([p.finish()]);y.destroy()}};
g.webnnInit=a=>{const b=a[0];[g.le,g.jd,g.webnnEnsureTensor,g.Sd,g.webnnDownloadTensor,g.ke,g.webnnEnableTraceEvent]=a.slice(1);g.webnnReleaseTensorId=g.jd;g.webnnUploadTensor=g.Sd;g.webnnRegisterMLContext=g.ke;g.webnnOnRunStart=c=>b.onRunStart(c);g.webnnOnRunEnd=b.onRunEnd.bind(b);g.webnnOnReleaseSession=c=>{b.onReleaseSession(c)};g.webnnCreateMLTensorDownloader=(c,d)=>b.createMLTensorDownloader(c,d);g.webnnRegisterMLTensor=(c,d,e,f)=>b.registerMLTensor(c,d,e,f);g.webnnCreateMLContext=c=>b.createMLContext(c);
g.webnnRegisterMLConstant=(c,d,e,f,h,k)=>b.registerMLConstant(c,d,e,f,h,g.Uc,k);g.webnnRegisterGraphInput=b.registerGraphInput.bind(b);g.webnnIsGraphInput=b.isGraphInput.bind(b);g.webnnRegisterGraphOutput=b.registerGraphOutput.bind(b);g.webnnIsGraphOutput=b.isGraphOutput.bind(b);g.webnnCreateTemporaryTensor=b.createTemporaryTensor.bind(b);g.webnnIsGraphInputOutputTypeSupported=b.isGraphInputOutputTypeSupported.bind(b)};Ra?moduleRtn=g:moduleRtn=new Promise((a,b)=>{xa=a;ya=b});
;return moduleRtn}export default ortWasmThreaded;var isPthread=globalThis.self?.name?.startsWith("em-pthread");var isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(isNode)isPthread=(await import("worker_threads")).workerData==="em-pthread";isPthread&&ortWasmThreaded();
