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.Je)&&"em-pthread"==ca.workerData}g.mountExternalData=(a,b)=>{a.startsWith("./")&&(a=a.substring(2));(g.Zc||(g.Zc=new Map)).set(a,b)};
g.unmountExternalData=()=>{delete g.Zc};var SharedArrayBuffer=globalThis.SharedArrayBuffer??(new WebAssembly.Memory({initial:0,maximum:0,Me:!0})).buffer.constructor;
let ea=()=>{const a=b=>(...c)=>{const d=r;c=b(...c);return r!=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({Uc:"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.Uc;if("load"===d){let e=[];self.onmessage=f=>e.push(f);Ba=()=>{postMessage({Uc:"loaded"});for(let f of e)a(f);self.onmessage=a};for(const f of c.ne)if(!g[f]||g[f].proxy)g[f]=(...h)=>{postMessage({Uc:"callHandler",me:f,args:h})},"print"==f&&(ra=g[f]),"printErr"==f&&(t=g[f]);v=c.we;wa();ta=c.xe;Da();Ea()}else if("run"===d){Fa(c.Sc);Ga(c.Sc,0,0,1,0,0);Ha();Ia(c.Sc);Ca||(Ja(),Ca=!0);try{Ka(c.te,c.ad)}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,B,C,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=B=new Int32Array(a);g.HEAPU32=C=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.dc()}function H(a){a="Aborted("+a+")";t(a);ua=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ya?.(a);throw a;}var Ta;async function Ua(a){if(!sa)try{var b=await ka(a);return new Uint8Array(b)}catch{}if(a==Ta&&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 Va(a,b){try{var c=await Ua(a);return await WebAssembly.instantiate(c,b)}catch(d){t(`failed to asynchronously prepare wasm: ${d}`),H(d)}}async function Wa(a){var b=Ta;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 Va(b,a)}
function Xa(){Ya={sa:Za,g:$a,K:ab,f:bb,n:cb,h:db,wa:eb,b:fb,ea:gb,Ja:hb,p:ib,fa:jb,Za:kb,$b:lb,bc:mb,_a:nb,Xa:ob,Qa:pb,Wa:qb,qa:rb,ac:sb,Zb:tb,Ya:ub,_b:vb,db:wb,Fa:xb,Ub:yb,Sb:zb,Ea:Ab,P:Cb,I:Db,Tb:Fb,ma:Gb,Vb:Hb,Ta:Ib,Xb:Jb,Ka:Kb,Pb:Lb,Ha:Mb,Sa:Ia,ab:Nb,W:Ob,r:Pb,c:Qb,tb:Rb,y:Sb,N:Tb,D:Ub,m:Vb,t:Wb,ub:Xb,J:Yb,V:Zb,j:$b,u:ac,q:bc,l:cc,Na:dc,Oa:ec,Pa:fc,La:gc,Ma:hc,Rb:ic,fb:jc,cb:kc,$:lc,sb:mc,na:nc,bb:oc,Y:pc,$a:qc,Yb:rc,G:sc,ib:tc,_:uc,ra:vc,Wb:wc,hb:xc,gb:yc,pb:zc,E:Ac,va:Bc,ua:Cc,rb:Dc,Z:Ec,w:Fc,
ob:Gc,nb:Hc,mb:Ic,qb:Jc,lb:Kc,kb:Lc,jb:Mc,Ua:Nc,Va:Oc,Ia:Pc,ga:Qc,pa:Rc,Ra:Sc,oa:Tc,Eb:Uc,za:Vc,Fb:Wc,Aa:Xc,H:Yc,e:Zc,s:$c,x:ad,B:bd,Ib:cd,L:dd,v:ed,Ba:fd,ca:gd,ja:hd,Gb:jd,Hb:kd,Da:ld,Ca:md,Kb:nd,O:od,da:pd,d:qd,A:rd,k:sd,Db:td,o:ud,z:vd,C:wd,F:xd,M:yd,Lb:zd,U:Ad,ka:Bd,ba:Cd,Mb:Dd,Nb:Ed,R:Fd,i:Gd,a:v,eb:Hd,Jb:Id,la:Jd,Q:Kd,ta:Ld,Ob:Md,S:Nd,Ab:Od,Bb:Pd,xa:Qd,ha:Rd,T:Sd,Ga:Td,ya:Ud,aa:Vd,yb:Wd,cc:Xd,X:Yd,Cb:Zd,vb:$d,wb:ae,xb:be,ia:ce,zb:de,Qb:ee};return{a:Ya}}
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=fe(k),d[h]=f):d[h]=k;G=d;G=ge();he.push(G.md);d=G;ie=d.ec;Ja=d.fc;g._OrtInit=d.gc;g._OrtGetLastError=d.hc;g._OrtCreateSessionOptions=d.ic;g._OrtAppendExecutionProvider=d.jc;g._OrtAddFreeDimensionOverride=d.kc;g._OrtAddSessionConfigEntry=d.lc;g._OrtReleaseSessionOptions=d.mc;g._OrtCreateSession=d.nc;g._OrtReleaseSession=d.oc;g._OrtGetInputOutputCount=d.pc;g._OrtGetInputOutputMetadata=
d.qc;g._OrtFree=d.rc;g._OrtCreateTensor=d.sc;g._OrtGetTensorData=d.tc;g._OrtReleaseTensor=d.uc;g._OrtCreateRunOptions=d.vc;g._OrtAddRunConfigEntry=d.wc;g._OrtReleaseRunOptions=d.xc;g._OrtCreateBinding=d.yc;g._OrtBindInput=d.zc;g._OrtBindOutput=d.Ac;g._OrtClearBoundOutputs=d.Bc;g._OrtReleaseBinding=d.Cc;g._OrtRunWithBinding=d.Dc;g._OrtRun=d.Ec;g._OrtEndProfiling=d.Fc;je=g._OrtGetWebGpuDevice=d.Gc;ke=d.Hc;I=g._free=d.Ic;le=g._malloc=d.Jc;me=g._wgpuBufferRelease=d.Kc;ne=g._wgpuCreateInstance=d.Lc;oe=
d.Mc;pe=d.Nc;qe=d.Oc;re=d.Pc;se=d.Qc;te=d.Tc;ue=d.bd;ve=d.cd;we=d.dd;xe=d.fd;ye=d.gd;ze=d.hd;Ae=d.id;Be=d.jd;Ce=d.kd;De=d.ld;Ga=d.od;Ma=d.pd;Ee=d.qd;Fe=d.rd;Ge=d.sd;He=d.td;Ie=d.ud;Je=d.vd;J=d.wd;Ke=d.xd;Le=d.yd;K=d.zd;Me=d.Ad;L=d.Bd;Ne=d.Cd;Oe=d.Dd;Pe=d.Ed;Qe=d.Fd;dynCall_vii=d.Gd;Re=d.Hd;dynCall_v=d.Id;Se=d.Jd;Te=d.Kd;Ue=d.Ld;dynCall_iii=d.Md;Ve=d.Nd;We=d.Od;Xe=d.Pd;dynCall_vi=d.Qd;Ye=d.Rd;Ze=d.Sd;$e=d.Td;af=d.Ud;bf=d.Vd;cf=d.Wd;df=d.Yd;ef=d.Zd;ff=d._d;gf=d.$d;hf=d.be;jf=d.ce;kf=d.de;lf=d.ee;mf=
d.fe;nf=d.ge;of=d.qe;pf=d.ve;qf=d.ye;rf=d.ze;sf=d.Ae;tf=d.Be;uf=d.Ce;vf=d.De;wf=d.Ee;xf=d.Fe;yf=d.Ge;zf=d.ef;Af=d.ff;Bf=d.gf;Cf=d.hf;ta=e;return G}var b=Xa();if(g.instantiateWasm)return new Promise(d=>{g.instantiateWasm(b,(e,f)=>{d(a(e,f))})});if(n){var c=new WebAssembly.Instance(ta,Xa());return a(c,ta)}Ta??=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 Wa(b))}class Df{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}
var Ef=a=>{a.terminate();a.onmessage=()=>{}},Ff=[],Gf=0,Hf=null,Nf=a=>{0==If.length&&(Jf(),Kf(If[0]));var b=If.pop();if(!b)return 6;Lf.push(b);Mf[a.Sc]=b;b.Sc=a.Sc;var c={Uc:"run",te:a.se,ad:a.ad,Sc:a.Sc};l&&b.unref();b.postMessage(c,a.he);return 0},M=0,N=(a,b,...c)=>{var d=16*c.length,e=L(),f=Me(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=Ee(a,0,d,f,b);K(e);return a};
function Hd(a){if(n)return N(0,1,a);va=a;if(!(0<M)){for(var b of Lf)Ef(b);for(b of If)Ef(b);If=[];Lf=[];Mf={};ua=!0}ha(a,new Df(a))}function Of(a){if(n)return N(1,0,a);Pc(a)}var Pc=a=>{va=a;if(n)throw Of(a),"unwind";Hd(a)},If=[],Lf=[],he=[],Mf={};function Pf(){for(var a=g.numThreads-1;a--;)Jf();Ff.push(async()=>{var b=Qf();Gf++;await b;Gf--;0==Gf&&Hf&&(b=Hf,Hf=null,b())})}var Rf=a=>{var b=a.Sc;delete Mf[b];If.push(a);Lf.splice(Lf.indexOf(a),1);a.Sc=0;Fe(b)};function Ha(){he.forEach(a=>a())}
var Kf=a=>new Promise(b=>{a.onmessage=f=>{var h=f.data;f=h.Uc;if(h.$c&&h.$c!=ke()){var k=Mf[h.$c];k?k.postMessage(h,h.he):t(`Internal error! Worker sent a message "${f}" to target pthread ${h.$c}, but that thread no longer exists!`)}else if("checkMailbox"===f)La();else if("spawnThread"===f)Nf(h);else if("cleanupThread"===f)Sf(()=>{Rf(Mf[h.ue])});else if("loaded"===f)a.loaded=!0,l&&!a.Sc&&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.me](...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({Uc:"load",ne:c,we:v,xe:ta})});async function Qf(){if(!n)return Promise.all(If.map(Kf))}
function Jf(){var a=new Worker(new URL(import.meta.url),{type:"module",workerData:"em-pthread",name:"em-pthread"});If.push(a)}function Fa(a){var b=(u(),C)[a+52>>>2>>>0];a=(u(),C)[a+56>>>2>>>0];Le(b,b-a);K(b)}var Ka=(a,b)=>{M=0;a=Re(a,b);0<M?va=a:Ge(a)},v,Tf=[],Uf=0,O=a=>-9007199254740992>a||9007199254740992<a?NaN:Number(a);function $a(a){a>>>=0;var b=new Vf(a);0==(u(),w)[b.Vc+12>>>0]&&(Wf(b,!0),Uf--);Xf(b,!1);Tf.push(b);return Qe(a)}
var Yf=0,ab=()=>{J(0,0);var a=Tf.pop();Ne(a.nd);Yf=0};function Wf(a,b){b=b?1:0;(u(),w)[a.Vc+12>>>0]=b}function Xf(a,b){b=b?1:0;(u(),w)[a.Vc+13>>>0]=b}class Vf{constructor(a){this.nd=a;this.Vc=a-24}}var Zf=a=>{var b=Yf;if(!b)return Ke(0),0;var c=new Vf(b);(u(),C)[c.Vc+16>>>2>>>0]=b;var d=(u(),C)[c.Vc+4>>>2>>>0];if(!d)return Ke(0),b;for(var e of a){if(0===e||e===d)break;if(Pe(e,d,c.Vc+16))return Ke(e),b}Ke(d);return b};function bb(){return Zf([])}function cb(a){return Zf([a>>>0])}
function db(a,b,c,d){return Zf([a>>>0,b>>>0,c>>>0,d>>>0])}var eb=()=>{var a=Tf.pop();a||H("no exception to throw");var b=a.nd;0==(u(),w)[a.Vc+13>>>0]&&(Tf.push(a),Xf(a,!0),Wf(a,!1),Uf++);Oe(b);Yf=b;throw Yf;};function fb(a,b,c){a>>>=0;var d=new Vf(a);b>>>=0;c>>>=0;(u(),C)[d.Vc+16>>>2>>>0]=0;(u(),C)[d.Vc+4>>>2>>>0]=b;(u(),C)[d.Vc+8>>>2>>>0]=c;Oe(a);Yf=a;Uf++;throw Yf;}var gb=()=>Uf;function $f(a,b,c,d){return n?N(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 $f(a,b,c,d);a={se:c,Sc:a,ad:d,he:e};return n?(a.Uc="spawnThread",postMessage(a,e),0):Nf(a)}function ib(a){Yf||=a>>>0;throw Yf;}
var ag=globalThis.TextDecoder&&new TextDecoder,bg=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},cg=(a,b=0,c,d)=>{b>>>=0;c=bg(a,b,c,d);if(16<c-b&&a.buffer&&ag)return ag.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},dg=(a,b,c)=>(a>>>=0)?cg((u(),x),a,b,c):"";function jb(a,b,c){return n?N(3,1,a,b,c):0}function kb(a,b){if(n)return N(4,1,a,b)}function lb(a,b){if(n)return N(5,1,a,b)}function mb(a,b,c){if(n)return N(6,1,a,b,c)}function nb(a,b,c){return n?N(7,1,a,b,c):0}function ob(a,b){if(n)return N(8,1,a,b)}function pb(a,b,c){if(n)return N(9,1,a,b,c)}function qb(a,b,c,d){if(n)return N(10,1,a,b,c,d)}function rb(a,b,c,d){if(n)return N(11,1,a,b,c,d)}
function sb(a,b,c,d){if(n)return N(12,1,a,b,c,d)}function tb(a){if(n)return N(13,1,a)}function ub(a,b){if(n)return N(14,1,a,b)}function vb(a,b,c){if(n)return N(15,1,a,b,c)}var wb=()=>H(""),P=a=>{a>>>=0;for(var b="";;){var c=(u(),x)[a++>>>0];if(!c)return b;b+=String.fromCharCode(c)}},eg={},fg={},gg={},hg=class extends Error{constructor(a){super(a);this.name="BindingError"}};
function ig(a,b,c={}){var d=b.name;if(!a)throw new hg(`type "${d}" must have a positive integer typeid pointer`);if(fg.hasOwnProperty(a)){if(c.oe)return;throw new hg(`Cannot register type '${d}' twice`);}fg[a]=b;delete gg[a];eg.hasOwnProperty(a)&&(b=eg[a],delete eg[a],b.forEach(e=>e()))}function Q(a,b,c={}){return ig(a,b,c)}
var jg=(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(),B)[d>>>2>>>0]:d=>(u(),C)[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,Rc:f,Xc:(h,k)=>{"number"==typeof k&&(k=BigInt(k));return k},Wc:jg(b,c,!d),Yc:null})}function yb(a,b,c,d){a>>>=0;b=P(b>>>0);Q(a,{name:b,Rc:function(e){return!!e},Xc:function(e,f){return f?c:d},Wc:function(e){return this.Rc((u(),x)[e>>>0])},Yc:null})}var kg=[],lg=[0,1,,1,null,1,!0,1,!1,1];function Qb(a){a>>>=0;9<a&&0===--lg[a+1]&&(lg[a]=void 0,kg.push(a))}
var R=a=>{if(!a)throw new hg(`Cannot use deleted val. handle = ${a}`);return lg[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=kg.pop()||lg.length;lg[b]=a;lg[b+1]=1;return b}};function mg(a){return this.Rc((u(),C)[a>>>2>>>0])}var ng={name:"emscripten::val",Rc:a=>{var b=R(a);Qb(a);return b},Xc:(a,b)=>S(b),Wc:mg,Yc:null};function zb(a){return Q(a>>>0,ng)}
var og=(a,b)=>{switch(b){case 4:return function(c){return this.Rc((u(),Pa)[c>>>2>>>0])};case 8:return function(c){return this.Rc((u(),E)[c>>>3>>>0])};default:throw new TypeError(`invalid float width (${b}): ${a}`);}};function Ab(a,b,c){a>>>=0;c>>>=0;b=P(b>>>0);Q(a,{name:b,Rc:d=>d,Xc:(d,e)=>e,Wc:og(b,c),Yc:null})}function Cb(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,Rc:f,Xc:(k,m)=>m,Wc:jg(b,c,0!==d),Yc:null})}
function Db(a,b,c){function d(f){var h=(u(),C)[f>>>2>>>0];f=(u(),C)[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,Rc:d,Wc:d},{oe:!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,Rc(c){var d=(u(),C)[c>>>2>>>0];d=dg(c+4,d,!0);I(c);return d},Xc(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 hg("Cannot pass non-string to std::string");var f=e?U(d):d.length;var h=le(4+f+1),k=h+4;(u(),C)[h>>>2>>>0]=f;e?T(d,k,f+1):(u(),x).set(d,k>>>0);null!==c&&c.push(I,h);return h},Wc:mg,Yc(c){I(c)}})}
var pg=globalThis.TextDecoder?new TextDecoder("utf-16le"):void 0,qg=(a,b,c)=>{a>>>=1;b=bg((u(),Oa),a,b/2,c);if(16<b-a&&pg)return pg.decode((u(),Oa).slice(a,b));for(c="";a<b;++a){var d=(u(),Oa)[a>>>0];c+=String.fromCharCode(d)}return c},rg=(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},sg=a=>2*a.length,tg=(a,b,c)=>{var d="";a>>>=2;for(var e=0;!(e>=b/4);e++){var f=
(u(),C)[a+e>>>0];if(!f&&!c)break;d+=String.fromCodePoint(f)}return d},ug=(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(),B)[b>>>2>>>0]=f;b+=4;if(b+4>c)break}(u(),B)[b>>>2>>>0]=0;return b-d},vg=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=qg;var e=rg;var f=sg}else d=tg,e=ug,f=vg;Q(a,{name:c,Rc:h=>{var k=(u(),C)[h>>>2>>>0];k=d(h+4,k*b,!0);I(h);return k},Xc:(h,k)=>{if("string"!=typeof k)throw new hg(`Cannot pass non-string to C++ string type ${c}`);var m=f(k),p=le(4+m+b);(u(),C)[p>>>2>>>0]=m/b;e(k,p+4,m+b);null!==h&&h.push(I,p);return p},Wc:mg,Yc(h){I(h)}})}function Hb(a,b){a>>>=0;b=P(b>>>0);Q(a,{pe:!0,name:b,Rc:()=>{},Xc:()=>{}})}
function Ib(a){Ga(a>>>0,!ba,1,!aa,131072,!1);Ha()}var Sf=a=>{if(!ua)try{if(a(),!(0<M))try{n?ke()&&Ge(va):Pc(va)}catch(b){b instanceof Df||"unwind"==b||ha(1,b)}}catch(b){b instanceof Df||"unwind"==b||ha(1,b)}},wg=!Atomics.waitAsync||globalThis.navigator?.userAgent&&91>Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2]);function Ia(a){a>>>=0;wg||(Atomics.waitAsync((u(),B),a>>>2,a).value.then(La),a+=128,Atomics.store((u(),B),a>>>2,1))}var La=()=>Sf(()=>{var a=ke();a&&(Ia(a),Ie())});
function Jb(a,b){a>>>=0;a==b>>>0?setTimeout(La):n?postMessage({$c:a,Uc:"checkMailbox"}):(a=Mf[a])&&a.postMessage({Uc:"checkMailbox"})}var xg=[];function Kb(a,b,c,d,e){b>>>=0;e>>>=0;xg.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];xg.push(f)}return(b?yg[b]:zg[a])(...xg)}var Lb=()=>{M=0};function Mb(a){a>>>=0;n?postMessage({Uc:"cleanupThread",ue:a}):Rf(Mf[a])}function Nb(a){l&&Mf[a>>>0].ref()}var Ag=a=>{try{a()}catch(b){H(b)}};
function fe(a){var b=(...c)=>{Bg.push(a);try{return a(...c)}finally{ua||(Bg.pop(),r&&1===Cg&&0===Bg.length&&(Cg=0,M+=1,Ag(Af),"undefined"!=typeof Fibers&&Fibers.Oe()))}};Dg.set(a,b);return b}var Cg=0,r=null,Eg=0,Bg=[],Fg=new Map,Gg=new Map,Dg=new Map,Hg=0,Ig=null,Jg=[];function da(){return new Promise((a,b)=>{Ig={resolve:a,reject:b}})}
function Kg(){var a=le(65548),b=a+12;(u(),C)[a>>>2>>>0]=b;(u(),C)[a+4>>>2>>>0]=b+65536;b=Bg[0];if(!Fg.has(b)){var c=Hg++;Fg.set(b,c);Gg.set(c,b)}b=Fg.get(b);(u(),B)[a+8>>>2>>>0]=b;return a}function Lg(){var a=(u(),B)[r+8>>>2>>>0];a=Gg.get(a);a=Dg.get(a);--M;return a()}
function Mg(a){if(!ua){if(0===Cg){var b=!1,c=!1;a((d=0)=>{if(!ua&&(Eg=d,b=!0,c)){Cg=2;Ag(()=>Bf(r));"undefined"!=typeof MainLoop&&MainLoop.le&&MainLoop.resume();d=!1;try{var e=Lg()}catch(k){e=k,d=!0}var f=!1;if(!r){var h=Ig;h&&(Ig=null,(d?h.reject:h.resolve)(e),f=!0)}if(d&&!f)throw e;}});c=!0;b||(Cg=1,r=Kg(),"undefined"!=typeof MainLoop&&MainLoop.le&&MainLoop.pause(),Ag(()=>zf(r)))}else 2===Cg?(Cg=0,Ag(Cf),I(r),r=null,Jg.forEach(Sf)):H(`invalid state: ${Cg}`);return Eg}}var Ng=a=>Mg(b=>{a().then(b)});
function Ob(a){a>>>=0;return Ng(async()=>{var b=await R(a);return S(b)})}var Og=[],Pg=a=>{var b=Og.length;Og.push(a);return b},Qg=(a,b)=>{for(var c=Array(a),d=0;d<a;++d){var e=d,f=(u(),C)[b+4*d>>>2>>>0],h=fg[f];if(void 0===h)throw a=`parameter ${d}`,f=ie(f),b=P(f),I(f),new hg(`${a} has unknown type ${b}`);c[e]=h}return c},Rg=(a,b,c)=>{var d=[];a=a(d,c);d.length&&((u(),C)[b>>>2>>>0]=S(d));return a},Sg={},Tg=a=>{var b=Sg[a];return void 0===b?P(a):b};
function Pb(a,b,c){var [d,...e]=Qg(a,b>>>0);b=d.Xc.bind(d);var f=e.map(m=>m.Wc.bind(m));a--;var h={toValue:R};a=f.map((m,p)=>{var z=`argFromPtr${p}`;h[z]=m;return`${z}(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=Tg,k="toValue(handle)[getStringOrSymbol(methodName)]"}k+=`(${a})`;d.pe||(h.toReturnWire=b,h.emval_returnValue=Rg,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 Pg(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=Tg(a);return S(globalThis[a])}function Tb(a){a=Tg(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&&(lg[a+1]+=1)}function Wb(a,b,c,d,e){return Og[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(Tg(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(),B)[b>>>2>>>0]=a.getUTCSeconds();(u(),B)[b+4>>>2>>>0]=a.getUTCMinutes();(u(),B)[b+8>>>2>>>0]=a.getUTCHours();(u(),B)[b+12>>>2>>>0]=a.getUTCDate();(u(),B)[b+16>>>2>>>0]=a.getUTCMonth();(u(),B)[b+20>>>2>>>0]=a.getUTCFullYear()-1900;(u(),B)[b+24>>>2>>>0]=a.getUTCDay();a=(a.getTime()-Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0))/864E5|0;(u(),B)[b+28>>>2>>>0]=a}
var Ug=a=>0===a%4&&(0!==a%100||0===a%400),Vg=[0,31,60,91,121,152,182,213,244,274,305,335],Wg=[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(),B)[b>>>2>>>0]=a.getSeconds();(u(),B)[b+4>>>2>>>0]=a.getMinutes();(u(),B)[b+8>>>2>>>0]=a.getHours();(u(),B)[b+12>>>2>>>0]=a.getDate();(u(),B)[b+16>>>2>>>0]=a.getMonth();(u(),B)[b+20>>>2>>>0]=a.getFullYear()-1900;(u(),B)[b+24>>>2>>>0]=a.getDay();var c=(Ug(a.getFullYear())?Vg:Wg)[a.getMonth()]+a.getDate()-1|0;(u(),B)[b+28>>>2>>>0]=c;(u(),B)[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(),B)[b+32>>>2>>>0]=a}
function fc(a){a>>>=0;var b=new Date((u(),B)[a+20>>>2>>>0]+1900,(u(),B)[a+16>>>2>>>0],(u(),B)[a+12>>>2>>>0],(u(),B)[a+8>>>2>>>0],(u(),B)[a+4>>>2>>>0],(u(),B)[a>>>2>>>0],0),c=(u(),B)[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(),B)[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(),B)[a+24>>>2>>>0]=b.getDay();c=(Ug(b.getFullYear())?
Vg:Wg)[b.getMonth()]+b.getDate()-1|0;(u(),B)[a+28>>>2>>>0]=c;(u(),B)[a>>>2>>>0]=b.getSeconds();(u(),B)[a+4>>>2>>>0]=b.getMinutes();(u(),B)[a+8>>>2>>>0]=b.getHours();(u(),B)[a+12>>>2>>>0]=b.getDate();(u(),B)[a+16>>>2>>>0]=b.getMonth();(u(),B)[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?N(16,1,a,b,c,d,e,f,h):-52}function hc(a,b,c,d,e,f){if(n)return N(17,1,a,b,c,d,e,f)}var Xg={},sc=()=>performance.timeOrigin+performance.now();
function ic(a,b){if(n)return N(18,1,a,b);Xg[a]&&(clearTimeout(Xg[a].id),delete Xg[a]);if(!b)return 0;var c=setTimeout(()=>{delete Xg[a];Sf(()=>He(a,performance.timeOrigin+performance.now()))},b);Xg[a]={id:c,Ne: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(),C)[a>>>2>>>0]=60*h;(u(),B)[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(),Yg=1;
function kc(a,b,c){c>>>=0;if(!(0<=a&&3>=a))return 28;if(0===a)a=Date.now();else if(Yg)a=performance.timeOrigin+performance.now();else return 52;a=Math.round(1E6*a);(u(),F)[c>>>3>>>0]=BigInt(a);return 0}var Zg=[],$g=(a,b)=>{Zg.length=0;for(var c;c=(u(),x)[a++>>>0];){var d=105!=c;d&=112!=c;b+=d&&b%8?4:0;Zg.push(112==c?(u(),C)[b>>>2>>>0]:106==c?(u(),F)[b>>>3>>>0]:105==c?(u(),B)[b>>>2>>>0]:(u(),E)[b>>>3>>>0]);b+=d?8:4}return Zg};function lc(a,b,c){a>>>=0;b=$g(b>>>0,c>>>0);return yg[a](...b)}
function mc(a,b,c){a>>>=0;b=$g(b>>>0,c>>>0);return yg[a](...b)}var nc=()=>{};function pc(a,b){return t(dg(a>>>0,b>>>0))}var qc=()=>{M+=1;throw"unwind";};function rc(){return 4294901760}var tc=()=>1,uc=()=>l?require("os").cpus().length:navigator.hardwareConcurrency,ah={},bh=a=>{var b=U(a)+1,c=le(b);c&&T(a,c,b);return c},ch=a=>{var b;return(b=/\bwasm-function\[\d+\]:(0x[0-9a-f]+)/.exec(a))?+b[1]:(b=/:(\d+):\d+(?:\)|$)/.exec(a))?2147483648|+b[1]:0},dh=a=>{for(var b of a)(a=ch(b))&&(ah[a]=b)};
function xc(){var a=Error().stack.toString().split("\n");"Error"==a[0]&&a.shift();dh(a);ah.Xd=ch(a[3]);ah.re=a;return ah.Xd}function vc(a){a=ah[a>>>0];if(!a)return 0;var b;if(b=/^\s+at .*\.wasm\.(.*) \(.*\)$/.exec(a))a=b[1];else if(b=/^\s+at (.*) \(.*\)$/.exec(a))a=b[1];else if(b=/^(.+?)@/.exec(a))a=b[1];else return 0;I(vc.ae??0);vc.ae=bh(a);return vc.ae}
function wc(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}
function yc(a,b,c){a>>>=0;b>>>=0;if(ah.Xd==a)var d=ah.re;else d=Error().stack.toString().split("\n"),"Error"==d[0]&&d.shift(),dh(d);for(var e=3;d[e]&&ch(d[e])!=a;)++e;for(a=0;a<c&&d[a+e];++a)(u(),B)[b+4*a>>>2>>>0]=ch(d[a+e]);return a}
var V=a=>{var b=U(a)+1,c=Me(b);T(a,c,b);return c},eh=[],W=(a,b)=>{eh[a>>>=0]=b},X=[],fh=[],gh=(a,b)=>{fh[a]=new Promise(c=>b.finally(()=>c(a)))},Y=a=>{if(a)return eh[a>>>0]},hh=(a,b=0)=>{"pending"!=a.mapState||H();b=ue(b,"mapped"==a.mapState?3:1);W(b,a);"mapped"==a.mapState&&(X[b]=[]);return b},ih=(a,b=0)=>{var c=we(b);b=ve(b,c);W(c,a.queue);W(b,a);return b},jh=(a,b,c)=>{(u(),C)[a>>>2>>>0]=b;(u(),C)[a+4>>>2>>>0]=c},kh=a=>{var b=(u(),C)[a>>>2>>>0];a=(u(),C)[a+4>>>2>>>0];return dg(b,a)},Z=a=>{var b=
(u(),C)[a>>>2>>>0];a=(u(),C)[a+4>>>2>>>0];if(b)return dg(b,a);if(0===a)return""},lh=a=>{var b=Z(a+4);var c=(c=(u(),C)[a+12>>>2>>>0])?Y(c):"auto";if(a+=16){var d=Y((u(),C)[a+4>>>2>>>0]);var e=(u(),C)[a+16>>>2>>>0];var f=(u(),C)[a+20>>>2>>>0];if(e){for(var h={},k=0;k<e;++k){var m=f+24*k,p=kh(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}},mh=(a,b)=>{function c(e,f){e=a[e];(u(),B)[b+f>>>2>>>0]=e}function d(e,
f){e=a[e];(u(),F)[b+f>>>3>>>0]=BigInt(e)}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);d("maxUniformBufferBindingSize",64);d("maxStorageBufferBindingSize",72);c("maxVertexBuffers",88);d("maxBufferSize",96);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.Le&&c("maxImmediateSize",148)},nh=[,"validation","out-of-memory","internal"],oh=[,"compatibility","core"],ph={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",327692:"chromium-experimental-unorm16-texture-formats",327693:"chromium-experimental-snorm16-texture-formats",327732:"chromium-experimental-multi-draw-indirect"},qh=[,"low-power","high-performance"],rh=[,"occlusion","timestamp"],sh={undefined:1,unknown:1,
destroyed:2};
function zc(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(),C)[f+12>>>2>>>0];if(k){var m=(u(),C)[f+16>>>2>>>0];a.requiredFeatures=Array.from((u(),C).subarray(m>>>2>>>0,m+4*k>>>2>>>0),q=>ph[q])}var p=(u(),C)[f+20>>>2>>>0];if(p){var z={};function q(A,D,za=!1){D=p+D;D=(u(),C)[D>>>2>>>0];4294967295==D||za&&0==D||(z[A]=D)}function y(A,D){D=p+D;var za=(u(),C)[D>>>2>>>0],Bb=(u(),C)[D+4>>>2>>>0];if(4294967295!=za||4294967295!=Bb)z[A]=4294967296*(u(),C)[D+4>>>2>>>0]+(u(),
C)[D>>>2>>>0]}q("maxTextureDimension1D",4);q("maxTextureDimension2D",8);q("maxTextureDimension3D",12);q("maxTextureArrayLayers",16);q("maxBindGroups",20);q("maxBindGroupsPlusVertexBuffers",24);q("maxDynamicUniformBuffersPerPipelineLayout",32);q("maxDynamicStorageBuffersPerPipelineLayout",36);q("maxSampledTexturesPerShaderStage",40);q("maxSamplersPerShaderStage",44);q("maxStorageBuffersPerShaderStage",48);q("maxStorageTexturesPerShaderStage",52);q("maxUniformBuffersPerShaderStage",56);q("minUniformBufferOffsetAlignment",
80);q("minStorageBufferOffsetAlignment",84);y("maxUniformBufferBindingSize",64);y("maxStorageBufferBindingSize",72);q("maxVertexBuffers",88);y("maxBufferSize",96);q("maxVertexAttributes",104);q("maxVertexBufferArrayStride",108);q("maxInterStageShaderVariables",112);q("maxColorAttachments",116);q("maxColorAttachmentBytesPerSample",120);q("maxComputeWorkgroupStorageSize",124);q("maxComputeInvocationsPerWorkgroup",128);q("maxComputeWorkgroupSizeX",132);q("maxComputeWorkgroupSizeY",136);q("maxComputeWorkgroupSizeZ",
140);q("maxComputeWorkgroupsPerDimension",144);q("maxImmediateSize",148,!0);a.requiredLimits=z}if(k=(u(),C)[f+24>>>2>>>0])k={label:Z(k+4)},a.defaultQueue=k;a.label=Z(f+4)}M+=1;gh(b,h.requestDevice(a).then(q=>{--M;W(e,q.queue);W(d,q);c&&(M+=1,gh(c,q.lost.then(y=>{--M;q.onuncapturederror=()=>{};var A=L(),D=V(y.message);ye(c,sh[y.reason],D);K(A)})));q.onuncapturederror=y=>{var A=5;y.error instanceof GPUValidationError?A=2:y.error instanceof GPUOutOfMemoryError?A=3:y.error instanceof GPUInternalError&&
(A=4);var D=L();y=V(y.error.message);De(d,A,y);K(D)};"adapterInfo"in q||(q.adapterInfo=h.info);Ce(b,1,d,0)},q=>{--M;var y=L();q=V(q.message);Ce(b,3,d,q);c&&ye(c,4,q);K(y)}))}function Ac(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()}var th=()=>{var a="getMappedRange size=0 no longer means WGPU_WHOLE_MAP_SIZE";th.ed||(th.ed={});th.ed[a]||(th.ed[a]=1,l&&(a="warning: "+a),t(a))};
function Bc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=Y(a);0===c&&th();4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b,c)}catch(h){return 0}var f=Je(16,e.byteLength);(u(),x).set(new Uint8Array(e),f>>>0);X[a].push(()=>I(f));return f}
function Cc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=Y(a);0===c&&th();4294967295==c&&(c=void 0);try{var e=d.getMappedRange(b,c)}catch(h){return 0}var f=Je(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));I(f)});return f}
function Dc(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);M+=1;gh(b,f.mapAsync(c,d>>>0,e).then(()=>{--M;ze(b,1,0)},h=>{--M;L();var k=V(h.message);ze(b,"AbortError"===h.name?4:"OperationError"===h.name?3:0,k);delete X[a]}))}function Ec(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 Fc(a){delete eh[a>>>0]}
function Gc(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=!!(u(),C)[b+32>>>2>>>0];b={label:Z(b+4),usage:(u(),C)[b+16>>>2>>>0],size:4294967296*(u(),C)[b+28>>>2>>>0]+(u(),C)[b+24>>>2>>>0],mappedAtCreation:d};a=Y(a);try{var e=a.createBuffer(b)}catch(f){return!1}W(c,e);d&&(X[c]=[]);return!0}
function Hc(a,b,c,d){a>>>=0;b=O(b);d>>>=0;c=lh(c>>>0);a=Y(a);M+=1;gh(b,a.createComputePipelineAsync(c).then(e=>{--M;W(d,e);xe(b,1,d,0)},e=>{--M;var f=L(),h=V(e.message);xe(b,"validation"===e.reason?3:"internal"===e.reason?4:0,d,h);K(f)}))}function Ic(a,b,c){a>>>=0;b>>>=0;c>>>=0;var d=(u(),C)[b>>>2>>>0],e=(u(),C)[d+4>>>2>>>0];b={label:Z(b+4),code:""};switch(e){case 2:b.code=kh(d+8)}W(c,Y(a).createShaderModule(b))}var Jc=a=>{a=Y(a);a.onuncapturederror=null;a.destroy()};
function Kc(a,b){b=O(b);a=Y(a>>>0);M+=1;gh(b,a.popErrorScope().then(c=>{--M;var d=5;c?c instanceof GPUValidationError?d=2:c instanceof GPUOutOfMemoryError?d=3:c instanceof GPUInternalError&&(d=4):d=1;var e=L();c=c?V(c.message):0;Ae(b,1,d,c);K(e)},c=>{--M;var d=L();c=V(c.message);Ae(b,1,5,c);K(d)}))}
function Lc(a,b,c,d){b=O(b);c>>>=0;d>>>=0;if(c){var e=(u(),C)[c+4>>>2>>>0];e={featureLevel:oh[e],powerPreference:qh[(u(),C)[c+8>>>2>>>0]],forceFallbackAdapter:!!(u(),C)[c+12>>>2>>>0]};c=(u(),C)[c>>>2>>>0];0!==c&&(u(),e.Qe=!!(u(),C)[c+8>>>2>>>0])}"gpu"in navigator?(M+=1,gh(b,navigator.gpu.requestAdapter(e).then(f=>{--M;if(f)W(d,f),Be(b,1,d,0);else{f=L();var h=V("WebGPU not available on this browser (requestAdapter returned null)");Be(b,3,d,h);K(f)}},f=>{--M;var h=L();f=V(f.message);Be(b,4,d,f);K(h)}))):
(c=L(),e=V("WebGPU not available on this browser (navigator.gpu is not available)"),Be(b,3,d,e),K(c))}function Mc(a,b,c){a>>>=0;b>>>=0;c>>>=0;return Ng(async()=>{var d=[];if(c){var e=(u(),B)[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=4294967296*(u(),C)[a+8*f+4>>>2>>>0]+(u(),C)[a+8*f>>>2>>>0];if(!(h in fh))return h;d[f]=fh[h]}d=await Promise.race(d);delete fh[d];return d})}
var uh={},wh=()=>{if(!vh){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 uh)void 0===uh[b]?delete a[b]:a[b]=uh[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);vh=c}return vh},vh;function Nc(a,b){if(n)return N(19,1,a,b);a>>>=0;b>>>=0;var c=0,d=0,e;for(e of wh()){var f=b+c;(u(),C)[a+d>>>2>>>0]=f;c+=T(e,f,Infinity)+1;d+=4}return 0}
function Oc(a,b){if(n)return N(20,1,a,b);a>>>=0;b>>>=0;var c=wh();(u(),C)[a>>>2>>>0]=c.length;a=0;for(var d of c)a+=U(d)+1;(u(),C)[b>>>2>>>0]=a;return 0}function Qc(a){return n?N(21,1,a):52}function Rc(a,b,c,d){return n?N(22,1,a,b,c,d):52}function Sc(a,b,c,d){return n?N(23,1,a,b,c,d):70}var xh=[null,[],[]];
function Tc(a,b,c,d){if(n)return N(24,1,a,b,c,d);b>>>=0;c>>>=0;d>>>=0;for(var e=0,f=0;f<c;f++){var h=(u(),C)[b>>>2>>>0],k=(u(),C)[b+4>>>2>>>0];b+=8;for(var m=0;m<k;m++){var p=a,z=(u(),x)[h+m>>>0],q=xh[p];0===z||10===z?((1===p?ra:t)(cg(q)),q.length=0):q.push(z)}e+=k}(u(),C)[d>>>2>>>0]=e;return 0}function Gd(a){return a>>>0}function Id(a,b){mh(Y(a>>>0).limits,b>>>0);return 1}function Jd(a,b){return Y(a>>>0).features.has(ph[b])}function Kd(a){return BigInt(Y(a>>>0).size)}
function Ld(a){return BigInt(Y(a>>>0).usage)}function Md(a,b){a>>>=0;b>>>=0;if(b){var c=Z(b+4);b=(u(),C)[b+12>>>2>>>0];b=0!==b?{querySet:Y((u(),C)[b+4>>>2>>>0]),beginningOfPassWriteIndex:(u(),C)[b+8>>>2>>>0],endOfPassWriteIndex:(u(),C)[b+12>>>2>>>0]}:void 0;c={label:c,timestampWrites:b}}a=Y(a);b=se(0);W(b,a.beginComputePass(c));return b}function Nd(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 Od(a){a=Y(a>>>0);var b=qe(0);W(b,a.finish());return b}function Pd(a,b,c,d,e,f){f=O(f);Y(a>>>0).resolveQuerySet(Y(b>>>0),c,d,Y(e>>>0),f)}function Qd(a,b,c,d){Y(a>>>0).dispatchWorkgroups(b,c,d)}function Rd(a,b,c){c=O(c);Y(a>>>0).dispatchWorkgroupsIndirect(Y(b>>>0),c)}function Sd(a){Y(a>>>0).end()}function Td(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(),C),e>>>2,d)}function Ud(a,b){Y(a>>>0).setPipeline(Y(b>>>0))}
function Vd(a,b,c){Y(a>>>0).Pe(Y(b>>>0),c)}function Wd(a,b){a=Y(a>>>0);var c=pe(0);W(c,a.getBindGroupLayout(b));return c}
function Xd(a,b){a>>>=0;b>>>=0;var c=Z(b+4),d=Y((u(),C)[b+12>>>2>>>0]),e=(u(),C)[b+16>>>2>>>0];b=(u(),C)[b+20>>>2>>>0];for(var f=[],h=0;h<e;++h){var k=f,m=k.push;var p=b+40*h;var z=(u(),C)[p+8>>>2>>>0],q=(u(),C)[p+32>>>2>>>0],y=(u(),C)[p+36>>>2>>>0],A=(u(),C)[p+4>>>2>>>0];z?(q=p+24,q=(u(),C)[q>>>2>>>0]+4294967296*(u(),B)[q+4>>>2>>>0],-1==q&&(q=void 0),p={binding:A,resource:{buffer:Y(z),offset:4294967296*(u(),C)[p+4+16>>>2>>>0]+(u(),C)[p+16>>>2>>>0],size:q}}):p=q?{binding:A,resource:Y(q)}:{binding:A,
resource:Y(y)};m.call(k,p)}c={label:c,layout:d,entries:f};a=Y(a);d=oe(0);W(d,a.createBindGroup(c));return d}function Yd(a,b){a>>>=0;b>>>=0;var c;b&&(c={label:Z(b+4)});a=Y(a);b=re(0);W(b,a.createCommandEncoder(c));return b}function Zd(a,b){a>>>=0;b>>>=0;b={type:rh[(u(),C)[b+12>>>2>>>0]],count:(u(),C)[b+16>>>2>>>0]};a=Y(a);var c=te(0);W(c,a.createQuerySet(b));return c}
function $d(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=bh(a.vendor+a.architecture+a.device+a.description),d=U(a.vendor);jh(b+4,c,d);c+=d;d=U(a.architecture);jh(b+12,c,d);c+=d;d=U(a.device);jh(b+20,c,d);jh(b+28,c+d,U(a.description));(u(),B)[b+36>>>2>>>0]=2;a=a.isFallbackAdapter?3:4;(u(),B)[b+40>>>2>>>0]=a;(u(),B)[b+44>>>2>>>0]=0;(u(),B)[b+48>>>2>>>0]=0;return 1}
var yh={"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,"chromium-experimental-unorm16-texture-formats":327692,"chromium-experimental-snorm16-texture-formats":327693,"chromium-experimental-multi-draw-indirect":327732};function ae(a,b){b>>>=0;a=Y(a>>>0);var c=le(4*a.features.size),d=0,e=0;a.features.forEach(f=>{f=yh[f];0<=f&&((u(),B)[c+d>>>2>>>0]=f,d+=4,e++)});(u(),C)[b+4>>>2>>>0]=c;(u(),C)[b>>>2>>>0]=e}function be(a,b){mh(Y(a>>>0).limits,b>>>0);return 1}function ce(a,b){Y(a>>>0).pushErrorScope(nh[b])}
function de(a,b,c){b>>>=0;c>>>=0;a=Y(a>>>0);b=Array.from((u(),B).subarray(c>>>2>>>0,c+4*b>>>2>>>0),d=>Y(d));a.submit(b)}function ee(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||Pf();n||(v=new WebAssembly.Memory({initial:256,maximum:65536,shared:!0}),wa());g.wasmBinary&&(sa=g.wasmBinary);g.stackSave=()=>L();g.stackRestore=a=>K(a);g.stackAlloc=a=>Me(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(),B)[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(),C)[a>>>2>>>0]=b;break;default:H(`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(),B)[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(),C)[a>>>2>>>0];default:H(`invalid type for getValue: ${b}`)}};g.UTF8ToString=dg;g.stringToUTF8=T;g.lengthBytesUTF8=U;
var zg=[Hd,Of,$f,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,ub,vb,gc,hc,ic,Nc,Oc,Qc,Rc,Sc,Tc],yg={1113148:(a,b,c,d,e)=>{if("undefined"==typeof g||!g.Zc)return 1;a=dg(Number(a>>>0));a.startsWith("./")&&(a=a.substring(2));a=g.Zc.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.ie?g.ie(d,f):g.Ke(d,f);break;default:return 4}return 0}catch{return 4}},1113972:(a,b,c)=>{g.ke(a,(u(),
x).subarray(b>>>0,b+c>>>0))},1114036:()=>g.Ie(),1114078:a=>{g.je(a)},1114115:()=>"undefined"!==typeof wasmOffsetConverter};function Za(){return"undefined"!==typeof wasmOffsetConverter}var ie,Ja,je,ke,I,le,me,ne,oe,pe,qe,re,se,te,ue,ve,we,xe,ye,ze,Ae,Be,Ce,De,Ga,Ma,Ee,Fe,Ge,He,Ie,Je,J,Ke,Le,K,Me,L,Ne,Oe,Pe,Qe,dynCall_vii,Re,dynCall_v,Se,Te,Ue,dynCall_iii,Ve,We,Xe,dynCall_vi,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,xf,yf,zf,Af,Bf,Cf,Ya;
function ad(a,b,c,d){var e=L();try{return Xe(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function $c(a,b,c){var d=L();try{return dynCall_iii(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0)}}function sd(a,b,c){var d=L();try{dynCall_vii(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0)}}function Zc(a,b){var c=L();try{return Re(a,b)}catch(d){K(c);if(d!==d+0)throw d;J(1,0)}}function qd(a){var b=L();try{dynCall_v(a)}catch(c){K(b);if(c!==c+0)throw c;J(1,0)}}
function ed(a,b,c,d,e,f,h){var k=L();try{return Ue(a,b,c,d,e,f,h)}catch(m){K(k);if(m!==m+0)throw m;J(1,0)}}function rd(a,b){var c=L();try{dynCall_vi(a,b)}catch(d){K(c);if(d!==d+0)throw d;J(1,0)}}function wd(a,b,c,d,e,f){var h=L();try{Se(a,b,c,d,e,f)}catch(k){K(h);if(k!==k+0)throw k;J(1,0)}}function ud(a,b,c,d){var e=L();try{We(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function xd(a,b,c,d,e,f,h){var k=L();try{Ze(a,b,c,d,e,f,h)}catch(m){K(k);if(m!==m+0)throw m;J(1,0)}}
function Ed(a,b,c,d,e,f,h){var k=L();try{$e(a,b,c,d,e,f,h)}catch(m){K(k);if(m!==m+0)throw m;J(1,0)}}function Dd(a,b,c,d,e,f,h,k){var m=L();try{kf(a,b,c,d,e,f,h,k)}catch(p){K(m);if(p!==p+0)throw p;J(1,0)}}function vd(a,b,c,d,e){var f=L();try{Te(a,b,c,d,e)}catch(h){K(f);if(h!==h+0)throw h;J(1,0)}}function bd(a,b,c,d,e){var f=L();try{return Ye(a,b,c,d,e)}catch(h){K(f);if(h!==h+0)throw h;J(1,0)}}function yd(a,b,c,d,e,f,h,k){var m=L();try{lf(a,b,c,d,e,f,h,k)}catch(p){K(m);if(p!==p+0)throw p;J(1,0)}}
function Bd(a,b,c,d,e,f,h,k,m,p,z,q){var y=L();try{af(a,b,c,d,e,f,h,k,m,p,z,q)}catch(A){K(y);if(A!==A+0)throw A;J(1,0)}}function dd(a,b,c,d,e,f){var h=L();try{return hf(a,b,c,d,e,f)}catch(k){K(h);if(k!==k+0)throw k;J(1,0)}}function od(a,b,c){var d=L();try{return ef(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0);return 0n}}function zd(a,b,c,d,e,f,h,k,m){var p=L();try{Ve(a,b,c,d,e,f,h,k,m)}catch(z){K(p);if(z!==z+0)throw z;J(1,0)}}
function Yc(a){var b=L();try{return cf(a)}catch(c){K(b);if(c!==c+0)throw c;J(1,0)}}function ld(a,b,c){var d=L();try{return mf(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0)}}function nd(a,b){var c=L();try{return yf(a,b)}catch(d){K(c);if(d!==d+0)throw d;J(1,0);return 0n}}function Fd(a,b,c,d,e){var f=L();try{nf(a,b,c,d,e)}catch(h){K(f);if(h!==h+0)throw h;J(1,0)}}function md(a){var b=L();try{return bf(a)}catch(c){K(b);if(c!==c+0)throw c;J(1,0);return 0n}}
function hd(a,b,c,d,e,f){var h=L();try{return qf(a,b,c,d,e,f)}catch(k){K(h);if(k!==k+0)throw k;J(1,0)}}function cd(a,b,c,d,e,f){var h=L();try{return rf(a,b,c,d,e,f)}catch(k){K(h);if(k!==k+0)throw k;J(1,0)}}function fd(a,b,c,d,e,f,h,k){var m=L();try{return jf(a,b,c,d,e,f,h,k)}catch(p){K(m);if(p!==p+0)throw p;J(1,0)}}function pd(a,b,c,d,e){var f=L();try{return sf(a,b,c,d,e)}catch(h){K(f);if(h!==h+0)throw h;J(1,0);return 0n}}
function Xc(a,b,c,d){var e=L();try{return tf(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function Vc(a,b,c,d){var e=L();try{return uf(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function gd(a,b,c,d,e,f,h,k,m,p,z,q){var y=L();try{return vf(a,b,c,d,e,f,h,k,m,p,z,q)}catch(A){K(y);if(A!==A+0)throw A;J(1,0)}}function Ad(a,b,c,d,e,f,h,k,m,p,z){var q=L();try{of(a,b,c,d,e,f,h,k,m,p,z)}catch(y){K(q);if(y!==y+0)throw y;J(1,0)}}
function Cd(a,b,c,d,e,f,h,k,m,p,z,q,y,A,D,za){var Bb=L();try{pf(a,b,c,d,e,f,h,k,m,p,z,q,y,A,D,za)}catch(Eb){K(Bb);if(Eb!==Eb+0)throw Eb;J(1,0)}}function kd(a,b,c,d){var e=L();try{return wf(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function jd(a,b,c,d,e){var f=L();try{return xf(a,b,c,d,e)}catch(h){K(f);if(h!==h+0)throw h;J(1,0)}}function Wc(a,b,c){var d=L();try{return df(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0)}}
function Uc(a,b,c){var d=L();try{return ff(a,b,c)}catch(e){K(d);if(e!==e+0)throw e;J(1,0)}}function td(a,b,c,d){var e=L();try{gf(a,b,c,d)}catch(f){K(e);if(f!==f+0)throw f;J(1,0)}}function ge(){var a=G;a=Object.assign({},a);var b=d=>e=>d(e)>>>0,c=d=>()=>d()>>>0;a.ec=b(a.ec);a.Hc=c(a.Hc);a.Jc=b(a.Jc);a.vd=(d=>(e,f)=>d(e,f)>>>0)(a.vd);a.Ad=b(a.Ad);a.Bd=c(a.Bd);a.Fd=b(a.Fd);return a}
function Ea(){if(0<Gf)Hf=Ea;else if(n)xa?.(g),Sa();else{for(var a=Ff;0<a.length;)a.shift()(g);0<Gf?Hf=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=ne(0);const p=ih(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=je(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=hh(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]&&(me(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 z=Y(p),q=16*Math.ceil(Number(m)/
16);return async()=>{const y=z.createBuffer({size:q,usage:9});try{const A=z.createCommandEncoder();A.copyBufferToBuffer(k,0,y,0,q);z.queue.submit([A.finish()]);await y.mapAsync(GPUMapMode.READ);return y.getMappedRange().slice(0,m)}finally{y.destroy()}}};g.ie=(k,m)=>{var p=m.buffer;const z=m.byteOffset,q=m.byteLength;m=16*Math.ceil(Number(q)/16);k=Y(k);if(!d){var y=je(e);d=Y(y)}y=d.createBuffer({mappedAtCreation:!0,size:m,usage:6});const A=y.getMappedRange();(new Uint8Array(A)).set(new Uint8Array(p,
z,q));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.Ie,g.je,g.webnnEnsureTensor,g.ke,g.webnnDownloadTensor,g.He,g.webnnEnableTraceEvent]=a.slice(1);g.webnnReleaseTensorId=g.je;g.webnnUploadTensor=g.ke;g.webnnRegisterMLContext=g.He;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.Zc,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();
