/*! * ONNX Runtime Web v1.14.0 * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ort=e():t.ort=e()}(self,(function(){return function(){var __webpack_modules__={8453:function(t,e,n){"use strict";n.r(e),n.d(e,{InferenceSession:function(){return d},Tensor:function(){return p},env:function(){return a},registerBackend:function(){return i}});const r={},o=[],i=(t,e,n)=>{if(!e||"function"!=typeof e.init||"function"!=typeof e.createSessionHandler)throw new TypeError("not a valid backend");{const i=r[t];if(void 0===i)r[t]={backend:e,priority:n};else{if(i.priority>n)return;if(i.priority===n&&i.backend!==e)throw new Error(`cannot register backend "${t}" using priority ${n}`)}if(n>=0){const e=o.indexOf(t);-1!==e&&o.splice(e,1);for(let e=0;e{let e=1;for(let n=0;n{const o=document.createElement("canvas"),i=o.getContext("2d");if(!t||!i)return r();const a=new Image;a.crossOrigin="Anonymous",a.src=t,a.onload=()=>{o.width=a.width,o.height=a.height,i.drawImage(a,0,0,o.width,o.height);const t=i.getImageData(0,0,o.width,o.height);if(void 0!==e){if(void 0!==e.height&&e.height!==o.height)throw new Error("Image input config height doesn't match ImageBitmap height");if(s.height=o.height,void 0!==e.width&&e.width!==o.width)throw new Error("Image input config width doesn't match ImageBitmap width");s.width=o.width}else s.height=o.height,s.width=o.width;n(f.bufferToTensor(t.data,s))}}));throw new Error("Input data provided is not supported - aborted tensor creation")}{const n="RGBA";let r,o;if(void 0!==e&&void 0!==e.resizedWidth&&void 0!==e.resizedHeight?(r=e.resizedHeight,o=e.resizedWidth):(r=t.height,o=t.width),void 0!==e){if(s=e,void 0!==e.bitmapFormat&&e.bitmapFormat!==n)throw new Error("Image input config format must be RGBA for ImageData");s.bitmapFormat="RGBA"}else s.bitmapFormat="RGBA";if(s.height=r,s.width=o,void 0!==e){const e=document.createElement("canvas");e.width=o,e.height=r;const n=e.getContext("2d");if(null==n)throw new Error("Can not access image data");n.putImageData(t,0,0),a=n.getImageData(0,0,o,r).data}else a=t.data}}if(void 0!==a)return f.bufferToTensor(a,s);throw new Error("Input data provided is not supported - aborted tensor creation")}toImageData(t){var e,n;const r=document.createElement("canvas").getContext("2d");let o;if(null==r)throw new Error("Can not access image data");{const i=this.dims[3],a=this.dims[2],s=this.dims[1],u=void 0!==t&&void 0!==t.format?t.format:"RGB",c=void 0!==t&&void 0!==(null===(e=t.norm)||void 0===e?void 0:e.mean)?t.norm.mean:255,l=void 0!==t&&void 0!==(null===(n=t.norm)||void 0===n?void 0:n.bias)?t.norm.bias:0,f=a*i;if(void 0!==t){if(void 0!==t.height&&t.height!==a)throw new Error("Image output config height doesn't match tensor height");if(void 0!==t.width&&t.width!==i)throw new Error("Image output config width doesn't match tensor width");if(void 0!==t.format&&4===s&&"RGBA"!==t.format||3===s&&"RGB"!==t.format&&"BGR"!==t.format)throw new Error("Tensor format doesn't match input tensor dims")}const p=4;let h=0,d=1,g=2,b=3,y=0,m=f,v=2*f,_=-1;"RGBA"===u?(y=0,m=f,v=2*f,_=3*f):"RGB"===u?(y=0,m=f,v=2*f):"RBG"===u&&(y=0,v=f,m=2*f),o=r.createImageData(i,a);for(let t=0;t=r.byteLength)throw new RangeError(`'byteOffset' is out of range [0, ${r.byteLength}).`);if(u=t.byteLength-o,"number"==typeof n){if(u=n,!Number.isSafeInteger(u))throw new RangeError("'byteLength' must be an integer.");if(u<=0||o+u>r.byteLength)throw new RangeError(`'byteLength' is out of range (0, ${r.byteLength-o}].`);if("object"==typeof i&&null!==i)s=i;else if(void 0!==i)throw new TypeError("'options' must be an object.")}else if(void 0!==n)throw new TypeError("'byteLength' must be a number.")}else if(void 0!==e)throw new TypeError("'options' must be an object.");a=new Uint8Array(r,o,u)}}const u=(s.executionProviders||[]).map((t=>"string"==typeof t?t:t.name)),c=await(async t=>{const e=0===t.length?o:t,n=[];for(const t of e){const e=r[t];if(e){if(e.initialized)return e.backend;if(e.aborted)continue;const r=!!e.initPromise;try{return r||(e.initPromise=e.backend.init()),await e.initPromise,e.initialized=!0,e.backend}catch(o){r||n.push({name:t,err:o}),e.aborted=!0}finally{delete e.initPromise}}}throw new Error(`no available backend found. ERR: ${n.map((t=>`[${t.name}] ${t.err}`)).join(", ")}`)})(u),l=await c.createSessionHandler(a,s);return new h(l)}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}const d=h},3474:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return k.buffer!=F&&W(k.buffer),N}function r(){return k.buffer!=F&&W(k.buffer),R}function o(){return k.buffer!=F&&W(k.buffer),L}function i(){return k.buffer!=F&&W(k.buffer),M}function a(){return k.buffer!=F&&W(k.buffer),j}var s,u,c;t=t||{},s||(s=void 0!==t?t:{}),s.ready=new Promise((function(t,e){u=t,c=e}));var l,f,p,h,d,g,b=Object.assign({},s),y="./this.program",m=(t,e)=>{throw e},v="object"==typeof window,_="function"==typeof importScripts,w="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,x=s.ENVIRONMENT_IS_PTHREAD||!1,T="";function S(t){return s.locateFile?s.locateFile(t,T):T+t}if(w){let e;T=_?n(908).dirname(T)+"/":"//",g=()=>{d||(h=n(1384),d=n(908))},l=function(t,e){return g(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=l(t,!0)).buffer||(t=new Uint8Array(t)),t),f=(t,e,n)=>{g(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if($())throw process.exitCode=t,e;e instanceof ut||P("exiting due to exception: "+e),process.exit(t)},s.inspect=function(){return"[Emscripten Module object]"};try{e=n(9925)}catch(t){throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'),t}n.g.Worker=e.Worker}else(v||_)&&(_?T=self.location.href:"undefined"!=typeof document&&document.currentScript&&(T=document.currentScript.src),_scriptDir&&(T=_scriptDir),T=0!==T.indexOf("blob:")?T.substr(0,T.replace(/[?#].*/,"").lastIndexOf("/")+1):"",w||(l=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),f=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));w&&"undefined"==typeof performance&&(n.g.performance=n(6953).performance);var O=console.log.bind(console),A=console.warn.bind(console);w&&(g(),O=t=>h.writeSync(1,t+"\n"),A=t=>h.writeSync(2,t+"\n"));var E,I=s.print||O,P=s.printErr||A;Object.assign(s,b),b=null,s.thisProgram&&(y=s.thisProgram),s.quit&&(m=s.quit),s.wasmBinary&&(E=s.wasmBinary);var D=s.noExitRuntime||!1;"object"!=typeof WebAssembly&&ot("no native wasm support detected");var k,C,F,N,R,L,M,j,U=!1,V="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function B(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&t[e++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function z(t,e){return(t>>>=0)?B(r(),t,e):""}function G(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-o}function H(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function W(t){F=t,s.HEAP8=N=new Int8Array(t),s.HEAP16=new Int16Array(t),s.HEAP32=L=new Int32Array(t),s.HEAPU8=R=new Uint8Array(t),s.HEAPU16=new Uint16Array(t),s.HEAPU32=M=new Uint32Array(t),s.HEAPF32=new Float32Array(t),s.HEAPF64=j=new Float64Array(t)}x&&(F=s.buffer);var q=s.INITIAL_MEMORY||16777216;if(x)k=s.wasmMemory,F=s.buffer;else if(s.wasmMemory)k=s.wasmMemory;else if(!((k=new WebAssembly.Memory({initial:q/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw P("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),w&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");k&&(F=k.buffer),q=F.byteLength,W(F);var X,Y=[],K=[],Z=[],J=[];function $(){return D||!1}function Q(){var t=s.preRun.shift();Y.unshift(t)}var tt,et=0,nt=null,rt=null;function ot(t){throw x?postMessage({cmd:"onAbort",arg:t}):s.onAbort&&s.onAbort(t),P(t="Aborted("+t+")"),U=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),c(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function at(){var t=tt;try{if(t==tt&&E)return new Uint8Array(E);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){ot(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=S(tt));var st={};function ut(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function ct(t){(t=ht.Vb[t])||ot(),ht.mc(t)}function lt(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function ft(t){if(x)return Xt(1,1,t);$()||(ht.oc(),s.onExit&&s.onExit(t),U=!0),m(t,new ut(t))}function pt(t,e){if(!e&&x)throw bt(t),"unwind";$()||x||(ye(),dt(Z),be(0),re[1].length&&oe(1,10),re[2].length&&oe(2,10),ht.oc()),ft(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){x&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,D=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,xe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var o=ht.Vb[n.Qc];o?o.postMessage(n,n.transferList):P('Internal error! Worker sent a message "'+r+'" to target pthread '+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?Bt(n.queue):"spawnThread"===r?lt(n):"cleanupThread"===r?ct(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),xe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?I("Thread "+n.threadId+": "+n.text):"printErr"===r?P("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?s.onAbort&&s.onAbort(n.arg):r&&P("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw P("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},w&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:s.mainScriptUrlOrBlob||_scriptDir,wasmMemory:k,wasmModule:C})},yc:function(){var t=S("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=o()[t+48>>2>>>0],Oe(e,e-t),Ee(e)};var yt=[];function mt(t){var e=yt[t];return e||(t>=yt.length&&(yt.length=t+1),yt[t]=e=X.get(t)),e}s.invokeEntryPoint=function(t,e){t=mt(t)(e),$()?ht.nc(t):Te(t)};var vt,_t,wt=[],xt=0,Tt=0;function St(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){o()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(o(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(o(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(De(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Ot(t){return ge(new St(t).Sb)}function At(t,e,n,r){return x?Xt(3,1,t,e,n,r):Et(t,e,n,r)}function Et(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return P("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var o=[];return x&&0===o.length?At(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:o},x?(t.Oc="spawnThread",postMessage(t,o),0):lt(t))}function It(t,e,n){return x?Xt(4,1,t,e,n):0}function Pt(t,e){if(x)return Xt(5,1,t,e)}function Dt(t,e){if(x)return Xt(6,1,t,e)}function kt(t,e,n){if(x)return Xt(7,1,t,e,n)}function Ct(t,e,n){return x?Xt(8,1,t,e,n):0}function Ft(t,e){if(x)return Xt(9,1,t,e)}function Nt(t,e,n){if(x)return Xt(10,1,t,e,n)}function Rt(t,e,n,r){if(x)return Xt(11,1,t,e,n,r)}function Lt(t,e,n,r){if(x)return Xt(12,1,t,e,n,r)}function Mt(t,e,n,r){if(x)return Xt(13,1,t,e,n,r)}function jt(t){if(x)return Xt(14,1,t)}function Ut(t,e){if(x)return Xt(15,1,t,e)}function Vt(t,e,n){if(x)return Xt(16,1,t,e,n)}function Bt(t){Atomics.store(o(),t>>2,1),he()&&we(t),Atomics.compareExchange(o(),t>>2,1,0)}function zt(t){return i()[t>>>2]+4294967296*o()[t+4>>>2]}function Gt(t,e,n,r,o,i){return x?Xt(17,1,t,e,n,r,o,i):-52}function Ht(t,e,n,r,o,i){if(x)return Xt(18,1,t,e,n,r,o,i)}function Wt(t){var n=H(t)+1,r=de(n);return r&&G(t,e(),r,n),r}function qt(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}if(x)return Xt(19,1,t,e,n);var a=(new Date).getFullYear(),s=new Date(a,0,1),u=new Date(a,6,1);a=s.getTimezoneOffset();var c=u.getTimezoneOffset(),l=Math.max(a,c);o()[t>>2>>>0]=60*l,o()[e>>2>>>0]=Number(a!=c),t=r(s),e=r(u),t=Wt(t),e=Wt(e),c>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function Xt(t,e){var n=arguments.length-2,r=arguments;return gt((()=>{for(var o=Ie(8*n),i=o>>3,s=0;s>>0]=u}return _e(t,n,o,e)}))}s.executeNotifiedProxyingQueue=Bt,_t=w?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:x?()=>performance.now()-s.__performance_now_clock_drift:()=>performance.now();var Yt,Kt=[],Zt={};function Jt(){if(!Yt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:y||"./this.program"};for(t in Zt)void 0===Zt[t]?delete e[t]:e[t]=Zt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Yt=n}return Yt}function $t(t,n){if(x)return Xt(20,1,t,n);var r=0;return Jt().forEach((function(o,a){var s=n+r;for(a=i()[t+4*a>>2>>>0]=s,s=0;s>0>>>0]=o.charCodeAt(s);e()[a>>0>>>0]=0,r+=o.length+1})),0}function Qt(t,e){if(x)return Xt(21,1,t,e);var n=Jt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return x?Xt(22,1,t):52}function ee(t,e,n,r){return x?Xt(23,1,t,e,n,r):52}function ne(t,e,n,r,o){return x?Xt(24,1,t,e,n,r,o):70}var re=[null,[],[]];function oe(t,e){var n=re[t];0===e||10===e?((1===t?I:P)(B(n,0)),n.length=0):n.push(e)}function ie(t,e,n,o){if(x)return Xt(25,1,t,e,n,o);for(var a=0,s=0;s>2>>>0],c=i()[e+4>>2>>>0];e+=8;for(var l=0;l>>0]);a+=c}return i()[o>>2>>>0]=a,0}var ae=0;function se(t){return 0==t%4&&(0!=t%100||0==t%400)}var ue=[31,29,31,30,31,30,31,31,30,31,30,31],ce=[31,28,31,30,31,30,31,31,30,31,30,31];function le(t,n,r,i){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=c(new Date(t.getFullYear(),0,4)),n=c(n),0>=u(e,t)?0>=u(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=o()[i+40>>2>>>0];for(var p in i={Lc:o()[i>>2>>>0],Kc:o()[i+4>>2>>>0],dc:o()[i+8>>2>>>0],jc:o()[i+12>>2>>>0],ec:o()[i+16>>2>>>0],Xb:o()[i+20>>2>>>0],Tb:o()[i+24>>2>>>0],Wb:o()[i+28>>2>>>0],Rc:o()[i+32>>2>>>0],Jc:o()[i+36>>2>>>0],Mc:f?z(f):""},r=z(r),f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),f[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in f={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return s((t.Xb+1900)/100|0,2)},"%d":function(t){return s(t.jc,2)},"%e":function(t){return a(t.jc,2," ")},"%g":function(t){return l(t).toString().substring(2)},"%G":function(t){return l(t)},"%H":function(t){return s(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return s(t.Lc,2)},"%t":function(){return"\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return s(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&se(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&se(t.Xb%400-1))&&e++}return s(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return s(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),f[p](i)));return p=function(t){var e=Array(H(t)+1);return G(t,e,0,e.length),e}(r=r.replace(/\0\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var fe=[null,ft,bt,At,It,Pt,Dt,kt,Ct,Ft,Nt,Rt,Lt,Mt,jt,Ut,Vt,Gt,Ht,qt,$t,Qt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new St(t)).uc()||(t.hc(!0),xt--),t.ic(!1),wt.push(t),t.sc(),t.vc()},ma:function(t){throw P("Unexpected exception thrown, this is not properly supported - aborting"),U=!0,t},x:function(){Se(0);var t=wt.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&mt(e)(t.Zb),Ot(t.Zb)}Tt=0},e:function(){var t=Tt;if(!t)return ae=0;var e=new St(t);e.cc(t);var n=e.bc();if(!n)return ae=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;oBt(r)));else if(x)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*zt(t)),o()[e>>2>>>0]=t.getUTCSeconds(),o()[e+4>>2>>>0]=t.getUTCMinutes(),o()[e+8>>2>>>0]=t.getUTCHours(),o()[e+12>>2>>>0]=t.getUTCDate(),o()[e+16>>2>>>0]=t.getUTCMonth(),o()[e+20>>2>>>0]=t.getUTCFullYear()-1900,o()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,o()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*zt(t)),o()[e>>2>>>0]=t.getSeconds(),o()[e+4>>2>>>0]=t.getMinutes(),o()[e+8>>2>>>0]=t.getHours(),o()[e+12>>2>>>0]=t.getDate(),o()[e+16>>2>>>0]=t.getMonth(),o()[e+20>>2>>>0]=t.getFullYear()-1900,o()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;o()[e+28>>2>>>0]=r,o()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),o()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(o()[t+20>>2>>>0]+1900,o()[t+16>>2>>>0],o()[t+12>>2>>>0],o()[t+8>>2>>>0],o()[t+4>>2>>>0],o()[t>>2>>>0],0),n=o()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1).getTimezoneOffset(),s=i.getTimezoneOffset(),u=Math.min(s,a);return 0>n?o()[t+32>>2>>>0]=Number(a!=s&&u==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,o()[t+28>>2>>>0]=n,o()[t>>2>>>0]=e.getSeconds(),o()[t+4>>2>>>0]=e.getMinutes(),o()[t+8>>2>>>0]=e.getHours(),o()[t+12>>2>>>0]=e.getDate(),o()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Gt,Ba:Ht,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,qt(e,n,r))},y:function(){ot("")},U:function(){if(!w&&!_){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";vt||(vt={}),vt[t]||(vt[t]=1,w&&(t="warning: "+t),P(t))}},ra:function(){return 4294901760},B:_t,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return w?n(3993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Kt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?st[-t-1]:fe[t]).apply(null,Kt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var o=e*(1+.2/n);o=Math.min(o,t+100663296);var i=Math;o=Math.max(t,o),i=i.min.call(i,4294901760,o+(65536-o%65536)%65536);t:{try{k.grow(i-F.byteLength+65535>>>16),W(k.buffer);var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Na:function(){throw"unwind"},Ga:$t,Ha:Qt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return ae},na:function t(r,o){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(w)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>ot("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ja:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},K:function(t){var e=Ae();try{return mt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},f:function(t,e){var n=Ae();try{return mt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},P:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},Q:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},k:function(t,e,n){var r=Ae();try{return mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},p:function(t,e,n,r){var o=Ae();try{return mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},q:function(t,e,n,r,o){var i=Ae();try{return mt(t)(e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},N:function(t,e,n,r,o,i){var a=Ae();try{return mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},s:function(t,e,n,r,o,i){var a=Ae();try{return mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},w:function(t,e,n,r,o,i,a){var s=Ae();try{return mt(t)(e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},L:function(t,e,n,r,o,i,a,s){var u=Ae();try{return mt(t)(e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},E:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Ae();try{return mt(t)(e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},aa:function(t,e,n,r,o,i,a,s){var u=Ae();try{return Ue(t,e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},_:function(t,e,n,r,o,i,a){var s=Ae();try{return Ce(t,e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},Z:function(t,e,n,r,o){var i=Ae();try{return Ve(t,e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},ca:function(t,e,n,r){var o=Ae();try{return Me(t,e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},$:function(t){var e=Ae();try{return ke(t)}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},ba:function(t,e){var n=Ae();try{return je(t,e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},Y:function(t,e,n){var r=Ae();try{return Fe(t,e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},g:function(t){var e=Ae();try{mt(t)()}catch(t){if(Ee(e),t!==t+0)throw t;Se(1,0)}},r:function(t,e){var n=Ae();try{mt(t)(e)}catch(t){if(Ee(n),t!==t+0)throw t;Se(1,0)}},i:function(t,e,n){var r=Ae();try{mt(t)(e,n)}catch(t){if(Ee(r),t!==t+0)throw t;Se(1,0)}},ha:function(t,e,n,r){var o=Ae();try{mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},m:function(t,e,n,r){var o=Ae();try{mt(t)(e,n,r)}catch(t){if(Ee(o),t!==t+0)throw t;Se(1,0)}},v:function(t,e,n,r,o){var i=Ae();try{mt(t)(e,n,r,o)}catch(t){if(Ee(i),t!==t+0)throw t;Se(1,0)}},u:function(t,e,n,r,o,i){var a=Ae();try{mt(t)(e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},O:function(t,e,n,r,o,i,a){var s=Ae();try{mt(t)(e,n,r,o,i,a)}catch(t){if(Ee(s),t!==t+0)throw t;Se(1,0)}},A:function(t,e,n,r,o,i,a,s){var u=Ae();try{mt(t)(e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},ka:function(t,e,n,r,o,i,a,s,u){var c=Ae();try{mt(t)(e,n,r,o,i,a,s,u)}catch(t){if(Ee(c),t!==t+0)throw t;Se(1,0)}},C:function(t,e,n,r,o,i,a,s,u,c,l){var f=Ae();try{mt(t)(e,n,r,o,i,a,s,u,c,l)}catch(t){if(Ee(f),t!==t+0)throw t;Se(1,0)}},D:function(t,e,n,r,o,i,a,s,u,c,l,f,p,h,d,g){var b=Ae();try{mt(t)(e,n,r,o,i,a,s,u,c,l,f,p,h,d,g)}catch(t){if(Ee(b),t!==t+0)throw t;Se(1,0)}},fa:function(t,e,n,r,o,i,a,s){var u=Ae();try{Ne(t,e,n,r,o,i,a,s)}catch(t){if(Ee(u),t!==t+0)throw t;Se(1,0)}},da:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Ae();try{Le(t,e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(Ee(p),t!==t+0)throw t;Se(1,0)}},ea:function(t,e,n,r,o,i){var a=Ae();try{Re(t,e,n,r,o,i)}catch(t){if(Ee(a),t!==t+0)throw t;Se(1,0)}},o:function(t){return t},a:k||s.wasmMemory,G:function(t){ae=t},la:le,z:function(t,e,n,r){return le(t,e,n,r)}};!function(){function t(t,e){s.asm=t.exports,ht.qc.push(s.asm.sb),X=s.asm.ub,K.unshift(s.asm.Va),C=e,x||(et--,s.monitorRunDependencies&&s.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!E&&(v||_)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+tt+"'";return t.arrayBuffer()})).catch((function(){return at()}));if(f)return new Promise((function(t,e){f(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return at()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){P("failed to asynchronously prepare wasm: "+t),ot(t)}))}var r={a:pe};if(x||(et++,s.monitorRunDependencies&&s.monitorRunDependencies(et)),s.instantiateWasm)try{return s.instantiateWasm(r,t)}catch(t){return P("Module.instantiateWasm callback failed with error: "+t),!1}(E||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||w||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return P("wasm streaming compile failed: "+t),P("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(c)}(),s.___wasm_call_ctors=function(){return(s.___wasm_call_ctors=s.asm.Va).apply(null,arguments)},s._OrtInit=function(){return(s._OrtInit=s.asm.Wa).apply(null,arguments)},s._OrtCreateSessionOptions=function(){return(s._OrtCreateSessionOptions=s.asm.Xa).apply(null,arguments)},s._OrtAppendExecutionProvider=function(){return(s._OrtAppendExecutionProvider=s.asm.Ya).apply(null,arguments)},s._OrtAddSessionConfigEntry=function(){return(s._OrtAddSessionConfigEntry=s.asm.Za).apply(null,arguments)},s._OrtReleaseSessionOptions=function(){return(s._OrtReleaseSessionOptions=s.asm._a).apply(null,arguments)},s._OrtCreateSession=function(){return(s._OrtCreateSession=s.asm.$a).apply(null,arguments)},s._OrtReleaseSession=function(){return(s._OrtReleaseSession=s.asm.ab).apply(null,arguments)},s._OrtGetInputCount=function(){return(s._OrtGetInputCount=s.asm.bb).apply(null,arguments)},s._OrtGetOutputCount=function(){return(s._OrtGetOutputCount=s.asm.cb).apply(null,arguments)},s._OrtGetInputName=function(){return(s._OrtGetInputName=s.asm.db).apply(null,arguments)},s._OrtGetOutputName=function(){return(s._OrtGetOutputName=s.asm.eb).apply(null,arguments)},s._OrtFree=function(){return(s._OrtFree=s.asm.fb).apply(null,arguments)},s._OrtCreateTensor=function(){return(s._OrtCreateTensor=s.asm.gb).apply(null,arguments)},s._OrtGetTensorData=function(){return(s._OrtGetTensorData=s.asm.hb).apply(null,arguments)},s._OrtReleaseTensor=function(){return(s._OrtReleaseTensor=s.asm.ib).apply(null,arguments)},s._OrtCreateRunOptions=function(){return(s._OrtCreateRunOptions=s.asm.jb).apply(null,arguments)},s._OrtAddRunConfigEntry=function(){return(s._OrtAddRunConfigEntry=s.asm.kb).apply(null,arguments)},s._OrtReleaseRunOptions=function(){return(s._OrtReleaseRunOptions=s.asm.lb).apply(null,arguments)},s._OrtRun=function(){return(s._OrtRun=s.asm.mb).apply(null,arguments)},s._OrtEndProfiling=function(){return(s._OrtEndProfiling=s.asm.nb).apply(null,arguments)};var he=s._pthread_self=function(){return(he=s._pthread_self=s.asm.ob).apply(null,arguments)},de=s._malloc=function(){return(de=s._malloc=s.asm.pb).apply(null,arguments)},ge=s._free=function(){return(ge=s._free=s.asm.qb).apply(null,arguments)},be=s._fflush=function(){return(be=s._fflush=s.asm.rb).apply(null,arguments)};s.__emscripten_tls_init=function(){return(s.__emscripten_tls_init=s.asm.sb).apply(null,arguments)};var ye=s.___funcs_on_exit=function(){return(ye=s.___funcs_on_exit=s.asm.tb).apply(null,arguments)},me=s.__emscripten_thread_init=function(){return(me=s.__emscripten_thread_init=s.asm.vb).apply(null,arguments)};s.__emscripten_thread_crashed=function(){return(s.__emscripten_thread_crashed=s.asm.wb).apply(null,arguments)};var ve,_e=s._emscripten_run_in_main_runtime_thread_js=function(){return(_e=s._emscripten_run_in_main_runtime_thread_js=s.asm.xb).apply(null,arguments)},we=s.__emscripten_proxy_execute_task_queue=function(){return(we=s.__emscripten_proxy_execute_task_queue=s.asm.yb).apply(null,arguments)},xe=s.__emscripten_thread_free_data=function(){return(xe=s.__emscripten_thread_free_data=s.asm.zb).apply(null,arguments)},Te=s.__emscripten_thread_exit=function(){return(Te=s.__emscripten_thread_exit=s.asm.Ab).apply(null,arguments)},Se=s._setThrew=function(){return(Se=s._setThrew=s.asm.Bb).apply(null,arguments)},Oe=s._emscripten_stack_set_limits=function(){return(Oe=s._emscripten_stack_set_limits=s.asm.Cb).apply(null,arguments)},Ae=s.stackSave=function(){return(Ae=s.stackSave=s.asm.Db).apply(null,arguments)},Ee=s.stackRestore=function(){return(Ee=s.stackRestore=s.asm.Eb).apply(null,arguments)},Ie=s.stackAlloc=function(){return(Ie=s.stackAlloc=s.asm.Fb).apply(null,arguments)},Pe=s.___cxa_can_catch=function(){return(Pe=s.___cxa_can_catch=s.asm.Gb).apply(null,arguments)},De=s.___cxa_is_pointer_type=function(){return(De=s.___cxa_is_pointer_type=s.asm.Hb).apply(null,arguments)},ke=s.dynCall_j=function(){return(ke=s.dynCall_j=s.asm.Ib).apply(null,arguments)},Ce=s.dynCall_iiiiij=function(){return(Ce=s.dynCall_iiiiij=s.asm.Jb).apply(null,arguments)},Fe=s.dynCall_jii=function(){return(Fe=s.dynCall_jii=s.asm.Kb).apply(null,arguments)},Ne=s.dynCall_viiiiij=function(){return(Ne=s.dynCall_viiiiij=s.asm.Lb).apply(null,arguments)},Re=s.dynCall_vjji=function(){return(Re=s.dynCall_vjji=s.asm.Mb).apply(null,arguments)},Le=s.dynCall_viiijjjii=function(){return(Le=s.dynCall_viiijjjii=s.asm.Nb).apply(null,arguments)},Me=s.dynCall_iij=function(){return(Me=s.dynCall_iij=s.asm.Ob).apply(null,arguments)},je=s.dynCall_ji=function(){return(je=s.dynCall_ji=s.asm.Pb).apply(null,arguments)},Ue=s.dynCall_iiiiiij=function(){return(Ue=s.dynCall_iiiiiij=s.asm.Qb).apply(null,arguments)},Ve=s.dynCall_iiij=function(){return(Ve=s.dynCall_iiij=s.asm.Rb).apply(null,arguments)};function Be(){function t(){if(!ve&&(ve=!0,s.calledRun=!0,!U)&&(x||dt(K),u(s),s.onRuntimeInitialized&&s.onRuntimeInitialized(),!x)){if(s.postRun)for("function"==typeof s.postRun&&(s.postRun=[s.postRun]);s.postRun.length;){var t=s.postRun.shift();J.unshift(t)}dt(J)}}if(!(0{throw e},d="object"==typeof window,g="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,y="";b?(y=g?n(908).dirname(y)+"/":"//",l=()=>{c||(u=n(1384),c=n(908))},i=function(t,e){return l(),t=c.normalize(t),u.readFileSync(t,e?void 0:"utf8")},s=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),a=(t,e,n)=>{l(),t=c.normalize(t),u.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(w||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},g&&(s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),a=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var m,v=e.print||console.log.bind(console),_=e.printErr||console.warn.bind(console);Object.assign(e,f),f=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(m=e.wasmBinary);var w=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&q("no native wasm support detected");var x,T,S,O,A,E,I=!1,P="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function D(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&t[e++])?r+=String.fromCharCode(o):(o-=65536,r+=String.fromCharCode(55296|o>>10,56320|1023&o))}}else r+=String.fromCharCode(o)}return r}function k(t,e){return(t>>>=0)?D(O,t,e):""}function C(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(n>=r)break;e[n++>>>0]=a}else{if(2047>=a){if(n+1>=r)break;e[n++>>>0]=192|a>>6}else{if(65535>=a){if(n+2>=r)break;e[n++>>>0]=224|a>>12}else{if(n+3>=r)break;e[n++>>>0]=240|a>>18,e[n++>>>0]=128|a>>12&63}e[n++>>>0]=128|a>>6&63}e[n++>>>0]=128|63&a}}return e[n>>>0]=0,n-o}function F(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(){var t=x.buffer;T=t,e.HEAP8=S=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=A=new Int32Array(t),e.HEAPU8=O=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=E=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var R,L=[],M=[],j=[],U=[],V=0;function B(){var t=e.preRun.shift();L.unshift(t)}var z,G=0,H=null,W=null;function q(t){throw e.onAbort&&e.onAbort(t),_(t="Aborted("+t+")"),I=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),o(t),t}function X(){return z.startsWith("data:application/octet-stream;base64,")}if(z="ort-wasm.wasm",!X()){var Y=z;z=e.locateFile?e.locateFile(Y,y):y+Y}function K(){var t=z;try{if(t==z&&m)return new Uint8Array(m);if(s)return s(t);throw"both async and sync fetching of the wasm failed"}catch(t){q(t)}}function Z(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function J(t){for(;0>2>>>0]=t},this.Eb=function(){return E[this.zb+4>>2>>>0]},this.Sb=function(t){E[this.zb+8>>2>>>0]=t},this.Wb=function(){return E[this.zb+8>>2>>>0]},this.Tb=function(){A[this.zb>>2>>>0]=0},this.Ib=function(t){S[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=S[this.zb+12>>0>>>0]},this.Jb=function(t){S[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=S[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){A[this.zb>>2>>>0]+=1},this.Xb=function(){var t=A[this.zb>>2>>>0];return A[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){E[this.zb+16>>2>>>0]=t},this.Ob=function(){return E[this.zb+16>>2>>>0]},this.Qb=function(){if(Et(this.Eb()))return E[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return vt(new et(t).zb)}var rt=[];function ot(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=R.get(t)),e}function it(t){var e=F(t)+1,n=mt(e);return n&&C(t,S,n,e),n}var at={};function st(){if(!ut){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in at)void 0===at[t]?delete e[t]:e[t]=at[t];var n=[];for(t in e)n.push(t+"="+e[t]);ut=n}return ut}var ut,ct=[null,[],[]];function lt(t,e){var n=ct[t];0===e||10===e?((1===t?v:_)(D(n,0)),n.length=0):n.push(e)}var ft=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function gt(t,e,n,r){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=a(e,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var c=A[r+40>>2>>>0];for(var l in r={$b:A[r>>2>>>0],Zb:A[r+4>>2>>>0],Gb:A[r+8>>2>>>0],Kb:A[r+12>>2>>>0],Hb:A[r+16>>2>>>0],Cb:A[r+20>>2>>>0],Ab:A[r+24>>2>>>0],Bb:A[r+28>>2>>>0],bc:A[r+32>>2>>>0],Yb:A[r+36>>2>>>0],ac:c?k(c):""},n=k(n),c={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(l,"g"),c[l]);var f="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(l in c={"%a":function(t){return f[t.Ab].substring(0,3)},"%A":function(t){return f[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return o(t.Kb,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\0\0"),c)n.includes(l)&&(n=n.replace(new RegExp(l,"g"),c[l](r)));return l=function(t){var e=Array(F(t)+1);return C(t,e,0,e.length),e}(n=n.replace(/\0\0/g,"%")),l.length>e?0:(S.set(l,t>>>0),l.length-1)}var bt={a:function(t){return mt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),Q--),t.Jb(!1),$.push(t),t.Nb(),t.Qb()},ia:function(t){throw _("Unexpected exception thrown, this is not properly supported - aborting"),I=!0,t},w:function(){xt(0);var t=$.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&ot(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return ft=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return ft=0,t;for(var r=Array.prototype.slice.call(arguments),o=0;o>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getUTCSeconds(),A[e+4>>2>>>0]=t.getUTCMinutes(),A[e+8>>2>>>0]=t.getUTCHours(),A[e+12>>2>>>0]=t.getUTCDate(),A[e+16>>2>>>0]=t.getUTCMonth(),A[e+20>>2>>>0]=t.getUTCFullYear()-1900,A[e+24>>2>>>0]=t.getUTCDay(),A[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(E[t>>>2]+4294967296*A[t+4>>>2])),A[e>>2>>>0]=t.getSeconds(),A[e+4>>2>>>0]=t.getMinutes(),A[e+8>>2>>>0]=t.getHours(),A[e+12>>2>>>0]=t.getDate(),A[e+16>>2>>>0]=t.getMonth(),A[e+20>>2>>>0]=t.getFullYear()-1900,A[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);A[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,A[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),A[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(A[t+20>>2>>>0]+1900,A[t+16>>2>>>0],A[t+12>>2>>>0],A[t+8>>2>>>0],A[t+4>>2>>>0],A[t>>2>>>0],0),n=A[t+32>>2>>>0],r=e.getTimezoneOffset(),o=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),a=o.getTimezoneOffset(),s=Math.min(a,i);return 0>n?A[t+32>>2>>>0]=Number(i!=a&&s==r):0>2>>>0]=e.getDay(),A[t+28>>2>>>0]=(e.getTime()-o.getTime())/864e5|0,A[t>>2>>>0]=e.getSeconds(),A[t+4>>2>>>0]=e.getMinutes(),A[t+8>>2>>>0]=e.getHours(),A[t+12>>2>>>0]=e.getDate(),A[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT"}var o=(new Date).getFullYear(),i=new Date(o,0,1),a=new Date(o,6,1);o=i.getTimezoneOffset();var s=a.getTimezoneOffset();A[t>>2>>>0]=60*Math.max(o,s),A[e>>2>>>0]=Number(o!=s),t=r(i),e=r(a),t=it(t),e=it(e),s>2>>>0]=t,E[n+4>>2>>>0]=e):(E[n>>2>>>0]=e,E[n+4>>2>>>0]=t)}(e,n,r))},B:function(){q("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){O.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=O.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var o=Math;r=Math.max(t,r),o=o.min.call(o,4294901760,r+(65536-r%65536)%65536);t:{try{x.grow(o-T.byteLength+65535>>>16),N();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return st().forEach((function(r,o){var i=e+n;for(o=E[t+4*o>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);S[o>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=st();E[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),E[e>>2>>>0]=r,0},ba:function(t){w||0>2>>>0],s=E[e+4>>2>>>0];e+=8;for(var u=0;u>>0]);o+=s}return E[r>>2>>>0]=o,0},c:function(){return ft},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module 'crypto'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>q("randomDevice")}());for(var o=0;o>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},fa:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},J:function(t){var e=Tt();try{return ot(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},e:function(t,e){var n=Tt();try{return ot(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},N:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},O:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},j:function(t,e,n){var r=Tt();try{return ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},o:function(t,e,n,r){var o=Tt();try{return ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},p:function(t,e,n,r,o){var i=Tt();try{return ot(t)(e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},M:function(t,e,n,r,o,i){var a=Tt();try{return ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},r:function(t,e,n,r,o,i){var a=Tt();try{return ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},v:function(t,e,n,r,o,i,a){var s=Tt();try{return ot(t)(e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},K:function(t,e,n,r,o,i,a,s){var u=Tt();try{return ot(t)(e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},D:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Tt();try{return ot(t)(e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},X:function(t,e,n,r,o,i,a,s){var u=Tt();try{return Lt(t,e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},V:function(t,e,n,r,o,i,a){var s=Tt();try{return Pt(t,e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},U:function(t,e,n,r,o){var i=Tt();try{return Mt(t,e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},Z:function(t,e,n,r){var o=Tt();try{return Nt(t,e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},W:function(t){var e=Tt();try{return It(t)}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},Y:function(t,e){var n=Tt();try{return Rt(t,e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},T:function(t,e,n){var r=Tt();try{return Dt(t,e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},f:function(t){var e=Tt();try{ot(t)()}catch(t){if(St(e),t!==t+0)throw t;xt(1,0)}},q:function(t,e){var n=Tt();try{ot(t)(e)}catch(t){if(St(n),t!==t+0)throw t;xt(1,0)}},h:function(t,e,n){var r=Tt();try{ot(t)(e,n)}catch(t){if(St(r),t!==t+0)throw t;xt(1,0)}},da:function(t,e,n,r){var o=Tt();try{ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},l:function(t,e,n,r){var o=Tt();try{ot(t)(e,n,r)}catch(t){if(St(o),t!==t+0)throw t;xt(1,0)}},t:function(t,e,n,r,o){var i=Tt();try{ot(t)(e,n,r,o)}catch(t){if(St(i),t!==t+0)throw t;xt(1,0)}},u:function(t,e,n,r,o,i){var a=Tt();try{ot(t)(e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},x:function(t,e,n,r,o,i,a){var s=Tt();try{ot(t)(e,n,r,o,i,a)}catch(t){if(St(s),t!==t+0)throw t;xt(1,0)}},z:function(t,e,n,r,o,i,a,s){var u=Tt();try{ot(t)(e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},ga:function(t,e,n,r,o,i,a,s,u){var c=Tt();try{ot(t)(e,n,r,o,i,a,s,u)}catch(t){if(St(c),t!==t+0)throw t;xt(1,0)}},A:function(t,e,n,r,o,i,a,s,u,c,l){var f=Tt();try{ot(t)(e,n,r,o,i,a,s,u,c,l)}catch(t){if(St(f),t!==t+0)throw t;xt(1,0)}},C:function(t,e,n,r,o,i,a,s,u,c,l,f,p,h,d,g){var b=Tt();try{ot(t)(e,n,r,o,i,a,s,u,c,l,f,p,h,d,g)}catch(t){if(St(b),t!==t+0)throw t;xt(1,0)}},aa:function(t,e,n,r,o,i,a,s){var u=Tt();try{kt(t,e,n,r,o,i,a,s)}catch(t){if(St(u),t!==t+0)throw t;xt(1,0)}},_:function(t,e,n,r,o,i,a,s,u,c,l,f){var p=Tt();try{Ft(t,e,n,r,o,i,a,s,u,c,l,f)}catch(t){if(St(p),t!==t+0)throw t;xt(1,0)}},$:function(t,e,n,r,o,i){var a=Tt();try{Ct(t,e,n,r,o,i)}catch(t){if(St(a),t!==t+0)throw t;xt(1,0)}},n:function(t){return t},F:function(t){ft=t},ha:gt,y:function(t,e,n,r){return gt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,x=e.asm.Ka,N(),R=e.asm.ib,M.unshift(e.asm.La),G--,e.monitorRunDependencies&&e.monitorRunDependencies(G),0==G&&(null!==H&&(clearInterval(H),H=null),W&&(t=W,W=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!m&&(d||g)){if("function"==typeof fetch&&!z.startsWith("file://"))return fetch(z,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+z+"'";return t.arrayBuffer()})).catch((function(){return K()}));if(a)return new Promise((function(t,e){a(z,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return K()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){_("failed to asynchronously prepare wasm: "+t),q(t)}))}var i={a:bt};if(G++,e.monitorRunDependencies&&e.monitorRunDependencies(G),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return _("Module.instantiateWasm callback failed with error: "+t),!1}(m||"function"!=typeof WebAssembly.instantiateStreaming||X()||z.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(z,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return _("wasm streaming compile failed: "+t),_("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(o)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var yt,mt=e._malloc=function(){return(mt=e._malloc=e.asm.eb).apply(null,arguments)},vt=e._free=function(){return(vt=e._free=e.asm.fb).apply(null,arguments)},_t=e._fflush=function(){return(_t=e._fflush=e.asm.gb).apply(null,arguments)},wt=e.___funcs_on_exit=function(){return(wt=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},xt=e._setThrew=function(){return(xt=e._setThrew=e.asm.jb).apply(null,arguments)},Tt=e.stackSave=function(){return(Tt=e.stackSave=e.asm.kb).apply(null,arguments)},St=e.stackRestore=function(){return(St=e.stackRestore=e.asm.lb).apply(null,arguments)},Ot=e.stackAlloc=function(){return(Ot=e.stackAlloc=e.asm.mb).apply(null,arguments)},At=e.___cxa_can_catch=function(){return(At=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Et=e.___cxa_is_pointer_type=function(){return(Et=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},It=e.dynCall_j=function(){return(It=e.dynCall_j=e.asm.pb).apply(null,arguments)},Pt=e.dynCall_iiiiij=function(){return(Pt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Dt=e.dynCall_jii=function(){return(Dt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},kt=e.dynCall_viiiiij=function(){return(kt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},Ct=e.dynCall_vjji=function(){return(Ct=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Ft=e.dynCall_viiijjjii=function(){return(Ft=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Nt=e.dynCall_iij=function(){return(Nt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Rt=e.dynCall_ji=function(){return(Rt=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Lt=e.dynCall_iiiiiij=function(){return(Lt=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},Mt=e.dynCall_iiij=function(){return(Mt=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function jt(){function t(){if(!yt&&(yt=!0,e.calledRun=!0,!I)){if(J(M),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();U.unshift(t)}J(U)}}if(!(01&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var r=new Array(64),o=new Array(123),i=0;i<64;)o[r[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;n.encode=function(t,e,n){for(var o,i=null,a=[],s=0,u=0;e>2],o=(3&c)<<4,u=1;break;case 1:a[s++]=r[o|c>>4],o=(15&c)<<2,u=2;break;case 2:a[s++]=r[o|c>>6],a[s++]=r[63&c],u=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=r[o],a[s++]=61,1===u&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";n.decode=function(t,e,n){for(var r,i=n,s=0,u=0;u1)break;if(void 0===(c=o[c]))throw Error(a);switch(s){case 0:r=c,s=1;break;case 1:e[n++]=r<<2|(48&c)>>4,r=c,s=2;break;case 2:e[n++]=(15&r)<<4|(60&c)>>2,r=c,s=3;break;case 3:e[n++]=(3&r)<<6|c,s=0}}if(1===s)throw Error(a);return n-i},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},9211:function(t){"use strict";function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],r=0;r0?0:2147483648,n,r);else if(isNaN(e))t(2143289344,n,r);else if(e>34028234663852886e22)t((o<<31|2139095040)>>>0,n,r);else if(e<11754943508222875e-54)t((o<<31|Math.round(e/1401298464324817e-60))>>>0,n,r);else{var i=Math.floor(Math.log(e)/Math.LN2);t((o<<31|i+127<<23|8388607&Math.round(e*Math.pow(2,-i)*8388608))>>>0,n,r)}}function a(t,e,n){var r=t(e,n),o=2*(r>>31)+1,i=r>>>23&255,a=8388607&r;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,r),t.readFloatLE=a.bind(null,o),t.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),r=128===n[7];function o(t,r,o){e[0]=t,r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2],r[o+3]=n[3],r[o+4]=n[4],r[o+5]=n[5],r[o+6]=n[6],r[o+7]=n[7]}function i(t,r,o){e[0]=t,r[o]=n[7],r[o+1]=n[6],r[o+2]=n[5],r[o+3]=n[4],r[o+4]=n[3],r[o+5]=n[2],r[o+6]=n[1],r[o+7]=n[0]}function a(t,r){return n[0]=t[r],n[1]=t[r+1],n[2]=t[r+2],n[3]=t[r+3],n[4]=t[r+4],n[5]=t[r+5],n[6]=t[r+6],n[7]=t[r+7],e[0]}function s(t,r){return n[7]=t[r],n[6]=t[r+1],n[5]=t[r+2],n[4]=t[r+3],n[3]=t[r+4],n[2]=t[r+5],n[1]=t[r+6],n[0]=t[r+7],e[0]}t.writeDoubleLE=r?o:i,t.writeDoubleBE=r?i:o,t.readDoubleLE=r?a:s,t.readDoubleBE=r?s:a}():function(){function e(t,e,n,r,o,i){var a=r<0?1:0;if(a&&(r=-r),0===r)t(0,o,i+e),t(1/r>0?0:2147483648,o,i+n);else if(isNaN(r))t(0,o,i+e),t(2146959360,o,i+n);else if(r>17976931348623157e292)t(0,o,i+e),t((a<<31|2146435072)>>>0,o,i+n);else{var s;if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,o,i+e),t((a<<31|s/4294967296)>>>0,o,i+n);else{var u=Math.floor(Math.log(r)/Math.LN2);1024===u&&(u=1023),t(4503599627370496*(s=r*Math.pow(2,-u))>>>0,o,i+e),t((a<<31|u+1023<<20|1048576*s&1048575)>>>0,o,i+n)}}}function a(t,e,n,r,o){var i=t(r,o+e),a=t(r,o+n),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+i;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,r,4,0),t.readDoubleLE=a.bind(null,o,0,4),t.readDoubleBE=a.bind(null,i,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function r(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function i(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},7199:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}module.exports=inquire},6662:function(t){"use strict";t.exports=function(t,e,n){var r=n||8192,o=r>>>1,i=null,a=r;return function(n){if(n<1||n>o)return t(n);a+n>r&&(i=t(r),a=0);var s=e.call(i,a,a+=n);return 7&a&&(a=1+(7|a)),s}}},4997:function(t,e){"use strict";var n=e;n.length=function(t){for(var e=0,n=0,r=0;r191&&r<224?i[a++]=(31&r)<<6|63&t[e++]:r>239&&r<365?(r=((7&r)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,i[a++]=55296+(r>>10),i[a++]=56320+(1023&r)):i[a++]=(15&r)<<12|(63&t[e++])<<6|63&t[e++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},n.write=function(t,e,n){for(var r,o,i=n,a=0;a>6|192,e[n++]=63&r|128):55296==(64512&r)&&56320==(64512&(o=t.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&o),++a,e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128);return n-i}},3442:function(t,e){"use strict";e.__esModule=!0;var n=function(){function t(e){if(!e)throw new TypeError("Invalid argument; `value` has no value.");this.value=t.EMPTY,e&&t.isGuid(e)&&(this.value=e)}return t.isGuid=function(e){var n=e.toString();return e&&(e instanceof t||t.validator.test(n))},t.create=function(){return new t([t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-"))},t.createEmpty=function(){return new t("emptyguid")},t.parse=function(e){return new t(e)},t.raw=function(){return[t.gen(2),t.gen(1),t.gen(1),t.gen(1),t.gen(3)].join("-")},t.gen=function(t){for(var e="",n=0;n>>=0)&&t<256)&&(r=i[t])?r:(n=u(t,(0|t)<0?-1:0,!0),a&&(i[t]=n),n):(a=-128<=(t|=0)&&t<128)&&(r=o[t])?r:(n=u(t,t<0?-1:0,!1),a&&(o[t]=n),n)}function s(t,e){if(isNaN(t))return e?y:b;if(e){if(t<0)return y;if(t>=h)return x}else{if(t<=-d)return T;if(t+1>=d)return w}return t<0?s(-t,e).neg():u(t%p|0,t/p|0,e)}function u(t,e,r){return new n(t,e,r)}n.fromInt=a,n.fromNumber=s,n.fromBits=u;var c=Math.pow;function l(t,e,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return b;if("number"==typeof e?(n=e,e=!1):e=!!e,(n=n||10)<2||360)throw Error("interior hyphen");if(0===r)return l(t.substring(1),e,n).neg();for(var o=s(c(n,8)),i=b,a=0;a>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},S.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((i=u).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(t){return r(t)||(t=f(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},S.eq=S.equals,S.notEquals=function(t){return!this.eq(t)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(t){return this.comp(t)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(t){return this.comp(t)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(t){return this.comp(t)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(t){return this.comp(t)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(t){if(r(t)||(t=f(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(m)},S.neg=S.negate,S.add=function(t){r(t)||(t=f(t));var e=this.high>>>16,n=65535&this.high,o=this.low>>>16,i=65535&this.low,a=t.high>>>16,s=65535&t.high,c=t.low>>>16,l=0,p=0,h=0,d=0;return h+=(d+=i+(65535&t.low))>>>16,p+=(h+=o+c)>>>16,l+=(p+=n+s)>>>16,l+=e+a,u((h&=65535)<<16|(d&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},S.subtract=function(t){return r(t)||(t=f(t)),this.add(t.neg())},S.sub=S.subtract,S.multiply=function(t){if(this.isZero())return b;if(r(t)||(t=f(t)),e)return u(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return b;if(this.eq(T))return t.isOdd()?T:b;if(t.eq(T))return this.isOdd()?T:b;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(g)&&t.lt(g))return s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,c=t.high>>>16,l=65535&t.high,p=t.low>>>16,h=65535&t.low,d=0,y=0,m=0,v=0;return m+=(v+=a*h)>>>16,y+=(m+=i*h)>>>16,m&=65535,y+=(m+=a*p)>>>16,d+=(y+=o*h)>>>16,y&=65535,d+=(y+=i*p)>>>16,y&=65535,d+=(y+=a*l)>>>16,d+=n*h+o*p+i*l+a*c,u((m&=65535)<<16|(v&=65535),(d&=65535)<<16|(y&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(t){if(r(t)||(t=f(t)),t.isZero())throw Error("division by zero");var n,o,i;if(e)return this.unsigned||-2147483648!==this.high||-1!==t.low||-1!==t.high?u((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:b;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return y;if(t.gt(this.shru(1)))return v;i=y}else{if(this.eq(T))return t.eq(m)||t.eq(_)?T:t.eq(T)?m:(n=this.shr(1).div(t).shl(1)).eq(b)?t.isNegative()?m:_:(o=this.sub(t.mul(n)),i=n.add(o.div(t)));if(t.eq(T))return this.unsigned?y:b;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();i=b}for(o=this;o.gte(t);){n=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:c(2,a-48),p=s(n),h=p.mul(t);h.isNegative()||h.gt(o);)h=(p=s(n-=l,this.unsigned)).mul(t);p.isZero()&&(p=m),i=i.add(p),o=o.sub(h)}return i},S.div=S.divide,S.modulo=function(t){return r(t)||(t=f(t)),e?u((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return u(~this.low,~this.high,this.unsigned)},S.and=function(t){return r(t)||(t=f(t)),u(this.low&t.low,this.high&t.high,this.unsigned)},S.or=function(t){return r(t)||(t=f(t)),u(this.low|t.low,this.high|t.high,this.unsigned)},S.xor=function(t){return r(t)||(t=f(t)),u(this.low^t.low,this.high^t.high,this.unsigned)},S.shiftLeft=function(t){return r(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?u(this.low<>>32-t,this.unsigned):u(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):u(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(t){if(r(t)&&(t=t.toInt()),0==(t&=63))return this;var e=this.high;return t<32?u(this.low>>>t|e<<32-t,e>>>t,this.unsigned):u(32===t?e:e>>>t-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},S.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},S.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},S.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},n.fromBytes=function(t,e,r){return r?n.fromBytesLE(t,e):n.fromBytesBE(t,e)},n.fromBytesLE=function(t,e){return new n(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},n.fromBytesBE=function(t,e){return new n(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)}},1446:function(t,e,n){"use strict";var r,o,i,a=n(2100),s=a.Reader,u=a.Writer,c=a.util,l=a.roots.default||(a.roots.default={});l.onnx=((i={}).Version=(r={},(o=Object.create(r))[r[0]="_START_VERSION"]=0,o[r[1]="IR_VERSION_2017_10_10"]=1,o[r[2]="IR_VERSION_2017_10_30"]=2,o[r[3]="IR_VERSION_2017_11_3"]=3,o[r[4]="IR_VERSION_2019_1_22"]=4,o[r[5]="IR_VERSION"]=5,o),i.AttributeProto=function(){function t(t){if(this.floats=[],this.ints=[],this.strings=[],this.tensors=[],this.graphs=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.name=t.string();break;case 21:r.refAttrName=t.string();break;case 13:r.docString=t.string();break;case 20:r.type=t.int32();break;case 2:r.f=t.float();break;case 3:r.i=t.int64();break;case 4:r.s=t.bytes();break;case 5:r.t=l.onnx.TensorProto.decode(t,t.uint32());break;case 6:r.g=l.onnx.GraphProto.decode(t,t.uint32());break;case 7:if(r.floats&&r.floats.length||(r.floats=[]),2==(7&o))for(var i=t.uint32()+t.pos;t.pos>>0,t.i.high>>>0).toNumber())),null!=t.s&&("string"==typeof t.s?c.base64.decode(t.s,e.s=c.newBuffer(c.base64.length(t.s)),0):t.s.length&&(e.s=t.s)),null!=t.t){if("object"!=typeof t.t)throw TypeError(".onnx.AttributeProto.t: object expected");e.t=l.onnx.TensorProto.fromObject(t.t)}if(null!=t.g){if("object"!=typeof t.g)throw TypeError(".onnx.AttributeProto.g: object expected");e.g=l.onnx.GraphProto.fromObject(t.g)}if(t.floats){if(!Array.isArray(t.floats))throw TypeError(".onnx.AttributeProto.floats: array expected");e.floats=[];for(var n=0;n>>0,t.ints[n].high>>>0).toNumber())}if(t.strings){if(!Array.isArray(t.strings))throw TypeError(".onnx.AttributeProto.strings: array expected");for(e.strings=[],n=0;n>>0,t.i.high>>>0).toNumber():t.i),null!=t.s&&t.hasOwnProperty("s")&&(n.s=e.bytes===String?c.base64.encode(t.s,0,t.s.length):e.bytes===Array?Array.prototype.slice.call(t.s):t.s),null!=t.t&&t.hasOwnProperty("t")&&(n.t=l.onnx.TensorProto.toObject(t.t,e)),null!=t.g&&t.hasOwnProperty("g")&&(n.g=l.onnx.GraphProto.toObject(t.g,e)),t.floats&&t.floats.length){n.floats=[];for(var o=0;o>>0,t.ints[o].high>>>0).toNumber():t.ints[o];if(t.strings&&t.strings.length)for(n.strings=[],o=0;o>>3){case 1:r.name=t.string();break;case 2:r.type=l.onnx.TypeProto.decode(t,t.uint32());break;case 3:r.docString=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.name&&t.hasOwnProperty("name")&&!c.isString(t.name))return"name: string expected";if(null!=t.type&&t.hasOwnProperty("type")){var e=l.onnx.TypeProto.verify(t.type);if(e)return"type."+e}return null!=t.docString&&t.hasOwnProperty("docString")&&!c.isString(t.docString)?"docString: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.ValueInfoProto)return t;var e=new l.onnx.ValueInfoProto;if(null!=t.name&&(e.name=String(t.name)),null!=t.type){if("object"!=typeof t.type)throw TypeError(".onnx.ValueInfoProto.type: object expected");e.type=l.onnx.TypeProto.fromObject(t.type)}return null!=t.docString&&(e.docString=String(t.docString)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.name="",n.type=null,n.docString=""),null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.type&&t.hasOwnProperty("type")&&(n.type=l.onnx.TypeProto.toObject(t.type,e)),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.NodeProto=function(){function t(t){if(this.input=[],this.output=[],this.attribute=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.input&&r.input.length||(r.input=[]),r.input.push(t.string());break;case 2:r.output&&r.output.length||(r.output=[]),r.output.push(t.string());break;case 3:r.name=t.string();break;case 4:r.opType=t.string();break;case 7:r.domain=t.string();break;case 5:r.attribute&&r.attribute.length||(r.attribute=[]),r.attribute.push(l.onnx.AttributeProto.decode(t,t.uint32()));break;case 6:r.docString=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.input&&t.hasOwnProperty("input")){if(!Array.isArray(t.input))return"input: array expected";for(var e=0;e>>3){case 1:r.irVersion=t.int64();break;case 8:r.opsetImport&&r.opsetImport.length||(r.opsetImport=[]),r.opsetImport.push(l.onnx.OperatorSetIdProto.decode(t,t.uint32()));break;case 2:r.producerName=t.string();break;case 3:r.producerVersion=t.string();break;case 4:r.domain=t.string();break;case 5:r.modelVersion=t.int64();break;case 6:r.docString=t.string();break;case 7:r.graph=l.onnx.GraphProto.decode(t,t.uint32());break;case 14:r.metadataProps&&r.metadataProps.length||(r.metadataProps=[]),r.metadataProps.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.irVersion&&t.hasOwnProperty("irVersion")&&!(c.isInteger(t.irVersion)||t.irVersion&&c.isInteger(t.irVersion.low)&&c.isInteger(t.irVersion.high)))return"irVersion: integer|Long expected";if(null!=t.opsetImport&&t.hasOwnProperty("opsetImport")){if(!Array.isArray(t.opsetImport))return"opsetImport: array expected";for(var e=0;e>>0,t.irVersion.high>>>0).toNumber())),t.opsetImport){if(!Array.isArray(t.opsetImport))throw TypeError(".onnx.ModelProto.opsetImport: array expected");e.opsetImport=[];for(var n=0;n>>0,t.modelVersion.high>>>0).toNumber())),null!=t.docString&&(e.docString=String(t.docString)),null!=t.graph){if("object"!=typeof t.graph)throw TypeError(".onnx.ModelProto.graph: object expected");e.graph=l.onnx.GraphProto.fromObject(t.graph)}if(t.metadataProps){if(!Array.isArray(t.metadataProps))throw TypeError(".onnx.ModelProto.metadataProps: array expected");for(e.metadataProps=[],n=0;n>>0,t.irVersion.high>>>0).toNumber():t.irVersion),null!=t.producerName&&t.hasOwnProperty("producerName")&&(n.producerName=t.producerName),null!=t.producerVersion&&t.hasOwnProperty("producerVersion")&&(n.producerVersion=t.producerVersion),null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.modelVersion&&t.hasOwnProperty("modelVersion")&&("number"==typeof t.modelVersion?n.modelVersion=e.longs===String?String(t.modelVersion):t.modelVersion:n.modelVersion=e.longs===String?c.Long.prototype.toString.call(t.modelVersion):e.longs===Number?new c.LongBits(t.modelVersion.low>>>0,t.modelVersion.high>>>0).toNumber():t.modelVersion),null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),null!=t.graph&&t.hasOwnProperty("graph")&&(n.graph=l.onnx.GraphProto.toObject(t.graph,e)),t.opsetImport&&t.opsetImport.length){n.opsetImport=[];for(var o=0;o>>3){case 1:r.key=t.string();break;case 2:r.value=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.key&&t.hasOwnProperty("key")&&!c.isString(t.key)?"key: string expected":null!=t.value&&t.hasOwnProperty("value")&&!c.isString(t.value)?"value: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.StringStringEntryProto)return t;var e=new l.onnx.StringStringEntryProto;return null!=t.key&&(e.key=String(t.key)),null!=t.value&&(e.value=String(t.value)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.key="",n.value=""),null!=t.key&&t.hasOwnProperty("key")&&(n.key=t.key),null!=t.value&&t.hasOwnProperty("value")&&(n.value=t.value),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i.TensorAnnotation=function(){function t(t){if(this.quantParameterTensorNames=[],t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorName=t.string();break;case 2:r.quantParameterTensorNames&&r.quantParameterTensorNames.length||(r.quantParameterTensorNames=[]),r.quantParameterTensorNames.push(l.onnx.StringStringEntryProto.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorName&&t.hasOwnProperty("tensorName")&&!c.isString(t.tensorName))return"tensorName: string expected";if(null!=t.quantParameterTensorNames&&t.hasOwnProperty("quantParameterTensorNames")){if(!Array.isArray(t.quantParameterTensorNames))return"quantParameterTensorNames: array expected";for(var e=0;e>>3){case 1:r.node&&r.node.length||(r.node=[]),r.node.push(l.onnx.NodeProto.decode(t,t.uint32()));break;case 2:r.name=t.string();break;case 5:r.initializer&&r.initializer.length||(r.initializer=[]),r.initializer.push(l.onnx.TensorProto.decode(t,t.uint32()));break;case 10:r.docString=t.string();break;case 11:r.input&&r.input.length||(r.input=[]),r.input.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 12:r.output&&r.output.length||(r.output=[]),r.output.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 13:r.valueInfo&&r.valueInfo.length||(r.valueInfo=[]),r.valueInfo.push(l.onnx.ValueInfoProto.decode(t,t.uint32()));break;case 14:r.quantizationAnnotation&&r.quantizationAnnotation.length||(r.quantizationAnnotation=[]),r.quantizationAnnotation.push(l.onnx.TensorAnnotation.decode(t,t.uint32()));break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.node&&t.hasOwnProperty("node")){if(!Array.isArray(t.node))return"node: array expected";for(var e=0;e>>3){case 1:if(r.dims&&r.dims.length||(r.dims=[]),2==(7&o))for(var i=t.uint32()+t.pos;t.pos>>0,t.dims[n].high>>>0).toNumber())}if(null!=t.dataType&&(e.dataType=0|t.dataType),null!=t.segment){if("object"!=typeof t.segment)throw TypeError(".onnx.TensorProto.segment: object expected");e.segment=l.onnx.TensorProto.Segment.fromObject(t.segment)}if(t.floatData){if(!Array.isArray(t.floatData))throw TypeError(".onnx.TensorProto.floatData: array expected");for(e.floatData=[],n=0;n>>0,t.int64Data[n].high>>>0).toNumber())}if(null!=t.name&&(e.name=String(t.name)),null!=t.docString&&(e.docString=String(t.docString)),null!=t.rawData&&("string"==typeof t.rawData?c.base64.decode(t.rawData,e.rawData=c.newBuffer(c.base64.length(t.rawData)),0):t.rawData.length&&(e.rawData=t.rawData)),t.externalData){if(!Array.isArray(t.externalData))throw TypeError(".onnx.TensorProto.externalData: array expected");for(e.externalData=[],n=0;n>>0,t.uint64Data[n].high>>>0).toNumber(!0))}return e},t.toObject=function(t,e){e||(e={});var n={};if((e.arrays||e.defaults)&&(n.dims=[],n.floatData=[],n.int32Data=[],n.stringData=[],n.int64Data=[],n.doubleData=[],n.uint64Data=[],n.externalData=[]),e.defaults&&(n.dataType=0,n.segment=null,n.name="",e.bytes===String?n.rawData="":(n.rawData=[],e.bytes!==Array&&(n.rawData=c.newBuffer(n.rawData))),n.docString="",n.dataLocation=e.enums===String?"DEFAULT":0),t.dims&&t.dims.length){n.dims=[];for(var r=0;r>>0,t.dims[r].high>>>0).toNumber():t.dims[r]}if(null!=t.dataType&&t.hasOwnProperty("dataType")&&(n.dataType=t.dataType),null!=t.segment&&t.hasOwnProperty("segment")&&(n.segment=l.onnx.TensorProto.Segment.toObject(t.segment,e)),t.floatData&&t.floatData.length)for(n.floatData=[],r=0;r>>0,t.int64Data[r].high>>>0).toNumber():t.int64Data[r];if(null!=t.name&&t.hasOwnProperty("name")&&(n.name=t.name),null!=t.rawData&&t.hasOwnProperty("rawData")&&(n.rawData=e.bytes===String?c.base64.encode(t.rawData,0,t.rawData.length):e.bytes===Array?Array.prototype.slice.call(t.rawData):t.rawData),t.doubleData&&t.doubleData.length)for(n.doubleData=[],r=0;r>>0,t.uint64Data[r].high>>>0).toNumber(!0):t.uint64Data[r];if(null!=t.docString&&t.hasOwnProperty("docString")&&(n.docString=t.docString),t.externalData&&t.externalData.length)for(n.externalData=[],r=0;r>>3){case 1:r.begin=t.int64();break;case 2:r.end=t.int64();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.begin&&t.hasOwnProperty("begin")&&!(c.isInteger(t.begin)||t.begin&&c.isInteger(t.begin.low)&&c.isInteger(t.begin.high))?"begin: integer|Long expected":null!=t.end&&t.hasOwnProperty("end")&&!(c.isInteger(t.end)||t.end&&c.isInteger(t.end.low)&&c.isInteger(t.end.high))?"end: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorProto.Segment)return t;var e=new l.onnx.TensorProto.Segment;return null!=t.begin&&(c.Long?(e.begin=c.Long.fromValue(t.begin)).unsigned=!1:"string"==typeof t.begin?e.begin=parseInt(t.begin,10):"number"==typeof t.begin?e.begin=t.begin:"object"==typeof t.begin&&(e.begin=new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber())),null!=t.end&&(c.Long?(e.end=c.Long.fromValue(t.end)).unsigned=!1:"string"==typeof t.end?e.end=parseInt(t.end,10):"number"==typeof t.end?e.end=t.end:"object"==typeof t.end&&(e.end=new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults){if(c.Long){var r=new c.Long(0,0,!1);n.begin=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.begin=e.longs===String?"0":0;c.Long?(r=new c.Long(0,0,!1),n.end=e.longs===String?r.toString():e.longs===Number?r.toNumber():r):n.end=e.longs===String?"0":0}return null!=t.begin&&t.hasOwnProperty("begin")&&("number"==typeof t.begin?n.begin=e.longs===String?String(t.begin):t.begin:n.begin=e.longs===String?c.Long.prototype.toString.call(t.begin):e.longs===Number?new c.LongBits(t.begin.low>>>0,t.begin.high>>>0).toNumber():t.begin),null!=t.end&&t.hasOwnProperty("end")&&("number"==typeof t.end?n.end=e.longs===String?String(t.end):t.end:n.end=e.longs===String?c.Long.prototype.toString.call(t.end):e.longs===Number?new c.LongBits(t.end.low>>>0,t.end.high>>>0).toNumber():t.end),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t.DataLocation=function(){var t={},e=Object.create(t);return e[t[0]="DEFAULT"]=0,e[t[1]="EXTERNAL"]=1,e}(),t}(),i.TensorShapeProto=function(){function t(t){if(this.dim=[],t)for(var e=Object.keys(t),n=0;n>>3==1?(r.dim&&r.dim.length||(r.dim=[]),r.dim.push(l.onnx.TensorShapeProto.Dimension.decode(t,t.uint32()))):t.skipType(7&o)}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.dim&&t.hasOwnProperty("dim")){if(!Array.isArray(t.dim))return"dim: array expected";for(var e=0;e>>3){case 1:r.dimValue=t.int64();break;case 2:r.dimParam=t.string();break;case 3:r.denotation=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";var e={};if(null!=t.dimValue&&t.hasOwnProperty("dimValue")&&(e.value=1,!(c.isInteger(t.dimValue)||t.dimValue&&c.isInteger(t.dimValue.low)&&c.isInteger(t.dimValue.high))))return"dimValue: integer|Long expected";if(null!=t.dimParam&&t.hasOwnProperty("dimParam")){if(1===e.value)return"value: multiple values";if(e.value=1,!c.isString(t.dimParam))return"dimParam: string expected"}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TensorShapeProto.Dimension)return t;var e=new l.onnx.TensorShapeProto.Dimension;return null!=t.dimValue&&(c.Long?(e.dimValue=c.Long.fromValue(t.dimValue)).unsigned=!1:"string"==typeof t.dimValue?e.dimValue=parseInt(t.dimValue,10):"number"==typeof t.dimValue?e.dimValue=t.dimValue:"object"==typeof t.dimValue&&(e.dimValue=new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber())),null!=t.dimParam&&(e.dimParam=String(t.dimParam)),null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.dimValue&&t.hasOwnProperty("dimValue")&&("number"==typeof t.dimValue?n.dimValue=e.longs===String?String(t.dimValue):t.dimValue:n.dimValue=e.longs===String?c.Long.prototype.toString.call(t.dimValue):e.longs===Number?new c.LongBits(t.dimValue.low>>>0,t.dimValue.high>>>0).toNumber():t.dimValue,e.oneofs&&(n.value="dimValue")),null!=t.dimParam&&t.hasOwnProperty("dimParam")&&(n.dimParam=t.dimParam,e.oneofs&&(n.value="dimParam")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),i.TypeProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.tensorType=l.onnx.TypeProto.Tensor.decode(t,t.uint32());break;case 6:r.denotation=t.string();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.tensorType&&t.hasOwnProperty("tensorType")){var e=l.onnx.TypeProto.Tensor.verify(t.tensorType);if(e)return"tensorType."+e}return null!=t.denotation&&t.hasOwnProperty("denotation")&&!c.isString(t.denotation)?"denotation: string expected":null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto)return t;var e=new l.onnx.TypeProto;if(null!=t.tensorType){if("object"!=typeof t.tensorType)throw TypeError(".onnx.TypeProto.tensorType: object expected");e.tensorType=l.onnx.TypeProto.Tensor.fromObject(t.tensorType)}return null!=t.denotation&&(e.denotation=String(t.denotation)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.denotation=""),null!=t.tensorType&&t.hasOwnProperty("tensorType")&&(n.tensorType=l.onnx.TypeProto.Tensor.toObject(t.tensorType,e),e.oneofs&&(n.value="tensorType")),null!=t.denotation&&t.hasOwnProperty("denotation")&&(n.denotation=t.denotation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t.Tensor=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.elemType=t.int32();break;case 2:r.shape=l.onnx.TensorShapeProto.decode(t,t.uint32());break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.elemType&&t.hasOwnProperty("elemType")&&!c.isInteger(t.elemType))return"elemType: integer expected";if(null!=t.shape&&t.hasOwnProperty("shape")){var e=l.onnx.TensorShapeProto.verify(t.shape);if(e)return"shape."+e}return null},t.fromObject=function(t){if(t instanceof l.onnx.TypeProto.Tensor)return t;var e=new l.onnx.TypeProto.Tensor;if(null!=t.elemType&&(e.elemType=0|t.elemType),null!=t.shape){if("object"!=typeof t.shape)throw TypeError(".onnx.TypeProto.Tensor.shape: object expected");e.shape=l.onnx.TensorShapeProto.fromObject(t.shape)}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.elemType=0,n.shape=null),null!=t.elemType&&t.hasOwnProperty("elemType")&&(n.elemType=t.elemType),null!=t.shape&&t.hasOwnProperty("shape")&&(n.shape=l.onnx.TensorShapeProto.toObject(t.shape,e)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),t}(),i.OperatorSetIdProto=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n>>3){case 1:r.domain=t.string();break;case 2:r.version=t.int64();break;default:t.skipType(7&o)}}return r},t.decodeDelimited=function(t){return t instanceof s||(t=new s(t)),this.decode(t,t.uint32())},t.verify=function(t){return"object"!=typeof t||null===t?"object expected":null!=t.domain&&t.hasOwnProperty("domain")&&!c.isString(t.domain)?"domain: string expected":null!=t.version&&t.hasOwnProperty("version")&&!(c.isInteger(t.version)||t.version&&c.isInteger(t.version.low)&&c.isInteger(t.version.high))?"version: integer|Long expected":null},t.fromObject=function(t){if(t instanceof l.onnx.OperatorSetIdProto)return t;var e=new l.onnx.OperatorSetIdProto;return null!=t.domain&&(e.domain=String(t.domain)),null!=t.version&&(c.Long?(e.version=c.Long.fromValue(t.version)).unsigned=!1:"string"==typeof t.version?e.version=parseInt(t.version,10):"number"==typeof t.version?e.version=t.version:"object"==typeof t.version&&(e.version=new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber())),e},t.toObject=function(t,e){e||(e={});var n={};if(e.defaults)if(n.domain="",c.Long){var r=new c.Long(0,0,!1);n.version=e.longs===String?r.toString():e.longs===Number?r.toNumber():r}else n.version=e.longs===String?"0":0;return null!=t.domain&&t.hasOwnProperty("domain")&&(n.domain=t.domain),null!=t.version&&t.hasOwnProperty("version")&&("number"==typeof t.version?n.version=e.longs===String?String(t.version):t.version:n.version=e.longs===String?c.Long.prototype.toString.call(t.version):e.longs===Number?new c.LongBits(t.version.low>>>0,t.version.high>>>0).toNumber():t.version),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,a.util.toJSONOptions)},t}(),i),t.exports=l},2100:function(t,e,n){"use strict";t.exports=n(9482)},9482:function(t,e,n){"use strict";var r=e;function o(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}r.build="minimal",r.Writer=n(1173),r.BufferWriter=n(3155),r.Reader=n(1408),r.BufferReader=n(593),r.util=n(9693),r.rpc=n(5994),r.roots=n(5054),r.configure=o,o()},1408:function(t,e,n){"use strict";t.exports=u;var r,o=n(9693),i=o.LongBits,a=o.utf8;function s(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function u(t){this.buf=t,this.pos=0,this.len=t.length}var c,l="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new u(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new u(t);throw Error("illegal buffer")},f=function(){return o.Buffer?function(t){return(u.create=function(t){return o.Buffer.isBuffer(t)?new r(t):l(t)})(t)}:l};function p(){var t=new i(0,0),e=0;if(!(this.len-this.pos>4)){for(;e<3;++e){if(this.pos>=this.len)throw s(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;if(e=0,this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw s(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function h(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=f(),u.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,u.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var t=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var t=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},u.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw s(this,t);return this.pos+=t,Array.isArray(this.buf)?this.buf.slice(e,n):e===n?new this.buf.constructor(0):this._slice.call(this.buf,e,n)},u.prototype.string=function(){var t=this.bytes();return a.read(t,0,t.length)},u.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw s(this,t);this.pos+=t}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},u._configure=function(t){r=t,u.create=f(),r._configure();var e=o.Long?"toLong":"toNumber";o.merge(u.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return d.call(this)[e](!0)},sfixed64:function(){return d.call(this)[e](!1)}})}},593:function(t,e,n){"use strict";t.exports=i;var r=n(1408);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(t){r.call(this,t)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},i._configure()},5054:function(t){"use strict";t.exports={}},5994:function(t,e,n){"use strict";e.Service=n(7948)},7948:function(t,e,n){"use strict";t.exports=o;var r=n(9693);function o(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(n)}(o.prototype=Object.create(r.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function t(e,n,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return r.asPromise(t,s,e,n,o,i);if(s.rpcImpl)try{return s.rpcImpl(e,n[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(t,n){if(t)return s.emit("error",t,e),a(t);if(null!==n){if(!(n instanceof o))try{n=o[s.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return s.emit("error",t,e),a(t)}return s.emit("data",n,e),a(null,n)}s.end(!0)}))}catch(t){return s.emit("error",t,e),void setTimeout((function(){a(t)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},1945:function(t,e,n){"use strict";t.exports=o;var r=n(9693);function o(t,e){this.lo=t>>>0,this.hi=e>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(t){if(0===t)return i;var e=t<0;e&&(t=-t);var n=t>>>0,r=(t-n)/4294967296>>>0;return e&&(r=~r>>>0,n=~n>>>0,++n>4294967295&&(n=0,++r>4294967295&&(r=0))),new o(n,r)},o.from=function(t){if("number"==typeof t)return o.fromNumber(t);if(r.isString(t)){if(!r.Long)return o.fromNumber(parseInt(t,10));t=r.Long.fromString(t)}return t.low||t.high?new o(t.low>>>0,t.high>>>0):i},o.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=1+~this.lo>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+4294967296*n)}return this.lo+4294967296*this.hi},o.prototype.toLong=function(t){return r.Long?new r.Long(0|this.lo,0|this.hi,Boolean(t)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(t)}};var s=String.prototype.charCodeAt;o.fromHash=function(t){return t===a?i:new o((s.call(t,0)|s.call(t,1)<<8|s.call(t,2)<<16|s.call(t,3)<<24)>>>0,(s.call(t,4)|s.call(t,5)<<8|s.call(t,6)<<16|s.call(t,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},o.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},o.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},9693:function(t,e,n){"use strict";var r=e;function o(t,e,n){for(var r=Object.keys(e),o=0;o0)},r.Buffer=function(){try{var t=r.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),r._Buffer_from=null,r._Buffer_allocUnsafe=null,r.newBuffer=function(t){return"number"==typeof t?r.Buffer?r._Buffer_allocUnsafe(t):new r.Array(t):r.Buffer?r._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},r.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||r.inquire("long"),r.key2Re=/^true|false|0|1$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(t){return t?r.LongBits.from(t).toHash():r.LongBits.zeroHash},r.longFromHash=function(t,e){var n=r.LongBits.fromHash(t);return r.Long?r.Long.fromBits(n.lo,n.hi,e):n.toNumber(Boolean(e))},r.merge=o,r.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},r.newError=i,r.ProtocolError=i("ProtocolError"),r.oneOfGetter=function(t){for(var e={},n=0;n-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},r.oneOfSetter=function(t){return function(e){for(var n=0;n>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[n++]=127&t.lo|128,t.lo=t.lo>>>7;e[n++]=t.lo}function b(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}f.create=p(),f.alloc=function(t){return new o.Array(t)},o.Array!==Array&&(f.alloc=o.pool(f.alloc,o.Array.prototype.subarray)),f.prototype._push=function(t,e,n){return this.tail=this.tail.next=new u(t,e,n),this.len+=e,this},d.prototype=Object.create(u.prototype),d.prototype.fn=function(t,e,n){for(;t>127;)e[n++]=127&t|128,t>>>=7;e[n]=t},f.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new d((t>>>=0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this},f.prototype.int32=function(t){return t<0?this._push(g,10,i.fromNumber(t)):this.uint32(t)},f.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},f.prototype.uint64=function(t){var e=i.from(t);return this._push(g,e.length(),e)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(t){var e=i.from(t).zzEncode();return this._push(g,e.length(),e)},f.prototype.bool=function(t){return this._push(h,1,t?1:0)},f.prototype.fixed32=function(t){return this._push(b,4,t>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(t){var e=i.from(t);return this._push(b,4,e.lo)._push(b,4,e.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(t){return this._push(o.float.writeFloatLE,4,t)},f.prototype.double=function(t){return this._push(o.float.writeDoubleLE,8,t)};var y=o.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var r=0;r>>0;if(!e)return this._push(h,1,0);if(o.isString(t)){var n=f.alloc(e=a.length(t));a.decode(t,n,0),t=n}return this.uint32(e)._push(y,e,t)},f.prototype.string=function(t){var e=s.length(t);return e?this.uint32(e)._push(s.write,e,t):this._push(h,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this},f.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e},f._configure=function(t){r=t,f.create=p(),r._configure()}},3155:function(t,e,n){"use strict";t.exports=i;var r=n(1173);(i.prototype=Object.create(r.prototype)).constructor=i;var o=n(9693);function i(){r.call(this)}function a(t,e,n){t.length<40?o.utf8.write(t,e,n):e.utf8Write?e.utf8Write(t,n):e.write(t,n)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var r=0;r>>0;return this.uint32(e),e&&this._push(i.writeBytesBuffer,e,t),this},i.prototype.string=function(t){var e=o.Buffer.byteLength(t);return this.uint32(e),e&&this._push(a,e,t),this},i._configure()},7714:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Attribute=void 0;var o=n(1446),i=n(9395),a=n(9162),s=n(2517),u=i.onnxruntime.experimental.fbs,c=function(){function t(e){var n,i;if(this._attributes=new Map,null!=e){try{for(var a=r(e),s=a.next();!s.done;s=a.next()){var c=s.value;c instanceof o.onnx.AttributeProto?this._attributes.set(c.name,[t.getValue(c),t.getType(c)]):c instanceof u.Attribute&&this._attributes.set(c.name(),[t.getValue(c),t.getType(c)])}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}if(this._attributes.size0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveBackend=e.backend=void 0;var a=n(5038),s=new Map;function u(t){return r(this,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return void 0!==(n=e.backend)[t]&&(a=n[t],"initialize"in(u=a)&&"function"==typeof u.initialize&&"createSessionHandler"in u&&"function"==typeof u.createSessionHandler&&"dispose"in u&&"function"==typeof u.dispose)?(r=n[t],"object"==typeof(i=r.initialize())&&"then"in i?[4,i]:[3,2]):[3,3];case 1:i=o.sent(),o.label=2;case 2:if(i)return s.set(t,r),[2,r];o.label=3;case 3:return[2,void 0]}var a,u}))}))}e.backend={webgl:new a.WebGLBackend},e.resolveBackend=function t(e){return r(this,void 0,void 0,(function(){var n,r,a,c,l,f,p,h,d;return o(this,(function(o){switch(o.label){case 0:return e?[3,1]:[2,t(["webgl"])];case 1:n="string"==typeof e?[e]:e,o.label=2;case 2:o.trys.push([2,7,8,9]),r=i(n),a=r.next(),o.label=3;case 3:return a.done?[3,6]:(c=a.value,(l=s.get(c))?[2,l]:[4,u(c)]);case 4:if(f=o.sent())return[2,f];o.label=5;case 5:return a=r.next(),[3,3];case 6:return[3,9];case 7:return p=o.sent(),h={error:p},[3,9];case 8:try{a&&!a.done&&(d=r.return)&&d.call(r)}finally{if(h)throw h.error}return[7];case 9:throw new Error("no available backend to use")}}))}))}},5038:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLBackend=void 0;var r=n(8453),o=n(6231),i=n(6416),a=n(7305),s=function(){function t(){}return Object.defineProperty(t.prototype,"contextId",{get:function(){return r.env.webgl.contextId},set:function(t){r.env.webgl.contextId=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matmulMaxBatchSize",{get:function(){return r.env.webgl.matmulMaxBatchSize},set:function(t){r.env.webgl.matmulMaxBatchSize=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textureCacheMode",{get:function(){return r.env.webgl.textureCacheMode},set:function(t){r.env.webgl.textureCacheMode=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pack",{get:function(){return r.env.webgl.pack},set:function(t){r.env.webgl.pack=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"async",{get:function(){return r.env.webgl.async},set:function(t){r.env.webgl.async=t},enumerable:!1,configurable:!0}),t.prototype.initialize=function(){try{return this.glContext=(0,a.createWebGLContext)(this.contextId),"number"!=typeof this.matmulMaxBatchSize&&(this.matmulMaxBatchSize=16),"string"!=typeof this.textureCacheMode&&(this.textureCacheMode="full"),"boolean"!=typeof this.pack&&(this.pack=!1),"boolean"!=typeof this.async&&(this.async=!1),o.Logger.setWithEnv(r.env),o.Logger.verbose("WebGLBackend","Created WebGLContext: ".concat(typeof this.glContext," with matmulMaxBatchSize: ").concat(this.matmulMaxBatchSize,"; textureCacheMode: ").concat(this.textureCacheMode,"; pack: ").concat(this.pack,"; async: ").concat(this.async,".")),!0}catch(t){return o.Logger.warning("WebGLBackend","Unable to initialize WebGLBackend. ".concat(t)),!1}},t.prototype.createSessionHandler=function(t){return new i.WebGLSessionHandler(this,t)},t.prototype.dispose=function(){this.glContext.dispose()},t}();e.WebGLBackend=s},5107:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.CoordsGlslLib=void 0;var s=n(2517),u=n(8520),c=n(5060),l=n(7859),f=n(9390),p=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.getFunctions=function(){return i(i(i(i(i(i(i({},this.offsetToCoords()),this.coordsToOffset()),this.toVec()),this.valueFrom()),this.getCommonUtilFuncs()),this.getInputsSamplingSnippets()),this.getOutputSamplingSnippet())},e.prototype.getCustomTypes=function(){return{}},e.prototype.offsetToCoords=function(){return{offsetToCoords:new u.GlslLibRoutine("\n vec2 ".concat("offsetToCoords","(int offset, int width, int height) {\n int t = offset / width;\n int s = offset - t*width;\n vec2 coords = (vec2(s,t) + vec2(0.5,0.5)) / vec2(width, height);\n return coords;\n }\n "))}},e.prototype.coordsToOffset=function(){return{coordsToOffset:new u.GlslLibRoutine("\n int ".concat("coordsToOffset","(vec2 coords, int width, int height) {\n float s = coords.s * float(width);\n float t = coords.t * float(height);\n int offset = int(t) * width + int(s);\n return offset;\n }\n "))}},e.prototype.getOutputSamplingSnippet=function(){var t=this.context.outputTextureLayout;return t.isPacked?this.getPackedOutputSamplingSnippet(t):this.getUnpackedOutputSamplingSnippet(t)},e.prototype.getPackedOutputSamplingSnippet=function(t){var e=t.unpackedShape,n=[t.width,t.height],r={},o="getOutputCoords";switch(e.length){case 0:r[o]=this.getOutputScalarCoords();break;case 1:r[o]=this.getOutputPacked1DCoords(e,n);break;case 2:r[o]=this.getOutputPacked2DCoords(e,n);break;case 3:r[o]=this.getOutputPacked3DCoords(e,n);break;default:r[o]=this.getOutputPackedNDCoords(e,n)}var i=(0,c.getGlsl)(this.context.glContext.version),a="\n void setOutput(vec4 val) {\n ".concat(i.output," = val;\n }\n ");return r.floatTextureSetRGBA=new u.GlslLibRoutine(a),r},e.prototype.getUnpackedOutputSamplingSnippet=function(t){var e=t.unpackedShape,n=[t.width,t.height],r={},o="getOutputCoords";switch(e.length){case 0:r[o]=this.getOutputScalarCoords();break;case 1:r[o]=this.getOutputUnpacked1DCoords(e,n);break;case 2:r[o]=this.getOutputUnpacked2DCoords(e,n);break;case 3:r[o]=this.getOutputUnpacked3DCoords(e,n);break;case 4:r[o]=this.getOutputUnpacked4DCoords(e,n);break;case 5:r[o]=this.getOutputUnpacked5DCoords(e,n);break;case 6:r[o]=this.getOutputUnpacked6DCoords(e,n);break;default:throw new Error("Unsupported output dimensionality: ".concat(e.length))}var i=(0,c.getGlsl)(this.context.glContext.version),a="\n void setOutput(float val) {\n ".concat(i.output," = vec4(val, 0, 0, 0);\n }\n ");return r.floatTextureSetR=new u.GlslLibRoutine(a),r},e.prototype.getOutputScalarCoords=function(){return new u.GlslLibRoutine("\n int getOutputCoords() {\n return 0;\n }\n ")},e.prototype.getOutputPacked1DCoords=function(t,e){var n=e,r="";return 1===n[0]?(r="\n int getOutputCoords() {\n return 2 * int(TexCoords.y * ".concat(n[1],".0);\n }\n "),new u.GlslLibRoutine(r)):1===n[1]?(r="\n int getOutputCoords() {\n return 2 * int(TexCoords.x * ".concat(n[0],".0);\n }\n "),new u.GlslLibRoutine(r)):(r="\n int getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(n[0],", ").concat(n[1],"));\n return 2 * (resTexRC.y * ").concat(n[0]," + resTexRC.x);\n }\n "),new u.GlslLibRoutine(r))},e.prototype.getOutputPacked2DCoords=function(t,e){var n="";if(s.ArrayUtil.arraysEqual(t,e))return n="\n ivec2 getOutputCoords() {\n return 2 * ivec2(TexCoords.xy * vec2(".concat(e[0],", ").concat(e[1],"));\n }\n "),new u.GlslLibRoutine(n);var r=e,o=Math.ceil(t[1]/2);return n="\n ivec2 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(r[0],", ").concat(r[1],"));\n\n int index = resTexRC.y * ").concat(r[0]," + resTexRC.x;\n\n // reverse r and c order for packed texture\n int r = imod(index, ").concat(o,") * 2;\n int c = 2 * (index / ").concat(o,");\n\n return ivec2(r, c);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputPacked3DCoords=function(t,e){var n=[e[0],e[1]],r=Math.ceil(t[2]/2),o=r*Math.ceil(t[1]/2),i="\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(n[0],", ").concat(n[1],"));\n int index = resTexRC.y * ").concat(n[0]," + resTexRC.x;\n\n int b = index / ").concat(o,";\n index -= b * ").concat(o,";\n\n // reverse r and c order for packed texture\n int r = imod(index, ").concat(r,") * 2;\n int c = 2 * (index / ").concat(r,");\n\n return ivec3(b, r, c);\n }\n ");return new u.GlslLibRoutine(i)},e.prototype.getOutputPackedNDCoords=function(t,e){for(var n=[e[0],e[1]],r=Math.ceil(t[t.length-1]/2),o=r*Math.ceil(t[t.length-2]/2),i=o,a="",s="b, r, c",c=2;c=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec3 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec3(r, c, d);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked4DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec4 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec4(r, c, d, d2);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked5DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2","d3"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec5 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec5(r, c, d, d2, d3);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getOutputUnpacked6DCoords=function(t,e){var n,r=t.length,o=null;r<2&&(o=[]),(o=new Array(r-1))[r-2]=t[r-1];for(var i=r-3;i>=0;--i)o[i]=o[i+1]*t[i+1];var a=["r","c","d","d2","d3","d4"],s=o.map((function(t,e){var n="int ".concat(a[e]," = index / ").concat(t),r=e===o.length-1?"int ".concat(a[e+1]," = index - ").concat(a[e]," * ").concat(t):"index -= ".concat(a[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join("");return n="\n ivec6 getOutputCoords() {\n ivec2 resTexRC = ivec2(TexCoords.xy *\n vec2(".concat(e[0],", ").concat(e[1],"));\n int index = resTexRC.y * ").concat(e[0]," + resTexRC.x;\n ").concat(s,"\n return ivec6(r, c, d, d2, d3, d4);\n }\n "),new u.GlslLibRoutine(n)},e.prototype.getCommonUtilFuncs=function(){var t={},e="uvFromFlat";t[e]=new u.GlslLibRoutine("\n vec2 uvFromFlat(int texNumR, int texNumC, int index) {\n int texC = index / texNumR;\n int texR = index - texC * texNumR;\n // TODO: swap texR, texC order in following function so row is corresponding to u and column is corresponding to\n // v.\n return (vec2(texR, texC) + halfCR) / vec2(texNumR, texNumC);\n }\n "),t[e="packedUVfrom1D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom1D(int texNumR, int texNumC, int index) {\n int texelIndex = index / 2;\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t[e="packedUVfrom2D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom2D(int texNumR, int texNumC, int texelsInLogicalRow, int row, int col) {\n int texelIndex = (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = texelIndex / texNumC;\n int texC = texelIndex - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),t[e="packedUVfrom3D"]=new u.GlslLibRoutine("\n vec2 packedUVfrom3D(int texNumR, int texNumC,\n int texelsInBatch, int texelsInLogicalRow, int b,\n int row, int col) {\n int index = b * texelsInBatch + (row / 2) * texelsInLogicalRow + (col / 2);\n int texR = index / texNumC;\n int texC = index - texR * texNumC;\n return (vec2(texC, texR) + halfCR) / vec2(texNumC, texNumR);\n }\n "),e="sampleTexture";var n=(0,c.getGlsl)(this.context.glContext.version);return t[e]=new u.GlslLibRoutine("\n float sampleTexture(sampler2D textureSampler, vec2 uv) {\n return ".concat(n.texture2D,"(textureSampler, uv).r;\n }")),t},e.prototype.getInputsSamplingSnippets=function(){var t=this,e={},n=this.context.outputTextureLayout;return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o],a=(0,f.generateShaderFuncNameFromInputSamplerName)(r);i.isPacked?e[a]=t.getPackedSamplerFromInput(a,r,i):e[a]=t.getUnpackedSamplerFromInput(a,r,i);var s=(0,f.generateShaderFuncNameFromInputSamplerNameAtOutCoords)(r);i.unpackedShape.length<=n.unpackedShape.length&&(i.isPacked?e[s]=t.getPackedSamplerAtOutputCoords(s,i,n,r):e[s]=t.getUnpackedSamplerAtOutputCoords(s,i,n,r))})),e},e.prototype.getPackedSamplerAtOutputCoords=function(t,e,n,r){var o,i=e.unpackedShape,a=n.unpackedShape,c=r,l=(0,f.generateShaderFuncNameFromInputSamplerName)(c),p=i.length,h=a.length,d=s.BroadcastUtil.getBroadcastDims(i,a),g=(0,f.getCoordsDataType)(h),b=h-p,y=(0,f.getGlChannels)();o=0===p?"":h<2&&d.length>=1?"coords = 0;":d.map((function(t){return"coords.".concat(y[t+b]," = 0;")})).join("\n");var m;m=h<2&&p>0?"coords":i.map((function(t,e){return"coords.".concat(y[e+b])})).join(", ");var v="return outputValue;",_=1===s.ShapeUtil.size(i),w=1===s.ShapeUtil.size(a);if(1!==p||_||w){if(_&&!w)v=1===h?"\n return vec4(outputValue.x, outputValue.x, 0., 0.);\n ":"\n return vec4(outputValue.x);\n ";else if(d.length){var x=p-2,T=p-1;d.indexOf(x)>-1&&d.indexOf(T)>-1?v="return vec4(outputValue.x);":d.indexOf(x)>-1?v="return vec4(outputValue.x, outputValue.y, outputValue.x, outputValue.y);":d.indexOf(T)>-1&&(v="return vec4(outputValue.xx, outputValue.zz);")}}else v="\n return vec4(outputValue.xy, outputValue.xy);\n ";var S="\n int lastDim = coords.".concat(y[h-1],";\n coords.").concat(y[h-1]," = coords.").concat(y[h-2],";\n coords.").concat(y[h-2]," = lastDim;\n "),O="\n vec4 ".concat(t,"() {\n ").concat(g," coords = getOutputCoords();\n ").concat(S,"\n ").concat(o,"\n vec4 outputValue = ").concat(l,"(").concat(m,");\n ").concat(v,"\n }\n ");return new u.GlslLibRoutine(O,["coordinates.getOutputCoords"])},e.prototype.getUnpackedSamplerAtOutputCoords=function(t,e,n,r){var o=[n.width,n.height],i=[e.width,e.height],a=e.unpackedShape.length,c=n.unpackedShape.length,l=e.unpackedShape,p=n.unpackedShape,h=(0,f.generateShaderFuncNameFromInputSamplerName)(r);if(a===c&&s.ArrayUtil.arraysEqual(i,o)){var d="\n float ".concat(t,"() {\n return sampleTexture(").concat(r,", TexCoords);\n }\n ");return new u.GlslLibRoutine(d,["coordinates.sampleTexture"])}var g,b=(0,f.getCoordsDataType)(c),y=s.BroadcastUtil.getBroadcastDims(l,p),m=c-a,v=(0,f.getGlChannels)();g=0===a?"":c<2&&y.length>=1?"coords = 0;":y.map((function(t){return"coords.".concat(v[t+m]," = 0;")})).join("\n");var _;_=c<2&&a>0?"coords":e.unpackedShape.map((function(t,e){return"coords.".concat(v[e+m])})).join(", ");var w="\n float ".concat(t,"() {\n ").concat(b," coords = getOutputCoords();\n ").concat(g,"\n return ").concat(h,"(").concat(_,");\n }\n ");return new u.GlslLibRoutine(w,["coordinates.getOutputCoords"])},e.prototype.getPackedSamplerFromInput=function(t,e,n){switch(n.unpackedShape.length){case 0:return this.getPackedSamplerScalar(t,e);case 1:return this.getPackedSampler1D(t,e,n);case 2:return this.getPackedSampler2D(t,e,n);case 3:return this.getPackedSampler3D(t,e,n);default:return this.getPackedSamplerND(t,e,n)}},e.prototype.getUnpackedSamplerFromInput=function(t,e,n){var r=n.unpackedShape;switch(r.length){case 0:return this.getUnpackedSamplerScalar(t,e,n);case 1:return this.getUnpackedSampler1D(t,e,n);case 2:return this.getUnpackedSampler2D(t,e,n);case 3:return this.getUnpackedSampler3D(t,e,n);case 4:return this.getUnpackedSampler4D(t,e,n);case 5:return this.getUnpackedSampler5D(t,e,n);case 6:return this.getUnpackedSampler6D(t,e,n);default:throw new Error("Unsupported dimension ".concat(r.length,"-D"))}},e.prototype.getPackedSamplerScalar=function(t,e){var n=(0,c.getGlsl)(this.context.glContext.version),r="\n vec4 ".concat(t,"() {\n return ").concat(n.texture2D,"(").concat(e,", halfCR);\n }\n ");return new u.GlslLibRoutine(r)},e.prototype.getPackedSampler1D=function(t,e,n){var r=[n.width,n.height],o=[r[1],r[0]],i=(0,c.getGlsl)(this.context.glContext.version),a="vec4 ".concat(t,"(int index) {\n vec2 uv = packedUVfrom1D(\n ").concat(o[0],", ").concat(o[1],", index);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(a,["coordinates.packedUVfrom1D"])},e.prototype.getPackedSampler2D=function(t,e,n){var r=n.unpackedShape,o=[n.width,n.height],i=(0,c.getGlsl)(this.context.glContext.version),a=o[0],l=o[1];if(null!=o&&s.ArrayUtil.arraysEqual(r,o)){var f="vec4 ".concat(t,"(int row, int col) {\n vec2 uv = (vec2(col, row) + halfCR) / vec2(").concat(l,".0, ").concat(a,".0);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(f)}var p=o,h=Math.ceil(r[1]/2),d="vec4 ".concat(t,"(int row, int col) {\n vec2 uv = packedUVfrom2D(").concat(p[1],", ").concat(p[0],", ").concat(h,", row, col);\n return ").concat(i.texture2D,"(").concat(e,", uv);\n }");return new u.GlslLibRoutine(d,["coordinates.packedUVfrom2D"])},e.prototype.getPackedSampler3D=function(t,e,n){var r=n.unpackedShape,o=[n.width,n.height],i=[o[0],o[1]],a=(0,c.getGlsl)(this.context.glContext.version);if(1===r[0]){var s=r.slice(1),l=(0,f.squeezeInputShape)(r,s),p=JSON.parse(JSON.stringify(n));p.unpackedShape=l;var h=this.getPackedSamplerFromInput(t,e,p),d="".concat(h.routineBody,"\n vec4 ").concat(t,"(int b, int row, int col) {\n return ").concat(t,"(").concat((0,f.getSqueezedParams)(["b","row","col"],[1,2]),");\n } ");return new u.GlslLibRoutine(d,h.dependencies)}var g=i[0],b=i[1],y=Math.ceil(r[2]/2),m=y*Math.ceil(r[1]/2),v="vec4 ".concat(t,"(int b, int row, int col) {\n vec2 uv = packedUVfrom3D(\n ").concat(b,", ").concat(g,", ").concat(m,", ").concat(y,", b, row, col);\n return ").concat(a.texture2D,"(").concat(e,", uv);}");return new u.GlslLibRoutine(v,["coordinates.packedUVfrom3D"])},e.prototype.getPackedSamplerND=function(t,e,n){for(var r=n.unpackedShape,o=r.length,i=[n.width,n.height],a=(0,c.getGlsl)(this.context.glContext.version),s=[i[0],i[1]],l=s[1],f=s[0],p=Math.ceil(r[o-1]/2),h=p*Math.ceil(r[o-2]/2),d="int b, int row, int col",g="b * ".concat(h," + (row / 2) * ").concat(p," + (col / 2)"),b=2;b0?o.unpackedShape:o.shape).length,a="_".concat(n);e[a]=new u.GlslLibRoutine(t.getValueFromSingle(n,i,o.width,o.height,!1),["shapeUtils.indicesToOffset".concat(a),"coordinates.offsetToCoords","fragcolor.getColorAsFloat"]),e[a+="_T"]=new u.GlslLibRoutine(t.getValueFromSingle(n,i,o.width,o.height,!0),["shapeUtils.indicesToOffset".concat(a),"coordinates.offsetToCoords","fragcolor.getColorAsFloat"])})),e},e.prototype.getValueFromSingle=function(t,e,n,r,o){var i="_".concat(t);o&&(i+="_T");var a=(0,c.getGlsl)(this.context.glContext.version);return"\n float ".concat(i,"(int m[").concat(e,"]) {\n int offset = indicesToOffset").concat(i,"(m);\n vec2 coords = offsetToCoords(offset, ").concat(n,", ").concat(r,");\n float value = getColorAsFloat(").concat(a.texture2D,"(").concat(t,", coords));\n return value;\n }\n ")},e.prototype.getPackedValueFrom=function(t,e,n,r,o){var i="_".concat(t,"_Pack");o&&(i+="_T");var a=(0,c.getGlsl)(this.context.glContext.version);return"\n vec4 ".concat(i,"(int m[").concat(e,"]) {\n int offset = indicesToOffset_").concat(t,"(m);\n vec2 coords = offsetToCoords(offset, ").concat(n,", ").concat(r,");\n return ").concat(a.texture2D,"(").concat(t,", coords);\n }\n ")},e}(u.GlslLib);e.CoordsGlslLib=p},8520:function(t,e){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TopologicalSortGlslRoutines=e.GlslLibRoutineNode=e.GlslLibRoutine=e.GlslLib=e.GlslContext=e.FunctionType=void 0,(n=e.FunctionType||(e.FunctionType={}))[n.ValueBased=0]="ValueBased",n[n.Positional=1]="Positional";e.GlslContext=function(t,e,n,r){this.glContext=t,this.programInfo=e,this.inputTextureLayouts=n,this.outputTextureLayout=r};e.GlslLib=function(t){this.context=t};e.GlslLibRoutine=function(t,e){this.routineBody=t,this.dependencies=e};var r=function(){function t(t,e,n){this.name=t,this.dependencies=n||[],e&&(this.routineBody=e)}return t.prototype.addDependency=function(t){t&&this.dependencies.push(t)},t}();e.GlslLibRoutineNode=r;var o=function(){function t(){}return t.returnOrderedNodes=function(t){if(!t||0===t.length)return[];if(1===t.length)return t;var e=new Set,n=new Set,r=new Array;return this.createOrderedNodes(t,e,n,r),r},t.createOrderedNodes=function(t,e,n,r){for(var o=0;o0)for(var i=0;i=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.GlslPreprocessor=void 0;var o=n(8520),i=n(2848),a=n(5483),s=n(5060),u=function(){function t(t,e,n,r){var i=this;this.libs={},this.glslLibRoutineDependencyGraph={},this.context=new o.GlslContext(t,e,n,r),Object.keys(a.glslRegistry).forEach((function(t){var e=new a.glslRegistry[t](i.context);i.libs[t]=e}));var s=this.glslLibRoutineDependencyGraph;for(var u in this.libs){var c=this.libs[u].getFunctions();for(var l in c){var f=u+"."+l,p=void 0;s[f]?(p=s[f]).routineBody=c[l].routineBody:(p=new o.GlslLibRoutineNode(f,c[l].routineBody),s[f]=p);var h=c[l].dependencies;if(h)for(var d=0;de)){for(var s=i.length,u=e-s,c="bcastMatmulIndices_".concat(r),l="",f=0;f=0;--o)r+="\n offset += indices[".concat(o,"] * ").concat(n[o],";\n ");return"\n int ".concat(t,"(int indices[").concat(e,"]) {\n int offset = 0;\n ").concat(r,"\n return offset;\n }\n ")},e.prototype.offsetToIndices=function(){var t=this,n={};return this.context.programInfo.inputNames.forEach((function(r,o){var i=t.context.inputTextureLayouts[o].shape,s=t.context.inputTextureLayouts[o].strides,u=i.length,c="offsetToIndices_".concat(r);n[c]=new a.GlslLibRoutine(e.offsetToIndicesSingle(c,u,s)),c="offsetToIndices_".concat(r,"_T"),n[c]=new a.GlslLibRoutine(e.offsetToIndicesSingle(c,u,s.slice().reverse()))})),n},e.offsetToIndicesSingle=function(t,e,n){for(var r=[],o=0;o= 0; --i) {\n if(i > axis) continue;\n indices[i] += 1;\n if(indices[i] < shape[i]) {\n break;\n }\n indices[i] = 0;\n }\n }\n ");e[s]=new a.GlslLibRoutine(l)})),e},e}(a.GlslLib);e.ShapeUtilsGlslLib=s},5060:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getDefaultFragShaderMain=e.getFragShaderPreamble=e.getVertexShaderSource=e.getGlsl=void 0;var n={version:"",attribute:"attribute",varyingVertex:"varying",varyingFrag:"varying",texture2D:"texture2D",output:"gl_FragColor",outputDeclaration:""},r={version:"#version 300 es",attribute:"in",varyingVertex:"out",varyingFrag:"in",texture2D:"texture",output:"outputColor",outputDeclaration:"out vec4 outputColor;"};function o(t){return 1===t?n:r}e.getGlsl=o,e.getVertexShaderSource=function(t){var e=o(t);return"".concat(e.version,"\n precision highp float;\n ").concat(e.attribute," vec3 position;\n ").concat(e.attribute," vec2 textureCoord;\n\n ").concat(e.varyingVertex," vec2 TexCoords;\n\n void main()\n {\n gl_Position = vec4(position, 1.0);\n TexCoords = textureCoord;\n }")},e.getFragShaderPreamble=function(t){var e=o(t);return"".concat(e.version,"\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n ").concat(e.varyingFrag," vec2 TexCoords;\n ").concat(e.outputDeclaration,"\n const vec2 halfCR = vec2(0.5, 0.5);\n\n // Custom vector types to handle higher dimenalities.\n struct ivec5\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n };\n\n struct ivec6\n {\n int x;\n int y;\n int z;\n int w;\n int u;\n int v;\n };\n\n int imod(int x, int y) {\n return x - y * (x / y);\n }\n\n ")},e.getDefaultFragShaderMain=function(t,e){var n=o(t);return"\n void main() {\n int indices[".concat(e,"];\n toVec(TexCoords, indices);\n vec4 result = vec4(process(indices));\n ").concat(n.output," = result;\n }\n ")}},3891:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseBatchNormalizationAttributes=e.batchNormalization=void 0;var i=n(246),a=n(5060),s=n(2039),u={name:"BatchNormalization",inputNames:["A","Scale","B","Mean","Variance"],inputTypes:[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]};e.batchNormalization=function(t,e,n){return l(e),[t.run(r(r({},u),{cacheHint:n.cacheKey,get:function(){return c(t,e,n)}}),e)]},e.parseBatchNormalizationAttributes=function(t){var e=t.attributes.getFloat("epsilon",1e-5),n=t.attributes.getFloat("momentum",.9),r=t.attributes.getInt("spatial",1);return(0,i.createAttributeWithCacheKey)({epsilon:e,momentum:n,spatial:r})};var c=function(t,e,n){var i=(0,a.getGlsl)(t.session.backend.glContext.version),c=e[0].dims.length,l=o(t.calculateTextureWidthAndHeight(e[1].dims,s.TextureType.unpacked),2),f=l[0],p=l[1],h="\n float process(int[".concat(c,"] indices) {\n vec2 position = offsetToCoords(indices[1], ").concat(f,", ").concat(p,");\n float scale = getColorAsFloat(").concat(i.texture2D,"(Scale, position));\n float mean = getColorAsFloat(").concat(i.texture2D,"(Mean, position));\n float variance = getColorAsFloat(").concat(i.texture2D,"(Variance, position));\n float b = getColorAsFloat(").concat(i.texture2D,"(B, position));\n\n return scale * ( (_A(indices) - mean) / sqrt(variance + float(").concat(n.epsilon,")) ) + b;\n }");return r(r({},u),{output:{dims:e[0].dims,type:e[0].type,textureType:s.TextureType.unpacked},shaderSource:h})},l=function(t){if(!t||5!==t.length)throw new Error("BatchNormalization requires 5 inputs.");var e=t[0],n=t[1],r=t[2],o=t[3],i=t[4];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length||1!==o.dims.length||1!==i.dims.length)throw new Error("invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1]||o.dims[0]!==e.dims[1]||i.dims[0]!==e.dims[1])throw new Error("invalid input shape.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type||"float32"!==o.type&&"float64"!==o.type||"float32"!==i.type&&"float64"!==i.type)throw new Error("invalid input tensor types.")}},7839:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.xor=e.sub=e.pRelu=e.pow=e.or=e.mul=e.less=e.greater=e.equal=e.div=e.and=e.add=e.glslPRelu=e.glslPow=e.glslXor=e.glslOr=e.glslAnd=e.glslLess=e.glslGreater=e.glslEqual=e.glslSub=e.glslMul=e.glslDiv=e.glslAdd=void 0;var r=n(2517),o=n(8520),i=n(5060),a=n(2039);function s(){var t="add_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a + b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 + v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function u(){var t="div_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a / b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 / v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function c(){var t="mul_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a * b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 * v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function l(){var t="sub_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a - b;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return v1 - v2;\n }\n "),name:t,type:o.FunctionType.ValueBased}}function f(){var t="equal_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a == b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4(equal(v1, v2));\n }\n "),name:t,type:o.FunctionType.ValueBased}}function p(){var t="greater_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a > b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4( v1.r > v2.r ,\n v1.g > v2.g,\n v1.b > v2.b,\n v1.a > v2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function h(){var t="less_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float(a < b);\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4( v1.r < v2.r ,\n v1.g < v2.g,\n v1.b < v2.b,\n v1.a < v2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function d(){var t="and_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) && bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r && b2.r ,\n b1.g && b2.g,\n b1.b && b2.b,\n b1.a && b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function g(){var t="or_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) || bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r || b2.r ,\n b1.g || b2.g,\n b1.b || b2.b,\n b1.a || b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function b(){var t="xor_";return{body:"\n float ".concat(t,"(float a, float b) {\n return float( bool(a) ^^ bool(b) );\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n bvec4 b1 = bvec4(v1);\n bvec4 b2 = bvec4(v2);\n return vec4( b1.r ^^ b2.r ,\n b1.g ^^ b2.g,\n b1.b ^^ b2.b,\n b1.a ^^ b2.a );\n }\n "),name:t,type:o.FunctionType.ValueBased}}function y(){return function(t){var e="".concat(t,"_");return{body:"\n float ".concat(e,"(float a, float b) {\n return ").concat(t,"(a, b);\n }\n vec4 ").concat(e,"(vec4 v1, vec4 v2) {\n return ").concat(t,"(v1, v2);\n }\n "),name:e,type:o.FunctionType.ValueBased}}("pow")}function m(){var t="prelu_";return{body:"\n float ".concat(t,"(float a, float b) {\n return a < 0.0 ? a * b: a;\n }\n vec4 ").concat(t,"(vec4 v1, vec4 v2) {\n return vec4(\n v1.r < 0.0 ? v1.r * v2.r: v1.r,\n v1.g < 0.0 ? v1.g * v2.g: v1.g,\n v1.b < 0.0 ? v1.b * v2.b: v1.b,\n v1.a < 0.0 ? v1.a * v2.a: v1.a\n );\n }\n "),name:t,type:o.FunctionType.ValueBased}}e.glslAdd=s,e.glslDiv=u,e.glslMul=c,e.glslSub=l,e.glslEqual=f,e.glslGreater=p,e.glslLess=h,e.glslAnd=d,e.glslOr=g,e.glslXor=b,e.glslPow=y,e.glslPRelu=m;var v=function(t,e,n,r,o){void 0===r&&(r=e[0].type);var i=t.session.pack?a.TextureType.packed:a.TextureType.unpacked;return{name:n.name,inputNames:["A","B"],inputTypes:[i,i],cacheHint:o,get:function(){return _(t,e,n,r)}}},_=function(t,e,n,o){void 0===o&&(o=e[0].type);var s=t.session.pack?a.TextureType.packed:a.TextureType.unpacked,u=!r.ShapeUtil.areEqual(e[0].dims,e[1].dims),c=e[0].dims,l=t.session.pack;if(u){var f=r.BroadcastUtil.calcShape(e[0].dims,e[1].dims,!1);if(!f)throw new Error("Can't perform binary op on the given tensors");var p=(c=f).length,h=0!==e[0].dims.length?e[0].dims.length:1,d=0!==e[1].dims.length?e[1].dims.length:1,g=0!==e[0].dims.length?"bcastIndices_A(indices, aindices);":"aindices[0] = 0;",b=0!==e[1].dims.length?"bcastIndices_B(indices, bindices);":"bindices[0] = 0;",y=(0,i.getGlsl)(t.session.backend.glContext.version),m=l?"\n ".concat(n.body,"\n void main() {\n vec4 a = getAAtOutCoords();\n vec4 b = getBAtOutCoords();\n vec4 result = ").concat(n.name,"(a, b);\n ").concat(y.output," = result;\n }"):"\n ".concat(n.body,"\n float process(int indices[").concat(p,"]) {\n int aindices[").concat(h,"];\n int bindices[").concat(d,"];\n ").concat(g,"\n ").concat(b,"\n return ").concat(n.name,"(_A(aindices), _B(bindices));\n }");return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:c,type:o,textureType:s},shaderSource:m,hasMain:l}}var v=(0,i.getGlsl)(t.session.backend.glContext.version),_="\n ".concat(n.body,"\n void main() {\n vec4 v1 = ").concat(v.texture2D,"(A, TexCoords);\n vec4 v2 = ").concat(v.texture2D,"(B, TexCoords);\n vec4 result = ").concat(n.name,"(v1, v2);\n ").concat(v.output," = result;\n }\n ");return{name:n.name,inputNames:["A","B"],inputTypes:[s,s],output:{dims:e[0].dims,type:o,textureType:s},shaderSource:_,hasMain:!0}};e.add=function(t,e){return[t.run(v(t,e,s()),e)]},e.and=function(t,e){return[t.run(v(t,e,d(),"bool"),e)]},e.div=function(t,e){return[t.run(v(t,e,u()),e)]},e.equal=function(t,e){return[t.run(v(t,e,f(),"bool"),e)]},e.greater=function(t,e){return[t.run(v(t,e,p(),"bool"),e)]},e.less=function(t,e){return[t.run(v(t,e,h(),"bool"),e)]},e.mul=function(t,e){return[t.run(v(t,e,c()),e)]},e.or=function(t,e){return[t.run(v(t,e,g(),"bool"),e)]},e.pow=function(t,e){return[t.run(v(t,e,y()),e)]},e.pRelu=function(t,e){return[t.run(v(t,e,m()),e)]},e.sub=function(t,e){return[t.run(v(t,e,l()),e)]},e.xor=function(t,e){return[t.run(v(t,e,b(),"bool"),e)]}},4196:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseCastAttributes=e.cast=void 0;var r=n(2517);e.cast=function(t,e,n){return o(e),[t.cast(e[0],n)]},e.parseCastAttributes=function(t){return r.ProtoUtil.tensorDataTypeFromProto(t.attributes.getInt("to"))};var o=function(t){if(!t||1!==t.length)throw new Error("Cast requires 1 input.");if("string"===t[0].type)throw new Error("Invalid input type.")}},1163:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=l.length||c<-1*l.length)throw new Error("axis specified for concat doesn't match input dimensionality");c<0&&(c=l.length+c);for(var f=l.slice(0),p=1;p= ").concat(w[p-1],") {\n return getChannel(\n getX").concat(p,"(").concat(u(_,x,A),"),\n vec2(").concat(u(T,x,A),"));\n }")}var E=w.length,I=w[w.length-1];O+="\n return getChannel(\n getX".concat(E,"(").concat(u(_,x,I),"),\n vec2(").concat(u(T,x,I),"));");var P=(0,o.getGlsl)(t.session.backend.glContext.version),D="\n ".concat(m,"\n float getValue(").concat(_.map((function(t){return"int "+t})),") {\n ").concat(O,"\n }\n\n void main() {\n ").concat(y," coords = getOutputCoords();\n int lastDim = coords.").concat(_[g-1],";\n coords.").concat(_[g-1]," = coords.").concat(_[g-2],";\n coords.").concat(_[g-2]," = lastDim;\n\n vec4 result = vec4(getValue(").concat(b,"), 0., 0., 0.);\n\n ").concat(b[g-1]," = ").concat(b[g-1]," + 1;\n if (").concat(b[g-1]," < ").concat(f[g-1],") {\n result.g = getValue(").concat(b,");\n }\n\n ").concat(b[g-2]," = ").concat(b[g-2]," + 1;\n if (").concat(b[g-2]," < ").concat(f[g-2],") {\n result.a = getValue(").concat(b,");\n }\n\n ").concat(b[g-1]," = ").concat(b[g-1]," - 1;\n if (").concat(b[g-2]," < ").concat(f[g-2]," &&\n ").concat(b[g-1]," < ").concat(f[g-1],") {\n result.b = getValue(").concat(b,");\n }\n ").concat(P.output," = result;\n }\n ");return r(r({},e),{output:{dims:f,type:n[0].type,textureType:i.TextureType.packed},shaderSource:D,hasMain:!0})}(t,f,e,n.axis)}})};var u=function(t,e,n){var r=t.indexOf(e);return t.map((function(t,e){return e===r?"".concat(t," - ").concat(n):t})).join()}},2069:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.parseConcatAttributes=e.concat=void 0;var i=n(246),a=n(2039),s=n(1163);e.concat=function(t,e,n){return h(e),t.session.pack&&e[0].dims.length>1?[t.run((0,s.createPackedConcatProgramInfoLoader)(t,e,n),e)]:[t.run(u(t,e,n),e)]};var u=function(t,e,n){var o,i,s=(o=e.length,i=n.cacheKey,{name:"Concat",inputNames:Array.from({length:o},(function(t,e){return"X".concat(e)})),inputTypes:Array(o).fill(a.TextureType.unpacked),cacheHint:i});return r(r({},s),{get:function(){return function(t,e,n,o){var i=n[0].dims.slice();if(o>=i.length||o<-1*i.length)throw new Error("axis specified for concat doesn't match input dimensionality");o<0&&(o=i.length+o);for(var s=i.slice(0),u=1;u2,l=n.cacheKey,{name:"GroupedConv",inputNames:c?["X","W","Bias"]:["X","W"],inputTypes:c?[a.TextureType.unpacked,a.TextureType.unpacked,a.TextureType.unpacked]:[a.TextureType.unpacked,a.TextureType.unpacked],cacheHint:l});return r(r({},f),{get:function(){return function(t,e,n,c){var l=e.length>2?"value += getBias(output_channel);":"",f=e[0].dims.slice(),p=e[1].dims.slice(),h=p[0]/c.group;o.Logger.verbose("GroupedConv","autpPad:".concat(c.autoPad,", dilations:").concat(c.dilations,", group:").concat(c.group,", kernelShape:").concat(c.kernelShape,", pads:").concat(c.pads,", strides:").concat(c.strides));var d=(0,s.calculateOutputShape)(f,p,c.dilations,c.pads,c.strides),g=(0,i.getGlsl)(t.session.backend.glContext.version),b=(0,u.getActivationSnippet)(c),y=b.activationFunction,m=b.applyActivation,v="\n const ivec2 strides = ivec2(".concat(c.strides[0],", ").concat(c.strides[1],");\n const ivec2 pads = ivec2(").concat(c.pads[0],", ").concat(c.pads[1],");\n ").concat(y,"\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n ivec2 xRCCorner = coords.zw * strides - pads;\n int group_id = output_channel / ").concat(h,";\n\n float value = 0.0;\n for (int wInChannel = 0; wInChannel < ").concat(p[1],"; wInChannel++) {\n int input_channel = group_id * ").concat(p[1]," + wInChannel;\n for (int wHeight = 0; wHeight < ").concat(p[2],"; wHeight++) {\n int xHeight = xRCCorner.x + wHeight * ").concat(c.dilations[0],";\n\n if (xHeight < 0 || xHeight >= ").concat(f[2],") {\n continue;\n }\n\n for (int wWidth = 0; wWidth < ").concat(p[3],"; wWidth++) {\n int xWidth = xRCCorner.y + wWidth * ").concat(c.dilations[1],";\n if (xWidth < 0 || xWidth >= ").concat(f[3],") {\n continue;\n }\n\n float xVal = getX(batch, input_channel, xWidth, xHeight);\n float wVal = getW(output_channel, wInChannel, wWidth, wHeight);\n value += xVal*wVal;\n }\n }\n }\n ").concat(l,"\n ").concat(m,"\n ").concat(g.output," = vec4(value, .0, .0, .0);\n }\n");return r(r({},n),{output:{dims:d,type:e[0].type,textureType:a.TextureType.unpacked},shaderSource:v,hasMain:!0})}(t,e,f,n)}})}},1386:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.conv2DPacked=e.conv2DPackedPointwise=void 0;var r=n(8138),o=n(8555),i=n(708);e.conv2DPackedPointwise=function(t,e,n){var o=e[0].dims,a=e[1].dims,s=(0,r.calculateOutputShape)(o,a,n.dilations,n.pads,n.strides),u=t.reshapePacked(e[0],[o[1],o[2]*o[3]]),c=t.reshapePacked(e[1],[a[0],a[1]]),l=e.length>2?[c,u,e[2]]:[c,u],f=t.run((0,i.createPackedMatmulProgramInfoLoader)(t,l,n),l);return t.reshapePacked(f,s)},e.conv2DPacked=function(t,e,n){var a=e[0].dims,s=e[1].dims,u=(0,r.calculateOutputShape)(a,s,n.dilations,n.pads,n.strides),c=t.run((0,o.createPackedIm2ColProgramInfoLoader)(t,e[0],e[1],u,n),[e[0]]),l=t.reshapePacked(e[1],[s[0],s[1]*s[2]*s[3]]),f=3===e.length?[l,c,e[2]]:[l,c],p=t.run((0,i.createPackedMatmulProgramInfoLoader)(t,f,n),f);return t.reshapePacked(p,u)}},9663:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o2,l=n.cacheKey,{name:"ConvTranspose",inputNames:a?["X","W","B"]:["X","W"],inputTypes:a?[u.TextureType.unpacked,u.TextureType.unpacked,u.TextureType.unpacked]:[u.TextureType.unpacked,u.TextureType.unpacked],cacheHint:l});return r(r({},f),{get:function(){return function(t,e,n,a){var l=e.length>2?"getB(output_channel)":"0.0",f=e[0].dims,p=e[1].dims,h=p[1],d=p[0]/a.group,g=i([e[0].dims[0],e[1].dims[1]*a.group],o(a.outputShape),!1),b=(0,s.getGlsl)(t.session.backend.glContext.version),y=(0,c.getActivationSnippet)(a),m=y.activationFunction,v=y.applyActivation,_="\n const ivec2 strides = ivec2(".concat(a.strides[0],", ").concat(a.strides[1],");\n const ivec2 pads = ivec2(").concat(a.pads[0],", ").concat(a.pads[1],");\n ").concat(m,"\n void main() {\n ivec4 coords = getOutputCoords();\n int batch = coords.x;\n int output_channel = coords.y;\n\n ivec2 loc = coords.zw + pads;\n\n int group_id = output_channel / ").concat(h,";\n int wOutChannel = output_channel - group_id * ").concat(h,";\n\n float value = ").concat(l,";\n for (int inChannelOffset = 0; inChannelOffset < ").concat(d,"; inChannelOffset++) {\n int input_channel = group_id * ").concat(d," + inChannelOffset;\n for (int wWOff = 0; wWOff < ").concat(p[2],"; wWOff++) {\n for (int wHOff = 0; wHOff < ").concat(p[3],"; wHOff++) {\n ivec2 wOff = ivec2(wWOff * ").concat(a.dilations[0],", wHOff * ").concat(a.dilations[1],");\n ivec2 wLoc = loc - wOff;\n ivec2 wLocIn = wLoc / strides;\n if (\n wLocIn * strides == wLoc &&\n wLocIn.x >= 0 && wLocIn.x < ").concat(f[2]," &&\n wLocIn.y >= 0 && wLocIn.y < ").concat(f[3],"\n ) {\n float xVal = getX(batch, input_channel, wLocIn.y, wLocIn.x);\n float wVal = getW(input_channel, wOutChannel, wHOff, wWOff);\n value += xVal * wVal;\n }\n }\n }\n }\n ").concat(v,"\n ").concat(b.output," = vec4(value, .0, .0, .0);\n }\n");return r(r({},n),{output:{dims:g,type:e[0].type,textureType:u.TextureType.unpacked},shaderSource:_,hasMain:!0})}(t,e,f,n)}})}(t,e,n),e)},d=function(t,e){var n=t.kernelShape.slice();if(0===t.kernelShape.length)for(var r=2;r0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o1?[t.run((0,u.createUnpackedGroupedConvProgramInfoLoader)(t,e,r),e)]:i&&o?[g(t,e,r)]:o&&4===e[0].dims.length&&1===e[0].dims[0]&&!i?[(0,c.conv2DPacked)(t,e,r)]:[b(t,e,r)]},g=function(t,n,r){var o=n[0].dims,i=n[1].dims,a=(0,e.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),s=t.reshapeUnpacked(n[0],[o[1],o[2]*o[3]]),u=t.reshapeUnpacked(n[1],[i[0],i[1]]),c=n.length>2?[u,s,n[2]]:[u,s],l=t.run((0,h.createMatmulProgramInfoLoader)(c,r),c);return t.reshapeUnpacked(l,a)},b=function(t,n,r){var o=n[0].dims,i=n[1].dims,a=(0,e.calculateOutputShape)(o,i,r.dilations,r.pads,r.strides),s=t.run((0,p.createIm2ColProgramInfoLoader)(t,n[0],n[1],a,r),[n[0]]),u=3===n.length?[s,n[1],n[2]]:[s,n[1]];return t.run((0,l.createDotProductProgramInfoLoader)(t,n,a,r),u)},y=function(t,e){var n=t.kernelShape.slice();if(0===t.kernelShape.length)for(var r=2;r0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseDepthToSpaceAttributes=e.depthToSpace=void 0;var o=n(3738);e.depthToSpace=function(t,e,n){i(e);var a=n.blocksize,s=a*a,u="DCR"===n.mode?[0,3,4,1,5,2]:[0,1,4,2,5,3],c="DCR"===n.mode?[e[0].dims[0],a,a,e[0].dims[1]/s,e[0].dims[2],e[0].dims[3]]:[e[0].dims[0],e[0].dims[1]/s,a,a,e[0].dims[2],e[0].dims[3]],l=t.reshapeUnpacked(e[0],c),f={perm:u,cacheKey:"".concat(u)},p=r((0,o.transpose)(t,[l],f),1)[0],h=[e[0].dims[0],e[0].dims[1]/s,e[0].dims[2]*a,e[0].dims[3]*a];return[t.reshapeUnpacked(p,h)]},e.parseDepthToSpaceAttributes=function(t){var e=t.attributes.getInt("blocksize");if(e<1)throw new Error("blocksize must be >= 1, but got : ".concat(e," for DepthToSpace"));var n=t.attributes.getString("mode","DCR");if("DCR"!==n&&"CRD"!==n)throw new Error("unrecognized mode: ".concat(n," for DepthToSpace"));return{mode:n,blocksize:e}};var i=function(t){if(1!==t.length)throw new Error("DepthToSpace expect 1 inputs, but got ".concat(t.length));if("string"===t[0].type||4!==t[0].dims.length)throw new TypeError("DepthToSpace input should be a 4-D numeric tensor")}},9828:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.createDotProductProgramInfoLoader=void 0;var i=n(2517),a=n(5060),s=n(2039),u=n(2823),c=n(3248);e.createDotProductProgramInfoLoader=function(t,e,n,l){var f=function(t,e){return{name:"ConvDotProduct",inputNames:t?["Im2Col","K","B"]:["Im2Col","K"],inputTypes:t?[s.TextureType.unpacked,s.TextureType.packedLastDimension,s.TextureType.unpacked]:[s.TextureType.unpacked,s.TextureType.packedLastDimension],cacheKey:e.activationCacheKey}}(e.length>2,l);return r(r({},f),{get:function(){return function(t,e,n,l,f){var p=n[0].dims,h=n[1].dims,d=[h[0],Math.ceil(p[1]*h[2]*h[3]/4)],g=(0,c.calculateIm2ColDims)(p,h,l),b=o(t.calculateTextureWidthAndHeight(d,s.TextureType.packedLastDimension),2),y=b[0],m=b[1],v=i.ShapeUtil.computeStrides(g),_=o(t.calculateTextureWidthAndHeight(g,s.TextureType.packedLastDimension),2),w=_[0],x=_[1],T=l.length,S=n.length<3?"0.0":"_B(b)",O=Math.ceil(p[1]*h[2]*h[3]/4),A=(0,u.getActivationSnippet)(f),E=A.activationFunction,I=A.applyActivation,P=(0,a.getGlsl)(t.session.backend.glContext.version),D="\n".concat(E,"\nfloat process(int indices[").concat(T,"]) {\n int b[1];\n b[0] = indices[1];\n int im2col[4];\n im2col[0] = indices[0];\n im2col[1] = indices[2];\n im2col[2] = indices[3];\n int im2colOffset = im2col[0] * ").concat(v[0]," + im2col[1] * ").concat(v[1]," + im2col[2] * ").concat(v[2],";\n int kernelOffset = indices[1] * ").concat(d[1],";\n float value = ").concat(S,";\n for (int i = 0; i < ").concat(O,"; ++i) {\n vec2 im2colCoords = offsetToCoords(im2colOffset, ").concat(w,", ").concat(x,");\n vec2 kernelCoords = offsetToCoords(kernelOffset, ").concat(y,", ").concat(m,");\n value += dot(").concat(P.texture2D,"(Im2Col, im2colCoords), ").concat(P.texture2D,"(K, kernelCoords));\n ++im2colOffset;\n ++kernelOffset;\n }\n ").concat(I,"\n return value;\n}");return r(r({},e),{output:{dims:l,type:n[0].type,textureType:s.TextureType.unpacked},shaderSource:D})}(t,f,e,n,l)}})}},7992:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseFlattenAttributes=e.flatten=void 0;var r=n(2517);e.flatten=function(t,e,n){o(e,n);var i=r.ShapeUtil.flattenShape(e[0].dims,n);return[t.reshapeUnpacked(e[0],i)]},e.parseFlattenAttributes=function(t){return t.attributes.getInt("axis",1)};var o=function(t,e){if(!t||1!==t.length)throw new Error("Flatten requires 1 input.");var n=t[0].dims.length;if(0===n)throw new Error("scalar tensor is not supported.");if(e<-n||e>n)throw new Error("Invalid axis");if("string"===t[0].type)throw new Error("string tensor is not supported.")}},2823:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseInternalActivationAttributes=e.getActivationSnippet=void 0;var o=n(2517),i=n(4909);e.getActivationSnippet=function(t){var e;switch(t.activation){case"Relu":e=(0,i.glslRelu)();break;case"Sigmoid":e=(0,i.glslSigmoid)();break;case"Clip":e=(0,i.glslClip)(t.clipMin,t.clipMax);break;default:return{activationFunction:"",applyActivation:""}}var n=e.name;return{activationFunction:e.body,applyActivation:"value = ".concat(n,"_(value);")}},e.parseInternalActivationAttributes=function(t){var e=t.getString("activation","");if("Clip"===e){var n=r(t.getFloats("activation_params",[o.MIN_CLIP,o.MAX_CLIP]),2),i=n[0],a=n[1];return{activation:e,clipMax:a,clipMin:i,activationCacheKey:"".concat(e,":").concat(i,",").concat(a)}}return{activation:e,activationCacheKey:e}}},1253:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;nn-1)throw new Error("Invalid axis.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invaid input type.");if("int32"!==t[1].type&&"int16"!==t[1].type)throw new Error("Invaid input type.")}},4776:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseGemmAttributesV11=e.parseGemmAttributesV7=e.gemm=void 0;var i=n(246),a=n(2517),s=n(2039);e.gemm=function(t,e,n){return f(e,n),[t.run(c(e,n),e)]};var u=function(t,e){var n=0!==t.attributes.getInt("transA",0),r=0!==t.attributes.getInt("transB",0),o=t.attributes.getFloat("alpha",1),a=t.attributes.getFloat("beta",1);return(0,i.createAttributeWithCacheKey)({transA:n,transB:r,alpha:o,beta:a,isOptionalC:e})};e.parseGemmAttributesV7=function(t){return u(t,!1)},e.parseGemmAttributesV11=function(t){return u(t,!0)};var c=function(t,e){var n={name:"Gemm",inputNames:3===t.length?["A","B","C"]:["A","B"],inputTypes:3===t.length?[s.TextureType.unpacked,s.TextureType.unpacked,s.TextureType.unpacked]:[s.TextureType.unpacked,s.TextureType.unpacked],key:e.cacheKey};return r(r({},n),{get:function(){return l(n,t,e)}})},l=function(t,e,n){var i=e[0].dims.slice(),u=e[1].dims.slice(),c=o(a.GemmUtil.getShapeOfGemmResult(i,n.transA,u,n.transB,3===e.length?e[2].dims:void 0),2),l=[c[0],c[1]];if(!l)throw new Error("Can't use gemm on the given tensors");var f=i[i.length-1],p="";n.transA&&(f=i[0]),n.transA&&n.transB?p="value += _A_T(a) * _B_T(b);":n.transA&&!n.transB?p="value += _A_T(a) * _B(b);":!n.transA&&n.transB?p="value += _A(a) * _B_T(b);":n.transA||n.transB||(p="value += _A(a) * _B(b);");var h=l.length,d=3===e.length?"int c[".concat(e[2].dims.length,"];"):"",g=3===e.length?"bcastIndices_C(indices, c);":"",b=3===e.length?"value += beta * _C(c);":"",y="\n float process(int indices[".concat(h,"]) {\n int a[").concat(h,"];\n int b[").concat(h,"];\n ").concat(d,"\n\n copyVec(indices, a);\n copyVec(indices, b);\n ").concat(g,"\n\n float value = 0.0;\n for (int k=0; k<").concat(f,"; ++k) {\n a[").concat(h-1,"] = k;\n b[").concat(h-2,"] = k;\n ").concat(p,"\n }\n\n value = value * alpha;\n ").concat(b,"\n return value;\n }");return r(r({},t),{output:{dims:l,type:e[0].type,textureType:s.TextureType.unpacked},variables:[{name:"alpha",type:"float",data:n.alpha},{name:"beta",type:"float",data:n.beta}],shaderSource:y})},f=function(t,e){if(!t)throw new Error("Input is missing");if(e.isOptionalC&&(t.length<2||t.length>3))throw new Error("Invaid input shape.");if(!e.isOptionalC&&3!==t.length)throw new Error("Gemm requires 3 inputs");if(3===t.length&&1!==t[2].dims.length&&2!==t[2].dims.length)throw new Error("Invalid input shape of C");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type||3===t.length&&"float32"!==t[2].type&&"float64"!==t[2].type)throw new Error("Invalid input type.");if(t[0].type!==t[1].type||3===t.length&&t[0].type!==t[2].type)throw new Error("Input types are mismatched")}},8555:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n= 0) {\n offsetX = imod(blockIndex, ").concat(u[p-1],") * ").concat(c.strides[1]," -\n ").concat(c.pads[1],";\n d1 = offsetX + ").concat(c.dilations[1]," * imod(imod(pos, ").concat(d,"), ").concat(f[2],");\n\n if(d1 < ").concat(l[3]," && d1 >= 0) {\n\n ch = int(float(pos)/ ").concat(d,".);\n innerDims = vec2(d0, d1);\n result[").concat(2*m+v,"] = getChannel(\n getA(0, ch, int(innerDims.x),\n int(innerDims.y)), innerDims);\n }\n }\n }\n\n ");var _="\n ".concat(g,"\n\n void main() {\n ivec2 rc = getOutputCoords();\n vec4 result = vec4(0.0);\n int blockIndex, pos, offsetY, d0, offsetX, d1, ch;\n vec2 innerDims;\n ").concat(y,"\n ").concat(b.output," = result;\n }\n ");return r(r({},e),{output:{dims:h,type:n.type,textureType:i.TextureType.packed},shaderSource:_,hasMain:!0})}(t,l,e,n,s,u)}})}},3248:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n= 0 &&\n xh2 < XH &&\n xw2 >= 0 &&\n xw2 < XW) {\n value[i] = _X(x);\n }\n }\n ++p;\n }\n return value;\n }\n ");return r(r({},n),{output:{dims:p,type:i.type,textureType:o.TextureType.packedLastDimension},shaderSource:h})}(0,c,n,i,a,s)}})},e.calculateIm2ColDims=function(t,e,n,r){return void 0===r&&(r=4),[n[0],n[2],n[3],Math.ceil(t[1]*e[2]*e[3]/r)]}},6572:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseInstanceNormalizationAttributes=e.instanceNormalization=void 0;var i=n(5060),a=n(2039);e.instanceNormalization=function(t,e,n){f(e);var r=t.run(u(e[0]),e);return[t.run(l(t,e[0],n,r.dims),[e[0],r,e[1],e[2]])]},e.parseInstanceNormalizationAttributes=function(t){return t.attributes.getFloat("epsilon",1e-5)};var s={name:"InstanceNormalization_MeanAndVariance",inputNames:["X"],inputTypes:[a.TextureType.unpacked]},u=function(t){return r(r({},s),{get:function(){return function(t,e){var n=e.dims.slice(),o=n[1],i=n[2]*n[3],s=[n[0],o],u="\n vec4 process(int[2] indices) {\n vec4 v = vec4(0.0);\n int a[4];\n a[0] = indices[0];\n a[1] = indices[1];\n float temp = 0.0;\n for(int a2=0; a2<".concat(n[2],"; a2++) {\n a[2] = a2;\n for(int a3=0; a3<").concat(n[3],"; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += x;\n }\n }\n float mean = temp / float(").concat(i,");\n temp = 0.0;\n for(int a2=0; a2<").concat(n[2],"; a2++) {\n a[2] = a2;\n for(int a3=0; a3<").concat(n[3],"; a3++) {\n a[3] = a3;\n float x = _X(a);\n temp += (x - mean) * (x - mean);\n }\n }\n v.r = mean;\n v.g = temp / float(").concat(i,");\n\n return v;\n }");return r(r({},t),{output:{dims:s,type:e.type,textureType:a.TextureType.packedLastDimension},shaderSource:u})}(s,t)}})},c={name:"InstanceNormalization_ComputeOutput",inputNames:["X","MeanAndVariance","Scale","B"],inputTypes:[a.TextureType.unpacked,a.TextureType.packedLastDimension,a.TextureType.unpacked,a.TextureType.unpacked]},l=function(t,e,n,s){var u=r(r({},c),{cacheHint:"".concat(n)});return r(r({},u),{get:function(){return function(t,e,n,s,u){var c=(0,i.getGlsl)(t.session.backend.glContext.version),l=o(t.calculateTextureWidthAndHeight(u,a.TextureType.packedLastDimension),2),f=l[0],p=l[1],h=o([f/4,p],2),d=h[0],g=h[1],b="\n vec4 get_MeanAndVariance(int[2] mv) {\n int offset = indicesToOffset_MeanAndVariance(mv);\n vec2 coords = offsetToCoords(offset, ".concat(d,", ").concat(g,");\n return ").concat(c.texture2D,"(MeanAndVariance, coords);\n }\n\n float process(int[4] indices) {\n int mv[2];\n mv[0] = indices[0];\n mv[1] = indices[1];\n vec4 mean_and_variance = get_MeanAndVariance(mv);\n float mean = mean_and_variance.r;\n float variance = mean_and_variance.g;\n\n int sb[1];\n sb[0] = indices[1];\n float scale = _Scale(sb);\n float b = _B(sb);\n\n return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;\n }");return r(r({},e),{output:{dims:n.dims,type:n.type,textureType:a.TextureType.unpacked},variables:[{name:"epsilon",type:"float",data:s}],shaderSource:b})}(t,u,e,n,s)}})},f=function(t){if(!t||3!==t.length)throw new Error("InstanceNormalization requires 3 inputs.");var e=t[0],n=t[1],r=t[2];if(e.dims.length<3||1!==n.dims.length||1!==r.dims.length)throw new Error("Invalid input shape.");if(n.dims[0]!==e.dims[1]||r.dims[0]!==e.dims[1])throw new Error("Input shapes are mismatched.");if("float32"!==e.type&&"float64"!==e.type||"float32"!==n.type&&"float64"!==n.type||"float32"!==r.type&&"float64"!==r.type)throw new Error("Invalid input type.");if(4!==t[0].dims.length)throw new Error("Only support 4-D input shape.")}},708:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n2,f=n.activationCacheKey,{name:"MatMul (packed)",inputNames:l?["A","B","Bias"]:["A","B"],inputTypes:l?[a.TextureType.packed,a.TextureType.packed,a.TextureType.packed]:[a.TextureType.packed,a.TextureType.packed],cacheHint:f});return r(r({},p),{get:function(){return function(t,e,n,l){var f=n.length>2,p=f?"value += getBiasForMatmul();":"",h=n[0].dims,d=n[1].dims,g=o.BroadcastUtil.calcShape(h,d,!0),b=!o.ShapeUtil.areEqual(n[0].dims,n[1].dims);if(!g)throw new Error("Can't use matmul on the given tensors");var y=h[h.length-1],m=Math.ceil(y/2),v=h.length,_=d.length,w=(0,i.getGlsl)(t.session.backend.glContext.version),x=(0,s.getCoordsDataType)(g.length),T=g.length,S=(0,s.getGlChannels)(),O=(0,u.getActivationSnippet)(l),A=O.activationFunction,E=O.applyActivation,I=f?"".concat((0,c.getBiasForMatmul)(x,S,n[2].dims,g,!0)):"",P=b?"".concat(function(t,e,n,r){var i=[],a=[],s=n[0].dims,u=n[1].dims,c=s.length,l=u.length,f=r.length,p=f-c,h=f-l;(i=s.map((function(t,n){return"coords.".concat(e[n+p])})))[c-1]="i*2",i.join(", "),(a=u.map((function(t,n){return"coords.".concat(e[n+h])})))[l-2]="i*2",a.join(", ");var d=o.BroadcastUtil.getBroadcastDims(s,r),g=o.BroadcastUtil.getBroadcastDims(u,r),b=d.map((function(t){return"coords.".concat(e[t+p]," = 0;")})).join("\n"),y=g.map((function(t){return"coords.".concat(e[t+h]," = 0;")})).join("\n"),m="int lastDim = coords.".concat(e[f-1],";\n coords.").concat(e[f-1]," = coords.").concat(e[f-2],";\n coords.").concat(e[f-2]," = lastDim;");return"\nvec4 getAAtOutCoordsMatmul(int i) {\n ".concat(t," coords = getOutputCoords();\n ").concat(m,"\n ").concat(b,"\n vec4 outputValue = getA(").concat(i,");\n return outputValue;\n}\n\nvec4 getBAtOutCoordsMatmul(int i) {\n ").concat(t," coords = getOutputCoords();\n ").concat(m,"\n ").concat(y,"\n vec4 outputValue = getB(").concat(a,");\n return outputValue;\n}")}(x,S,n,g)):"",D=b?"getAAtOutCoordsMatmul(i)":"getA(".concat(function(t,e){for(var n="",r=0;r2,u=e.activationCacheKey,{name:"MatMul",inputNames:n?["A","B","Bias"]:["A","B"],inputTypes:n?[i.TextureType.unpacked,i.TextureType.unpacked,i.TextureType.unpacked]:[i.TextureType.unpacked,i.TextureType.unpacked],cacheHint:u});return r(r({},c),{get:function(){return function(t,e,n){var u=e[0].dims,c=e[1].dims,l=o.BroadcastUtil.calcShape(u,c,!0);if(!l)throw new Error("Can't use matmul on the given tensors");var p=(0,a.getCoordsDataType)(l.length),h=(0,a.getGlChannels)(),d=(0,s.getActivationSnippet)(n),g=d.activationFunction,b=d.applyActivation,y=e.length>2,m=y?"value += getBiasForMatmul();":"",v=y?"".concat(f(p,h,e[2].dims,l,!1)):"",_=l.length,w=u.length,x=c.length,T=u[u.length-1],S="\n ".concat(g,"\n ").concat(v,"\n float process(int indices[").concat(_,"]) {\n int a[").concat(w,"];\n int b[").concat(x,"];\n bcastMatmulIndices_A(indices, a);\n bcastMatmulIndices_B(indices, b);\n\n float value;\n for (int k=0; k<").concat(T,"; ++k) {\n a[").concat(w-1,"] = k;\n b[").concat(x-2,"] = k;\n value += _A(a) * _B(b);\n }\n ").concat(m,"\n ").concat(b,"\n return value;\n }");return r(r({},t),{output:{dims:l,type:e[0].type,textureType:i.TextureType.unpacked},shaderSource:S})}(c,t,e)}})}e.matMul=function(t,e,n){return l(e),t.session.pack?[t.run((0,u.createPackedMatmulProgramInfoLoader)(t,e,n),e)]:[t.run(c(e,n),e)]},e.parseMatMulAttributes=function(t){return(0,s.parseInternalActivationAttributes)(t.attributes)},e.createMatmulProgramInfoLoader=c;var l=function(t){if(!t||2!==t.length)throw new Error("MatMul requires 2 inputs.");if(t[0].dims[t[0].dims.length-1]!==t[1].dims[t[1].dims.length-2])throw new Error("shared dimension does not match.");if("float32"!==t[0].type&&"float64"!==t[0].type||"float32"!==t[1].type&&"float64"!==t[1].type)throw new Error("inputs should be float type");if(t[0].type!==t[1].type)throw new Error("inputs types should match")};function f(t,e,n,r,i){var a,s=n.length,u=r.length,c=u-s;a=u<2&&s>0?"coords":n.map((function(t,n){return"coords.".concat(e[n+c])})).join(", ");var l=o.BroadcastUtil.getBroadcastDims(n,r).map((function(t){return"coords.".concat(e[t+c]," = 0;")})).join("\n"),f="vec4(outputValue.xx, outputValue.yy)";return 1===o.ShapeUtil.size(n)&&(f="vec4(outputValue.x)"),i?"\nvec4 getBiasForMatmul() {\n ".concat(t," coords = getOutputCoords();\n ").concat(l,"\n vec4 outputValue = getBias(").concat(a,");\n return ").concat(f,";\n}"):"\nfloat getBiasForMatmul() {\n ".concat(t," coords = getOutputCoords();\n ").concat(l,"\n return getBias(coords.x);\n}")}e.getBiasForMatmul=f},2403:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n= ").concat(f,";\n bool cEdge = cp1 >= ").concat(l,";\n ")),v=function(t,e,n){if(0===t)return"false";if(1===t)return"rc > ".concat(e[0]);for(var r="",o=t-2;o= ").concat(e[o-t+2]),o= ".concat(t[0]," ? 0. : getA(rc + 1),\n 0, 0");var r="";if(n>2)for(var o=0;o0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parsePadAttributesV11=e.padV11=e.parsePadAttributesV2=e.padV2=void 0;var i=n(246),a=n(2517),s=n(5060),u=n(2039),c={name:"Pad",inputNames:["A"],inputTypes:[u.TextureType.unpacked]};e.padV2=function(t,e,n){return p(e),[t.run(r(r({},c),{cacheHint:n.cacheKey,get:function(){return f(t,e[0],n)}}),e)]},e.parsePadAttributesV2=function(t){var e=t.attributes.getString("mode","constant"),n=t.attributes.getFloat("value",0),r=t.attributes.getInts("pads");return(0,i.createAttributeWithCacheKey)({mode:e,value:n,pads:r})},e.padV11=function(t,n,r){h(n);var o=l(t,n,r);return(0,e.padV2)(t,[n[0]],o)},e.parsePadAttributesV11=function(t){return t.attributes.getString("mode","constant")};var l=function(t,e,n){if(!t.session.isInitializer(e[1].dataId)||e.length>=3&&!t.session.isInitializer(e[2].dataId))throw new Error("dynamic pad attributes are not allowed");var r=Array.from(e[1].integerData),o=e.length>=3?e[2].floatData[0]:0;return(0,i.createAttributeWithCacheKey)({mode:n,pads:r,value:o})},f=function(t,e,n){var r=a.ShapeUtil.padShape(e.dims.slice(),n.pads),o=r.length,i=d(t,e,n),s="\n ".concat(i,"\n float process(int[").concat(o,"] indices) {\n return padA(indices);\n }");return{name:"Pad",inputNames:["A"],inputTypes:[u.TextureType.unpacked],output:{dims:r,type:e.type,textureType:u.TextureType.unpacked},shaderSource:s}},p=function(t){if(!t||1!==t.length)throw new Error("Pad requires 1 input");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},h=function(t){if(!t||2!==t.length&&3!==t.length)throw new Error("Pad requires 2 or 3 inputs");if("int32"!==t[1].type)throw new Error("Invalid input type.");if(t.length>=3&&"string"===t[2].type)throw new Error("Invalid input type.")},d=function(t,e,n){var r=(0,s.getGlsl)(t.session.backend.glContext.version),i=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),c=i[0],l=i[1],f=a.ShapeUtil.computeStrides(e.dims);switch(n.mode){case"constant":return g(r,e.dims,f,c,l,n.pads,n.value);case"reflect":return b(r,e.dims,f,c,l,n.pads);case"edge":return y(r,e.dims,f,c,l,n.pads);default:throw new Error("Invalid mode")}},g=function(t,e,n,r,o,i,a){for(var s=e.length,u="",c=s-1;c>=0;--c)u+="\n k = m[".concat(c,"] - ").concat(i[c],";\n if (k < 0) return constant;\n if (k >= ").concat(e[c],") return constant;\n offset += k * ").concat(n[c],";\n ");return"\n float padA(int m[".concat(s,"]) {\n const float constant = float(").concat(a,");\n int offset = 0;\n int k = 0;\n ").concat(u,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")},b=function(t,e,n,r,o,i){for(var a=e.length,s="",u=a-1;u>=0;--u)s+="\n k = m[".concat(u,"] - ").concat(i[u],";\n if (k < 0) { k = -k; }\n {\n const int _2n_1 = ").concat(2*(e[u]-1),";\n k = int( mod( float(k), float(_2n_1) ) ) ;\n if(k >= ").concat(e[u],") { k = _2n_1 - k; }\n }\n offset += k * ").concat(n[u],";\n ");return"\n float padA(int m[".concat(a,"]) {\n int offset = 0;\n int k = 0;\n ").concat(s,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")},y=function(t,e,n,r,o,i){for(var a=e.length,s="",u=a-1;u>=0;--u)s+="\n k = m[".concat(u,"] - ").concat(i[u],";\n if (k < 0) k = 0;\n if (k >= ").concat(e[u],") k = ").concat(e[u]-1,";\n offset += k * ").concat(n[u],";\n ");return"\n float padA(int m[".concat(a,"]) {\n int offset = 0;\n int k = 0;\n ").concat(s,"\n vec2 coords = offsetToCoords(offset, ").concat(r,", ").concat(o,");\n float value = getColorAsFloat(").concat(t.texture2D,"(A, coords));\n return value;\n }\n ")}},2143:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.globalMaxPool=e.parseMaxPoolAttributes=e.maxPool=e.parseGlobalAveragePoolAttributes=e.globalAveragePool=e.parseAveragePoolAttributes=e.averagePool=void 0;var i=n(246),a=n(2517),s=n(2039);e.averagePool=function(t,e,n){h(e);var o={name:"AveragePool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(r(r({},o),{get:function(){return u(e,o,!1,n)}}),e)]},e.parseAveragePoolAttributes=function(t){var e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),r=0!==t.attributes.getInt("count_include_pad",0),o=t.attributes.getInts("kernel_shape"),a=t.attributes.getInts("strides",[]),s=t.attributes.getInts("pads",[]);if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for AveragePool");return(0,i.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:r,kernelShape:o,strides:a,pads:s})};var u=function(t,e,n,i){var u=o(l(t,i,n),2),c=u[0],f=u[1],p=a.ShapeUtil.size(c.kernelShape),h="";c.countIncludePad?h+="value /= float(".concat(p,");"):h+="value /= float(".concat(p," - pad);");var g=d(t[0].dims,c,"value += _X(x);",h,"0.0"),b="\n ".concat(g,"\n ");return r(r({},e),{output:{dims:f,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:b})};e.globalAveragePool=function(t,e,n){h(e);var o={name:"GlobalAveragePool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:"".concat(n.countIncludePad)};return[t.run(r(r({},o),{get:function(){return u(e,o,!0,n)}}),e)]},e.parseGlobalAveragePoolAttributes=function(t){var e=0!==t.attributes.getInt("count_include_pad",0);return(0,i.createAttributeWithCacheKey)({autoPad:"",ceilMode:0,countIncludePad:e,kernelShape:[],strides:[],pads:[]})},e.maxPool=function(t,e,n){h(e);var o={name:"MaxPool",inputNames:["X"],inputTypes:[s.TextureType.unpacked],cacheHint:n.cacheKey};return[t.run(r(r({},o),{get:function(){return c(e,o,!1,n)}}),e)]},e.parseMaxPoolAttributes=function(t){var e=t.attributes.getString("auto_pad","NOTSET"),n=t.attributes.getInt("ceil_mode",0),r=t.attributes.getInts("kernel_shape"),o=t.attributes.getInts("strides",[]),a=t.attributes.getInts("pads",[]),s=t.attributes.getInt("storage_order",0),u=t.attributes.getInts("dilations",[]);if(0!==s)throw new Error("column major storage order is not yet supported for MaxPool");if(0!==n)throw new Error("using ceil() in shape computation is not yet supported for MaxPool");return(0,i.createAttributeWithCacheKey)({autoPad:e,ceilMode:n,countIncludePad:!1,kernelShape:r,strides:o,pads:a,storageOrder:s,dilations:u})};var c=function(t,e,n,i){var a=o(l(t,i,n),2),u=a[0],c=a[1],f=d(t[0].dims,u,"\n value = max(_X(x), value);\n ","","-1e5"),p="\n ".concat(f,"\n ");return r(r({},e),{output:{dims:c,type:t[0].type,textureType:s.TextureType.unpacked},shaderSource:p})},l=function(t,e,n){var r=t[0].dims.slice(),o=Object.hasOwnProperty.call(e,"dilations"),i=e.kernelShape.slice(),s=e.strides.slice(),u=o?e.dilations.slice():[],c=e.pads.slice();a.PoolConvUtil.adjustPoolAttributes(n,r,i,s,u,c);var l=a.PoolConvUtil.computePoolOutputShape(n,r,s,u,i,c,e.autoPad),f=Object.assign({},e);return o?Object.assign(f,{kernelShape:i,strides:s,pads:c,dilations:u,cacheKey:e.cacheKey}):Object.assign(f,{kernelShape:i,strides:s,pads:c,cacheKey:e.cacheKey}),[f,l]},f={autoPad:"",ceilMode:0,countIncludePad:!1,kernelShape:[],strides:[],pads:[],storageOrder:0,dilations:[],cacheKey:""},p={name:"GlobalMaxPool",inputNames:["X"],inputTypes:[s.TextureType.unpacked]};e.globalMaxPool=function(t,e){return h(e),[t.run(r(r({},p),{get:function(){return c(e,p,!0,f)}}),e)]};var h=function(t){if(!t||1!==t.length)throw new Error("Pool ops requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type.")},d=function(t,e,n,r,o){var i=t.length;if(e.kernelShape.length<=2){var s,u=e.kernelShape[e.kernelShape.length-1],c=e.strides[e.strides.length-1],l=e.pads[e.pads.length/2-1],f=e.pads[e.pads.length-1],p=t[i-1],h="",d="";if(s=l+f!==0?"\n for (int i = 0; i < ".concat(u,"; i++) {\n x[").concat(i," - 1] = indices[").concat(i," - 1] * ").concat(c," - ").concat(l," + i;\n if (x[").concat(i," - 1] < 0 || x[").concat(i," - 1] >= ").concat(p,") {\n pad++;\n continue;\n }\n ").concat(n,"\n }"):"\n for (int i = 0; i < ".concat(u,"; i++) {\n x[").concat(i," - 1] = indices[").concat(i," - 1] * ").concat(c," - ").concat(l," + i;\n ").concat(n,"\n }"),2===e.kernelShape.length){var y=e.kernelShape[e.kernelShape.length-2],m=e.strides[e.strides.length-2],v=e.pads[e.pads.length/2-2],_=e.pads[e.pads.length-2],w=t[i-2];h=v+_!==0?"\n for (int j = 0; j < ".concat(y,"; j++) {\n x[").concat(i," - 2] = indices[").concat(i," - 2] * ").concat(m," - ").concat(v," + j;\n if (x[").concat(i," - 2] < 0 || x[").concat(i," - 2] >= ").concat(w,") {\n pad+= ").concat(u,";\n continue;\n }\n "):"\n for (int j = 0; j < ".concat(y,"; j++) {\n x[").concat(i," - 2] = indices[").concat(i," - 2] * ").concat(m," - ").concat(v," + j;\n "),d="\n }\n "}return"\n float process(int indices[".concat(i,"]) {\n int x[").concat(i,"];\n copyVec(indices, x);\n\n float value = ").concat(o,";\n int pad = 0;\n ").concat(h,"\n ").concat(s,"\n ").concat(d,"\n ").concat(r,"\n return value;\n }\n ")}var x,T=a.ShapeUtil.size(e.kernelShape),S=a.ShapeUtil.computeStrides(e.kernelShape),O=S.length,A=e.pads.length,E=b(O),I=g(t,"inputDims"),P=g(e.pads,"pads"),D=g(S,"kernelStrides"),k=g(e.strides,"strides");return x=e.pads.reduce((function(t,e){return t+e}))?"\n if (x[j] >= inputDims[j] || x[j] < 0) {\n pad++;\n isPad = true;\n break;\n }\n }\n if (!isPad) {\n ".concat(n,"\n }"):"\n }\n ".concat(n,"\n "),"\n ".concat(E,"\n float process(int indices[").concat(i,"]) {\n int x[").concat(i,"];\n copyVec(indices, x);\n int offset[").concat(O,"];\n int pads[").concat(A,"];\n int inputDims[").concat(i,"];\n int kernelStrides[").concat(O,"];\n int strides[").concat(O,"];\n ").concat(P,"\n ").concat(I,"\n ").concat(k,"\n ").concat(D,"\n\n float value = ").concat(o,";\n int pad = 0;\n bool isPad = false;\n for (int i = 0; i < ").concat(T,"; i++) {\n offsetToIndices(i, kernelStrides, offset);\n isPad = false;\n for (int j = ").concat(i," - ").concat(O,"; j < ").concat(i,"; j++) {\n x[j] = indices[j] * strides[j - ").concat(i," + ").concat(O,"]\n + offset[j - ").concat(i," + ").concat(O,"] - pads[j - 2];\n ").concat(x,"\n }\n ").concat(r,"\n\n return value;\n }\n ")},g=function(t,e){for(var n="",r=0;r=0||0===p.length?(n.keepDims&&c.push(1),d="\n for(int j".concat(g," = 0; j").concat(g," < ").concat(e[0].dims[g],"; j").concat(g,"++) {\n inputIdx[").concat(g,"] = j").concat(g,";\n ").concat(d,"\n }")):(f.push("inputIdx[".concat(g,"] = outputIdx[").concat(c.length,"];")),c.push(e[0].dims[g]));var b=c.length||1,y="\n float process(int outputIdx[".concat(b,"]) {\n float value; // final result\n int inputIdx[").concat(l,"]; // addressing input data\n ").concat(f.join("\n"),"\n ").concat(h[0]," // init ops for reduce max/min\n ").concat(d,"\n ").concat(h[2]," // final computation for reduce mean\n return value;\n }");return r(r({},u),{output:{dims:c,type:e[0].type,textureType:s.TextureType.unpacked},shaderSource:y})},l=function(t){if(!t||1!==t.length)throw new Error("Reduce op requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.reduceSum=function(t,e,n){return u(t,e,n,"ReduceSum",(function(){return["value = 0.0;","value += _A(inputIdx);",""]}))},e.reduceMean=function(t,e,n){return u(t,e,n,"ReduceMean",(function(t,e){for(var n=1,r=0;r=0||0===e.length)&&(n*=t[0].dims[r]);return["value = 0.0;","value += _A(inputIdx);","value /= ".concat(n,".;")]}))},e.reduceMax=function(t,e,n){return u(t,e,n,"ReduceMax",(function(t,e){for(var n=[],r=0;r=0||0===e.length)&&n.push("inputIdx[".concat(r,"] = 0;"));return["".concat(n.join("\n"),"\nvalue = _A(inputIdx);"),"value = max(value, _A(inputIdx));",""]}))},e.reduceMin=function(t,e,n){return u(t,e,n,"ReduceMin",(function(t,e){for(var n=[],r=0;r=0||0===e.length)&&n.push("inputIdx[".concat(r,"] = 0;"));return["".concat(n.join("\n"),"\nvalue = _A(inputIdx);"),"value = min(value, _A(inputIdx));",""]}))},e.reduceProd=function(t,e,n){return u(t,e,n,"ReduceProd",(function(){return["value = 1.0;","value *= _A(inputIdx);",""]}))},e.reduceLogSum=function(t,e,n){return u(t,e,n,"ReduceLogSum",(function(){return["value = 0.0;","value += _A(inputIdx);","value = log(value);"]}))},e.reduceLogSumSquare=function(t,e,n){return u(t,e,n,"ReduceLogSumSquare",(function(){return["float t; value = 0.0;","t = _A(inputIdx); value += t * t;",""]}))}},7019:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0?"if(outputCoords.y < rows && outputCoords.z < cols){":"","\n int flattenedIndex = getFlattenedIndex(outputCoords);\n\n ivec3 inputRC = inputCoordsFromReshapedOutCoords(flattenedIndex);\n vec2 innerDims = vec2(float(inputRC.y),float(inputRC.z));\n\n result[").concat(p,"] = getChannel(getA(inputRC.x, inputRC.y, inputRC.z), innerDims);\n\n ").concat(p>0?"}":"","\n ")}var d,g,b,y,m,v=(0,i.getGlsl)(t.session.backend.glContext.version),_="\n ".concat((d=c,g=o.ShapeUtil.computeStrides(d),b=["b","r","c"],y="index",m=g.map((function(t,e){var n="int ".concat(b[e]," = ").concat(y," / ").concat(t),r=e===g.length-1?"int ".concat(b[e+1]," = ").concat(y," - ").concat(b[e]," * ").concat(t):"index -= ".concat(b[e]," * ").concat(t);return"".concat(n,"; ").concat(r,";")})).join(""),"\n ivec3 inputCoordsFromReshapedOutCoords(int index) {\n ".concat(m,"\n return ivec3(b, r, c);\n }\n ")),"\n ").concat(function(t){var e=o.ShapeUtil.computeStrides(t);return"\n int getFlattenedIndex(ivec3 coords) {\n // reverse y, z order\n return coords.x * ".concat(e[0]," + coords.z * ").concat(e[1]," + coords.y;\n }\n")}(l),"\n ").concat((0,s.unpackFromChannel)(),"\n\n void main() {\n ivec3 rc = getOutputCoords();\n\n vec4 result = vec4(0.0);\n\n ivec3 outputCoords;\n int rows = ").concat(l[2],";\n int cols = ").concat(l[1],";\n\n ").concat(f,"\n ").concat(v.output," = result;\n }\n ");return r(r({},n),{output:{dims:l,type:e.type,textureType:a.TextureType.packed},shaderSource:_,hasMain:!0})}(t,e,u,n)}})},e.processDims3D=function(t){if(0===t.length)return[1,1,1];for(var e=1,n=0;n1?t[t.length-2]:1,t[t.length-1]]},e.isReshapeCheap=function(t,e){return 0===t.length||0===e.length||(t.length<2||e.length<2?t[t.length-1]===e[e.length-1]:t[t.length-1]===e[e.length-1]&&t[t.length-2]===e[e.length-2])}},718:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.reshape=void 0;var r=n(2517);e.reshape=function(t,e){var n=r.ShapeUtil.calculateReshapedDims(e[0].dims,e[1].integerData);return t.session.pack?[t.reshapePacked(e[0],n)]:[t.reshapeUnpacked(e[0],n)]}},2268:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseResizeAttributesV11=e.parseResizeAttributesV10=e.resize=void 0;var i=n(5060),a=n(2039),s=n(9390),u=n(2827),c=n(9793),l={name:"Resize",inputNames:["A"],inputTypes:[a.TextureType.packed]};e.resize=function(t,e,n){return(0,c.validateInputs)(e,n),[t.run(r(r({},l),{cacheHint:n.cacheKey,get:function(){return f(t,e,n)}}),e)]},e.parseResizeAttributesV10=function(t){return(0,c.parseUpsampleAttributes)(t,10)},e.parseResizeAttributesV11=function(t){return(0,c.parseUpsampleAttributes)(t,11)};var f=function(t,e,n){var c=(0,i.getGlsl)(t.session.backend.glContext.version),f=o(p(e,n),2),h=f[0],d=f[1];if(h.every((function(t){return 1===t}))&&"tf_crop_and_resize"!==n.coordinateTransformMode)return r(r({},l),{output:{dims:d,type:e[0].type,textureType:a.TextureType.packed},hasMain:!0,shaderSource:"void main() {\n vec4 v = ".concat(c.texture2D,"(X, TexCoords);\n ").concat(c.output," = v;\n }")});var g=d.length;if(g<2)throw new Error("output dimension should be at least 2, but got ".concat(g));var b=d[g-2],y=d[g-1],m=e[0].dims;if(g!==m.length)throw new Error("output dimension should match input ".concat(m.length,", but got ").concat(g));var v=m[g-2],_=m[g-1],w=h[g-2],x=h[g-1],T="";if("linear"!==n.mode)throw new Error("resize (packed) does not support mode: '".concat(n.mode,"'"));switch(n.coordinateTransformMode){case"asymmetric":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n return vec4(coords) / scaleWHWH;\n }\n ";break;case"half_pixel":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n return (vec4(coords) + 0.5) / scaleWHWH - 0.5;\n }\n ";break;case"pytorch_half_pixel":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 fcoords = vec4(coords);\n return vec4(\n ".concat(y,".0 > 1.0 ? (fcoords.x + 0.5) / scaleWHWH.x - 0.5 : 0.0,\n ").concat(b,".0 > 1.0 ? (fcoords.y + 0.5) / scaleWHWH.y - 0.5 : 0.0,\n ").concat(y,".0 > 1.0 ? (fcoords.z + 0.5) / scaleWHWH.z - 0.5 : 0.0,\n ").concat(b,".0 > 1.0 ? (fcoords.w + 0.5) / scaleWHWH.w - 0.5 : 0.0\n );\n }\n ");break;case"align_corners":T="\n vec4 getSourceFracIndex(ivec4 coords) {\n vec4 resized = vec4(".concat(y,".0 - 1.0, ").concat(b,".0 - 1.0, ").concat(y,".0 - 1.0,\n ").concat(b,".0 - 1.0);\n vec4 original = vec4(").concat(_,".0 - 1.0, ").concat(v,".0 - 1.0, ").concat(_,".0 - 1.0,\n ").concat(v,".0 - 1.0);\n vec4 new_scale = original / resized;\n return vec4(coords) * new_scale;\n }\n ");break;default:throw new Error("resize (packed) does not support coordinateTransformMode: '".concat(n.coordinateTransformMode,"'"))}var S=(0,s.getCoordsDataType)(g),O=(0,u.unpackFromChannel)(),A="\n const vec2 inputWH = vec2(".concat(v,".0, ").concat(_,".0);\n const vec4 scaleWHWH = vec4(float(").concat(w,"), float(").concat(x,"), float(").concat(w,"), float(").concat(x,"));\n ").concat(O,"\n ").concat(T,"\n float getAValue(int x10, int r, int c, int d) {\n return getChannel(getA(x10, r, c, d), vec2(c, d));\n }\n void main() {\n ").concat(S," rc = getOutputCoords();\n\n int batch = rc[0];\n int depth = rc[1];\n\n // retrieve the 4 coordinates that is used in the 4 packed output values.\n ivec4 coords = ivec4(rc.wz, rc.w + 1, rc.z + 1);\n\n // calculate the source index in fraction\n vec4 sourceFrac = getSourceFracIndex(coords);\n\n // get the lower and upper bound of the 4 values that will be packed into one texel.\n ivec4 x00 = ivec4(max(sourceFrac.xy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xy)));\n ivec4 x01 = ivec4(max(sourceFrac.xw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.xw)));\n ivec4 x10 = ivec4(max(sourceFrac.zy, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zy)));\n ivec4 x11 = ivec4(max(sourceFrac.zw, vec2(0.0)), min(inputWH - 1.0, ceil(sourceFrac.zw)));\n\n bool hasNextRow = rc.w < ").concat(b-1,";\n bool hasNextCol = rc.z < ").concat(y-1,";\n\n // pack x00, x01, x10, x11's top-left corner into one vec4 structure\n vec4 topLeft = vec4(\n getAValue(batch, depth, x00.x, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's top-right corner into one vec4 structure\n vec4 topRight = vec4(\n getAValue(batch, depth, x00.x, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.x, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.x, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.x, x11.w) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-left corner into one vec4 structure\n vec4 bottomLeft = vec4(\n getAValue(batch, depth, x00.z, x00.y),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.y) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.y) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.y) : 0.0);\n\n // pack x00, x01, x10, x11's bottom-right corner into one vec4 structure\n vec4 bottomRight = vec4(\n getAValue(batch, depth, x00.z, x00.w),\n hasNextCol ? getAValue(batch, depth, x01.z, x01.w) : 0.0,\n hasNextRow ? getAValue(batch, depth, x10.z, x10.w) : 0.0,\n (hasNextRow && hasNextCol) ? getAValue(batch, depth, x11.z, x11.w) : 0.0);\n\n // calculate the interpolation fraction on u and v direction\n vec4 frac = vec4(sourceFrac) - floor(sourceFrac);\n vec4 clampFrac = clamp(frac, vec4(0.0), vec4(1.0));\n\n vec4 top = mix(topLeft, topRight, clampFrac.ywyw);\n vec4 bottom = mix(bottomLeft, bottomRight, clampFrac.ywyw);\n vec4 newValue = mix(top, bottom, clampFrac.xxzz);\n\n ").concat(c.output," = vec4(newValue);\n }\n ");return r(r({},l),{output:{dims:d,type:e[0].type,textureType:a.TextureType.packed},hasMain:!0,shaderSource:A})},p=function(t,e){var n,r=t[0].dims,o=e.scales;if(0===o.length){var i=t[e.scalesInputIdx];if(i&&0!==i.size){if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");o=h(i,e.mode,e.isResize)}else{var a=t[e.sizesInputIdx];if(!a||0===a.size)throw new Error("Either scales or sizes MUST be provided as input.");n=Array.from(a.integerData),o=d(n,r,e.mode,e.isResize)}}else if(t[e.sizesInputIdx])throw new Error("Only one of scales or sizes must be provided as input.");var s=n||r.map((function(t,e){return Math.floor(t*o[e])}));return[o,s]},h=function(t,e,n){var r=Array.from(t.floatData);return(0,c.scalesValidation)(r,e,n),r},d=function(t,e,n,r){for(var o=e.length,i=new Array(o),a=0,s=o;ae.dims[i[n]]-1?e.dims[i[n]]:a.ShapeUtil.normalizeAxis(t,e.dims[i[n]])})),l=n.ends.map((function(t,n){return t>e.dims[i[n]]-1?e.dims[i[n]]:a.ShapeUtil.normalizeAxis(t,e.dims[i[n]])})),f=e.dims.slice(),p=[],h=0;h0&&p.push("outputIdx[".concat(i[h],"] += ").concat(c[h],";"));var d=f.length,g="\n float process(int outputIdx[".concat(d,"]) {\n ").concat(p.join("\n "),"\n return _A(outputIdx);\n }");return r(r({},u),{output:{dims:f,type:e.type,textureType:s.TextureType.unpacked},shaderSource:g})},l=function(t){if(!t||1!==t.length)throw new Error("Slice requires 1 input.");if(-1===i.NUMBER_TYPES.indexOf(t[0].type))throw new Error("Invalid input type.")};e.sliceV10=function(t,e){p(e);var n=f(t,e);return[t.run(r(r({},u),{cacheHint:n.cacheKey,get:function(){return c(t,e[0],n)}}),[e[0]])]};var f=function(t,e){if(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)||e.length>=4&&!t.session.isInitializer(e[3].dataId)||e.length>=5&&!t.session.isInitializer(e[4].dataId))throw new Error("dynamic slice attributes are not allowed");if(e.length>=5&&e[4].integerData.some((function(t){return 1!==t})))throw new Error("currently non-1 steps is not supported for Slice");var n=Array.from(e[1].integerData),r=Array.from(e[2].integerData),o=e.length>=4?Array.from(e[3].integerData):[];return{starts:n,ends:r,axes:o,cacheKey:"".concat(o,";").concat(n,";").concat(r)}},p=function(t){if(!t||t.length<3||t.length>5)throw new Error("Invalid input number.");if("int32"!==t[1].type||1!==t[1].dims.length)throw new Error("Invalid input type.");if("int32"!==t[2].type||1!==t[2].dims.length)throw new Error("Invalid input type.");if(t.length>=4&&("int32"!==t[3].type||1!==t[3].dims.length))throw new Error("Invalid input type.");if(t.length>=5&&("int32"!==t[4].type||1!==t[4].dims.length))throw new Error("Invalid input type.")}},5524:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.softmaxV13=e.parseSoftmaxAttributesV13=e.parseSoftmaxAttributes=e.softmax=void 0;var i=n(246),a=n(2517),s=n(5060),u=n(2039),c=n(3738),l={name:"SoftmaxComputeMax",inputNames:["A"],inputTypes:[u.TextureType.unpacked]},f={name:"SoftmaxComputeScale",inputNames:["A","Max"],inputTypes:[u.TextureType.unpacked,u.TextureType.unpacked]},p={name:"SoftMax",inputNames:["A","Max","Norm"],inputTypes:[u.TextureType.unpacked,u.TextureType.unpacked,u.TextureType.unpacked]};e.softmax=function(t,e,n){y(e);var r=e[0].dims.slice(),o=a.ShapeUtil.normalizeAxis(n.axis,r.length),i=a.ShapeUtil.sizeToDimension(r,o),s=a.ShapeUtil.sizeFromDimension(r,o);return h(t,e,n,i,s)},e.parseSoftmaxAttributes=function(t){return(0,i.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",1)})},e.parseSoftmaxAttributesV13=function(t){return(0,i.createAttributeWithCacheKey)({axis:t.attributes.getInt("axis",-1)})},e.softmaxV13=function(t,e,n){y(e);var r,o=e[0].dims.slice(),s=a.ShapeUtil.normalizeAxis(n.axis,o.length),u=o.length,l=s!==u-1,f=[],p=[],d=[];l&&((p=Array.from({length:u}).map((function(t,e){return e})))[s]=u-1,p[u-1]=s,p.map((function(t){return f.push(o[t])})),r=(0,i.createAttributeWithCacheKey)({perm:p}),d=(0,c.transpose)(t,e,r));var g=l?a.ShapeUtil.sizeToDimension(f,u-1):a.ShapeUtil.sizeToDimension(o,u-1),b=l?a.ShapeUtil.sizeFromDimension(f,u-1):a.ShapeUtil.sizeFromDimension(o,u-1),m=h(t,l?d:e,n,g,b);return l?(0,c.transpose)(t,m,r):m};var h=function(t,e,n,o,i){var a=d(t,e[0],o,i,[o]),s=t.run(r(r({},l),{cacheHint:n.cacheKey,get:function(){return a}}),e),u=g(t,e[0],o,i,a.output.dims,[o]),c=t.run(r(r({},f),{cacheHint:n.cacheKey,get:function(){return u}}),[e[0],s]),h=b(t,e[0],o,i,a.output.dims,u.output.dims);return[t.run(r(r({},p),{cacheHint:n.cacheKey,get:function(){return h}}),[e[0],s,c])]},d=function(t,e,n,i,a){var c=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),f=c[0],p=c[1],h=a.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length)throw new Error("Dimensionality of the output should be 1");if(a[0]!==n)throw new Error("Shape of the output should be equal to logical row count");var d=(0,s.getGlsl)(t.session.backend.glContext.version),g="\n float process(int[".concat(h,"] indices) {\n int logical_row_start_offset = indices[0] * ").concat(i,";\n\n float max = getColorAsFloat(").concat(d.texture2D,"(A, offsetToCoords(logical_row_start_offset, ").concat(f,",\n ").concat(p," )));\n for(int i=1; i<").concat(i,"; ++i)\n {\n float current = getColorAsFloat(").concat(d.texture2D,"(A, offsetToCoords(logical_row_start_offset + i,\n ").concat(f,", ").concat(p,")));\n if(current > max)\n max = current;\n }\n\n return max;\n }");return r(r({},l),{output:{dims:a,type:e.type,textureType:u.TextureType.unpacked},shaderSource:g})},g=function(t,e,n,i,a,c){var l=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),p=l[0],h=l[1],d=c.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==c.length)throw new Error("Dimensionality of the output should be 1");if(c[0]!==n)throw new Error("Shape of the output should be equal to logical row count");if(1!==a.length)throw new Error("Dimensionality of the intermediate results should be 1");if(a[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");var g=(0,s.getGlsl)(t.session.backend.glContext.version),b="\n float process(int[".concat(d,"] indices) {\n int logical_row_start_offset = indices[0] * ").concat(i,";\n\n float norm_factor = 0.0;\n float max = _Max(indices);\n for(int i=0; i<").concat(i,"; ++i)\n {\n norm_factor += exp(getColorAsFloat(").concat(g.texture2D,"(A, offsetToCoords(logical_row_start_offset + i,\n ").concat(p,", ").concat(h,"))) - max);\n }\n\n return norm_factor;\n }");return r(r({},f),{output:{dims:c,type:e.type,textureType:u.TextureType.unpacked},shaderSource:b})},b=function(t,e,n,i,a,s){var c=o(t.calculateTextureWidthAndHeight(e.dims,u.TextureType.unpacked),2),l=c[0],f=c[1],h=e.dims.length;if(n<1||i<1)throw new Error("Logical row count N and feature count D must be greater than or equal to 1");if(1!==a.length||1!==s.length)throw new Error("Dimensionality of the intermediate results should be 1");if(a[0]!==n||s[0]!==n)throw new Error("Shape of the intermediate results should be equal to logical row count");var d="\n float process(int[".concat(h,"] indices) {\n\n // get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)\n int offset = coordsToOffset(TexCoords, ").concat(l,", ").concat(f,");\n\n //determine the logical row for this index\n int logical_row_index[1];\n logical_row_index[0] = offset / ").concat(i,";\n\n float norm_factor = _Norm(logical_row_index);\n\n // avoid possible division by 0\n // if norm_facor is 0, all elements are zero\n // if so, return 0\n if(norm_factor == 0.0)\n return 0.0;\n\n return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;\n }");return r(r({},p),{output:{dims:e.dims,type:e.type,textureType:u.TextureType.unpacked},shaderSource:d})},y=function(t){if(!t||1!==t.length)throw new Error("Softmax requires 1 input.");if("float32"!==t[0].type&&"float64"!==t[0].type)throw new Error("Invalid input type")}},5975:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.parseSplitAttributes=e.split=void 0;var i=n(246),a=n(2517),s=n(2039),u={name:"Split",inputNames:["A"],inputTypes:[s.TextureType.unpacked]};e.split=function(t,e,n){f(e);for(var o=a.ShapeUtil.normalizeAxis(n.axis,e[0].dims.length),i=c(t,e,o,n),s=[],p=function(i){s.push(t.run(r(r({},u),{cacheHint:"".concat(n.cacheKey,";").concat(i),get:function(){return l(t,e[0],n,o,i)}}),e))},h=0;h0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 127.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(0.0, 0.0, 128.0, 255.0) / 255.0;\n }\n\n highp vec4 c = vec4(0,0,0,0);\n\n highp float e = floor(log2(av));\n highp float m = exp2(fract(log2(av))) - 1.0;\n\n c[2] = floor(128.0 * m);\n m -= c[2] / 128.0;\n c[1] = floor(32768.0 * m);\n m -= c[1] / 32768.0;\n c[0] = floor(8388608.0 * m);\n\n highp float ebias = e + 127.0;\n c[3] = floor(ebias / 2.0);\n ebias -= c[3] * 2.0;\n c[2] += floor(ebias) * 128.0;\n\n c[3] += 128.0 * step(0.0, -v);\n\n return c / 255.0;\n }\n\n void main() {\n float value = ".concat(i.texture2D,"(X,TexCoords).r;\n ").concat(i.output," = encodeAsUint8(value);\n }"),s={name:"Uint8Encode",inputTypes:[o.TextureType.unpacked],inputNames:["X"],output:{dims:n,type:e.tensor.type,textureType:o.TextureType.downloadUint8AsFloat},shaderSource:a,hasMain:!0};return t.executeProgram(s,[e.tensor])}},4909:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n= 0.0 ? a: (exp(a) - 1.0) * alpha;\n }\n vec4 ").concat(e,"_(vec4 v) {\n return vec4(").concat(e,"_(v.x), ").concat(e,"_(v.y), ").concat(e,"_(v.z), ").concat(e,"_(v.w));\n }\n "),name:e,type:a.FunctionType.ValueBased}}function b(){return D("exp")}function y(){return D("floor")}function m(t,e){var n="clip";return{body:"\n const float min = float(".concat(t,");\n const float max = float(").concat(e,");\n\n float ").concat(n,"_(float a) {\n return clamp(a, min, max);\n }\n vec4 ").concat(n,"_(vec4 v) {\n return clamp(v, min, max);\n }\n "),name:n,type:a.FunctionType.ValueBased}}function v(){var t="indentity";return{body:"\n float ".concat(t,"_(float a) {\n return a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return v;\n }\n "),name:t,type:a.FunctionType.ValueBased}}function _(t){var e="leakyRelu";return{body:"\n const float alpha = float(".concat(t,");\n\n float ").concat(e,"_(float a) {\n return a < 0.0 ? a * alpha : a;\n }\n vec4 ").concat(e,"_(vec4 v) {\n return vec4(").concat(e,"_(v.x), ").concat(e,"_(v.y), ").concat(e,"_(v.z), ").concat(e,"_(v.w));\n }\n "),name:e,type:a.FunctionType.ValueBased}}function w(){return D("log")}function x(){var t="neg";return{body:"\n float ".concat(t,"_(float a) {\n return -a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return -v;\n }\n "),name:t,type:a.FunctionType.ValueBased}}function T(){var t="not";return{body:"\n float ".concat(t,"_(float a) {\n return float( ! bool(a) );\n }\n bool ").concat(t,"_(bool a) {\n return !a;\n }\n vec4 ").concat(t,"_(vec4 v) {\n return vec4(!bool(v.x), !bool(v.y), !bool(v.z), !bool(v.w));\n }\n bvec4 ").concat(t,"_(bvec4 v) {\n return bvec4(!v.x, !v.y, !v.z, !v.w);\n }\n "),name:t,type:a.FunctionType.ValueBased}}function S(){return D("sin")}function O(){var t="relu";return{body:"\n float ".concat(t,"_(float a) {\n return max( a, 0.0 );\n }\n vec4 ").concat(t,"_(vec4 v) {\n return max( v, 0.0 );\n }\n "),name:t,type:a.FunctionType.ValueBased}}function A(){var t="sigmoid";return{body:"\n float ".concat(t,"_(float a) {\n return 1.0 / (1.0 + exp(-a));\n }\n vec4 ").concat(t,"_(vec4 v) {\n return 1.0 / (1.0 + exp(-v));\n }\n "),name:t,type:a.FunctionType.ValueBased}}function E(){return D("sqrt")}function I(){return D("tan")}function P(){var t="tanh";return{body:"\n float ".concat(t,"_(float a) {\n a = clamp(a, -10., 10.);\n a = exp(2.*a);\n return (a - 1.) / (a + 1.);\n }\n vec4 ").concat(t,"_(vec4 v) {\n v = clamp(v, -10., 10.);\n v = exp(2.*v);\n return (v - 1.) / (v + 1.);\n }\n "),name:t,type:a.FunctionType.ValueBased}}function D(t){return{body:"\n float ".concat(t,"_(float a) {\n return ").concat(t,"(a);\n }\n vec4 ").concat(t,"_(vec4 v) {\n return ").concat(t,"(v);\n }\n "),name:t,type:a.FunctionType.ValueBased}}e.glslAbs=c,e.glslAcos=l,e.glslAsin=f,e.glslAtan=p,e.glslCeil=h,e.glslCos=d,e.glslElu=g,e.glslExp=b,e.glslFloor=y,e.glslClip=m,e.glslIdentity=v,e.glslLeakyRelu=_,e.glslLog=w,e.glslNeg=x,e.glslNot=T,e.glslSin=S,e.glslRelu=O,e.glslSigmoid=A,e.glslSqrt=E,e.glslTan=I,e.glslTanh=P;var k=function(t,e,n,o){var i=t.session.pack?u.TextureType.packed:u.TextureType.unpacked,a={name:n.name,inputTypes:[i],inputNames:["A"],cacheHint:o};return r(r({},a),{get:function(){return function(t,e,n,o){var i=t.session.pack?u.TextureType.packed:u.TextureType.unpacked,a=(0,s.getGlsl)(t.session.backend.glContext.version);return r(r({},e),{output:{dims:n.dims,type:n.type,textureType:i},shaderSource:"\n ".concat(o.body,"\n void main() {\n vec4 v = ").concat(a.texture2D,"(A, TexCoords);\n v = ").concat(o.name,"_(v);\n ").concat(a.output," = v;\n }\n "),hasMain:!0})}(t,a,e,n)}})};e.abs=function(t,e){return[t.run(k(t,e[0],c()),e)]},e.acos=function(t,e){return[t.run(k(t,e[0],l()),e)]},e.asin=function(t,e){return[t.run(k(t,e[0],f()),e)]},e.atan=function(t,e){return[t.run(k(t,e[0],p()),e)]},e.clip=function(t,e,n){return[t.run(k(t,e[0],m(n.min,n.max),n.cacheKey),e)]},e.parseClipAttributes=function(t){return(0,o.createAttributeWithCacheKey)({min:t.attributes.getFloat("min",i.MIN_CLIP),max:t.attributes.getFloat("max",i.MAX_CLIP)})},e.clipV11=function(t,n){var r=C(t,n);return(0,e.clip)(t,[n[0]],r)};var C=function(t,e){if(e.length>=3&&(!t.session.isInitializer(e[1].dataId)||!t.session.isInitializer(e[2].dataId)))throw new Error("dynamic clip attributes are not allowed");var n=e.length>=3?e[1].numberData[0]:i.MIN_CLIP,r=e.length>=3?e[2].numberData[0]:i.MAX_CLIP;return(0,o.createAttributeWithCacheKey)({min:n,max:r})};e.ceil=function(t,e){return[t.run(k(t,e[0],h()),e)]},e.cos=function(t,e){return[t.run(k(t,e[0],d()),e)]},e.elu=function(t,e,n){return[t.run(k(t,e[0],g(n.alpha),n.cacheKey),e)]},e.parseEluAttributes=function(t){return(0,o.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",1)})},e.exp=function(t,e){return[t.run(k(t,e[0],b()),e)]},e.floor=function(t,e){return[t.run(k(t,e[0],y()),e)]},e.identity=function(t,e){return[t.run(k(t,e[0],v()),e)]},e.leakyRelu=function(t,e,n){return[t.run(k(t,e[0],_(n.alpha),n.cacheKey),e)]},e.parseLeakyReluAttributes=function(t){return(0,o.createAttributeWithCacheKey)({alpha:t.attributes.getFloat("alpha",.01)})},e.log=function(t,e){return[t.run(k(t,e[0],w()),e)]},e.neg=function(t,e){return[t.run(k(t,e[0],x()),e)]},e.not=function(t,e){return[t.run(k(t,e[0],T()),e)]},e.relu=function(t,e){return[t.run(k(t,e[0],O()),e)]},e.sigmoid=function(t,e){return[t.run(k(t,e[0],A()),e)]},e.sin=function(t,e){return[t.run(k(t,e[0],S()),e)]},e.sqrt=function(t,e){return[t.run(k(t,e[0],E()),e)]},e.tan=function(t,e){return[t.run(k(t,e[0],I()),e)]},e.tanh=function(t,e){return[t.run(k(t,e[0],P()),e)]}},5611:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.scalesValidation=e.validateInputs=e.parseUpsampleAttributes=e.parseUpsampleAttributesV9=e.parseUpsampleAttributesV7=e.upsample=void 0;var a=n(246),s=n(5060),u=n(2039),c={name:"Upsample",inputNames:["X"],inputTypes:[u.TextureType.unpacked]};e.upsample=function(t,n,o){return(0,e.validateInputs)(n,o),[t.run(r(r({},c),{cacheHint:o.cacheKey,get:function(){return l(t,n,o)}}),n)]},e.parseUpsampleAttributesV7=function(t){return(0,e.parseUpsampleAttributes)(t,7)},e.parseUpsampleAttributesV9=function(t){return(0,e.parseUpsampleAttributes)(t,9)},e.parseUpsampleAttributes=function(t,n){var r=n>=10,o=t.attributes.getString("mode","nearest");if("nearest"!==o&&"linear"!==o&&(n<11||"cubic"!==o))throw new Error("unrecognized mode: ".concat(o));var i=[];n<9&&(i=t.attributes.getFloats("scales"),(0,e.scalesValidation)(i,o,r));var s=t.attributes.getFloat("extrapolation_value",0),u=n>10?t.attributes.getString("coordinate_transformation_mode","half_pixel"):"asymmetric";if(-1===["asymmetric","pytorch_half_pixel","tf_half_pixel_for_nn","align_corners","tf_crop_and_resize","half_pixel"].indexOf(u))throw new Error("coordinate_transform_mode '".concat(u,"' is not supported"));var c="tf_crop_and_resize"===u,l=c,f="nearest"===o&&n>=11?t.attributes.getString("nearest_mode","round_prefer_floor"):"";if(-1===["round_prefer_floor","round_prefer_ceil","floor","ceil",""].indexOf(f))throw new Error("nearest_mode '".concat(f,"' is not supported"));var p=t.attributes.getFloat("cubic_coeff_a",-.75),h=0!==t.attributes.getInt("exclude_outside",0);if(h&&"cubic"!==o)throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");var d=n<11||"nearest"===o&&"asymmetric"===u&&"floor"===f,g=0,b=0,y=0;return n>10?t.inputs.length>2?(g=1,b=2,y=3):(b=1,y=2):9===n&&(b=1),(0,a.createAttributeWithCacheKey)({opset:n,isResize:r,mode:o,scales:i,extrapolationValue:s,coordinateTransformMode:u,useExtrapolation:l,needRoiInput:c,nearestMode:f,cubicCoefficientA:p,excludeOutside:h,useNearest2xOptimization:d,roiInputIdx:g,scalesInputIdx:b,sizesInputIdx:y})};var l=function(t,e,n){for(var i=(0,s.getGlsl)(t.session.backend.glContext.version),a=o(t.calculateTextureWidthAndHeight(e[0].dims,u.TextureType.unpacked),2),l=a[0],f=a[1],p=e[0].dims.map((function(t,e){return Math.floor(t*n.scales[e])})),h=o(t.calculateTextureWidthAndHeight(p,u.TextureType.unpacked),2),d=h[0],g=h[1],b=p.length,y=new Array(b),m=new Array(b),v="\n int output_pitches[".concat(b,"];\n int input_pitches[").concat(b,"];\n "),_=b-1;_>=0;_--)y[_]=_===b-1?1:y[_+1]*p[_+1],m[_]=_===b-1?1:m[_+1]*e[0].dims[_+1],v+="\n output_pitches[".concat(_,"] = ").concat(y[_],";\n input_pitches[").concat(_,"] = ").concat(m[_],";\n ");var w="\n float getInputFloat(int index) {\n vec2 coords = offsetToCoords(index, ".concat(l,", ").concat(f,");\n float value = getColorAsFloat(").concat(i.texture2D,"(X, coords));\n return value;\n }\n "),x="nearest"===n.mode?"\n ".concat(w,"\n float process(int indices[").concat(b,"]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int d, m;\n for (int dim = 0; dim < ").concat(b,"; ++dim) {\n d = output_index / output_pitches[dim];\n m = output_index - d * output_pitches[dim];\n output_index = m;\n\n if (scales[dim] != 1 && d > 0) {\n int d2 = d / scales[dim];\n m = d - d2 * scales[dim];\n d = d2;\n }\n input_index += input_pitches[dim] * d;\n }\n\n return getInputFloat(input_index);\n }"):4===b?"\n ".concat(w,"\n float process(int indices[4]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int m;\n int index_of_dim0, index_of_dim1, index_of_dim2, index_of_dim3;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m / output_pitches[1];\n m = m - index_of_dim1 * output_pitches[1];\n index_of_dim2 = m / output_pitches[2];\n m = m - index_of_dim2 * output_pitches[2];\n index_of_dim3 = m;\n\n int index_of_input_dim2, index_of_input_dim3, x_offset, y_offset;\n index_of_input_dim2 = index_of_dim2 / scales[2];\n y_offset = index_of_dim2 - index_of_input_dim2 * scales[2];\n index_of_input_dim3 = index_of_dim3 / scales[3];\n x_offset = index_of_dim3 - index_of_input_dim3 * scales[3];\n\n input_index = index_of_dim0 * input_pitches[0] +\n index_of_dim1 * input_pitches[1] +\n index_of_input_dim2 * input_pitches[2] +\n index_of_input_dim3;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim2 = false;\n if (index_of_input_dim2 == (").concat(e[0].dims[2]," - 1)) {\n // It's the end in dimension 2\n x01 = x00;\n end_of_dim2 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[2]);\n }\n\n if (index_of_input_dim3 == (input_pitches[2] - 1)) {\n // It's the end in dimension 3\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim2 ? x10 : getInputFloat(input_index + input_pitches[2] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[2]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[2]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[3]);\n }"):"\n ".concat(w,"\n float process(int indices[2]) {\n int input_index = 0;\n int output_index = coordsToOffset(TexCoords, ").concat(d,", ").concat(g,");\n\n ").concat(v,"\n\n int m;\n int index_of_dim0, index_of_dim1;\n index_of_dim0 = output_index / output_pitches[0];\n m = output_index - index_of_dim0 * output_pitches[0];\n index_of_dim1 = m;\n\n int index_of_input_dim0, index_of_input_dim1, x_offset, y_offset;\n index_of_input_dim0 = index_of_dim0 / scales[0];\n y_offset = index_of_dim0 - index_of_input_dim0 * scales[0];\n index_of_input_dim1 = index_of_dim1 / scales[1];\n x_offset = index_of_dim1 - index_of_input_dim1 * scales[1];\n\n input_index = index_of_input_dim0 * input_pitches[0] + index_of_input_dim1;\n\n float x00 = getInputFloat(input_index);\n float x10, x01, x11;\n\n bool end_of_dim0 = false;\n if (index_of_input_dim0 == (").concat(e[0].dims[0]," - 1)) {\n // It's the end in dimension 0\n x01 = x00;\n end_of_dim0 = true;\n } else {\n x01 = getInputFloat(input_index + input_pitches[0]);\n }\n\n if (index_of_input_dim1 == (input_pitches[0] - 1)) {\n // It's the end in dimension 1\n x10 = x00;\n x11 = x01;\n }\n else {\n x10 = getInputFloat(input_index + 1);\n x11 = end_of_dim0 ? x10 : getInputFloat(input_index + input_pitches[0] + 1);\n }\n\n float y0 = x00 + float(y_offset) * (x01 - x00) / float(scales[0]);\n float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);\n return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);\n }");return r(r({},c),{output:{dims:p,type:e[0].type,textureType:u.TextureType.unpacked},shaderSource:x,variables:[{name:"scales",type:"int",arrayLength:n.scales.length,data:n.scales.map((function(t){return Math.ceil(t)}))}]})};e.validateInputs=function(t,e){if(!t||e.opset<9&&1!==t.length||e.opset>=9&&e.opset<11&&2!==t.length||e.opset>=11&&t.length<2)throw new Error("invalid inputs.");if(e.scales.length>0&&t[0].dims.length!==e.scales.length)throw new Error("Invalid input shape.");if("string"===t[0].type)throw new Error("Invalid input tensor types.")},e.scalesValidation=function(t,e,n){var r,o,a,s;if(n)try{for(var u=i(t),c=u.next();!c.done;c=u.next())if(c.value<=0)throw new Error("Scale value should be greater than 0.")}catch(t){a={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}else try{for(var l=i(t),f=l.next();!f.done;f=l.next())if(f.value<1)throw new Error("Scale value should be greater than or equal to 1.")}catch(t){r={error:t}}finally{try{f&&!f.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}if(!("linear"!==e&&"cubic"!==e||2===t.length||4===t.length&&1===t[0]&&1===t[1]))throw new Error("'Linear' mode and 'Cubic' mode only support 2-D inputs ('Bilinear', 'Bicubic') or 4-D inputs with the corresponding outermost 2 scale values being 1 in the ".concat(n?"Resize":"Upsample"," opeartor."))}},1958:function(t,e,n){"use strict";var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.ProgramManager=void 0;var i=n(8453),a=n(6231),s=n(8879),u=n(5060),c=function(){function t(t,e,n){this.profiler=t,this.glContext=e,this.textureLayoutStrategy=n,this.repo=new Map,this.attributesBound=!1}return t.prototype.getArtifact=function(t){return this.repo.get(t)},t.prototype.setArtifact=function(t,e){this.repo.set(t,e)},t.prototype.run=function(t,e,n){var r,o=this;this.profiler.event("op","ProgramManager.run ".concat(null!==(r=t.programInfo.name)&&void 0!==r?r:"unknown kernel"),(function(){var r,i=o.glContext.gl,s=t.program;i.useProgram(s);try{o.bindOutput(n),o.attributesBound||o.bindAttributes(t.attribLocations),o.bindUniforms(t.uniformLocations,null!==(r=t.programInfo.variables)&&void 0!==r?r:[],e)}catch(e){throw a.Logger.error("ProgramManager",t.programInfo.shaderSource),e}o.profiler.event("backend","GlContext.draw()",(function(){o.glContext.draw()}))}),this.glContext)},t.prototype.dispose=function(){var t=this;this.vertexShader&&this.glContext.deleteShader(this.vertexShader),this.repo.forEach((function(e){return t.glContext.deleteProgram(e.program)}))},t.prototype.build=function(t,e,n){var r=this;return this.profiler.event("backend","ProgramManager.build",(function(){var o=new s.GlslPreprocessor(r.glContext,t,e,n),i=o.preprocess(),a=r.compile(i);return{programInfo:t,program:a,uniformLocations:r.getUniformLocations(a,o.context.programInfo.inputNames,o.context.programInfo.variables),attribLocations:r.getAttribLocations(a)}}))},t.prototype.compile=function(t){if(!this.vertexShader){a.Logger.verbose("ProrgramManager","Compiling and caching Vertex shader for the first time");var e=(0,u.getVertexShaderSource)(this.glContext.version);this.vertexShader=this.glContext.compileShader(e,this.glContext.gl.VERTEX_SHADER)}i.env.debug&&a.Logger.verbose("ProrgramManager","FragShader:\n".concat(t,"\n"));var n=this.glContext.compileShader(t,this.glContext.gl.FRAGMENT_SHADER),r=this.glContext.createProgram(this.vertexShader,n);return this.glContext.deleteShader(n),r},t.prototype.bindOutput=function(t){var e=t.width,n=t.height;a.Logger.verbose("ProrgramManager","Binding output texture to Framebuffer: w/h=".concat(e,"/").concat(n,", shape=").concat(t.shape,", type=").concat(t.tensor.type)),this.glContext.attachFramebuffer(t.texture,e,n)},t.prototype.bindAttributes=function(t){var e=t.position,n=t.textureCoord;this.glContext.setVertexAttributes(e,n),this.attributesBound=!0},t.prototype.bindUniforms=function(t,e,n){var r,i,a,s=this.glContext.gl,u=0,c=function(t,r,o,i){var c=null===(a=e.find((function(e){return e.name===t})))||void 0===a?void 0:a.data;if("sampler2D"!==r&&!c)throw new Error("variable '".concat(t,"' does not have data defined in program info"));switch(r){case"sampler2D":l.bindTexture(n[u],o,u),u++;break;case"float":i?s.uniform1fv(o,c):s.uniform1f(o,c);break;case"int":i?s.uniform1iv(o,c):s.uniform1i(o,c);break;default:throw new Error("Uniform not implemented: ".concat(r))}},l=this;try{for(var f=o(t),p=f.next();!p.done;p=f.next()){var h=p.value;c(h.name,h.type,h.location,h.arrayLength)}}catch(t){r={error:t}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}},t.prototype.bindTexture=function(t,e,n){this.glContext.bindTextureToUniform(t.texture,n,e)},t.prototype.getAttribLocations=function(t){return{position:this.getAttribLocation(t,"position"),textureCoord:this.getAttribLocation(t,"textureCoord")}},t.prototype.getUniformLocations=function(t,e,n){var i,a,s,u,c=[];if(e)try{for(var l=o(e),f=l.next();!f.done;f=l.next()){var p=f.value;c.push({name:p,type:"sampler2D",location:this.getUniformLocation(t,p)})}}catch(t){i={error:t}}finally{try{f&&!f.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}if(n)try{for(var h=o(n),d=h.next();!d.done;d=h.next()){var g=d.value;c.push(r(r({},g),{location:this.getUniformLocation(t,g.name)}))}}catch(t){s={error:t}}finally{try{d&&!d.done&&(u=h.return)&&u.call(h)}finally{if(s)throw s.error}}return c},t.prototype.getUniformLocation=function(t,e){var n=this.glContext.gl.getUniformLocation(t,e);if(null===n)throw new Error("Uniform ".concat(e," not found."));return n},t.prototype.getAttribLocation=function(t,e){return this.glContext.gl.getAttribLocation(t,e)},t}();e.ProgramManager=c},6416:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebGLSessionHandler=void 0;var r=n(6231),o=n(1047),i=n(8316),a=n(1640),s=n(1958),u=n(7859),c=n(5702),l=function(){function t(t,e){this.backend=t,this.context=e,this.layoutStrategy=new u.PreferLogicalStrategy(t.glContext.maxTextureSize),this.programManager=new s.ProgramManager(this.context.profiler,t.glContext,this.layoutStrategy),this.textureManager=new c.TextureManager(t.glContext,this.layoutStrategy,this.context.profiler,{reuseTextures:"full"===t.textureCacheMode}),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache=new Map,this.pack=t.pack,this.pack2unpackMap=new Map,this.unpack2packMap=new Map}return t.prototype.createInferenceHandler=function(){return new i.WebGLInferenceHandler(this)},t.prototype.onGraphInitialized=function(t){var e=t.getValues().filter((function(t){return-1===t.from&&t.tensor})).map((function(t){return t.tensor.dataId}));this.initializers=new Set(e)},t.prototype.isInitializer=function(t){return!!this.initializers&&this.initializers.has(t)},t.prototype.addInitializer=function(t){this.initializers.add(t)},t.prototype.getTextureData=function(t,e){return e?this.packedTextureDataCache.get(t):this.unpackedTextureDataCache.get(t)},t.prototype.setTextureData=function(t,e,n){void 0===n&&(n=!1),r.Logger.verbose("WebGLSessionHandler","Storing Texture data in cache"),n?this.packedTextureDataCache.set(t,e):this.unpackedTextureDataCache.set(t,e)},t.prototype.dispose=function(){var t=this;this.programManager.dispose(),this.textureManager.clearActiveTextures(),this.packedTextureDataCache.forEach((function(e){return t.textureManager.releaseTexture(e,!0)})),this.packedTextureDataCache=new Map,this.unpackedTextureDataCache.forEach((function(e){return t.textureManager.releaseTexture(e,!0)})),this.unpackedTextureDataCache=new Map},t.prototype.resolve=function(t,e,n){var r=(0,o.resolveOperator)(t,e,a.WEBGL_OP_RESOLVE_RULES);return{impl:r.opImpl,context:r.opInit?r.opInit(t,n):t}},t}();e.WebGLSessionHandler=l},7769:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Uint8DataEncoder=e.RGBAFloatDataEncoder=e.RedFloat32DataEncoder=void 0;var r=n(6231),o=function(){function t(t,e){if(void 0===e&&(e=1),1===e)this.internalFormat=t.R32F,this.format=t.RED,this.textureType=t.FLOAT,this.channelSize=e;else{if(4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA32F,this.format=t.RGBA,this.textureType=t.FLOAT,this.channelSize=e}}return t.prototype.encode=function(t,e){var n,o;return t.constructor!==Float32Array&&(r.Logger.warning("Encoder","data was not of type Float32; creating new Float32Array"),o=new Float32Array(t)),e*this.channelSize>t.length?(r.Logger.warning("Encoder","Source data too small. Allocating larger array"),o=t,n=this.allocate(e*this.channelSize),o.forEach((function(t,e){return n[e]=t}))):n=o=t,n},t.prototype.allocate=function(t){return new Float32Array(4*t)},t.prototype.decode=function(t,e){return 1===this.channelSize?t.filter((function(t,e){return e%4==0})).subarray(0,e):t.subarray(0,e)},t}();e.RedFloat32DataEncoder=o;var i=function(){function t(t,e,n){if(void 0===e&&(e=1),1!==e&&4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA,this.format=t.RGBA,this.channelSize=e,this.textureType=n||t.FLOAT}return t.prototype.encode=function(t,e){var n=t;return 1===this.channelSize&&(r.Logger.verbose("Encoder","Exploding into a larger array"),n=this.allocate(e),t.forEach((function(t,e){return n[4*e]=t}))),n},t.prototype.allocate=function(t){return new Float32Array(4*t)},t.prototype.decode=function(t,e){return 1===this.channelSize?t.filter((function(t,e){return e%4==0})).subarray(0,e):t.subarray(0,e)},t}();e.RGBAFloatDataEncoder=i;var a=function(){function t(t,e){if(void 0===e&&(e=1),this.channelSize=4,1===e)this.internalFormat=t.ALPHA,this.format=t.ALPHA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e;else{if(4!==e)throw new Error("Invalid number of channels: ".concat(e));this.internalFormat=t.RGBA,this.format=t.RGBA,this.textureType=t.UNSIGNED_BYTE,this.channelSize=e}}return t.prototype.encode=function(t,e){return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},t.prototype.allocate=function(t){return new Uint8Array(t*this.channelSize)},t.prototype.decode=function(t,e){if(t instanceof Uint8Array)return t.subarray(0,e);throw new Error("Invalid array type: ".concat(t.constructor))},t}();e.Uint8DataEncoder=a},7859:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBatchDim=e.sizeToSquarishShape=e.getRowsCols=e.sizeFromShape=e.isInt=e.parseAxisParam=e.squeezeShape=e.PreferLogicalStrategy=e.AlwaysKeepOriginalSizeStrategy=void 0;var r=n(6231),o=n(2517),i=function(){function t(t){this.maxTextureSize=t}return t.prototype.computeTextureWH=function(t,e){if(0===t.length)return[1,1];var n=this.maxTextureSize;if(e&&void 0!==e.breakAxis){var o=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce((function(t,e){return t*e})),i=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce((function(t,e){return t*e}));if(!(o>n||i>n))return[o,i];r.Logger.verbose("TextureLayout","Given width/height preferences were unattainable: shape:".concat(t,", breakAxis:").concat(e.breakAxis))}for(var a=t.reduce((function(t,e){return t*e})),s=Math.floor(Math.sqrt(a));s=n||a%s!=0)throw new Error("The given dimensions are outside this GPU's boundaries: ".concat(t));return[s,a/s]},t}();e.AlwaysKeepOriginalSizeStrategy=i;var a=function(){function t(t){this.maxTextureSize=t}return t.prototype.computeTextureWH=function(t,e){var n=this.computeTexture(t,e);return e&&e.isPacked&&(n[0]/=2,n[1]/=2),e&&e.reverseWH?[n[1],n[0]]:n},t.prototype.computeTexture=function(t,e){var n=e&&e.isPacked;if(0===t.length)return n?[2,2]:[1,1];var o=this.maxTextureSize;if(e&&void 0!==e.breakAxis){var i=e.breakAxis>=t.length?1:t.slice(e.breakAxis).reduce((function(t,e){return t*e})),a=e.breakAxis<=0?1:t.slice(0,e.breakAxis).reduce((function(t,e){return t*e}));if(!(i>o||a>o))return[i,a];r.Logger.verbose("TextureLayout","Given width/height preferences were unattainable: shape:".concat(t,", breakAxis:").concat(e.breakAxis))}var u=t.slice(0);if(n&&(o*=2,1===(u=u.map((function(t,e){return e>=u.length-2?u[e]%2==0?u[e]:u[e]+1:u[e]}))).length&&(u=[2,u[0]])),2!==u.length){var c=s(u);u=c.newShape}var p=l(u);return u.length<=1&&p<=o?[1,p]:2===u.length&&u[0]<=o&&u[1]<=o?u:3===u.length&&u[0]*u[1]<=o&&u[2]<=o?[u[0]*u[1],u[2]]:3===u.length&&u[0]<=o&&u[1]*u[2]<=o?[u[0],u[1]*u[2]]:4===u.length&&u[0]*u[1]*u[2]<=o&&u[3]<=o?[u[0]*u[1]*u[2],u[3]]:4===u.length&&u[0]<=o&&u[1]*u[2]*u[3]<=o?[u[0],u[1]*u[2]*u[3]]:n?f(p/4).map((function(t){return 2*t})):f(p)},t}();function s(t,e){for(var n=[],r=[],o=null!=e&&Array.isArray(e)&&0===e.length,i=null==e||o?null:u(e,t).sort(),a=0,s=0;ss)&&1===t[s]&&(n.push(t[s]),r.push(s)),i[a]<=s&&a++}1!==t[s]&&(n.push(t[s]),r.push(s))}return{newShape:n,keptDims:r}}function u(t,e){var n=e.length;return t=null==t?e.map((function(t,e){return e})):[].concat(t),(0,o.assert)(t.every((function(t){return t>=-n&&t1?t[t.length-2]:1,t[t.length-1]]},e.sizeToSquarishShape=f,e.getBatchDim=function(t,e){return void 0===e&&(e=2),l(t.slice(0,t.length-e))}},4057:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.createTextureLayoutFromShape=e.calculateTextureWidthAndHeight=e.createTextureLayoutFromTextureType=void 0;var o=n(2517),i=n(2039);e.createTextureLayoutFromTextureType=function(t,n,r){var o=r===i.TextureType.unpacked||r===i.TextureType.unpackedReversed?1:4,a=r===i.TextureType.packed,s=r===i.TextureType.unpackedReversed||r===i.TextureType.packed,u=r===i.TextureType.packedLastDimension?n.length-1:void 0,c=r===i.TextureType.packedLastDimension?n.map((function(t,e){return e===n.length-1?4*t:t})):void 0;return(0,e.createTextureLayoutFromShape)(t,n,o,c,{isPacked:a,reverseWH:s,breakAxis:u})},e.calculateTextureWidthAndHeight=function(t,n,r){var o=(0,e.createTextureLayoutFromTextureType)(t,n,r);return[o.width,o.height]},e.createTextureLayoutFromShape=function(t,e,n,i,a){void 0===n&&(n=1);var s=!(!a||!a.isPacked),u=r(t.computeTextureWH(s&&i||e,a),2),c=u[0],l=u[1],f=e.length,p=e.slice(0);if(0===f&&(p=[1]),1===n)i=e;else if(s){if(4!==n)throw new Error("a packed texture must be 4-channel");i=e,f>0&&(p[f-1]=Math.ceil(p[f-1]/2)),f>1&&(p[f-2]=Math.ceil(p[f-2]/2))}else if(!i)throw new Error("Unpacked shape is needed when using channels > 1");return{width:c,height:l,channels:n,isPacked:s,shape:p,strides:o.ShapeUtil.computeStrides(p),unpackedShape:i,reversedWH:a&&a.reverseWH}}},5702:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0){var p=f.pop();return u.push(p),1===r&&this.glContext.updateTexture(p,c,l,a,this.toTextureData(t,n)),p}}i.Logger.verbose("TextureManager","Creating new texture of size ".concat(e.width,"x").concat(e.height));var h=this.glContext.allocateTexture(c,l,a,this.toTextureData(t,n));return this.config.reuseTextures&&(u.push(h),this.textureLookup.set(h,s)),h},t.prototype.readTexture=function(t,e,n){var r=this;return n||(n=1),this.profiler.event("backend","TextureManager.readTexture",(function(){var o=t.shape.reduce((function(t,e){return t*e}))*n,i=r.glContext.readTexture(t.texture,t.width,t.height,o,r.toEncoderType(e),n);return r.toTensorData(e,i)}))},t.prototype.readTextureAsync=function(t,e,n){return r(this,void 0,void 0,(function(){var i,a,s=this;return o(this,(function(u){return i=t.tensor.dataId,n||(n=1),this.pendingRead.has(i)?(a=this.pendingRead.get(i),[2,new Promise((function(t){return null==a?void 0:a.push(t)}))]):[2,this.profiler.event("backend","TextureManager.readTextureAsync",(function(){return r(s,void 0,void 0,(function(){var r,a,s,u;return o(this,(function(o){switch(o.label){case 0:return this.pendingRead.set(i,[]),r=t.shape.reduce((function(t,e){return t*e}))*n,[4,this.glContext.createAndWaitForFence()];case 1:return o.sent(),a=this.glContext.readTexture(t.texture,t.width,t.height,r,this.toEncoderType(e),n),s=this.toTensorData(e,a),u=this.pendingRead.get(i),this.pendingRead.delete(i),null==u||u.forEach((function(t){return t(s)})),[2,s]}}))}))}))]}))}))},t.prototype.readUint8TextureAsFloat=function(t){var e=this;return this.profiler.event("backend","TextureManager.readUint8TextureAsFloat",(function(){var n=t.shape.reduce((function(t,e){return t*e})),r=e.glContext.readTexture(t.texture,t.width,t.height,4*n,"byte",4);return new Float32Array(r.buffer,r.byteOffset,n)}))},t.prototype.releaseTexture=function(t,e){var n;if(this.config.reuseTextures&&(n=this.textureLookup.get(t.texture))){e&&this.textureLookup.delete(n);var r=this.inUseTextures.get(n);if(r){var o=r.indexOf(t.texture);if(-1!==o){r.splice(o,1);var a=this.idleTextures.get(n);a||(a=[],this.idleTextures.set(n,a)),a.push(t.texture)}}}n&&!e||(i.Logger.verbose("TextureManager","Deleting texture of size ".concat(t.width,"x").concat(t.height)),this.glContext.deleteTexture(t.texture))},t.prototype.toTensorData=function(t,e){switch(t){case"int16":return e instanceof Int16Array?e:Int16Array.from(e);case"int32":return e instanceof Int32Array?e:Int32Array.from(e);case"int8":return e instanceof Int8Array?e:Int8Array.from(e);case"uint16":return e instanceof Uint16Array?e:Uint16Array.from(e);case"uint32":return e instanceof Uint32Array?e:Uint32Array.from(e);case"uint8":case"bool":return e instanceof Uint8Array?e:Uint8Array.from(e);case"float32":return e instanceof Float32Array?e:Float32Array.from(e);case"float64":return e instanceof Float64Array?e:Float64Array.from(e);default:throw new Error("TensorData type ".concat(t," is not supported"))}},t.prototype.toTextureData=function(t,e){if(e)return e instanceof Float32Array?e:new Float32Array(e)},t.prototype.toEncoderType=function(t){return"float"},t.prototype.clearActiveTextures=function(){this.glContext.clearActiveTextures()},t}();e.TextureManager=a},2039:function(t,e){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0}),e.TextureType=void 0,(n=e.TextureType||(e.TextureType={}))[n.unpacked=0]="unpacked",n[n.unpackedReversed=1]="unpackedReversed",n[n.packed=2]="packed",n[n.downloadUint8AsFloat=3]="downloadUint8AsFloat",n[n.packedLastDimension=4]="packedLastDimension"},9390:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=n?o():setTimeout(a,s)}};a()}))]}))}))},e.generateShaderFuncNameFromInputSamplerName=function(t){return(0,i.assert)(void 0!==t&&0!==t.length,(function(){return"empty string found for sampler name"})),"get"+t.charAt(0).toUpperCase()+t.slice(1)},e.generateShaderFuncNameFromInputSamplerNameAtOutCoords=function(t){return(0,i.assert)(void 0!==t&&0!==t.length,(function(){return"empty string found for sampler name"})),"get"+t.charAt(0).toUpperCase()+t.slice(1)+"AtOutCoords"},e.squeezeInputShape=function(t,e){return JSON.parse(JSON.stringify(t)),e},e.getSqueezedParams=function(t,e){return e.map((function(e){return t[e]})).join(", ")},e.getCoordsDataType=function(t){if(t<=1)return"int";if(2===t)return"ivec2";if(3===t)return"ivec3";if(4===t)return"ivec4";if(5===t)return"ivec5";if(6===t)return"ivec6";throw Error("GPU for rank ".concat(t," is not yet supported"))},e.getGlChannels=function(t){return void 0===t&&(t=6),["x","y","z","w","u","v"].slice(0,t)}},7305:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createNewWebGLContext=e.createWebGLContext=void 0;var r=n(6231),o=n(1713),i={};function a(t){var e,n=function(){if("undefined"==typeof document){if("undefined"==typeof OffscreenCanvas)throw new TypeError("failed to create canvas: OffscreenCanvas is not supported");return new OffscreenCanvas(1,1)}var t=document.createElement("canvas");return t.width=1,t.height=1,t}(),i={alpha:!1,depth:!1,antialias:!1,stencil:!1,preserveDrawingBuffer:!1,premultipliedAlpha:!1,failIfMajorPerformanceCaveat:!1};if((!t||"webgl2"===t)&&(e=n.getContext("webgl2",i)))try{return new o.WebGLContext(e,2)}catch(t){r.Logger.warning("GlContextFactory","failed to create WebGLContext using contextId 'webgl2'. Error: ".concat(t))}if((!t||"webgl"===t)&&(e=n.getContext("webgl",i)||n.getContext("experimental-webgl",i)))try{return new o.WebGLContext(e,1)}catch(t){r.Logger.warning("GlContextFactory","failed to create WebGLContext using contextId 'webgl' or 'experimental-webgl'. Error: ".concat(t))}throw new Error("WebGL is not supported")}e.createWebGLContext=function t(e){var n;e&&"webgl2"!==e||!("webgl2"in i)?e&&"webgl"!==e||!("webgl"in i)||(n=i.webgl):n=i.webgl2,n=n||a(e),e=e||1===n.version?"webgl":"webgl2";var r=n.gl;return i[e]=n,r.isContextLost()?(delete i[e],t(e)):(r.disable(r.DEPTH_TEST),r.disable(r.STENCIL_TEST),r.disable(r.BLEND),r.disable(r.DITHER),r.disable(r.POLYGON_OFFSET_FILL),r.disable(r.SAMPLE_COVERAGE),r.enable(r.SCISSOR_TEST),r.enable(r.CULL_FACE),r.cullFace(r.BACK),n)},e.createNewWebGLContext=a},1713:function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&r(e,t,n);return o(e,t),e},a=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]1?[2]:[4,(0,l.repeatedTry)((function(){return n.pollItems(),0===n.itemsToPoll.length}))];case 1:return r.sent(),[2]}}))}))},t}();e.WebGLContext=p},1036:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,o=0,i=e.length;o=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.Graph=void 0;var o=n(1446),i=n(7778),a=n(9395),s=n(9162),u=n(2517),c=a.onnxruntime.experimental.fbs;e.Graph={from:function(t,e){return new p(t,e)}};var l=function(){function t(t){this._from=void 0,this._to=[],this.tensor=void 0,this.type=void 0,t&&(this.type=u.ProtoUtil.tensorValueTypeFromProto(t.type.tensorType))}return Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:!1,configurable:!0}),t}(),f=function(t,e){t instanceof o.onnx.NodeProto?(this.name=t.name,this.opType=t.opType,this.attributes=new i.Attribute(t.attribute)):t instanceof c.Node&&(this.name=null!=e?e:t.name(),this.opType=t.opType(),this.attributes=new i.Attribute(u.ProtoUtil.tensorAttributesFromORTFormat(t))),this.inputs=[],this.outputs=[],this.executeNode=!0},p=function(){function t(t,e){if(!t)throw new TypeError("graph is empty");this.buildGraph(t),this.transformGraph(e),this.checkIsAcyclic()}return t.prototype.getInputIndices=function(){return this._allInputIndices},t.prototype.getInputNames=function(){return this._allInputNames},t.prototype.getOutputIndices=function(){return this._allOutputIndices},t.prototype.getOutputNames=function(){return this._allOutputNames},t.prototype.getValues=function(){return this._allData},t.prototype.getNodes=function(){return this._nodes},t.prototype.buildGraph=function(t){if(t instanceof o.onnx.GraphProto)this.buildGraphFromOnnxFormat(t);else{if(!(t instanceof c.Graph))throw new TypeError("Graph type is not supported.");this.buildGraphFromOrtFormat(t)}},t.prototype.buildGraphFromOnnxFormat=function(t){var e,n,o,i,a,c,p,h,d,g,b,y,m=new Map;this._allData=[],this._allInputIndices=[],this._allInputNames=[],this._allOutputIndices=[],this._allOutputNames=[],this._nodes=[];var v=new Map;if(!t.input)throw new Error("missing information in graph: input");var _=[];try{for(var w=r(t.input),x=w.next();!x.done;x=w.next()){var T=x.value;if(m.has(T.name))throw new Error("duplicated input name: ".concat(T.name));var S=this._allData.push(new l(T))-1;m.set(T.name,S),_.push(T.name)}}catch(t){e={error:t}}finally{try{x&&!x.done&&(n=w.return)&&n.call(w)}finally{if(e)throw e.error}}if(!t.initializer)throw new Error("missing information in graph: initializer");try{for(var O=r(t.initializer),A=O.next();!A.done;A=O.next()){T=A.value;var E=m.get(T.name);if(void 0===E){var I=new l;I.type={shape:{dims:u.ProtoUtil.tensorDimsFromProto(T.dims)},tensorType:u.ProtoUtil.tensorDataTypeFromProto(T.dataType)},E=this._allData.push(I)-1,m.set(T.name,E)}this._allData[E]._from=-1,this._allData[E].tensor=s.Tensor.fromProto(T)}}catch(t){o={error:t}}finally{try{A&&!A.done&&(i=O.return)&&i.call(O)}finally{if(o)throw o.error}}for(T=0;T0;)o()},t.prototype.transformGraph=function(t){this.removeAllIdentityNodes(),this.removeAllDropoutNodes(),this.fuseConvActivationNodes(),t&&t.transformGraph(this),this.finalizeGraph()},t.prototype.finalizeGraph=function(){for(var t,e=this,n=0,r=function(r){if(!o._nodes[r].executeNode)return n++,o._nodes[r].outputs.forEach((function(t){e._allData[t]._from=-2})),o._nodes.splice(r,1),r--,t=r,"continue";n>0&&(o._nodes[r].inputs.forEach((function(t){var o=e._allData[t]._to.indexOf(r+n);-1!==o&&(e._allData[t]._to[o]=r)})),o._nodes[r].outputs.forEach((function(t){e._allData[t]._from&&e._allData[t]._from===r+n&&(e._allData[t]._from=r)}))),t=r},o=this,i=0;i0){var r=-1;void 0!==u._allData[t].from&&-1!==u._allData[t].from?-1!==(r=u._nodes[u._allData[t].from].outputs.indexOf(t+n))&&(u._nodes[u._allData[t].from].outputs[r]=t):-1!==(r=u._allInputIndices.indexOf(t+n))&&(u._allInputIndices[r]=t),u._allData[t].to.forEach((function(o){-1!==(r=e._nodes[o].inputs.indexOf(t+n))&&(e._nodes[o].inputs[r]=t)})),0===u._allData[t].to.length&&-1!==(r=u._allOutputIndices.indexOf(t+n))&&(u._allOutputIndices[r]=t)}a=t},u=this;for(i=0;i1)for(var i=1;i0)throw new Error("Node deletion with more than one output connected to other nodes is not supported. ");o.executeNode=!1;var a=o.inputs[0],s=o.outputs[0],u=this._allData[s].to,c=this._allData[a].to.indexOf(t);if(-1===c)throw new Error("The Value object doesn't have the current Node in it's 'to' property ");this._allData[a].to.splice(c,1),this._allData[s]._to=[];var l=this._allOutputIndices.indexOf(s);if(-1!==l&&(this._allOutputIndices[l]=a),u&&u.length>0)try{for(var f=r(u),p=f.next();!p.done;p=f.next()){var h=p.value,d=this._nodes[h].inputs.indexOf(s);if(-1===d)throw new Error("The Node object doesn't have the output Value in it's 'inputs' property ");this._nodes[h].inputs[d]=a,this._allData[a].to.push(h)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}},t.prototype.removeAllDropoutNodes=function(){var t,e,n=0;try{for(var o=r(this._nodes),i=o.next();!i.done;i=o.next()){var a=i.value;if("Dropout"===a.opType){if(1!==a.inputs.length)throw new Error("Dropout nodes should only contain one input. ");if(1!==a.outputs.length&&2!==a.outputs.length)throw new Error("Dropout nodes should contain either 1 or 2 output(s)");if(2===a.outputs.length&&0!==this._allData[a.outputs[1]]._to.length)throw new Error("Dropout nodes's second output should not be referenced by other nodes");this.deleteNode(n)}n++}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.removeAllIdentityNodes=function(){var t,e,n=0;try{for(var o=r(this._nodes),i=o.next();!i.done;i=o.next())"Identity"===i.value.opType&&this.deleteNode(n),n++}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}},t.prototype.isActivation=function(t){switch(t.opType){case"Relu":case"Sigmoid":case"Clip":return!0;default:return!1}},t.prototype.fuseConvActivationNodes=function(){var t,e;try{for(var n=r(this._nodes),o=n.next();!o.done;o=n.next()){var i=o.value;if("Conv"===i.opType){var a=this._allData[i.outputs[0]]._to;if(1===a.length&&this.isActivation(this._nodes[a[0]])){var s=this._nodes[a[0]];if("Clip"===s.opType)if(1===s.inputs.length)try{i.attributes.set("activation_params","floats",[s.attributes.getFloat("min"),s.attributes.getFloat("max")])}catch(t){i.attributes.set("activation_params","floats",[u.MIN_CLIP,u.MAX_CLIP])}else{if(!(s.inputs.length>=3&&void 0!==this._allData[s.inputs[1]].tensor&&void 0!==this._allData[s.inputs[2]].tensor))continue;i.attributes.set("activation_params","floats",[this._allData[s.inputs[1]].tensor.floatData[0],this._allData[s.inputs[2]].tensor.floatData[0]])}i.attributes.set("activation","string",s.opType),this.deleteNode(a[0])}}}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},t}()},6231:function(t,e){"use strict";var n,r,o=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=this._flushBatchSize||t-this._flushTime>=this._flushIntervalInMilliseconds){for(var n=this._flushPointer;this._flushPointer=3");this._opsets=n.opsetImport.map((function(t){return{domain:t.domain,version:s.LongUtil.longToNumber(t.version)}})),this._graph=i.Graph.from(n.graph,e)},t.prototype.loadFromOrtFormat=function(t,e){var n=new r.flatbuffers.ByteBuffer(t),o=u.InferenceSession.getRootAsInferenceSession(n).model();if(s.LongUtil.longToNumber(o.irVersion())<3)throw new Error("only support ONNX model with IR_VERSION>=3");this._opsets=[];for(var a=0;a=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};function r(t,e){if(e.endsWith("+")){var n=Number.parseInt(e.substring(0,e.length-1),10);return!isNaN(n)&&n<=t}if(2===e.split("-").length){var r=e.split("-"),o=(n=Number.parseInt(r[0],10),Number.parseInt(r[1],10));return!isNaN(n)&&!isNaN(o)&&n<=t&&t<=o}return Number.parseInt(e,10)===t}Object.defineProperty(e,"__esModule",{value:!0}),e.resolveOperator=void 0,e.resolveOperator=function(t,e,o){var i,a,s,u;try{for(var c=n(o),l=c.next();!l.done;l=c.next()){var f=l.value,p=f[0],h=f[1],d=f[2],g=f[3],b=f[4];if(t.opType===p)try{for(var y=(s=void 0,n(e)),m=y.next();!m.done;m=y.next()){var v=m.value;if((v.domain===h||"ai.onnx"===v.domain&&""===h)&&r(v.version,d))return{opImpl:g,opInit:b}}}catch(t){s={error:t}}finally{try{m&&!m.done&&(u=y.return)&&u.call(y)}finally{if(s)throw s.error}}}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}throw new TypeError("cannot resolve operator '".concat(t.opType,"' with opsets: ").concat(e.map((function(t){return"".concat(t.domain||"ai.onnx"," v").concat(t.version)})).join(", ")))}},9395:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.onnxruntime=void 0;var r,o,i,a,s=n(5686);r=e.onnxruntime||(e.onnxruntime={}),o=r.experimental||(r.experimental={}),i=o.fbs||(o.fbs={}),(a=i.AttributeType||(i.AttributeType={}))[a.UNDEFINED=0]="UNDEFINED",a[a.FLOAT=1]="FLOAT",a[a.INT=2]="INT",a[a.STRING=3]="STRING",a[a.TENSOR=4]="TENSOR",a[a.GRAPH=5]="GRAPH",a[a.FLOATS=6]="FLOATS",a[a.INTS=7]="INTS",a[a.STRINGS=8]="STRINGS",a[a.TENSORS=9]="TENSORS",a[a.GRAPHS=10]="GRAPHS",a[a.SPARSE_TENSOR=11]="SPARSE_TENSOR",a[a.SPARSE_TENSORS=12]="SPARSE_TENSORS",function(t){!function(t){!function(t){var e;(e=t.DimensionValueType||(t.DimensionValueType={}))[e.UNKNOWN=0]="UNKNOWN",e[e.VALUE=1]="VALUE",e[e.PARAM=2]="PARAM"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.TensorDataType||(t.TensorDataType={}))[e.UNDEFINED=0]="UNDEFINED",e[e.FLOAT=1]="FLOAT",e[e.UINT8=2]="UINT8",e[e.INT8=3]="INT8",e[e.UINT16=4]="UINT16",e[e.INT16=5]="INT16",e[e.INT32=6]="INT32",e[e.INT64=7]="INT64",e[e.STRING=8]="STRING",e[e.BOOL=9]="BOOL",e[e.FLOAT16=10]="FLOAT16",e[e.DOUBLE=11]="DOUBLE",e[e.UINT32=12]="UINT32",e[e.UINT64=13]="UINT64",e[e.COMPLEX64=14]="COMPLEX64",e[e.COMPLEX128=15]="COMPLEX128",e[e.BFLOAT16=16]="BFLOAT16"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.NodeType||(t.NodeType={}))[e.Primitive=0]="Primitive",e[e.Fused=1]="Fused"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e;(e=t.TypeInfoValue||(t.TypeInfoValue={}))[e.NONE=0]="NONE",e[e.tensor_type=1]="tensor_type",e[e.sequence_type=2]="sequence_type",e[e.map_type=3]="map_type"}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsShape=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsShape=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.dim=function(e,n){var r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Dimension).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.dimLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startShape=function(t){t.startObject(1)},e.addDim=function(t,e){t.addFieldOffset(0,e,0)},e.createDimVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startDimVector=function(t,e){t.startVector(4,e,4)},e.endShape=function(t){return t.endObject()},e.createShape=function(t,n){return e.startShape(t),e.addDim(t,n),e.endShape(t)},e}();e.Shape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsDimension=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsDimension=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.value=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.DimensionValue).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.denotation=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.startDimension=function(t){t.startObject(2)},e.addValue=function(t,e){t.addFieldOffset(0,e,0)},e.addDenotation=function(t,e){t.addFieldOffset(1,e,0)},e.endDimension=function(t){return t.endObject()},e.createDimension=function(t,n,r){return e.startDimension(t),e.addValue(t,n),e.addDenotation(t,r),e.endDimension(t)},e}();e.Dimension=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsDimensionValue=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsDimensionValue=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.dimType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):t.experimental.fbs.DimensionValueType.UNKNOWN},e.prototype.dimValue=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.dimParam=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.startDimensionValue=function(t){t.startObject(3)},e.addDimType=function(e,n){e.addFieldInt8(0,n,t.experimental.fbs.DimensionValueType.UNKNOWN)},e.addDimValue=function(t,e){t.addFieldInt64(1,e,t.createLong(0,0))},e.addDimParam=function(t,e){t.addFieldOffset(2,e,0)},e.endDimensionValue=function(t){return t.endObject()},e.createDimensionValue=function(t,n,r,o){return e.startDimensionValue(t),e.addDimType(t,n),e.addDimValue(t,r),e.addDimParam(t,o),e.endDimensionValue(t)},e}();e.DimensionValue=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTensorTypeAndShape=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTensorTypeAndShape=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.elemType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.shape=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Shape).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startTensorTypeAndShape=function(t){t.startObject(2)},e.addElemType=function(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addShape=function(t,e){t.addFieldOffset(1,e,0)},e.endTensorTypeAndShape=function(t){return t.endObject()},e.createTensorTypeAndShape=function(t,n,r){return e.startTensorTypeAndShape(t),e.addElemType(t,n),e.addShape(t,r),e.endTensorTypeAndShape(t)},e}();e.TensorTypeAndShape=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsMapType=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsMapType=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.keyType=function(){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.valueType=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startMapType=function(t){t.startObject(2)},e.addKeyType=function(e,n){e.addFieldInt32(0,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addValueType=function(t,e){t.addFieldOffset(1,e,0)},e.endMapType=function(t){return t.endObject()},e.createMapType=function(t,n,r){return e.startMapType(t),e.addKeyType(t,n),e.addValueType(t,r),e.endMapType(t)},e}();e.MapType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSequenceType=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSequenceType=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.elemType=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startSequenceType=function(t){t.startObject(1)},e.addElemType=function(t,e){t.addFieldOffset(0,e,0)},e.endSequenceType=function(t){return t.endObject()},e.createSequenceType=function(t,n){return e.startSequenceType(t),e.addElemType(t,n),e.endSequenceType(t)},e}();e.SequenceType=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.prototype.nodeIndex=function(){return this.bb.readUint32(this.bb_pos)},t.prototype.srcArgIndex=function(){return this.bb.readInt32(this.bb_pos+4)},t.prototype.dstArgIndex=function(){return this.bb.readInt32(this.bb_pos+8)},t.createEdgeEnd=function(t,e,n,r){return t.prep(4,12),t.writeInt32(r),t.writeInt32(n),t.writeInt32(e),t.offset()},t}();t.EdgeEnd=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsNodeEdge=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsNodeEdge=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.nodeIndex=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.inputEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null},e.prototype.inputEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.EdgeEnd).__init(this.bb.__vector(this.bb_pos+r)+12*e,this.bb):null},e.prototype.outputEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startNodeEdge=function(t){t.startObject(3)},e.addNodeIndex=function(t,e){t.addFieldInt32(0,e,0)},e.addInputEdges=function(t,e){t.addFieldOffset(1,e,0)},e.startInputEdgesVector=function(t,e){t.startVector(12,e,4)},e.addOutputEdges=function(t,e){t.addFieldOffset(2,e,0)},e.startOutputEdgesVector=function(t,e){t.startVector(12,e,4)},e.endNodeEdge=function(t){return t.endObject()},e.createNodeEdge=function(t,n,r,o){return e.startNodeEdge(t),e.addNodeIndex(t,n),e.addInputEdges(t,r),e.addOutputEdges(t,o),e.endNodeEdge(t)},e}();e.NodeEdge=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsNode=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsNode=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.sinceVersion=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt32(this.bb_pos+t):0},e.prototype.index=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.opType=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.NodeType.Primitive},e.prototype.executionProviderType=function(t){var e=this.bb.__offset(this.bb_pos,18);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.inputs=function(t,e){var n=this.bb.__offset(this.bb_pos,20);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.inputsLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputs=function(t,e){var n=this.bb.__offset(this.bb_pos,22);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.outputsLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.attributes=function(e,n){var r=this.bb.__offset(this.bb_pos,24);return r?(n||new t.experimental.fbs.Attribute).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.attributesLength=function(){var t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputArgCounts=function(t){var e=this.bb.__offset(this.bb_pos,26);return e?this.bb.readInt32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.prototype.inputArgCountsLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputArgCountsArray=function(){var t=this.bb.__offset(this.bb_pos,26);return t?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.implicitInputs=function(t,e){var n=this.bb.__offset(this.bb_pos,28);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.implicitInputsLength=function(){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startNode=function(t){t.startObject(13)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addDomain=function(t,e){t.addFieldOffset(2,e,0)},e.addSinceVersion=function(t,e){t.addFieldInt32(3,e,0)},e.addIndex=function(t,e){t.addFieldInt32(4,e,0)},e.addOpType=function(t,e){t.addFieldOffset(5,e,0)},e.addType=function(e,n){e.addFieldInt32(6,n,t.experimental.fbs.NodeType.Primitive)},e.addExecutionProviderType=function(t,e){t.addFieldOffset(7,e,0)},e.addInputs=function(t,e){t.addFieldOffset(8,e,0)},e.createInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInputsVector=function(t,e){t.startVector(4,e,4)},e.addOutputs=function(t,e){t.addFieldOffset(9,e,0)},e.createOutputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOutputsVector=function(t,e){t.startVector(4,e,4)},e.addAttributes=function(t,e){t.addFieldOffset(10,e,0)},e.createAttributesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startAttributesVector=function(t,e){t.startVector(4,e,4)},e.addInputArgCounts=function(t,e){t.addFieldOffset(11,e,0)},e.createInputArgCountsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()},e.startInputArgCountsVector=function(t,e){t.startVector(4,e,4)},e.addImplicitInputs=function(t,e){t.addFieldOffset(12,e,0)},e.createImplicitInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startImplicitInputsVector=function(t,e){t.startVector(4,e,4)},e.endNode=function(t){return t.endObject()},e.createNode=function(t,n,r,o,i,a,s,u,c,l,f,p,h,d){return e.startNode(t),e.addName(t,n),e.addDocString(t,r),e.addDomain(t,o),e.addSinceVersion(t,i),e.addIndex(t,a),e.addOpType(t,s),e.addType(t,u),e.addExecutionProviderType(t,c),e.addInputs(t,l),e.addOutputs(t,f),e.addAttributes(t,p),e.addInputArgCounts(t,h),e.addImplicitInputs(t,d),e.endNode(t)},e}();e.Node=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsValueInfo=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsValueInfo=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(e){var n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.TypeInfo).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startValueInfo=function(t){t.startObject(3)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addType=function(t,e){t.addFieldOffset(2,e,0)},e.endValueInfo=function(t){return t.endObject()},e.createValueInfo=function(t,n,r,o){return e.startValueInfo(t),e.addName(t,n),e.addDocString(t,r),e.addType(t,o),e.endValueInfo(t)},e}();e.ValueInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTypeInfo=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTypeInfo=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.denotation=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.valueType=function(){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):t.experimental.fbs.TypeInfoValue.NONE},e.prototype.value=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__union(t,this.bb_pos+e):null},e.startTypeInfo=function(t){t.startObject(3)},e.addDenotation=function(t,e){t.addFieldOffset(0,e,0)},e.addValueType=function(e,n){e.addFieldInt8(1,n,t.experimental.fbs.TypeInfoValue.NONE)},e.addValue=function(t,e){t.addFieldOffset(2,e,0)},e.endTypeInfo=function(t){return t.endObject()},e.createTypeInfo=function(t,n,r,o){return e.startTypeInfo(t),e.addDenotation(t,n),e.addValueType(t,r),e.addValue(t,o),e.endTypeInfo(t)},e}();e.TypeInfo=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsOperatorSetId=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsOperatorSetId=function(e,n){return e.setPosition(e.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},t.prototype.version=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},t.startOperatorSetId=function(t){t.startObject(2)},t.addDomain=function(t,e){t.addFieldOffset(0,e,0)},t.addVersion=function(t,e){t.addFieldInt64(1,e,t.createLong(0,0))},t.endOperatorSetId=function(t){return t.endObject()},t.createOperatorSetId=function(e,n,r){return t.startOperatorSetId(e),t.addDomain(e,n),t.addVersion(e,r),t.endOperatorSetId(e)},t}();t.OperatorSetId=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsTensor=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsTensor=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.dims=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.dimsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.dataType=function(){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.TensorDataType.UNDEFINED},e.prototype.rawData=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.readUint8(this.bb.__vector(this.bb_pos+e)+t):0},e.prototype.rawDataLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.rawDataArray=function(){var t=this.bb.__offset(this.bb_pos,12);return t?new Uint8Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.stringData=function(t,e){var n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.stringDataLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startTensor=function(t){t.startObject(6)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addDims=function(t,e){t.addFieldOffset(2,e,0)},e.createDimsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startDimsVector=function(t,e){t.startVector(8,e,8)},e.addDataType=function(e,n){e.addFieldInt32(3,n,t.experimental.fbs.TensorDataType.UNDEFINED)},e.addRawData=function(t,e){t.addFieldOffset(4,e,0)},e.createRawDataVector=function(t,e){t.startVector(1,e.length,1);for(var n=e.length-1;n>=0;n--)t.addInt8(e[n]);return t.endVector()},e.startRawDataVector=function(t,e){t.startVector(1,e,1)},e.addStringData=function(t,e){t.addFieldOffset(5,e,0)},e.createStringDataVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startStringDataVector=function(t,e){t.startVector(4,e,4)},e.endTensor=function(t){return t.endObject()},e.createTensor=function(t,n,r,o,i,a,s){return e.startTensor(t),e.addName(t,n),e.addDocString(t,r),e.addDims(t,o),e.addDataType(t,i),e.addRawData(t,a),e.addStringData(t,s),e.endTensor(t)},e}();e.Tensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSparseTensor=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSparseTensor=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.values=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.indices=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.dims=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.dimsLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startSparseTensor=function(t){t.startObject(3)},e.addValues=function(t,e){t.addFieldOffset(0,e,0)},e.addIndices=function(t,e){t.addFieldOffset(1,e,0)},e.addDims=function(t,e){t.addFieldOffset(2,e,0)},e.createDimsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startDimsVector=function(t,e){t.startVector(8,e,8)},e.endSparseTensor=function(t){return t.endObject()},e.createSparseTensor=function(t,n,r,o){return e.startSparseTensor(t),e.addValues(t,n),e.addIndices(t,r),e.addDims(t,o),e.endSparseTensor(t)},e}();e.SparseTensor=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsAttribute=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsAttribute=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.name=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.type=function(){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):t.experimental.fbs.AttributeType.UNDEFINED},e.prototype.f=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readFloat32(this.bb_pos+t):0},e.prototype.i=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.s=function(t){var e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.t=function(e){var n=this.bb.__offset(this.bb_pos,16);return n?(e||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.g=function(e){var n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.floats=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.readFloat32(this.bb.__vector(this.bb_pos+e)+4*t):0},e.prototype.floatsLength=function(){var t=this.bb.__offset(this.bb_pos,20);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.floatsArray=function(){var t=this.bb.__offset(this.bb_pos,20);return t?new Float32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},e.prototype.ints=function(t){var e=this.bb.__offset(this.bb_pos,22);return e?this.bb.readInt64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},e.prototype.intsLength=function(){var t=this.bb.__offset(this.bb_pos,22);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.strings=function(t,e){var n=this.bb.__offset(this.bb_pos,24);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.stringsLength=function(){var t=this.bb.__offset(this.bb_pos,24);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.tensors=function(e,n){var r=this.bb.__offset(this.bb_pos,26);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.tensorsLength=function(){var t=this.bb.__offset(this.bb_pos,26);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.graphs=function(e,n){var r=this.bb.__offset(this.bb_pos,28);return r?(n||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.graphsLength=function(){var t=this.bb.__offset(this.bb_pos,28);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startAttribute=function(t){t.startObject(13)},e.addName=function(t,e){t.addFieldOffset(0,e,0)},e.addDocString=function(t,e){t.addFieldOffset(1,e,0)},e.addType=function(e,n){e.addFieldInt32(2,n,t.experimental.fbs.AttributeType.UNDEFINED)},e.addF=function(t,e){t.addFieldFloat32(3,e,0)},e.addI=function(t,e){t.addFieldInt64(4,e,t.createLong(0,0))},e.addS=function(t,e){t.addFieldOffset(5,e,0)},e.addT=function(t,e){t.addFieldOffset(6,e,0)},e.addG=function(t,e){t.addFieldOffset(7,e,0)},e.addFloats=function(t,e){t.addFieldOffset(8,e,0)},e.createFloatsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addFloat32(e[n]);return t.endVector()},e.startFloatsVector=function(t,e){t.startVector(4,e,4)},e.addInts=function(t,e){t.addFieldOffset(9,e,0)},e.createIntsVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},e.startIntsVector=function(t,e){t.startVector(8,e,8)},e.addStrings=function(t,e){t.addFieldOffset(10,e,0)},e.createStringsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startStringsVector=function(t,e){t.startVector(4,e,4)},e.addTensors=function(t,e){t.addFieldOffset(11,e,0)},e.createTensorsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startTensorsVector=function(t,e){t.startVector(4,e,4)},e.addGraphs=function(t,e){t.addFieldOffset(12,e,0)},e.createGraphsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startGraphsVector=function(t,e){t.startVector(4,e,4)},e.endAttribute=function(t){return t.endObject()},e.createAttribute=function(t,n,r,o,i,a,s,u,c,l,f,p,h,d){return e.startAttribute(t),e.addName(t,n),e.addDocString(t,r),e.addType(t,o),e.addF(t,i),e.addI(t,a),e.addS(t,s),e.addT(t,u),e.addG(t,c),e.addFloats(t,l),e.addInts(t,f),e.addStrings(t,p),e.addTensors(t,h),e.addGraphs(t,d),e.endAttribute(t)},e}();e.Attribute=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsGraph=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsGraph=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.initializers=function(e,n){var r=this.bb.__offset(this.bb_pos,4);return r?(n||new t.experimental.fbs.Tensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.initializersLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.nodeArgs=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.ValueInfo).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodeArgsLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.nodes=function(e,n){var r=this.bb.__offset(this.bb_pos,8);return r?(n||new t.experimental.fbs.Node).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodesLength=function(){var t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.maxNodeIndex=function(){var t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readUint32(this.bb_pos+t):0},e.prototype.nodeEdges=function(e,n){var r=this.bb.__offset(this.bb_pos,12);return r?(n||new t.experimental.fbs.NodeEdge).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.nodeEdgesLength=function(){var t=this.bb.__offset(this.bb_pos,12);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.inputs=function(t,e){var n=this.bb.__offset(this.bb_pos,14);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.inputsLength=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.outputs=function(t,e){var n=this.bb.__offset(this.bb_pos,16);return n?this.bb.__string(this.bb.__vector(this.bb_pos+n)+4*t,e):null},e.prototype.outputsLength=function(){var t=this.bb.__offset(this.bb_pos,16);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.sparseInitializers=function(e,n){var r=this.bb.__offset(this.bb_pos,18);return r?(n||new t.experimental.fbs.SparseTensor).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.sparseInitializersLength=function(){var t=this.bb.__offset(this.bb_pos,18);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startGraph=function(t){t.startObject(8)},e.addInitializers=function(t,e){t.addFieldOffset(0,e,0)},e.createInitializersVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInitializersVector=function(t,e){t.startVector(4,e,4)},e.addNodeArgs=function(t,e){t.addFieldOffset(1,e,0)},e.createNodeArgsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodeArgsVector=function(t,e){t.startVector(4,e,4)},e.addNodes=function(t,e){t.addFieldOffset(2,e,0)},e.createNodesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodesVector=function(t,e){t.startVector(4,e,4)},e.addMaxNodeIndex=function(t,e){t.addFieldInt32(3,e,0)},e.addNodeEdges=function(t,e){t.addFieldOffset(4,e,0)},e.createNodeEdgesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startNodeEdgesVector=function(t,e){t.startVector(4,e,4)},e.addInputs=function(t,e){t.addFieldOffset(5,e,0)},e.createInputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startInputsVector=function(t,e){t.startVector(4,e,4)},e.addOutputs=function(t,e){t.addFieldOffset(6,e,0)},e.createOutputsVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOutputsVector=function(t,e){t.startVector(4,e,4)},e.addSparseInitializers=function(t,e){t.addFieldOffset(7,e,0)},e.createSparseInitializersVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startSparseInitializersVector=function(t,e){t.startVector(4,e,4)},e.endGraph=function(t){return t.endObject()},e.createGraph=function(t,n,r,o,i,a,s,u,c){return e.startGraph(t),e.addInitializers(t,n),e.addNodeArgs(t,r),e.addNodes(t,o),e.addMaxNodeIndex(t,i),e.addNodeEdges(t,a),e.addInputs(t,s),e.addOutputs(t,u),e.addSparseInitializers(t,c),e.endGraph(t)},e}();e.Graph=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsModel=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsModel=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.irVersion=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.opsetImport=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.OperatorSetId).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.opsetImportLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.prototype.producerName=function(t){var e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.producerVersion=function(t){var e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.domain=function(t){var e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.modelVersion=function(){var t=this.bb.__offset(this.bb_pos,14);return t?this.bb.readInt64(this.bb_pos+t):this.bb.createLong(0,0)},e.prototype.docString=function(t){var e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.graph=function(e){var n=this.bb.__offset(this.bb_pos,18);return n?(e||new t.experimental.fbs.Graph).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.graphDocString=function(t){var e=this.bb.__offset(this.bb_pos,20);return e?this.bb.__string(this.bb_pos+e,t):null},e.startModel=function(t){t.startObject(9)},e.addIrVersion=function(t,e){t.addFieldInt64(0,e,t.createLong(0,0))},e.addOpsetImport=function(t,e){t.addFieldOffset(1,e,0)},e.createOpsetImportVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startOpsetImportVector=function(t,e){t.startVector(4,e,4)},e.addProducerName=function(t,e){t.addFieldOffset(2,e,0)},e.addProducerVersion=function(t,e){t.addFieldOffset(3,e,0)},e.addDomain=function(t,e){t.addFieldOffset(4,e,0)},e.addModelVersion=function(t,e){t.addFieldInt64(5,e,t.createLong(0,0))},e.addDocString=function(t,e){t.addFieldOffset(6,e,0)},e.addGraph=function(t,e){t.addFieldOffset(7,e,0)},e.addGraphDocString=function(t,e){t.addFieldOffset(8,e,0)},e.endModel=function(t){return t.endObject()},e.createModel=function(t,n,r,o,i,a,s,u,c,l){return e.startModel(t),e.addIrVersion(t,n),e.addOpsetImport(t,r),e.addProducerName(t,o),e.addProducerVersion(t,i),e.addDomain(t,a),e.addModelVersion(t,s),e.addDocString(t,u),e.addGraph(t,c),e.addGraphDocString(t,l),e.endModel(t)},e}();e.Model=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(t){!function(t){var e=function(){function t(){this.bb=null,this.bb_pos=0}return t.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},t.getRootAsKernelCreateInfos=function(e,n){return(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.getSizePrefixedRootAsKernelCreateInfos=function(e,n){return e.setPosition(e.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new t).__init(e.readInt32(e.position())+e.position(),e)},t.prototype.nodeIndices=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readUint32(this.bb.__vector(this.bb_pos+e)+4*t):0},t.prototype.nodeIndicesLength=function(){var t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__vector_len(this.bb_pos+t):0},t.prototype.nodeIndicesArray=function(){var t=this.bb.__offset(this.bb_pos,4);return t?new Uint32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+t),this.bb.__vector_len(this.bb_pos+t)):null},t.prototype.kernelDefHashes=function(t){var e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint64(this.bb.__vector(this.bb_pos+e)+8*t):this.bb.createLong(0,0)},t.prototype.kernelDefHashesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},t.startKernelCreateInfos=function(t){t.startObject(2)},t.addNodeIndices=function(t,e){t.addFieldOffset(0,e,0)},t.createNodeIndicesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addInt32(e[n]);return t.endVector()},t.startNodeIndicesVector=function(t,e){t.startVector(4,e,4)},t.addKernelDefHashes=function(t,e){t.addFieldOffset(1,e,0)},t.createKernelDefHashesVector=function(t,e){t.startVector(8,e.length,8);for(var n=e.length-1;n>=0;n--)t.addInt64(e[n]);return t.endVector()},t.startKernelDefHashesVector=function(t,e){t.startVector(8,e,8)},t.endKernelCreateInfos=function(t){return t.endObject()},t.createKernelCreateInfos=function(e,n,r){return t.startKernelCreateInfos(e),t.addNodeIndices(e,n),t.addKernelDefHashes(e,r),t.endKernelCreateInfos(e)},t}();t.KernelCreateInfos=e}(t.fbs||(t.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSubGraphSessionState=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSubGraphSessionState=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.graphId=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.sessionState=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startSubGraphSessionState=function(t){t.startObject(2)},e.addGraphId=function(t,e){t.addFieldOffset(0,e,0)},e.addSessionState=function(t,e){t.addFieldOffset(1,e,0)},e.endSubGraphSessionState=function(t){var e=t.endObject();return t.requiredField(e,4),e},e.createSubGraphSessionState=function(t,n,r){return e.startSubGraphSessionState(t),e.addGraphId(t,n),e.addSessionState(t,r),e.endSubGraphSessionState(t)},e}();e.SubGraphSessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsSessionState=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsSessionState=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.prototype.kernels=function(e){var n=this.bb.__offset(this.bb_pos,4);return n?(e||new t.experimental.fbs.KernelCreateInfos).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.subGraphSessionStates=function(e,n){var r=this.bb.__offset(this.bb_pos,6);return r?(n||new t.experimental.fbs.SubGraphSessionState).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+r)+4*e),this.bb):null},e.prototype.subGraphSessionStatesLength=function(){var t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__vector_len(this.bb_pos+t):0},e.startSessionState=function(t){t.startObject(2)},e.addKernels=function(t,e){t.addFieldOffset(0,e,0)},e.addSubGraphSessionStates=function(t,e){t.addFieldOffset(1,e,0)},e.createSubGraphSessionStatesVector=function(t,e){t.startVector(4,e.length,4);for(var n=e.length-1;n>=0;n--)t.addOffset(e[n]);return t.endVector()},e.startSubGraphSessionStatesVector=function(t,e){t.startVector(4,e,4)},e.endSessionState=function(t){return t.endObject()},e.createSessionState=function(t,n,r){return e.startSessionState(t),e.addKernels(t,n),e.addSubGraphSessionStates(t,r),e.endSessionState(t)},e}();e.SessionState=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={})),function(t){!function(e){!function(e){var n=function(){function e(){this.bb=null,this.bb_pos=0}return e.prototype.__init=function(t,e){return this.bb_pos=t,this.bb=e,this},e.getRootAsInferenceSession=function(t,n){return(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.getSizePrefixedRootAsInferenceSession=function(t,n){return t.setPosition(t.position()+s.flatbuffers.SIZE_PREFIX_LENGTH),(n||new e).__init(t.readInt32(t.position())+t.position(),t)},e.bufferHasIdentifier=function(t){return t.__has_identifier("ORTM")},e.prototype.ortVersion=function(t){var e=this.bb.__offset(this.bb_pos,4);return e?this.bb.__string(this.bb_pos+e,t):null},e.prototype.model=function(e){var n=this.bb.__offset(this.bb_pos,6);return n?(e||new t.experimental.fbs.Model).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.prototype.sessionState=function(e){var n=this.bb.__offset(this.bb_pos,8);return n?(e||new t.experimental.fbs.SessionState).__init(this.bb.__indirect(this.bb_pos+n),this.bb):null},e.startInferenceSession=function(t){t.startObject(3)},e.addOrtVersion=function(t,e){t.addFieldOffset(0,e,0)},e.addModel=function(t,e){t.addFieldOffset(1,e,0)},e.addSessionState=function(t,e){t.addFieldOffset(2,e,0)},e.endInferenceSession=function(t){return t.endObject()},e.finishInferenceSessionBuffer=function(t,e){t.finish(e,"ORTM")},e.finishSizePrefixedInferenceSessionBuffer=function(t,e){t.finish(e,"ORTM",!0)},e.createInferenceSession=function(t,n,r,o){return e.startInferenceSession(t),e.addOrtVersion(t,n),e.addModel(t,r),e.addSessionState(t,o),e.endInferenceSession(t)},e}();e.InferenceSession=n}(e.fbs||(e.fbs={}))}(t.experimental||(t.experimental={}))}(e.onnxruntime||(e.onnxruntime={}))},7448:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0){var o=r.data,i=new DataView(e.rawData.buffer,e.rawData.byteOffset,e.rawData.byteLength),a=h(e.dataType),c=e.rawData.byteLength/a;if(e.rawData.byteLength%a!=0)throw new Error("invalid buffer length");if(o.length!==c)throw new Error("buffer length mismatch");for(var f=0;f0){var a=o.data,s=new DataView(e.rawDataArray().buffer,e.rawDataArray().byteOffset,e.rawDataLength()),u=h(e.dataType()),c=e.rawDataLength()/u;if(e.rawDataLength()%u!=0)throw new Error("invalid buffer length");if(a.length!==c)throw new Error("buffer length mismatch");for(i=0;i0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.decodeUtf8String=e.MAX_CLIP=e.MIN_CLIP=e.PoolConvUtil=e.ReduceUtil=e.SplitUtil=e.MathUtil=e.ShapeUtil=e.LongUtil=e.ProtoUtil=e.GemmUtil=e.arrayCopyHelper=e.BroadcastUtil=e.MatMulUtil=e.ArrayUtil=e.assert=e.checkInputsShape=void 0;var a=n(5686),s=i(n(3720)),u=n(1446),c=n(9162);e.checkInputsShape=function(t){for(var e=[],n=1;n1&&h>1)return;u[s-l]=Math.max(p,h)}return u},t.index=function(e,n){var r=new Array(n.length);return t.fillIndex(e,n,r),r},t.fillIndex=function(t,e,n){for(var r=t.length-e.length,o=0;o=0;_--)l[_]=m%a[_],m=Math.floor(m/a[_]);g||(t.fillIndex(l,e.dims,f),h=e.get(f)),y||(t.fillIndex(l,n.dims,p),d=n.get(p)),u.set(l,r(h,d))}}return u}},t.isValidBroadcast=function(t,e){var n=t.length,r=e.length;if(n>r)return!1;for(var o=1;o<=n;o++)if(1!==t[n-o]&&t[n-o]!==e[r-o])return!1;return!0},t.getBroadcastDims=function(t,e){for(var n=t.length,r=[],o=0;o1&&1===a&&r.unshift(i)}return r},t}();e.BroadcastUtil=p,e.arrayCopyHelper=function(t,e,n,r,o){if(r<0||r>=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;ie.length)throw new Error("invalid dimension of ".concat(n," for sizeFromDimension as Tensor has ").concat(e.length," dimensions."));return t.getSizeFromDimensionRange(e,n,e.length)},t.sizeToDimension=function(e,n){if(n<0||n>e.length)throw new Error("invalid dimension of ".concat(n," for sizeToDimension as Tensor has ").concat(e.length," dimensions."));return t.getSizeFromDimensionRange(e,0,n)},t.getSizeFromDimensionRange=function(t,e,n){for(var r=1,o=e;o=0;--r)n[r]=n[r+1]*t[r+1];return n},t.transpose=function(t){return t.slice().reverse()},t.indicesToOffset=function(t,e,n){void 0===n&&(n=t.length);for(var r=0,o=0;o=e)throw new Error("unsupported axis for this operation.");return t<0?t+e:t},t.normalizeAxes=function(t,e){var n=this;return t.map((function(t){return n.normalizeAxis(t,e)}))},t.incrementIndex=function(t,e,n){if(0===e.length||0===t.length)throw new Error("Index incrementing unsupported for scalar Tensor");if(void 0===n)n=e.length;else if(n<=0||n>e.length)throw new Error("Incorrect axis to increment on");for(var r=n-1;r>=0&&(t[r]++,!(t[r]=e.length)throw new Error("the dimension with value zero exceeds the dimension size of the input tensor");o[s]=e[s]}else o[s]=n[s];a*=o[s]}}var u=t.size(e);if(-1!==i){if(u%a!=0)throw new Error("the input tensor cannot be reshaped to the requested shape. Input shape: [".concat(e,"] Output shape: [").concat(n,"]"));o[i]=u/a}else if(a!==u)throw new Error("reshapedDims and originalDims don't have matching sizes");return o},t.sortBasedOnPerm=function(t,e){return e?e.map((function(e){return t[e]})):t.slice().reverse()},t.padShape=function(t,e){var n=t.length;return t.map((function(t,r){return t+e[r]+e[r+n]}))},t.areEqual=function(t,e){return t.length===e.length&&t.every((function(t,n){return t===e[n]}))},t.validateDimsAndCalcSize=function(t){var e,n;if(t.length>6)throw new TypeError("Only rank 0 to 6 is supported for tensor shape.");var r=1;try{for(var i=o(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(!Number.isInteger(s))throw new TypeError("Invalid shape: ".concat(s," is not an integer"));if(s<0||s>2147483647)throw new TypeError("Invalid shape: length ".concat(s," is not allowed"));r*=s}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.flattenShape=function(t,e){e<0&&(e+=t.length);var n=t.reduce((function(t,e){return t*e}),1),r=t.slice(e).reduce((function(t,e){return t*e}),1);return[n/r,r]},t.squeezeShape=function(e,n){var r=new Array;n=t.normalizeAxes(n,e.length);for(var o=0;o=0;if(i&&1!==e[o])throw new Error("squeeze an axis of size different than 1");(0===n.length&&e[o]>1||n.length>0&&!i)&&r.push(e[o])}return r},t.unsqueezeShape=function(e,n){var r=new Array(e.length+n.length);r.fill(0);for(var o=0;o=r.length)throw new Error("'axes' has an out of range axis");if(0!==r[i])throw new Error("'axes' has a duplicate axis");r[i]=1}var a=0;for(o=0;o=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;i=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var a=0;a=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var a=0;a=e.length)throw new Error("sourceIndex out of bounds");if(n<0||n>=t.length)throw new Error("targetIndex out of bounds");if(r+o>e.length)throw new Error("source indices to be copied are outside bounds");if(n+o>t.length)throw new Error("target array is too small to hold result");for(var i=0;i=n.length)return a(e[i]);for(var c=n[o],l=c>=r.length?1:b.size(r.slice(c+1)),f=0;f=n.length?n.push(e[a+2]):n[a]=e[a+2];for(a=0;a=n[a]||i[a+n.length]>=n[a])throw new Error("pads should be smaller than kernel")}},t.adjustPadsBasedOnAutoPad=function(e,n,r,o,i,a){if(a){if(i.length!==2*(e.length-2))throw new Error("length of pads should be twice the length of data dimensions");if(n.length!==e.length-2)throw new Error("length of strides should be the length of data dimensions");if(o.length!==e.length-2)throw new Error("length of kernel shapes should be the length of data dimensions");for(var s=0;s0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=function(t,r,o,i){if("object"==typeof t&&null!==t){if(o.has(t))throw new Error("Circular reference in options");o.add(t)}Object.entries(t).forEach((function(t){var a=n(t,2),s=a[0],u=a[1],c=r?r+s:s;if("object"==typeof u)(0,e.iterateExtraOptions)(u,c+".",o,i);else if("string"==typeof u||"number"==typeof u)i(c,u.toString());else{if("boolean"!=typeof u)throw new Error("Can't handle extra config type: ".concat(typeof u));i(c,u?"1":"0")}}))}},2157:function(t,e,n){"use strict";var r,o=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(e,n);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,o)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&o(e,t,n);return i(e,t),e},s=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},u=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]4)throw new Error("log serverity level is not valid: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))s.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));void 0===(null==t?void 0:t.terminate)&&(s.terminate=!1);var u=0;if(void 0!==(null==t?void 0:t.tag)&&(u=(0,o.allocWasmString)(t.tag,a)),0===(n=e._OrtCreateRunOptions(s.logSeverityLevel,s.logVerbosityLevel,!!s.terminate,u)))throw new Error("Can't create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var i=(0,o.allocWasmString)(t,a),s=(0,o.allocWasmString)(r,a);if(0!==e._OrtAddRunConfigEntry(n,i,s))throw new Error("Can't set a run config entry: ".concat(t," - ").concat(r))})),[n,a]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),a.forEach(e._free),t}}},2306:function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(t){i(t)}}function s(t){try{u(r.throw(t))}catch(t){i(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.OnnxruntimeWebAssemblySessionHandler=void 0;var a,s=n(2806),u=n(8453),c=n(2850),l=n(2157),f=function(t){switch(t){case"verbose":return 0;case"info":return 1;case"warning":return 2;case"error":return 3;case"fatal":return 4;default:throw new Error("unsupported logging level: ".concat(t))}},p=function(){function t(){}return t.prototype.createSessionAllocate=function(t){return r(this,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,fetch(t)];case 1:return[4,n.sent().arrayBuffer()];case 2:return e=n.sent(),[2,(0,l.createSessionAllocate)(new Uint8Array(e))]}}))}))},t.prototype.loadModel=function(t,e){return r(this,void 0,void 0,(function(){var n,r,p,h,d;return o(this,(function(o){switch(o.label){case 0:return a?[3,2]:[4,(0,l.initOrt)(u.env.wasm.numThreads,f(u.env.logLevel))];case 1:o.sent(),a=!0,o.label=2;case 2:return"string"!=typeof t?[3,9]:"undefined"!=typeof fetch?[3,5]:[4,(0,c.promisify)(s.readFile)(t)];case 3:return n=o.sent(),[4,(0,l.createSession)(n,e)];case 4:return p=i.apply(void 0,[o.sent(),3]),this.sessionId=p[0],this.inputNames=p[1],this.outputNames=p[2],[3,8];case 5:return[4,this.createSessionAllocate(t)];case 6:return r=o.sent(),[4,(0,l.createSessionFinalize)(r,e)];case 7:h=i.apply(void 0,[o.sent(),3]),this.sessionId=h[0],this.inputNames=h[1],this.outputNames=h[2],o.label=8;case 8:return[3,11];case 9:return[4,(0,l.createSession)(t,e)];case 10:d=i.apply(void 0,[o.sent(),3]),this.sessionId=d[0],this.inputNames=d[1],this.outputNames=d[2],o.label=11;case 11:return[2]}}))}))},t.prototype.dispose=function(){return r(this,void 0,void 0,(function(){return o(this,(function(t){return[2,(0,l.releaseSession)(this.sessionId)]}))}))},t.prototype.run=function(t,e,n){return r(this,void 0,void 0,(function(){var r,i,a,s,c,f,p=this;return o(this,(function(o){switch(o.label){case 0:return r=[],i=[],Object.entries(t).forEach((function(t){var e=t[0],n=t[1],o=p.inputNames.indexOf(e);if(-1===o)throw new Error("invalid input '".concat(e,"'"));r.push(n),i.push(o)})),a=[],Object.entries(e).forEach((function(t){var e=t[0],n=p.outputNames.indexOf(e);if(-1===n)throw new Error("invalid output '".concat(e,"'"));a.push(n)})),[4,(0,l.run)(this.sessionId,i,r.map((function(t){return[t.type,t.dims,t.data]})),a,n)];case 1:for(s=o.sent(),c={},f=0;f=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;var o=n(7967),i=n(4983),a=n(6361);e.setSessionOptions=function(t){var e=(0,a.getInstance)(),n=0,s=[],u=t||{};!function(t){t.extra||(t.extra={}),t.extra.session||(t.extra.session={});var e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")}(u);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(u.graphOptimizationLevel="all");var c=function(t){switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error("unsupported graph optimization level: ".concat(t))}}(u.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(u.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(u.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(u.executionMode="sequential");var l=function(t){switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error("unsupported execution mode: ".concat(t))}}(u.executionMode),f=0;if(void 0!==(null==t?void 0:t.logId)&&(f=(0,i.allocWasmString)(t.logId,s)),void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error("log serverity level is not valid: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));if(void 0===(null==t?void 0:t.enableProfiling)&&(u.enableProfiling=!1),0===(n=e._OrtCreateSessionOptions(c,!!u.enableCpuMemArena,!!u.enableMemPattern,l,!!u.enableProfiling,0,f,u.logSeverityLevel,u.logVerbosityLevel)))throw new Error("Can't create session options");return(null==t?void 0:t.executionProviders)&&function(t,e,n){var o,s;try{for(var u=r(e),c=u.next();!c.done;c=u.next()){var l=c.value,f="string"==typeof l?l:l.name;switch(f){case"xnnpack":f="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error("not supported EP: ".concat(f))}var p=(0,i.allocWasmString)(f,n);if(0!==(0,a.getInstance)()._OrtAppendExecutionProvider(t,p))throw new Error("Can't append execution provider: ".concat(f))}}catch(t){o={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}}(n,t.executionProviders,s),void 0!==(null==t?void 0:t.extra)&&(0,o.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var o=(0,i.allocWasmString)(t,s),a=(0,i.allocWasmString)(r,s);if(0!==e._OrtAddSessionConfigEntry(n,o,a))throw new Error("Can't set a session config entry: ".concat(t," - ").concat(r))})),[n,s]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),s.forEach(e._free),t}}},4983:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;var r=n(6361);e.allocWasmString=function(t,e){var n=(0,r.getInstance)(),o=n.lengthBytesUTF8(t)+1,i=n._malloc(o);return n.stringToUTF8(t,i,o),e.push(i),i}},349:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;var i=n(586),a=n(4919),s=n(4983),u=n(6361);e.initOrt=function(t,e){var n=(0,u.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error("Can't initialize onnxruntime. error code = ".concat(n))};var c=new Map;e.createSessionAllocate=function(t){var e=(0,u.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=function(t,e){var n,o=(0,u.getInstance)(),i=0,s=0,l=[];try{if(s=(n=r((0,a.setSessionOptions)(e),2))[0],l=n[1],0===(i=o._OrtCreateSession(t[0],t[1],s)))throw new Error("Can't create a session")}finally{o._free(t[0]),o._OrtReleaseSessionOptions(s),l.forEach(o._free)}for(var f=o._OrtGetInputCount(i),p=o._OrtGetOutputCount(i),h=[],d=[],g=[],b=[],y=0;y0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]1&&function(){try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}}(),a=o&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}}(),u="string"==typeof t.wasmPaths?t.wasmPaths:void 0,y=b(!1,i),m=b(a,i),v="object"==typeof t.wasmPaths?t.wasmPaths[m]:void 0,_=!1,w=[],e>0&&w.push(new Promise((function(t){setTimeout((function(){_=!0,t()}),e)}))),w.push(new Promise((function(t,e){var r=i?p:f.default,o={locateFile:function(t,e){return i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(4154)],{type:"text/javascript"})):t===y?null!=v?v:(null!=u?u:e)+m:e+t}};if(i)if("undefined"==typeof Blob)o.mainScriptUrlOrBlob=l.join("/","ort-wasm-threaded.js");else{var a="var ortWasmThreaded=(function(){var _scriptDir;return ".concat(r.toString(),"})();");o.mainScriptUrlOrBlob=new Blob([a],{type:"text/javascript"})}r(o).then((function(e){d=!1,h=!0,c=e,t()}),(function(t){d=!1,g=!0,e(t)}))}))),[4,Promise.race(w)];case 1:if(s.sent(),_)throw new Error("WebAssembly backend initializing failed due to timeout: ".concat(e,"ms"));return[2]}}))}))},e.getInstance=function(){if(h&&c)return c;throw new Error("WebAssembly is not initialized yet.")},e.dispose=function(){var t;!h||d||g||(d=!0,null===(t=c.PThread)||void 0===t||t.terminateAllThreads(),c=void 0,d=!1,h=!1,g=!0)}},9710:function(t,e,n){"use strict";n.d(e,{Z:function(){return i}});var r=n(477),o=n.n(r);function i(){return o()('/*!\n* ONNX Runtime Web v1.14.0\n* Copyright (c) Microsoft Corporation. All rights reserved.\n* Licensed under the MIT License.\n*/\n!function(){var t={474:function(t,e,n){var _scriptDir,r=(_scriptDir=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(t){function e(){return j.buffer!=D&&N(j.buffer),P}function r(){return j.buffer!=D&&N(j.buffer),U}function a(){return j.buffer!=D&&N(j.buffer),F}function i(){return j.buffer!=D&&N(j.buffer),I}function o(){return j.buffer!=D&&N(j.buffer),W}var u,c,s;t=t||{},u||(u=void 0!==t?t:{}),u.ready=new Promise((function(t,e){c=t,s=e}));var f,l,p,h,d,y,b=Object.assign({},u),m="./this.program",v=(t,e)=>{throw e},g="object"==typeof window,w="function"==typeof importScripts,_="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,O=u.ENVIRONMENT_IS_PTHREAD||!1,S="";function A(t){return u.locateFile?u.locateFile(t,S):S+t}if(_){let e;S=w?n(908).dirname(S)+"/":"//",y=()=>{d||(h=n(384),d=n(908))},f=function(t,e){return y(),t=d.normalize(t),h.readFileSync(t,e?void 0:"utf8")},p=t=>((t=f(t,!0)).buffer||(t=new Uint8Array(t)),t),l=(t,e,n)=>{y(),t=d.normalize(t),h.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if($())throw process.exitCode=t,e;e instanceof ct||x("exiting due to exception: "+e),process.exit(t)},u.inspect=function(){return"[Emscripten Module object]"};try{e=n(925)}catch(t){throw console.error(\'The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?\'),t}n.g.Worker=e.Worker}else(g||w)&&(w?S=self.location.href:"undefined"!=typeof document&&document.currentScript&&(S=document.currentScript.src),_scriptDir&&(S=_scriptDir),S=0!==S.indexOf("blob:")?S.substr(0,S.replace(/[?#].*/,"").lastIndexOf("/")+1):"",_||(f=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},w&&(p=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),l=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)}));_&&"undefined"==typeof performance&&(n.g.performance=n(953).performance);var T=console.log.bind(console),E=console.warn.bind(console);_&&(y(),T=t=>h.writeSync(1,t+"\\n"),E=t=>h.writeSync(2,t+"\\n"));var M,C=u.print||T,x=u.printErr||E;Object.assign(u,b),b=null,u.thisProgram&&(m=u.thisProgram),u.quit&&(v=u.quit),u.wasmBinary&&(M=u.wasmBinary);var R=u.noExitRuntime||!1;"object"!=typeof WebAssembly&&at("no native wasm support detected");var j,k,D,P,U,F,I,W,H=!1,L="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function z(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function Y(t,e){return(t>>>=0)?z(r(),t,e):""}function B(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function G(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function N(t){D=t,u.HEAP8=P=new Int8Array(t),u.HEAP16=new Int16Array(t),u.HEAP32=F=new Int32Array(t),u.HEAPU8=U=new Uint8Array(t),u.HEAPU16=new Uint16Array(t),u.HEAPU32=I=new Uint32Array(t),u.HEAPF32=new Float32Array(t),u.HEAPF64=W=new Float64Array(t)}O&&(D=u.buffer);var V=u.INITIAL_MEMORY||16777216;if(O)j=u.wasmMemory,D=u.buffer;else if(u.wasmMemory)j=u.wasmMemory;else if(!((j=new WebAssembly.Memory({initial:V/65536,maximum:65536,shared:!0})).buffer instanceof SharedArrayBuffer))throw x("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),_&&console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"),Error("bad memory");j&&(D=j.buffer),V=D.byteLength,N(D);var q,X=[],J=[],Z=[],Q=[];function $(){return R||!1}function K(){var t=u.preRun.shift();X.unshift(t)}var tt,et=0,nt=null,rt=null;function at(t){throw O?postMessage({cmd:"onAbort",arg:t}):u.onAbort&&u.onAbort(t),x(t="Aborted("+t+")"),H=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),s(t),t}function it(){return tt.startsWith("data:application/octet-stream;base64,")}function ot(){var t=tt;try{if(t==tt&&M)return new Uint8Array(M);if(p)return p(t);throw"both async and sync fetching of the wasm failed"}catch(t){at(t)}}tt="ort-wasm-threaded.wasm",it()||(tt=A(tt));var ut={};function ct(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function st(t){(t=ht.Vb[t])||at(),ht.mc(t)}function ft(t){var e=ht.Cc();if(!e)return 6;ht.ac.push(e),ht.Vb[t.Ub]=e,e.Ub=t.Ub;var n={cmd:"run",start_routine:t.Ic,arg:t.zc,pthread_ptr:t.Ub};return e.$b=()=>{n.time=performance.now(),e.postMessage(n,t.Nc)},e.loaded&&(e.$b(),delete e.$b),0}function lt(t){if(O)return qt(1,1,t);$()||(ht.oc(),u.onExit&&u.onExit(t),H=!0),v(t,new ct(t))}function pt(t,e){if(!e&&O)throw bt(t),"unwind";$()||O||(me(),dt(Z),be(0),re[1].length&&ae(1,10),re[2].length&&ae(2,10),ht.oc()),lt(t)}var ht={Yb:[],ac:[],qc:[],Vb:{},fc:function(){O&&ht.Ec()},Pc:function(){},Ec:function(){ht.receiveObjectTransfer=ht.Gc,ht.threadInitTLS=ht.pc,ht.setExitStatus=ht.nc,R=!1},nc:function(){},oc:function(){for(var t of Object.values(ht.Vb))ht.mc(t);for(t of ht.Yb)t.terminate();ht.Yb=[]},mc:function(t){var e=t.Ub;delete ht.Vb[e],ht.Yb.push(t),ht.ac.splice(ht.ac.indexOf(t),1),t.Ub=0,Oe(e)},Gc:function(){},pc:function(){ht.qc.forEach((t=>t()))},Fc:function(t,e){t.onmessage=n=>{var r=(n=n.data).cmd;if(t.Ub&&(ht.Bc=t.Ub),n.targetThread&&n.targetThread!=he()){var a=ht.Vb[n.Qc];a?a.postMessage(n,n.transferList):x(\'Internal error! Worker sent a message "\'+r+\'" to target pthread \'+n.targetThread+", but that thread no longer exists!")}else"processProxyingQueue"===r?zt(n.queue):"spawnThread"===r?ft(n):"cleanupThread"===r?st(n.thread):"killThread"===r?(n=n.thread,r=ht.Vb[n],delete ht.Vb[n],r.terminate(),Oe(n),ht.ac.splice(ht.ac.indexOf(r),1),r.Ub=0):"cancelThread"===r?ht.Vb[n.thread].postMessage({cmd:"cancel"}):"loaded"===r?(t.loaded=!0,e&&e(t),t.$b&&(t.$b(),delete t.$b)):"print"===r?C("Thread "+n.threadId+": "+n.text):"printErr"===r?x("Thread "+n.threadId+": "+n.text):"alert"===r?alert("Thread "+n.threadId+": "+n.text):"setimmediate"===n.target?t.postMessage(n):"onAbort"===r?u.onAbort&&u.onAbort(n.arg):r&&x("worker sent an unknown command "+r);ht.Bc=void 0},t.onerror=t=>{throw x("worker sent an error! "+t.filename+":"+t.lineno+": "+t.message),t},_&&(t.on("message",(function(e){t.onmessage({data:e})})),t.on("error",(function(e){t.onerror(e)})),t.on("detachedExit",(function(){}))),t.postMessage({cmd:"load",urlOrBlob:u.mainScriptUrlOrBlob||_scriptDir,wasmMemory:j,wasmModule:k})},yc:function(){var t=A("ort-wasm-threaded.worker.js");ht.Yb.push(new Worker(t))},Cc:function(){return 0==ht.Yb.length&&(ht.yc(),ht.Fc(ht.Yb[0])),ht.Yb.pop()}};function dt(t){for(;0>2>>>0];t=a()[t+48>>2>>>0],Te(e,e-t),Me(e)};var mt=[];function vt(t){var e=mt[t];return e||(t>=mt.length&&(mt.length=t+1),mt[t]=e=q.get(t)),e}u.invokeEntryPoint=function(t,e){t=vt(t)(e),$()?ht.nc(t):Se(t)};var gt,wt,_t=[],Ot=0,St=0;function At(t){this.Zb=t,this.Sb=t-24,this.xc=function(t){i()[this.Sb+4>>2>>>0]=t},this.bc=function(){return i()[this.Sb+4>>2>>>0]},this.wc=function(t){i()[this.Sb+8>>2>>>0]=t},this.Dc=function(){return i()[this.Sb+8>>2>>>0]},this.rc=function(){a()[this.Sb>>2>>>0]=0},this.hc=function(t){t=t?1:0,e()[this.Sb+12>>0>>>0]=t},this.uc=function(){return 0!=e()[this.Sb+12>>0>>>0]},this.ic=function(t){t=t?1:0,e()[this.Sb+13>>0>>>0]=t},this.kc=function(){return 0!=e()[this.Sb+13>>0>>>0]},this.fc=function(t,e){this.cc(0),this.xc(t),this.wc(e),this.rc(),this.hc(!1),this.ic(!1)},this.sc=function(){Atomics.add(a(),this.Sb>>2,1)},this.Hc=function(){return 1===Atomics.sub(a(),this.Sb>>2,1)},this.cc=function(t){i()[this.Sb+16>>2>>>0]=t},this.tc=function(){return i()[this.Sb+16>>2>>>0]},this.vc=function(){if(Re(this.bc()))return i()[this.Zb>>2>>>0];var t=this.tc();return 0!==t?t:this.Zb}}function Tt(t){return ye(new At(t).Sb)}function Et(t,e,n,r){return O?qt(3,1,t,e,n,r):Mt(t,e,n,r)}function Mt(t,e,n,r){if("undefined"==typeof SharedArrayBuffer)return x("Current environment does not support SharedArrayBuffer, pthreads are not available!"),6;var a=[];return O&&0===a.length?Et(t,e,n,r):(t={Ic:n,Ub:t,zc:r,Nc:a},O?(t.Oc="spawnThread",postMessage(t,a),0):ft(t))}function Ct(t,e,n){return O?qt(4,1,t,e,n):0}function xt(t,e){if(O)return qt(5,1,t,e)}function Rt(t,e){if(O)return qt(6,1,t,e)}function jt(t,e,n){if(O)return qt(7,1,t,e,n)}function kt(t,e,n){return O?qt(8,1,t,e,n):0}function Dt(t,e){if(O)return qt(9,1,t,e)}function Pt(t,e,n){if(O)return qt(10,1,t,e,n)}function Ut(t,e,n,r){if(O)return qt(11,1,t,e,n,r)}function Ft(t,e,n,r){if(O)return qt(12,1,t,e,n,r)}function It(t,e,n,r){if(O)return qt(13,1,t,e,n,r)}function Wt(t){if(O)return qt(14,1,t)}function Ht(t,e){if(O)return qt(15,1,t,e)}function Lt(t,e,n){if(O)return qt(16,1,t,e,n)}function zt(t){Atomics.store(a(),t>>2,1),he()&&_e(t),Atomics.compareExchange(a(),t>>2,1,0)}function Yt(t){return i()[t>>>2]+4294967296*a()[t+4>>>2]}function Bt(t,e,n,r,a,i){return O?qt(17,1,t,e,n,r,a,i):-52}function Gt(t,e,n,r,a,i){if(O)return qt(18,1,t,e,n,r,a,i)}function Nt(t){var n=G(t)+1,r=de(n);return r&&B(t,e(),r,n),r}function Vt(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}if(O)return qt(19,1,t,e,n);var o=(new Date).getFullYear(),u=new Date(o,0,1),c=new Date(o,6,1);o=u.getTimezoneOffset();var s=c.getTimezoneOffset(),f=Math.max(o,s);a()[t>>2>>>0]=60*f,a()[e>>2>>>0]=Number(o!=s),t=r(u),e=r(c),t=Nt(t),e=Nt(e),s>2>>>0]=t,i()[n+4>>2>>>0]=e):(i()[n>>2>>>0]=e,i()[n+4>>2>>>0]=t)}function qt(t,e){var n=arguments.length-2,r=arguments;return yt((()=>{for(var a=Ce(8*n),i=a>>3,u=0;u>>0]=c}return we(t,n,a,e)}))}u.executeNotifiedProxyingQueue=zt,wt=_?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:O?()=>performance.now()-u.__performance_now_clock_drift:()=>performance.now();var Xt,Jt=[],Zt={};function Qt(){if(!Xt){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:m||"./this.program"};for(t in Zt)void 0===Zt[t]?delete e[t]:e[t]=Zt[t];var n=[];for(t in e)n.push(t+"="+e[t]);Xt=n}return Xt}function $t(t,n){if(O)return qt(20,1,t,n);var r=0;return Qt().forEach((function(a,o){var u=n+r;for(o=i()[t+4*o>>2>>>0]=u,u=0;u>0>>>0]=a.charCodeAt(u);e()[o>>0>>>0]=0,r+=a.length+1})),0}function Kt(t,e){if(O)return qt(21,1,t,e);var n=Qt();i()[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),i()[e>>2>>>0]=r,0}function te(t){return O?qt(22,1,t):52}function ee(t,e,n,r){return O?qt(23,1,t,e,n,r):52}function ne(t,e,n,r,a){return O?qt(24,1,t,e,n,r,a):70}var re=[null,[],[]];function ae(t,e){var n=re[t];0===e||10===e?((1===t?C:x)(z(n,0)),n.length=0):n.push(e)}function ie(t,e,n,a){if(O)return qt(25,1,t,e,n,a);for(var o=0,u=0;u>2>>>0],s=i()[e+4>>2>>>0];e+=8;for(var f=0;f>>0]);o+=s}return i()[a>>2>>>0]=o,0}var oe=0;function ue(t){return 0==t%4&&(0!=t%100||0==t%400)}var ce=[31,29,31,30,31,30,31,31,30,31,30,31],se=[31,28,31,30,31,30,31,31,30,31,30,31];function fe(t,n,r,i){function o(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=s(new Date(t.getFullYear(),0,4)),n=s(n),0>=c(e,t)?0>=c(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var l=a()[i+40>>2>>>0];for(var p in i={Lc:a()[i>>2>>>0],Kc:a()[i+4>>2>>>0],dc:a()[i+8>>2>>>0],jc:a()[i+12>>2>>>0],ec:a()[i+16>>2>>>0],Xb:a()[i+20>>2>>>0],Tb:a()[i+24>>2>>>0],Wb:a()[i+28>>2>>>0],Rc:a()[i+32>>2>>>0],Jc:a()[i+36>>2>>>0],Mc:l?Y(l):""},r=Y(r),l={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(p,"g"),l[p]);var h="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),d="January February March April May June July August September October November December".split(" ");for(p in l={"%a":function(t){return h[t.Tb].substring(0,3)},"%A":function(t){return h[t.Tb]},"%b":function(t){return d[t.ec].substring(0,3)},"%B":function(t){return d[t.ec]},"%C":function(t){return u((t.Xb+1900)/100|0,2)},"%d":function(t){return u(t.jc,2)},"%e":function(t){return o(t.jc,2," ")},"%g":function(t){return f(t).toString().substring(2)},"%G":function(t){return f(t)},"%H":function(t){return u(t.dc,2)},"%I":function(t){return 0==(t=t.dc)?t=12:12t.dc?"AM":"PM"},"%S":function(t){return u(t.Lc,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Tb||7},"%U":function(t){return u(Math.floor((t.Wb+7-t.Tb)/7),2)},"%V":function(t){var e=Math.floor((t.Wb+7-(t.Tb+6)%7)/7);if(2>=(t.Tb+371-t.Wb-2)%7&&e++,e)53==e&&(4==(n=(t.Tb+371-t.Wb)%7)||3==n&&ue(t.Xb)||(e=1));else{e=52;var n=(t.Tb+7-t.Wb-1)%7;(4==n||5==n&&ue(t.Xb%400-1))&&e++}return u(e,2)},"%w":function(t){return t.Tb},"%W":function(t){return u(Math.floor((t.Wb+7-(t.Tb+6)%7)/7),2)},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var e=0<=(t=t.Jc);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.Mc},"%%":function(){return"%"}},r=r.replace(/%%/g,"\\0\\0"),l)r.includes(p)&&(r=r.replace(new RegExp(p,"g"),l[p](i)));return p=function(t){var e=Array(G(t)+1);return B(t,e,0,e.length),e}(r=r.replace(/\\0\\0/g,"%")),p.length>n?0:(function(t,n){e().set(t,n>>>0)}(p,t),p.length-1)}ht.fc();var le=[null,lt,bt,Et,Ct,xt,Rt,jt,kt,Dt,Pt,Ut,Ft,It,Wt,Ht,Lt,Bt,Gt,Vt,$t,Kt,te,ee,ne,ie],pe={b:function(t){return de(t+24)+24},n:function(t){return(t=new At(t)).uc()||(t.hc(!0),Ot--),t.ic(!1),_t.push(t),t.sc(),t.vc()},ma:function(t){throw x("Unexpected exception thrown, this is not properly supported - aborting"),H=!0,t},x:function(){Ae(0);var t=_t.pop();if(t.Hc()&&!t.kc()){var e=t.Dc();e&&vt(e)(t.Zb),Tt(t.Zb)}St=0},e:function(){var t=St;if(!t)return oe=0;var e=new At(t);e.cc(t);var n=e.bc();if(!n)return oe=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;azt(r)));else if(O)postMessage({targetThread:t,cmd:"processProxyingQueue",queue:r});else{if(!(t=ht.Vb[t]))return;t.postMessage({cmd:"processProxyingQueue",queue:r})}return 1},Ea:function(){return-1},Pa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getUTCSeconds(),a()[e+4>>2>>>0]=t.getUTCMinutes(),a()[e+8>>2>>>0]=t.getUTCHours(),a()[e+12>>2>>>0]=t.getUTCDate(),a()[e+16>>2>>>0]=t.getUTCMonth(),a()[e+20>>2>>>0]=t.getUTCFullYear()-1900,a()[e+24>>2>>>0]=t.getUTCDay(),t=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0,a()[e+28>>2>>>0]=t},Qa:function(t,e){t=new Date(1e3*Yt(t)),a()[e>>2>>>0]=t.getSeconds(),a()[e+4>>2>>>0]=t.getMinutes(),a()[e+8>>2>>>0]=t.getHours(),a()[e+12>>2>>>0]=t.getDate(),a()[e+16>>2>>>0]=t.getMonth(),a()[e+20>>2>>>0]=t.getFullYear()-1900,a()[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1),r=(t.getTime()-n.getTime())/864e5|0;a()[e+28>>2>>>0]=r,a()[e+36>>2>>>0]=-60*t.getTimezoneOffset(),r=new Date(t.getFullYear(),6,1).getTimezoneOffset(),t=0|(r!=(n=n.getTimezoneOffset())&&t.getTimezoneOffset()==Math.min(n,r)),a()[e+32>>2>>>0]=t},Ra:function(t){var e=new Date(a()[t+20>>2>>>0]+1900,a()[t+16>>2>>>0],a()[t+12>>2>>>0],a()[t+8>>2>>>0],a()[t+4>>2>>>0],a()[t>>2>>>0],0),n=a()[t+32>>2>>>0],r=e.getTimezoneOffset(),i=new Date(e.getFullYear(),0,1),o=new Date(e.getFullYear(),6,1).getTimezoneOffset(),u=i.getTimezoneOffset(),c=Math.min(u,o);return 0>n?a()[t+32>>2>>>0]=Number(o!=u&&c==r):0>2>>>0]=e.getDay(),n=(e.getTime()-i.getTime())/864e5|0,a()[t+28>>2>>>0]=n,a()[t>>2>>>0]=e.getSeconds(),a()[t+4>>2>>>0]=e.getMinutes(),a()[t+8>>2>>>0]=e.getHours(),a()[t+12>>2>>>0]=e.getDate(),a()[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},Aa:Bt,Ba:Gt,Sa:function t(e,n,r){t.Ac||(t.Ac=!0,Vt(e,n,r))},y:function(){at("")},U:function(){if(!_&&!w){var t="Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";gt||(gt={}),gt[t]||(gt[t]=1,_&&(t="warning: "+t),x(t))}},ra:function(){return 4294901760},B:wt,Ia:function(t,e,n){r().copyWithin(t>>>0,e>>>0,e+n>>>0)},F:function(){return _?n(993).cpus().length:navigator.hardwareConcurrency},Da:function(t,e,n){Jt.length=e,n>>=3;for(var r=0;r>>0];return(0>t?ut[-t-1]:le[t]).apply(null,Jt)},qa:function(t){var e=r().length;if((t>>>=0)<=e||4294901760=n;n*=2){var a=e*(1+.2/n);a=Math.min(a,t+100663296);var i=Math;a=Math.max(t,a),i=i.min.call(i,4294901760,a+(65536-a%65536)%65536);t:{try{j.grow(i-D.byteLength+65535>>>16),N(j.buffer);var o=1;break t}catch(t){}o=void 0}if(o)return!0}return!1},Na:function(){throw"unwind"},Ga:$t,Ha:Kt,J:pt,I:te,S:ee,ga:ne,R:ie,d:function(){return oe},na:function t(r,a){t.lc||(t.lc=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(_)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>at("randomDevice")}());for(var i=0;i>0>>>0]=t.lc();return 0},ia:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},ja:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},K:function(t){var e=Ee();try{return vt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},f:function(t,e){var n=Ee();try{return vt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},P:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},Q:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},k:function(t,e,n){var r=Ee();try{return vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},p:function(t,e,n,r){var a=Ee();try{return vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},q:function(t,e,n,r,a){var i=Ee();try{return vt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},N:function(t,e,n,r,a,i){var o=Ee();try{return vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},s:function(t,e,n,r,a,i){var o=Ee();try{return vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},w:function(t,e,n,r,a,i,o){var u=Ee();try{return vt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},L:function(t,e,n,r,a,i,o,u){var c=Ee();try{return vt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},E:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=Ee();try{return vt(t)(e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(Me(p),t!==t+0)throw t;Ae(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=Ee();try{return He(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},_:function(t,e,n,r,a,i,o){var u=Ee();try{return ke(t,e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},Z:function(t,e,n,r,a){var i=Ee();try{return Le(t,e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},ca:function(t,e,n,r){var a=Ee();try{return Ie(t,e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},$:function(t){var e=Ee();try{return je(t)}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},ba:function(t,e){var n=Ee();try{return We(t,e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},Y:function(t,e,n){var r=Ee();try{return De(t,e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},g:function(t){var e=Ee();try{vt(t)()}catch(t){if(Me(e),t!==t+0)throw t;Ae(1,0)}},r:function(t,e){var n=Ee();try{vt(t)(e)}catch(t){if(Me(n),t!==t+0)throw t;Ae(1,0)}},i:function(t,e,n){var r=Ee();try{vt(t)(e,n)}catch(t){if(Me(r),t!==t+0)throw t;Ae(1,0)}},ha:function(t,e,n,r){var a=Ee();try{vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},m:function(t,e,n,r){var a=Ee();try{vt(t)(e,n,r)}catch(t){if(Me(a),t!==t+0)throw t;Ae(1,0)}},v:function(t,e,n,r,a){var i=Ee();try{vt(t)(e,n,r,a)}catch(t){if(Me(i),t!==t+0)throw t;Ae(1,0)}},u:function(t,e,n,r,a,i){var o=Ee();try{vt(t)(e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},O:function(t,e,n,r,a,i,o){var u=Ee();try{vt(t)(e,n,r,a,i,o)}catch(t){if(Me(u),t!==t+0)throw t;Ae(1,0)}},A:function(t,e,n,r,a,i,o,u){var c=Ee();try{vt(t)(e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},ka:function(t,e,n,r,a,i,o,u,c){var s=Ee();try{vt(t)(e,n,r,a,i,o,u,c)}catch(t){if(Me(s),t!==t+0)throw t;Ae(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,f){var l=Ee();try{vt(t)(e,n,r,a,i,o,u,c,s,f)}catch(t){if(Me(l),t!==t+0)throw t;Ae(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,f,l,p,h,d,y){var b=Ee();try{vt(t)(e,n,r,a,i,o,u,c,s,f,l,p,h,d,y)}catch(t){if(Me(b),t!==t+0)throw t;Ae(1,0)}},fa:function(t,e,n,r,a,i,o,u){var c=Ee();try{Pe(t,e,n,r,a,i,o,u)}catch(t){if(Me(c),t!==t+0)throw t;Ae(1,0)}},da:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=Ee();try{Fe(t,e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(Me(p),t!==t+0)throw t;Ae(1,0)}},ea:function(t,e,n,r,a,i){var o=Ee();try{Ue(t,e,n,r,a,i)}catch(t){if(Me(o),t!==t+0)throw t;Ae(1,0)}},o:function(t){return t},a:j||u.wasmMemory,G:function(t){oe=t},la:fe,z:function(t,e,n,r){return fe(t,e,n,r)}};!function(){function t(t,e){u.asm=t.exports,ht.qc.push(u.asm.sb),q=u.asm.ub,J.unshift(u.asm.Va),k=e,O||(et--,u.monitorRunDependencies&&u.monitorRunDependencies(et),0==et&&(null!==nt&&(clearInterval(nt),nt=null),rt&&(t=rt,rt=null,t())))}function e(e){t(e.instance,e.module)}function n(t){return function(){if(!M&&(g||w)){if("function"==typeof fetch&&!tt.startsWith("file://"))return fetch(tt,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+tt+"\'";return t.arrayBuffer()})).catch((function(){return ot()}));if(l)return new Promise((function(t,e){l(tt,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return ot()}))}().then((function(t){return WebAssembly.instantiate(t,r)})).then((function(t){return t})).then(t,(function(t){x("failed to asynchronously prepare wasm: "+t),at(t)}))}var r={a:pe};if(O||(et++,u.monitorRunDependencies&&u.monitorRunDependencies(et)),u.instantiateWasm)try{return u.instantiateWasm(r,t)}catch(t){return x("Module.instantiateWasm callback failed with error: "+t),!1}(M||"function"!=typeof WebAssembly.instantiateStreaming||it()||tt.startsWith("file://")||_||"function"!=typeof fetch?n(e):fetch(tt,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,r).then(e,(function(t){return x("wasm streaming compile failed: "+t),x("falling back to ArrayBuffer instantiation"),n(e)}))}))).catch(s)}(),u.___wasm_call_ctors=function(){return(u.___wasm_call_ctors=u.asm.Va).apply(null,arguments)},u._OrtInit=function(){return(u._OrtInit=u.asm.Wa).apply(null,arguments)},u._OrtCreateSessionOptions=function(){return(u._OrtCreateSessionOptions=u.asm.Xa).apply(null,arguments)},u._OrtAppendExecutionProvider=function(){return(u._OrtAppendExecutionProvider=u.asm.Ya).apply(null,arguments)},u._OrtAddSessionConfigEntry=function(){return(u._OrtAddSessionConfigEntry=u.asm.Za).apply(null,arguments)},u._OrtReleaseSessionOptions=function(){return(u._OrtReleaseSessionOptions=u.asm._a).apply(null,arguments)},u._OrtCreateSession=function(){return(u._OrtCreateSession=u.asm.$a).apply(null,arguments)},u._OrtReleaseSession=function(){return(u._OrtReleaseSession=u.asm.ab).apply(null,arguments)},u._OrtGetInputCount=function(){return(u._OrtGetInputCount=u.asm.bb).apply(null,arguments)},u._OrtGetOutputCount=function(){return(u._OrtGetOutputCount=u.asm.cb).apply(null,arguments)},u._OrtGetInputName=function(){return(u._OrtGetInputName=u.asm.db).apply(null,arguments)},u._OrtGetOutputName=function(){return(u._OrtGetOutputName=u.asm.eb).apply(null,arguments)},u._OrtFree=function(){return(u._OrtFree=u.asm.fb).apply(null,arguments)},u._OrtCreateTensor=function(){return(u._OrtCreateTensor=u.asm.gb).apply(null,arguments)},u._OrtGetTensorData=function(){return(u._OrtGetTensorData=u.asm.hb).apply(null,arguments)},u._OrtReleaseTensor=function(){return(u._OrtReleaseTensor=u.asm.ib).apply(null,arguments)},u._OrtCreateRunOptions=function(){return(u._OrtCreateRunOptions=u.asm.jb).apply(null,arguments)},u._OrtAddRunConfigEntry=function(){return(u._OrtAddRunConfigEntry=u.asm.kb).apply(null,arguments)},u._OrtReleaseRunOptions=function(){return(u._OrtReleaseRunOptions=u.asm.lb).apply(null,arguments)},u._OrtRun=function(){return(u._OrtRun=u.asm.mb).apply(null,arguments)},u._OrtEndProfiling=function(){return(u._OrtEndProfiling=u.asm.nb).apply(null,arguments)};var he=u._pthread_self=function(){return(he=u._pthread_self=u.asm.ob).apply(null,arguments)},de=u._malloc=function(){return(de=u._malloc=u.asm.pb).apply(null,arguments)},ye=u._free=function(){return(ye=u._free=u.asm.qb).apply(null,arguments)},be=u._fflush=function(){return(be=u._fflush=u.asm.rb).apply(null,arguments)};u.__emscripten_tls_init=function(){return(u.__emscripten_tls_init=u.asm.sb).apply(null,arguments)};var me=u.___funcs_on_exit=function(){return(me=u.___funcs_on_exit=u.asm.tb).apply(null,arguments)},ve=u.__emscripten_thread_init=function(){return(ve=u.__emscripten_thread_init=u.asm.vb).apply(null,arguments)};u.__emscripten_thread_crashed=function(){return(u.__emscripten_thread_crashed=u.asm.wb).apply(null,arguments)};var ge,we=u._emscripten_run_in_main_runtime_thread_js=function(){return(we=u._emscripten_run_in_main_runtime_thread_js=u.asm.xb).apply(null,arguments)},_e=u.__emscripten_proxy_execute_task_queue=function(){return(_e=u.__emscripten_proxy_execute_task_queue=u.asm.yb).apply(null,arguments)},Oe=u.__emscripten_thread_free_data=function(){return(Oe=u.__emscripten_thread_free_data=u.asm.zb).apply(null,arguments)},Se=u.__emscripten_thread_exit=function(){return(Se=u.__emscripten_thread_exit=u.asm.Ab).apply(null,arguments)},Ae=u._setThrew=function(){return(Ae=u._setThrew=u.asm.Bb).apply(null,arguments)},Te=u._emscripten_stack_set_limits=function(){return(Te=u._emscripten_stack_set_limits=u.asm.Cb).apply(null,arguments)},Ee=u.stackSave=function(){return(Ee=u.stackSave=u.asm.Db).apply(null,arguments)},Me=u.stackRestore=function(){return(Me=u.stackRestore=u.asm.Eb).apply(null,arguments)},Ce=u.stackAlloc=function(){return(Ce=u.stackAlloc=u.asm.Fb).apply(null,arguments)},xe=u.___cxa_can_catch=function(){return(xe=u.___cxa_can_catch=u.asm.Gb).apply(null,arguments)},Re=u.___cxa_is_pointer_type=function(){return(Re=u.___cxa_is_pointer_type=u.asm.Hb).apply(null,arguments)},je=u.dynCall_j=function(){return(je=u.dynCall_j=u.asm.Ib).apply(null,arguments)},ke=u.dynCall_iiiiij=function(){return(ke=u.dynCall_iiiiij=u.asm.Jb).apply(null,arguments)},De=u.dynCall_jii=function(){return(De=u.dynCall_jii=u.asm.Kb).apply(null,arguments)},Pe=u.dynCall_viiiiij=function(){return(Pe=u.dynCall_viiiiij=u.asm.Lb).apply(null,arguments)},Ue=u.dynCall_vjji=function(){return(Ue=u.dynCall_vjji=u.asm.Mb).apply(null,arguments)},Fe=u.dynCall_viiijjjii=function(){return(Fe=u.dynCall_viiijjjii=u.asm.Nb).apply(null,arguments)},Ie=u.dynCall_iij=function(){return(Ie=u.dynCall_iij=u.asm.Ob).apply(null,arguments)},We=u.dynCall_ji=function(){return(We=u.dynCall_ji=u.asm.Pb).apply(null,arguments)},He=u.dynCall_iiiiiij=function(){return(He=u.dynCall_iiiiiij=u.asm.Qb).apply(null,arguments)},Le=u.dynCall_iiij=function(){return(Le=u.dynCall_iiij=u.asm.Rb).apply(null,arguments)};function ze(){function t(){if(!ge&&(ge=!0,u.calledRun=!0,!H)&&(O||dt(J),c(u),u.onRuntimeInitialized&&u.onRuntimeInitialized(),!O)){if(u.postRun)for("function"==typeof u.postRun&&(u.postRun=[u.postRun]);u.postRun.length;){var t=u.postRun.shift();Q.unshift(t)}dt(Q)}}if(!(0{throw e},d="object"==typeof window,y="function"==typeof importScripts,b="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,m="";b?(m=y?n(908).dirname(m)+"/":"//",f=()=>{s||(c=n(384),s=n(908))},i=function(t,e){return f(),t=s.normalize(t),c.readFileSync(t,e?void 0:"utf8")},u=t=>((t=i(t,!0)).buffer||(t=new Uint8Array(t)),t),o=(t,e,n)=>{f(),t=s.normalize(t),c.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},1{if(_||0{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},y&&(u=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),o=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var v,g=e.print||console.log.bind(console),w=e.printErr||console.warn.bind(console);Object.assign(e,l),l=null,e.thisProgram&&(p=e.thisProgram),e.quit&&(h=e.quit),e.wasmBinary&&(v=e.wasmBinary);var _=e.noExitRuntime||!1;"object"!=typeof WebAssembly&&V("no native wasm support detected");var O,S,A,T,E,M,C=!1,x="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function R(t,e,n){var r=(e>>>=0)+n;for(n=e;t[n]&&!(n>=r);)++n;if(16(a=224==(240&a)?(15&a)<<12|i<<6|o:(7&a)<<18|i<<12|o<<6|63&t[e++])?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296|a>>10,56320|1023&a))}}else r+=String.fromCharCode(a)}return r}function j(t,e){return(t>>>=0)?R(T,t,e):""}function k(t,e,n,r){if(!(0>>=0;r=n+r-1;for(var i=0;i=o&&(o=65536+((1023&o)<<10)|1023&t.charCodeAt(++i)),127>=o){if(n>=r)break;e[n++>>>0]=o}else{if(2047>=o){if(n+1>=r)break;e[n++>>>0]=192|o>>6}else{if(65535>=o){if(n+2>=r)break;e[n++>>>0]=224|o>>12}else{if(n+3>=r)break;e[n++>>>0]=240|o>>18,e[n++>>>0]=128|o>>12&63}e[n++>>>0]=128|o>>6&63}e[n++>>>0]=128|63&o}}return e[n>>>0]=0,n-a}function D(t){for(var e=0,n=0;n=r?e++:2047>=r?e+=2:55296<=r&&57343>=r?(e+=4,++n):e+=3}return e}function P(){var t=O.buffer;S=t,e.HEAP8=A=new Int8Array(t),e.HEAP16=new Int16Array(t),e.HEAP32=E=new Int32Array(t),e.HEAPU8=T=new Uint8Array(t),e.HEAPU16=new Uint16Array(t),e.HEAPU32=M=new Uint32Array(t),e.HEAPF32=new Float32Array(t),e.HEAPF64=new Float64Array(t)}var U,F=[],I=[],W=[],H=[],L=0;function z(){var t=e.preRun.shift();F.unshift(t)}var Y,B=0,G=null,N=null;function V(t){throw e.onAbort&&e.onAbort(t),w(t="Aborted("+t+")"),C=!0,t=new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info."),a(t),t}function q(){return Y.startsWith("data:application/octet-stream;base64,")}if(Y="ort-wasm.wasm",!q()){var X=Y;Y=e.locateFile?e.locateFile(X,m):m+X}function J(){var t=Y;try{if(t==Y&&v)return new Uint8Array(v);if(u)return u(t);throw"both async and sync fetching of the wasm failed"}catch(t){V(t)}}function Z(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Q(t){for(;0>2>>>0]=t},this.Eb=function(){return M[this.zb+4>>2>>>0]},this.Sb=function(t){M[this.zb+8>>2>>>0]=t},this.Wb=function(){return M[this.zb+8>>2>>>0]},this.Tb=function(){E[this.zb>>2>>>0]=0},this.Ib=function(t){A[this.zb+12>>0>>>0]=t?1:0},this.Pb=function(){return 0!=A[this.zb+12>>0>>>0]},this.Jb=function(t){A[this.zb+13>>0>>>0]=t?1:0},this.Lb=function(){return 0!=A[this.zb+13>>0>>>0]},this.Rb=function(t,e){this.Fb(0),this.Ub(t),this.Sb(e),this.Tb(),this.Ib(!1),this.Jb(!1)},this.Nb=function(){E[this.zb>>2>>>0]+=1},this.Xb=function(){var t=E[this.zb>>2>>>0];return E[this.zb>>2>>>0]=t-1,1===t},this.Fb=function(t){M[this.zb+16>>2>>>0]=t},this.Ob=function(){return M[this.zb+16>>2>>>0]},this.Qb=function(){if(Mt(this.Eb()))return M[this.Db>>2>>>0];var t=this.Ob();return 0!==t?t:this.Db}}function nt(t){return gt(new et(t).zb)}var rt=[];function at(t){var e=rt[t];return e||(t>=rt.length&&(rt.length=t+1),rt[t]=e=U.get(t)),e}function it(t){var e=D(t)+1,n=vt(e);return n&&k(t,A,n,e),n}var ot={};function ut(){if(!ct){var t,e={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:p||"./this.program"};for(t in ot)void 0===ot[t]?delete e[t]:e[t]=ot[t];var n=[];for(t in e)n.push(t+"="+e[t]);ct=n}return ct}var ct,st=[null,[],[]];function ft(t,e){var n=st[t];0===e||10===e?((1===t?g:w)(R(n,0)),n.length=0):n.push(e)}var lt=0;function pt(t){return 0==t%4&&(0!=t%100||0==t%400)}var ht=[31,29,31,30,31,30,31,31,30,31,30,31],dt=[31,28,31,30,31,30,31,31,30,31,30,31];function yt(t,e,n,r){function a(t,e,n){for(t="number"==typeof t?t.toString():t||"";t.lengtht?-1:0r-t.getDate())){t.setDate(t.getDate()+e);break}e-=r-t.getDate()+1,t.setDate(1),11>n?t.setMonth(n+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return n=new Date(t.getFullYear()+1,0,4),e=u(new Date(t.getFullYear(),0,4)),n=u(n),0>=o(e,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var s=E[r+40>>2>>>0];for(var f in r={$b:E[r>>2>>>0],Zb:E[r+4>>2>>>0],Gb:E[r+8>>2>>>0],Kb:E[r+12>>2>>>0],Hb:E[r+16>>2>>>0],Cb:E[r+20>>2>>>0],Ab:E[r+24>>2>>>0],Bb:E[r+28>>2>>>0],bc:E[r+32>>2>>>0],Yb:E[r+36>>2>>>0],ac:s?j(s):""},n=j(n),s={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})n=n.replace(new RegExp(f,"g"),s[f]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),p="January February March April May June July August September October November December".split(" ");for(f in s={"%a":function(t){return l[t.Ab].substring(0,3)},"%A":function(t){return l[t.Ab]},"%b":function(t){return p[t.Hb].substring(0,3)},"%B":function(t){return p[t.Hb]},"%C":function(t){return i((t.Cb+1900)/100|0,2)},"%d":function(t){return i(t.Kb,2)},"%e":function(t){return a(t.Kb,2," ")},"%g":function(t){return c(t).toString().substring(2)},"%G":function(t){return c(t)},"%H":function(t){return i(t.Gb,2)},"%I":function(t){return 0==(t=t.Gb)?t=12:12t.Gb?"AM":"PM"},"%S":function(t){return i(t.$b,2)},"%t":function(){return"\\t"},"%u":function(t){return t.Ab||7},"%U":function(t){return i(Math.floor((t.Bb+7-t.Ab)/7),2)},"%V":function(t){var e=Math.floor((t.Bb+7-(t.Ab+6)%7)/7);if(2>=(t.Ab+371-t.Bb-2)%7&&e++,e)53==e&&(4==(n=(t.Ab+371-t.Bb)%7)||3==n&&pt(t.Cb)||(e=1));else{e=52;var n=(t.Ab+7-t.Bb-1)%7;(4==n||5==n&&pt(t.Cb%400-1))&&e++}return i(e,2)},"%w":function(t){return t.Ab},"%W":function(t){return i(Math.floor((t.Bb+7-(t.Ab+6)%7)/7),2)},"%y":function(t){return(t.Cb+1900).toString().substring(2)},"%Y":function(t){return t.Cb+1900},"%z":function(t){var e=0<=(t=t.Yb);return t=Math.abs(t)/60,(e?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.ac},"%%":function(){return"%"}},n=n.replace(/%%/g,"\\0\\0"),s)n.includes(f)&&(n=n.replace(new RegExp(f,"g"),s[f](r)));return f=function(t){var e=Array(D(t)+1);return k(t,e,0,e.length),e}(n=n.replace(/\\0\\0/g,"%")),f.length>e?0:(A.set(f,t>>>0),f.length-1)}var bt={a:function(t){return vt(t+24)+24},m:function(t){return(t=new et(t)).Pb()||(t.Ib(!0),K--),t.Jb(!1),$.push(t),t.Nb(),t.Qb()},ia:function(t){throw w("Unexpected exception thrown, this is not properly supported - aborting"),C=!0,t},w:function(){Ot(0);var t=$.pop();if(t.Xb()&&!t.Lb()){var e=t.Wb();e&&at(e)(t.Db),nt(t.Db)}tt=0},d:function(){var t=tt;if(!t)return lt=0;var e=new et(t);e.Fb(t);var n=e.Eb();if(!n)return lt=0,t;for(var r=Array.prototype.slice.call(arguments),a=0;a>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getUTCSeconds(),E[e+4>>2>>>0]=t.getUTCMinutes(),E[e+8>>2>>>0]=t.getUTCHours(),E[e+12>>2>>>0]=t.getUTCDate(),E[e+16>>2>>>0]=t.getUTCMonth(),E[e+20>>2>>>0]=t.getUTCFullYear()-1900,E[e+24>>2>>>0]=t.getUTCDay(),E[e+28>>2>>>0]=(t.getTime()-Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0))/864e5|0},Ea:function(t,e){t=new Date(1e3*(M[t>>>2]+4294967296*E[t+4>>>2])),E[e>>2>>>0]=t.getSeconds(),E[e+4>>2>>>0]=t.getMinutes(),E[e+8>>2>>>0]=t.getHours(),E[e+12>>2>>>0]=t.getDate(),E[e+16>>2>>>0]=t.getMonth(),E[e+20>>2>>>0]=t.getFullYear()-1900,E[e+24>>2>>>0]=t.getDay();var n=new Date(t.getFullYear(),0,1);E[e+28>>2>>>0]=(t.getTime()-n.getTime())/864e5|0,E[e+36>>2>>>0]=-60*t.getTimezoneOffset();var r=new Date(t.getFullYear(),6,1).getTimezoneOffset();n=n.getTimezoneOffset(),E[e+32>>2>>>0]=0|(r!=n&&t.getTimezoneOffset()==Math.min(n,r))},Fa:function(t){var e=new Date(E[t+20>>2>>>0]+1900,E[t+16>>2>>>0],E[t+12>>2>>>0],E[t+8>>2>>>0],E[t+4>>2>>>0],E[t>>2>>>0],0),n=E[t+32>>2>>>0],r=e.getTimezoneOffset(),a=new Date(e.getFullYear(),0,1),i=new Date(e.getFullYear(),6,1).getTimezoneOffset(),o=a.getTimezoneOffset(),u=Math.min(o,i);return 0>n?E[t+32>>2>>>0]=Number(i!=o&&u==r):0>2>>>0]=e.getDay(),E[t+28>>2>>>0]=(e.getTime()-a.getTime())/864e5|0,E[t>>2>>>0]=e.getSeconds(),E[t+4>>2>>>0]=e.getMinutes(),E[t+8>>2>>>0]=e.getHours(),E[t+12>>2>>>0]=e.getDate(),E[t+16>>2>>>0]=e.getMonth(),e.getTime()/1e3|0},sa:function(){return-52},ta:function(){},Ga:function t(e,n,r){t.Vb||(t.Vb=!0,function(t,e,n){function r(t){return(t=t.toTimeString().match(/\\(([A-Za-z ]+)\\)$/))?t[1]:"GMT"}var a=(new Date).getFullYear(),i=new Date(a,0,1),o=new Date(a,6,1);a=i.getTimezoneOffset();var u=o.getTimezoneOffset();E[t>>2>>>0]=60*Math.max(a,u),E[e>>2>>>0]=Number(a!=u),t=r(i),e=r(o),t=it(t),e=it(e),u>2>>>0]=t,M[n+4>>2>>>0]=e):(M[n>>2>>>0]=e,M[n+4>>2>>>0]=t)}(e,n,r))},B:function(){V("")},ma:function(){return 4294901760},I:b?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),xa:function(t,e,n){T.copyWithin(t>>>0,e>>>0,e+n>>>0)},G:function(t){var e=T.length;if(4294901760<(t>>>=0))return!1;for(var n=1;4>=n;n*=2){var r=e*(1+.2/n);r=Math.min(r,t+100663296);var a=Math;r=Math.max(t,r),a=a.min.call(a,4294901760,r+(65536-r%65536)%65536);t:{try{O.grow(a-S.byteLength+65535>>>16),P();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},va:function(t,e){var n=0;return ut().forEach((function(r,a){var i=e+n;for(a=M[t+4*a>>2>>>0]=i,i=0;i>0>>>0]=r.charCodeAt(i);A[a>>0>>>0]=0,n+=r.length+1})),0},wa:function(t,e){var n=ut();M[t>>2>>>0]=n.length;var r=0;return n.forEach((function(t){r+=t.length+1})),M[e>>2>>>0]=r,0},ba:function(t){_||0>2>>>0],u=M[e+4>>2>>>0];e+=8;for(var c=0;c>>0]);a+=u}return M[r>>2>>>0]=a,0},c:function(){return lt},ja:function t(e,r){t.Mb||(t.Mb=function(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var t=new Uint8Array(1);return()=>(crypto.getRandomValues(t),t[0])}if(b)try{var e=n(Object(function(){var t=new Error("Cannot find module \'crypto\'");throw t.code="MODULE_NOT_FOUND",t}()));return()=>e.randomBytes(1)[0]}catch(t){}return()=>V("randomDevice")}());for(var a=0;a>0>>>0]=t.Mb();return 0},ea:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},fa:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},J:function(t){var e=St();try{return at(t)()}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},e:function(t,e){var n=St();try{return at(t)(e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},N:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},O:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},j:function(t,e,n){var r=St();try{return at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},o:function(t,e,n,r){var a=St();try{return at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},p:function(t,e,n,r,a){var i=St();try{return at(t)(e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},M:function(t,e,n,r,a,i){var o=St();try{return at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},r:function(t,e,n,r,a,i){var o=St();try{return at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},v:function(t,e,n,r,a,i,o){var u=St();try{return at(t)(e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},K:function(t,e,n,r,a,i,o,u){var c=St();try{return at(t)(e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},D:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=St();try{return at(t)(e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(At(p),t!==t+0)throw t;Ot(1,0)}},X:function(t,e,n,r,a,i,o,u){var c=St();try{return Ft(t,e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},V:function(t,e,n,r,a,i,o){var u=St();try{return xt(t,e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},U:function(t,e,n,r,a){var i=St();try{return It(t,e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},Z:function(t,e,n,r){var a=St();try{return Pt(t,e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},W:function(t){var e=St();try{return Ct(t)}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},Y:function(t,e){var n=St();try{return Ut(t,e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},T:function(t,e,n){var r=St();try{return Rt(t,e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},f:function(t){var e=St();try{at(t)()}catch(t){if(At(e),t!==t+0)throw t;Ot(1,0)}},q:function(t,e){var n=St();try{at(t)(e)}catch(t){if(At(n),t!==t+0)throw t;Ot(1,0)}},h:function(t,e,n){var r=St();try{at(t)(e,n)}catch(t){if(At(r),t!==t+0)throw t;Ot(1,0)}},da:function(t,e,n,r){var a=St();try{at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},l:function(t,e,n,r){var a=St();try{at(t)(e,n,r)}catch(t){if(At(a),t!==t+0)throw t;Ot(1,0)}},t:function(t,e,n,r,a){var i=St();try{at(t)(e,n,r,a)}catch(t){if(At(i),t!==t+0)throw t;Ot(1,0)}},u:function(t,e,n,r,a,i){var o=St();try{at(t)(e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},x:function(t,e,n,r,a,i,o){var u=St();try{at(t)(e,n,r,a,i,o)}catch(t){if(At(u),t!==t+0)throw t;Ot(1,0)}},z:function(t,e,n,r,a,i,o,u){var c=St();try{at(t)(e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},ga:function(t,e,n,r,a,i,o,u,c){var s=St();try{at(t)(e,n,r,a,i,o,u,c)}catch(t){if(At(s),t!==t+0)throw t;Ot(1,0)}},A:function(t,e,n,r,a,i,o,u,c,s,f){var l=St();try{at(t)(e,n,r,a,i,o,u,c,s,f)}catch(t){if(At(l),t!==t+0)throw t;Ot(1,0)}},C:function(t,e,n,r,a,i,o,u,c,s,f,l,p,h,d,y){var b=St();try{at(t)(e,n,r,a,i,o,u,c,s,f,l,p,h,d,y)}catch(t){if(At(b),t!==t+0)throw t;Ot(1,0)}},aa:function(t,e,n,r,a,i,o,u){var c=St();try{jt(t,e,n,r,a,i,o,u)}catch(t){if(At(c),t!==t+0)throw t;Ot(1,0)}},_:function(t,e,n,r,a,i,o,u,c,s,f,l){var p=St();try{Dt(t,e,n,r,a,i,o,u,c,s,f,l)}catch(t){if(At(p),t!==t+0)throw t;Ot(1,0)}},$:function(t,e,n,r,a,i){var o=St();try{kt(t,e,n,r,a,i)}catch(t){if(At(o),t!==t+0)throw t;Ot(1,0)}},n:function(t){return t},F:function(t){lt=t},ha:yt,y:function(t,e,n,r){return yt(t,e,n,r)}};!function(){function t(t){e.asm=t.exports,O=e.asm.Ka,P(),U=e.asm.ib,I.unshift(e.asm.La),B--,e.monitorRunDependencies&&e.monitorRunDependencies(B),0==B&&(null!==G&&(clearInterval(G),G=null),N&&(t=N,N=null,t()))}function n(e){t(e.instance)}function r(t){return function(){if(!v&&(d||y)){if("function"==typeof fetch&&!Y.startsWith("file://"))return fetch(Y,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at \'"+Y+"\'";return t.arrayBuffer()})).catch((function(){return J()}));if(o)return new Promise((function(t,e){o(Y,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return J()}))}().then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){w("failed to asynchronously prepare wasm: "+t),V(t)}))}var i={a:bt};if(B++,e.monitorRunDependencies&&e.monitorRunDependencies(B),e.instantiateWasm)try{return e.instantiateWasm(i,t)}catch(t){return w("Module.instantiateWasm callback failed with error: "+t),!1}(v||"function"!=typeof WebAssembly.instantiateStreaming||q()||Y.startsWith("file://")||b||"function"!=typeof fetch?r(n):fetch(Y,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(n,(function(t){return w("wasm streaming compile failed: "+t),w("falling back to ArrayBuffer instantiation"),r(n)}))}))).catch(a)}(),e.___wasm_call_ctors=function(){return(e.___wasm_call_ctors=e.asm.La).apply(null,arguments)},e._OrtInit=function(){return(e._OrtInit=e.asm.Ma).apply(null,arguments)},e._OrtCreateSessionOptions=function(){return(e._OrtCreateSessionOptions=e.asm.Na).apply(null,arguments)},e._OrtAppendExecutionProvider=function(){return(e._OrtAppendExecutionProvider=e.asm.Oa).apply(null,arguments)},e._OrtAddSessionConfigEntry=function(){return(e._OrtAddSessionConfigEntry=e.asm.Pa).apply(null,arguments)},e._OrtReleaseSessionOptions=function(){return(e._OrtReleaseSessionOptions=e.asm.Qa).apply(null,arguments)},e._OrtCreateSession=function(){return(e._OrtCreateSession=e.asm.Ra).apply(null,arguments)},e._OrtReleaseSession=function(){return(e._OrtReleaseSession=e.asm.Sa).apply(null,arguments)},e._OrtGetInputCount=function(){return(e._OrtGetInputCount=e.asm.Ta).apply(null,arguments)},e._OrtGetOutputCount=function(){return(e._OrtGetOutputCount=e.asm.Ua).apply(null,arguments)},e._OrtGetInputName=function(){return(e._OrtGetInputName=e.asm.Va).apply(null,arguments)},e._OrtGetOutputName=function(){return(e._OrtGetOutputName=e.asm.Wa).apply(null,arguments)},e._OrtFree=function(){return(e._OrtFree=e.asm.Xa).apply(null,arguments)},e._OrtCreateTensor=function(){return(e._OrtCreateTensor=e.asm.Ya).apply(null,arguments)},e._OrtGetTensorData=function(){return(e._OrtGetTensorData=e.asm.Za).apply(null,arguments)},e._OrtReleaseTensor=function(){return(e._OrtReleaseTensor=e.asm._a).apply(null,arguments)},e._OrtCreateRunOptions=function(){return(e._OrtCreateRunOptions=e.asm.$a).apply(null,arguments)},e._OrtAddRunConfigEntry=function(){return(e._OrtAddRunConfigEntry=e.asm.ab).apply(null,arguments)},e._OrtReleaseRunOptions=function(){return(e._OrtReleaseRunOptions=e.asm.bb).apply(null,arguments)},e._OrtRun=function(){return(e._OrtRun=e.asm.cb).apply(null,arguments)},e._OrtEndProfiling=function(){return(e._OrtEndProfiling=e.asm.db).apply(null,arguments)};var mt,vt=e._malloc=function(){return(vt=e._malloc=e.asm.eb).apply(null,arguments)},gt=e._free=function(){return(gt=e._free=e.asm.fb).apply(null,arguments)},wt=e._fflush=function(){return(wt=e._fflush=e.asm.gb).apply(null,arguments)},_t=e.___funcs_on_exit=function(){return(_t=e.___funcs_on_exit=e.asm.hb).apply(null,arguments)},Ot=e._setThrew=function(){return(Ot=e._setThrew=e.asm.jb).apply(null,arguments)},St=e.stackSave=function(){return(St=e.stackSave=e.asm.kb).apply(null,arguments)},At=e.stackRestore=function(){return(At=e.stackRestore=e.asm.lb).apply(null,arguments)},Tt=e.stackAlloc=function(){return(Tt=e.stackAlloc=e.asm.mb).apply(null,arguments)},Et=e.___cxa_can_catch=function(){return(Et=e.___cxa_can_catch=e.asm.nb).apply(null,arguments)},Mt=e.___cxa_is_pointer_type=function(){return(Mt=e.___cxa_is_pointer_type=e.asm.ob).apply(null,arguments)},Ct=e.dynCall_j=function(){return(Ct=e.dynCall_j=e.asm.pb).apply(null,arguments)},xt=e.dynCall_iiiiij=function(){return(xt=e.dynCall_iiiiij=e.asm.qb).apply(null,arguments)},Rt=e.dynCall_jii=function(){return(Rt=e.dynCall_jii=e.asm.rb).apply(null,arguments)},jt=e.dynCall_viiiiij=function(){return(jt=e.dynCall_viiiiij=e.asm.sb).apply(null,arguments)},kt=e.dynCall_vjji=function(){return(kt=e.dynCall_vjji=e.asm.tb).apply(null,arguments)},Dt=e.dynCall_viiijjjii=function(){return(Dt=e.dynCall_viiijjjii=e.asm.ub).apply(null,arguments)},Pt=e.dynCall_iij=function(){return(Pt=e.dynCall_iij=e.asm.vb).apply(null,arguments)},Ut=e.dynCall_ji=function(){return(Ut=e.dynCall_ji=e.asm.wb).apply(null,arguments)},Ft=e.dynCall_iiiiiij=function(){return(Ft=e.dynCall_iiiiiij=e.asm.xb).apply(null,arguments)},It=e.dynCall_iiij=function(){return(It=e.dynCall_iiij=e.asm.yb).apply(null,arguments)};function Wt(){function t(){if(!mt&&(mt=!0,e.calledRun=!0,!C)){if(Q(I),r(e),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;){var t=e.postRun.shift();H.unshift(t)}Q(H)}}if(!(00)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(e,"__esModule",{value:!0}),e.iterateExtraOptions=void 0,e.iterateExtraOptions=function(t,r,a,i){if("object"==typeof t&&null!==t){if(a.has(t))throw new Error("Circular reference in options");a.add(t)}Object.entries(t).forEach((function(t){var o=n(t,2),u=o[0],c=o[1],s=r?r+u:u;if("object"==typeof c)(0,e.iterateExtraOptions)(c,s+".",a,i);else if("string"==typeof c||"number"==typeof c)i(s,c.toString());else{if("boolean"!=typeof c)throw new Error("Can\'t handle extra config type: ".concat(typeof c));i(s,c?"1":"0")}}))}},586:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setRunOptions=void 0;var r=n(967),a=n(983),i=n(361);e.setRunOptions=function(t){var e=(0,i.getInstance)(),n=0,o=[],u=t||{};try{if(void 0===(null==t?void 0:t.logSeverityLevel))u.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error("log serverity level is not valid: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))u.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));void 0===(null==t?void 0:t.terminate)&&(u.terminate=!1);var c=0;if(void 0!==(null==t?void 0:t.tag)&&(c=(0,a.allocWasmString)(t.tag,o)),0===(n=e._OrtCreateRunOptions(u.logSeverityLevel,u.logVerbosityLevel,!!u.terminate,c)))throw new Error("Can\'t create run options");return void 0!==(null==t?void 0:t.extra)&&(0,r.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var i=(0,a.allocWasmString)(t,o),u=(0,a.allocWasmString)(r,o);if(0!==e._OrtAddRunConfigEntry(n,i,u))throw new Error("Can\'t set a run config entry: ".concat(t," - ").concat(r))})),[n,o]}catch(t){throw 0!==n&&e._OrtReleaseRunOptions(n),o.forEach(e._free),t}}},919:function(t,e,n){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.setSessionOptions=void 0;var a=n(967),i=n(983),o=n(361);e.setSessionOptions=function(t){var e=(0,o.getInstance)(),n=0,u=[],c=t||{};!function(t){t.extra||(t.extra={}),t.extra.session||(t.extra.session={});var e=t.extra.session;e.use_ort_model_bytes_directly||(e.use_ort_model_bytes_directly="1")}(c);try{void 0===(null==t?void 0:t.graphOptimizationLevel)&&(c.graphOptimizationLevel="all");var s=function(t){switch(t){case"disabled":return 0;case"basic":return 1;case"extended":return 2;case"all":return 99;default:throw new Error("unsupported graph optimization level: ".concat(t))}}(c.graphOptimizationLevel);void 0===(null==t?void 0:t.enableCpuMemArena)&&(c.enableCpuMemArena=!0),void 0===(null==t?void 0:t.enableMemPattern)&&(c.enableMemPattern=!0),void 0===(null==t?void 0:t.executionMode)&&(c.executionMode="sequential");var f=function(t){switch(t){case"sequential":return 0;case"parallel":return 1;default:throw new Error("unsupported execution mode: ".concat(t))}}(c.executionMode),l=0;if(void 0!==(null==t?void 0:t.logId)&&(l=(0,i.allocWasmString)(t.logId,u)),void 0===(null==t?void 0:t.logSeverityLevel))c.logSeverityLevel=2;else if("number"!=typeof t.logSeverityLevel||!Number.isInteger(t.logSeverityLevel)||t.logSeverityLevel<0||t.logSeverityLevel>4)throw new Error("log serverity level is not valid: ".concat(t.logSeverityLevel));if(void 0===(null==t?void 0:t.logVerbosityLevel))c.logVerbosityLevel=0;else if("number"!=typeof t.logVerbosityLevel||!Number.isInteger(t.logVerbosityLevel))throw new Error("log verbosity level is not valid: ".concat(t.logVerbosityLevel));if(void 0===(null==t?void 0:t.enableProfiling)&&(c.enableProfiling=!1),0===(n=e._OrtCreateSessionOptions(s,!!c.enableCpuMemArena,!!c.enableMemPattern,f,!!c.enableProfiling,0,l,c.logSeverityLevel,c.logVerbosityLevel)))throw new Error("Can\'t create session options");return(null==t?void 0:t.executionProviders)&&function(t,e,n){var a,u;try{for(var c=r(e),s=c.next();!s.done;s=c.next()){var f=s.value,l="string"==typeof f?f:f.name;switch(l){case"xnnpack":l="XNNPACK";break;case"wasm":case"cpu":continue;default:throw new Error("not supported EP: ".concat(l))}var p=(0,i.allocWasmString)(l,n);if(0!==(0,o.getInstance)()._OrtAppendExecutionProvider(t,p))throw new Error("Can\'t append execution provider: ".concat(l))}}catch(t){a={error:t}}finally{try{s&&!s.done&&(u=c.return)&&u.call(c)}finally{if(a)throw a.error}}}(n,t.executionProviders,u),void 0!==(null==t?void 0:t.extra)&&(0,a.iterateExtraOptions)(t.extra,"",new WeakSet,(function(t,r){var a=(0,i.allocWasmString)(t,u),o=(0,i.allocWasmString)(r,u);if(0!==e._OrtAddSessionConfigEntry(n,a,o))throw new Error("Can\'t set a session config entry: ".concat(t," - ").concat(r))})),[n,u]}catch(t){throw 0!==n&&e._OrtReleaseSessionOptions(n),u.forEach(e._free),t}}},983:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.allocWasmString=void 0;var r=n(361);e.allocWasmString=function(t,e){var n=(0,r.getInstance)(),a=n.lengthBytesUTF8(t)+1,i=n._malloc(a);return n.stringToUTF8(t,i,a),e.push(i),i}},349:function(t,e,n){"use strict";var r=this&&this.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,a,i=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(t){a={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o},a=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.extractTransferableBuffers=e.endProfiling=e.run=e.releaseSession=e.createSession=e.createSessionFinalize=e.createSessionAllocate=e.initOrt=void 0;var i=n(586),o=n(919),u=n(983),c=n(361);e.initOrt=function(t,e){var n=(0,c.getInstance)()._OrtInit(t,e);if(0!==n)throw new Error("Can\'t initialize onnxruntime. error code = ".concat(n))};var s=new Map;e.createSessionAllocate=function(t){var e=(0,c.getInstance)(),n=e._malloc(t.byteLength);return e.HEAPU8.set(t,n),[n,t.byteLength]},e.createSessionFinalize=function(t,e){var n,a=(0,c.getInstance)(),i=0,u=0,f=[];try{if(u=(n=r((0,o.setSessionOptions)(e),2))[0],f=n[1],0===(i=a._OrtCreateSession(t[0],t[1],u)))throw new Error("Can\'t create a session")}finally{a._free(t[0]),a._OrtReleaseSessionOptions(u),f.forEach(a._free)}for(var l=a._OrtGetInputCount(i),p=a._OrtGetOutputCount(i),h=[],d=[],y=[],b=[],m=0;m0&&a[a.length-1])||6!==u[0]&&2!==u[0])){o=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]1&&function(){try{return"undefined"!=typeof SharedArrayBuffer&&("undefined"!=typeof MessageChannel&&(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11])))}catch(t){return!1}}(),o=a&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,30,1,28,0,65,0,253,15,253,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,253,186,1,26,11]))}catch(t){return!1}}(),c="string"==typeof t.wasmPaths?t.wasmPaths:void 0,m=b(!1,i),v=b(o,i),g="object"==typeof t.wasmPaths?t.wasmPaths[v]:void 0,w=!1,_=[],e>0&&_.push(new Promise((function(t){setTimeout((function(){w=!0,t()}),e)}))),_.push(new Promise((function(t,e){var r=i?p:l.default,a={locateFile:function(t,e){return i&&t.endsWith(".worker.js")&&"undefined"!=typeof Blob?URL.createObjectURL(new Blob([n(154)],{type:"text/javascript"})):t===m?null!=g?g:(null!=c?c:e)+v:e+t}};if(i)if("undefined"==typeof Blob)a.mainScriptUrlOrBlob=f.join("/","ort-wasm-threaded.js");else{var o="var ortWasmThreaded=(function(){var _scriptDir;return ".concat(r.toString(),"})();");a.mainScriptUrlOrBlob=new Blob([o],{type:"text/javascript"})}r(a).then((function(e){d=!1,h=!0,s=e,t()}),(function(t){d=!1,y=!0,e(t)}))}))),[4,Promise.race(_)];case 1:if(u.sent(),w)throw new Error("WebAssembly backend initializing failed due to timeout: ".concat(e,"ms"));return[2]}}))}))},e.getInstance=function(){if(h&&s)return s;throw new Error("WebAssembly is not initialized yet.")},e.dispose=function(){var t;!h||d||y||(d=!0,null===(t=s.PThread)||void 0===t||t.terminateAllThreads(),s=void 0,d=!1,h=!1,y=!0)}},154:function(t){"use strict";t.exports=\'"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\\n\'},384:function(){},993:function(){},908:function(){},953:function(){},925:function(){},449:function(){}},e={};function n(r){var a=e[r];if(void 0!==a)return a.exports;var i=e[r]={exports:{}};return t[r].call(i.exports,i,i.exports,n),i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),function(){"use strict";var t=n(349),e=n(361);self.onmessage=function(n){switch(n.data.type){case"init-wasm":(0,e.initializeWebAssembly)(n.data.in).then((function(){return postMessage({type:"init-wasm"})}),(function(t){return postMessage({type:"init-wasm",err:t})}));break;case"init-ort":try{var r=n.data.in,a=r.numThreads,i=r.loggingLevel;(0,t.initOrt)(a,i),postMessage({type:"init-ort"})}catch(t){postMessage({type:"init-ort",err:t})}break;case"create_allocate":try{var o=n.data.in.model,u=(0,t.createSessionAllocate)(o);postMessage({type:"create_allocate",out:u})}catch(t){postMessage({type:"create_allocate",err:t})}break;case"create_finalize":try{var c=n.data.in,s=(u=c.modeldata,c.options),f=(0,t.createSessionFinalize)(u,s);postMessage({type:"create_finalize",out:f})}catch(t){postMessage({type:"create_finalize",err:t})}break;case"create":try{var l=n.data.in;o=l.model,s=l.options,f=(0,t.createSession)(o,s),postMessage({type:"create",out:f})}catch(t){postMessage({type:"create",err:t})}break;case"release":try{var p=n.data.in;(0,t.releaseSession)(p),postMessage({type:"release"})}catch(t){postMessage({type:"release",err:t})}break;case"run":try{var h=n.data.in,d=h.sessionId,y=h.inputIndices,b=h.inputs,m=h.outputIndices,v=(s=h.options,(0,t.run)(d,y,b,m,s));postMessage({type:"run",out:v},(0,t.extractTransferableBuffers)(v))}catch(t){postMessage({type:"run",err:t})}break;case"end-profiling":try{p=n.data.in,(0,t.endProfiling)(p),postMessage({type:"end-profiling"})}catch(t){postMessage({type:"end-profiling",err:t})}}}}()}();\n',"Worker",void 0,void 0)}},477:function(t){"use strict";t.exports=function(t,e,n,r){var o=self||window;try{try{var i;try{i=new o.Blob([t])}catch(e){(i=new(o.BlobBuilder||o.WebKitBlobBuilder||o.MozBlobBuilder||o.MSBlobBuilder)).append(t),i=i.getBlob()}var a=o.URL||o.webkitURL,s=a.createObjectURL(i),u=new o[e](s,n);return a.revokeObjectURL(s),u}catch(r){return new o[e]("data:application/javascript,".concat(encodeURIComponent(t)),n)}}catch(t){if(!r)throw Error("Inline worker is not supported");return new o[e](r,n)}}},4154:function(t){"use strict";t.exports='"use strict";var e={},t="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node;if(t){var r=require("worker_threads"),a=r.parentPort;a.on("message",(e=>onmessage({data:e})));var o=require("fs");Object.assign(global,{self:global,require:require,Module:e,location:{href:__filename},Worker:r.Worker,importScripts:function(e){(0,eval)(o.readFileSync(e,"utf8"))},postMessage:function(e){a.postMessage(e)},performance:global.performance||{now:function(){return Date.now()}}})}var s=!1,n=[],i=function(){var e=Array.prototype.slice.call(arguments).join(" ");t?o.writeSync(2,e+"\\n"):console.error(e)};self.alert=function(){var t=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:t,threadId:e._pthread_self()})},e.instantiateWasm=(t,r)=>{var a=new WebAssembly.Instance(e.wasmModule,t);return r(a),e.wasmModule=null,a.exports},self.onunhandledrejection=e=>{throw e.reason??e},self.onmessage=t=>{try{if("load"===t.data.cmd){if(e.wasmModule=t.data.wasmModule,e.wasmMemory=t.data.wasmMemory,e.buffer=e.wasmMemory.buffer,e.ENVIRONMENT_IS_PTHREAD=!0,"string"==typeof t.data.urlOrBlob)importScripts(t.data.urlOrBlob);else{var r=URL.createObjectURL(t.data.urlOrBlob);importScripts(r),URL.revokeObjectURL(r)}ortWasmThreaded(e).then((function(t){e=t}))}else if("run"===t.data.cmd){e.__performance_now_clock_drift=performance.now()-t.data.time,e.__emscripten_thread_init(t.data.pthread_ptr,0,0,1),e.establishStackSpace(),e.PThread.receiveObjectTransfer(t.data),e.PThread.threadInitTLS(),s||(n.forEach((t=>{e.executeNotifiedProxyingQueue(t)})),n=[],s=!0);try{e.invokeEntryPoint(t.data.start_routine,t.data.arg)}catch(t){if("unwind"!=t){if(!(t instanceof e.ExitStatus))throw t;e.keepRuntimeAlive()||e.__emscripten_thread_exit(t.status)}}}else"cancel"===t.data.cmd?e._pthread_self()&&e.__emscripten_thread_exit(-1):"setimmediate"===t.data.target||("processProxyingQueue"===t.data.cmd?s?e.executeNotifiedProxyingQueue(t.data.queue):n.push(t.data.queue):(i("worker.js received unknown command "+t.data.cmd),i(t.data)))}catch(t){throw i("worker.js onmessage() captured an uncaught exception: "+t),t&&t.stack&&i(t.stack),e.__emscripten_thread_crashed&&e.__emscripten_thread_crashed(),t}};\n'},7067:function(){},1296:function(){},1384:function(){},3993:function(){},908:function(){},6953:function(){},9925:function(){},2806:function(){},6449:function(){},2850:function(){},5381:function(){},5686:function(t,e,n){"use strict";n.r(e),n.d(e,{flatbuffers:function(){return r}});var r={};r.Offset,r.Table,r.SIZEOF_SHORT=2,r.SIZEOF_INT=4,r.FILE_IDENTIFIER_LENGTH=4,r.SIZE_PREFIX_LENGTH=4,r.Encoding={UTF8_BYTES:1,UTF16_STRING:2},r.int32=new Int32Array(2),r.float32=new Float32Array(r.int32.buffer),r.float64=new Float64Array(r.int32.buffer),r.isLittleEndian=1===new Uint16Array(new Uint8Array([1,0]).buffer)[0],r.Long=function(t,e){this.low=0|t,this.high=0|e},r.Long.create=function(t,e){return 0==t&&0==e?r.Long.ZERO:new r.Long(t,e)},r.Long.prototype.toFloat64=function(){return(this.low>>>0)+4294967296*this.high},r.Long.prototype.equals=function(t){return this.low==t.low&&this.high==t.high},r.Long.ZERO=new r.Long(0,0),r.Builder=function(t){if(t)e=t;else var e=1024;this.bb=r.ByteBuffer.allocate(e),this.space=e,this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.clear=function(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1},r.Builder.prototype.forceDefaults=function(t){this.force_defaults=t},r.Builder.prototype.dataBuffer=function(){return this.bb},r.Builder.prototype.asUint8Array=function(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())},r.Builder.prototype.prep=function(t,e){t>this.minalign&&(this.minalign=t);for(var n=1+~(this.bb.capacity()-this.space+e)&t-1;this.space=0&&0==this.vtable[e];e--);for(var n=e+1;e>=0;e--)this.addInt16(0!=this.vtable[e]?t-this.vtable[e]:0);this.addInt16(t-this.object_start);var o=(n+2)*r.SIZEOF_SHORT;this.addInt16(o);var i=0,a=this.space;t:for(e=0;e=0;a--)this.writeInt8(i.charCodeAt(a))}this.prep(this.minalign,r.SIZEOF_INT+o),this.addOffset(t),o&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)},r.Builder.prototype.finishSizePrefixed=function(t,e){this.finish(t,e,!0)},r.Builder.prototype.requiredField=function(t,e){var n=this.bb.capacity()-t,r=n-this.bb.readInt32(n);if(0==this.bb.readInt16(r+e))throw new Error("FlatBuffers: field "+e+" must be set")},r.Builder.prototype.startVector=function(t,e,n){this.notNested(),this.vector_num_elems=e,this.prep(r.SIZEOF_INT,t*e),this.prep(n,t*e)},r.Builder.prototype.endVector=function(){return this.writeInt32(this.vector_num_elems),this.offset()},r.Builder.prototype.createString=function(t){if(t instanceof Uint8Array)var e=t;else{e=[];for(var n=0;n=56320?o:(o<<10)+t.charCodeAt(n++)+-56613888)<128?e.push(r):(r<2048?e.push(r>>6&31|192):(r<65536?e.push(r>>12&15|224):e.push(r>>18&7|240,r>>12&63|128),e.push(r>>6&63|128)),e.push(63&r|128))}}this.addInt8(0),this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),n=0;for(var i=this.space,a=this.bb.bytes();n>24},r.ByteBuffer.prototype.readUint8=function(t){return this.bytes_[t]},r.ByteBuffer.prototype.readInt16=function(t){return this.readUint16(t)<<16>>16},r.ByteBuffer.prototype.readUint16=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8},r.ByteBuffer.prototype.readInt32=function(t){return this.bytes_[t]|this.bytes_[t+1]<<8|this.bytes_[t+2]<<16|this.bytes_[t+3]<<24},r.ByteBuffer.prototype.readUint32=function(t){return this.readInt32(t)>>>0},r.ByteBuffer.prototype.readInt64=function(t){return new r.Long(this.readInt32(t),this.readInt32(t+4))},r.ByteBuffer.prototype.readUint64=function(t){return new r.Long(this.readUint32(t),this.readUint32(t+4))},r.ByteBuffer.prototype.readFloat32=function(t){return r.int32[0]=this.readInt32(t),r.float32[0]},r.ByteBuffer.prototype.readFloat64=function(t){return r.int32[r.isLittleEndian?0:1]=this.readInt32(t),r.int32[r.isLittleEndian?1:0]=this.readInt32(t+4),r.float64[0]},r.ByteBuffer.prototype.writeInt8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeUint8=function(t,e){this.bytes_[t]=e},r.ByteBuffer.prototype.writeInt16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeUint16=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8},r.ByteBuffer.prototype.writeInt32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeUint32=function(t,e){this.bytes_[t]=e,this.bytes_[t+1]=e>>8,this.bytes_[t+2]=e>>16,this.bytes_[t+3]=e>>24},r.ByteBuffer.prototype.writeInt64=function(t,e){this.writeInt32(t,e.low),this.writeInt32(t+4,e.high)},r.ByteBuffer.prototype.writeUint64=function(t,e){this.writeUint32(t,e.low),this.writeUint32(t+4,e.high)},r.ByteBuffer.prototype.writeFloat32=function(t,e){r.float32[0]=e,this.writeInt32(t,r.int32[0])},r.ByteBuffer.prototype.writeFloat64=function(t,e){r.float64[0]=e,this.writeInt32(t,r.int32[r.isLittleEndian?0:1]),this.writeInt32(t+4,r.int32[r.isLittleEndian?1:0])},r.ByteBuffer.prototype.getBufferIdentifier=function(){if(this.bytes_.length>10),56320+(1023&a)))}return o},r.ByteBuffer.prototype.__indirect=function(t){return t+this.readInt32(t)},r.ByteBuffer.prototype.__vector=function(t){return t+this.readInt32(t)+r.SIZEOF_INT},r.ByteBuffer.prototype.__vector_len=function(t){return this.readInt32(t+this.readInt32(t))},r.ByteBuffer.prototype.__has_identifier=function(t){if(t.length!=r.FILE_IDENTIFIER_LENGTH)throw new Error("FlatBuffers: file identifier must be length "+r.FILE_IDENTIFIER_LENGTH);for(var e=0;e