UNPKG

@mediapipe/tasks-vision

Version:

MediaPipe Vision Tasks

1 lines 139 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,s=0;s<r.length;s++)if(null==(i=i[r[s]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,s;const o="undefined"!=typeof TextDecoder;let a;const h="undefined"!=typeof TextEncoder;function c(t){if(h)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var u,l=e(610401301,!1),f=e(645172343,e(1,!0)),d=e(660014094,!1);const p=t.navigator;function g(t){return!!l&&(!!u&&u.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function m(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function y(){return!!l&&(!!u&&u.brands.length>0)}function _(){return y()?g("Chromium"):(m("Chrome")||m("CriOS"))&&!(!y()&&m("Edge"))||m("Silk")}function v(t){return v[" "](t),t}u=p&&p.userAgentData||null,v[" "]=function(){};var E=!y()&&(m("Trident")||m("MSIE"));!m("Android")||_(),_(),m("Safari")&&(_()||!y()&&m("Coast")||!y()&&m("Opera")||!y()&&m("Edge")||(y()?g("Microsoft Edge"):m("Edg/"))||y()&&g("Opera"));var w={},T=null;function A(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=T[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}b();for(var r=0;;){var i=n(-1),s=n(0),o=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|s>>4),64!=o&&(e(s<<4&240|o>>2),64!=a&&e(o<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function b(){if(!T){T={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;n<5;n++){var r=t.concat(e[n].split(""));w[n]=r;for(var i=0;i<r.length;i++){var s=r[i];void 0===T[s]&&(T[s]=i)}}}}var k="undefined"!=typeof Uint8Array,x=!E&&"function"==typeof btoa;function S(t){if(!x){var e;void 0===e&&(e=0),b(),e=w[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let h=0,c=0;for(;h<t.length-2;h+=3){var i=t[h],s=t[h+1],o=t[h+2],a=e[i>>2];i=e[(3&i)<<4|s>>4],s=e[(15&s)<<2|o>>6],o=e[63&o],n[c++]=a+i+s+o}switch(a=0,o=r,t.length-h){case 2:o=e[(15&(a=t[h+1]))<<2]||r;case 1:t=t[h],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+o+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const L=/[-_.]/g,F={"-":"+",_:"/",".":"="};function R(t){return F[t]||""}function M(t){if(!x)return A(t);L.test(t)&&(t=t.replace(L,R)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function I(t){return k&&null!=t&&t instanceof Uint8Array}var P={};let O;function C(t){if(t!==P)throw Error("illegal external caller")}function U(){return O||=new D(null,P)}function N(t){C(P);var e=t.g;return null==(e=null==e||I(e)?e:"string"==typeof e?M(e):null)?e:t.g=e}var D=class{constructor(t,e){if(C(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}h(){return new Uint8Array(N(this)||0)}};function B(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}let G;function j(){const e=Error();B(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}function V(t){return B(t=Error(t),"warning"),t}function X(){return"function"==typeof BigInt}function H(t){return Array.prototype.slice.call(t)}var W="function"==typeof Symbol&&"symbol"==typeof Symbol();function z(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():t}var K=z(),Y=z("0di"),$=z("2ex"),q=z("1oa"),J=z("0dg"),Z=W?(t,e)=>{t[K]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Q=W?(t,e)=>{t[K]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)},tt=W?t=>0|t[K]:t=>0|t.g,et=W?t=>t[K]:t=>t.g,nt=W?(t,e)=>{t[K]=e}:(t,e)=>{void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function rt(t){return Z(t,34),t}function it(t,e){nt(e,-14591&(0|t))}function st(t,e){nt(e,-14557&(34|t))}var ot,at={},ht={};function ct(t){return!(!t||"object"!=typeof t||t.Ja!==ht)}function ut(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function lt(t,e,n){if(null!=t)if("string"==typeof t)t=t?new D(t,P):U();else if(t.constructor!==D)if(I(t))t=t.length?new D(n?t:new Uint8Array(t),P):U();else{if(!e)throw Error();t=void 0}return t}function ft(t){return!(!Array.isArray(t)||t.length)&&!!(1&tt(t))}const dt=[];function pt(t){if(2&t)throw Error()}nt(dt,55),ot=Object.freeze(dt);class gt{constructor(t,e,n){this.l=0,this.g=t,this.h=e,this.m=n}next(){if(this.l<this.g.length){const t=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,t):t}}return{done:!0,value:void 0}}[Symbol.iterator](){return new gt(this.g,this.h,this.m)}}let mt,yt;function _t(t,e){(e=mt?e[mt]:void 0)&&(t[mt]=H(e))}var vt=Object.freeze({});Object.freeze({});var Et=Object.freeze({});const wt="function"==typeof Uint8Array.prototype.slice;let Tt,At=0,bt=0;function kt(t){const e=t>>>0;At=e,bt=(t-e)/4294967296>>>0}function xt(t){if(t<0){kt(-t);const[e,n]=Pt(At,bt);At=e>>>0,bt=n>>>0}else kt(t)}function St(t){const e=Tt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),bt=0,At=e.getUint32(0,!0)}function Lt(t,e){return 4294967296*e+(t>>>0)}function Ft(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Lt(t,e),n?-t:t}function Rt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else X()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Mt(n)+Mt(t));return n}function Mt(t){return t=String(t),"0000000".slice(t.length)+t}function It(t){if(t.length<16)xt(Number(t));else if(X())t=BigInt(t),At=Number(t&BigInt(4294967295))>>>0,bt=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);bt=At=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));bt*=1e6,At=1e6*At+e,At>=4294967296&&(bt+=Math.trunc(At/4294967296),bt>>>=0,At>>>=0)}if(e){const[t,e]=Pt(At,bt);At=t,bt=e}}}function Pt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ot(t){return t.Qa=!0,t}var Ct=Ot((t=>"number"==typeof t)),Ut=Ot((t=>"string"==typeof t)),Nt=Ot((t=>"boolean"==typeof t)),Dt="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0),Bt=Ot((t=>Dt?t>=jt&&t<=Xt:"-"===t[0]?Ht(t,Gt):Ht(t,Vt)));const Gt=Number.MIN_SAFE_INTEGER.toString(),jt=Dt?BigInt(Number.MIN_SAFE_INTEGER):void 0,Vt=Number.MAX_SAFE_INTEGER.toString(),Xt=Dt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ht(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}function Wt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function zt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}const Kt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Yt(t){const e=typeof t;switch(e){case"bigint":return!0;case"number":return Number.isFinite(t)}return"string"===e&&Kt.test(t)}function $t(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function qt(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?t>>>0:void 0}function Jt(t){return"-"!==t[0]&&(t.length<20||20===t.length&&Number(t.substring(0,6))<184467)}function Zt(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(xt(t),t=Ft(At,bt)),t}function Qt(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?t.length<20||20===t.length&&Number(t.substring(0,7))>-922337:t.length<19||19===t.length&&Number(t.substring(0,6))<922337))if(It(t),t=At,2147483648&(e=bt))if(X())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=Pt(t,e);t="-"+Rt(n,r)}else t=Rt(t,e);return t}function te(t){return null==t?t:"bigint"==typeof t?(Bt(t)?t=Number(t):(t=BigInt.asIntN(64,t),t=Bt(t)?Number(t):String(t)),t):Yt(t)?"number"==typeof t?Zt(t):Qt(t):void 0}function ee(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(BigInt.asUintN(64,t));if(Yt(t)){if("string"===e)return e=Math.trunc(Number(t)),Number.isSafeInteger(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Jt(t)||(It(t),t=Rt(At,bt))),t;if("number"===e)return(t=Math.trunc(t))>=0&&Number.isSafeInteger(t)?t:function(t){if(t<0){xt(t);const e=Rt(At,bt);return t=Number(e),Number.isSafeInteger(t)?t:e}return Jt(String(t))?t:(xt(t),Lt(At,bt))}(t)}}function ne(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ie(t){return null==t||"string"==typeof t?t:void 0}function se(t,e,n,r){if(null!=t&&"object"==typeof t&&t.Y===at)return t;if(!Array.isArray(t))return n?2&r?(t=e[Y])?e=t:(rt((t=new e).u),e=e[Y]=t):e=new e:e=void 0,e;let i=n=tt(t);return 0===i&&(i|=32&r),i|=2&r,i!==n&&nt(t,i),new e(t)}function oe(t,e,n){if(e)t:{if(!Yt(e=t))throw V("int64");switch(typeof e){case"string":e=Qt(e);break t;case"bigint":if(t=e=BigInt.asIntN(64,e),Ut(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Ct(t)&&!Number.isSafeInteger(t))throw Error(String(t));e=Dt?BigInt(e):Nt(e)?e?"1":"0":Ut(e)?e.trim()||"0":String(e);break t;default:e=Zt(e)}}else e=te(t);return"string"==typeof(n=null==(t=e)?n?0:void 0:t)&&(e=+n,Number.isSafeInteger(e))?e:n}function ae(t){var e=he?.get(t);if(e)return e;if(Math.random()>.01)return t;if(void 0===ue)if("function"!=typeof Proxy)ue=null;else try{ue=-1!==Proxy.toString().indexOf("[native code]")?Proxy:null}catch{ue=null}return(e=ue)?(function(t,e){(he||=new WeakMap).set(t,e),(ce||=new WeakMap).set(e,t)}(t,e=new e(t,{set:(t,e,n)=>(j(),t[e]=n,!0)})),e):t}let he,ce,ue,le,fe,de;function pe(t){switch(typeof t){case"boolean":return fe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?de||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function ge(t,e){return me(t,e[0],e[1])}function me(t,e,n){if(null==t&&(t=le),le=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(r=tt(t)))throw Error("farr");if(64&r)return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const t=i-1;if(ut(n[t])){if((e=t-(+!!(512&(r|=256))-1))>=1024)throw Error("pvtlmt");r=-16760833&r|(1023&e)<<14;break t}}if(e){if((e=Math.max(e,i-(+!!(512&r)-1)))>1024)throw Error("spvt");r=-16760833&r|(1023&e)<<14}}}return nt(t,r),t}const ye={};let _e=function(){try{return v(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ve{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}const Ee=_e?(Object.setPrototypeOf(ve.prototype,Map.prototype),Object.defineProperties(ve.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ve):class extends Map{constructor(){super()}};function we(t){return t}function Te(t){if(2&t.L)throw Error("Cannot mutate an immutable Map")}var Ae=class extends Ee{constructor(t,e,n=we,r=we){super();let i=tt(t);i|=64,nt(t,i),this.L=i,this.V=e,this.S=n,this.aa=this.V?be:r;for(let s=0;s<t.length;s++){const o=t[s],a=n(o[0],!1,!0);let h=o[1];e?void 0===h&&(h=null):h=r(o[1],!1,!0,void 0,void 0,i),super.set(a,h)}}oa(t=ke){if(0!==this.size)return this.Z(t)}Z(t=ke){const e=[],n=super.entries();for(var r;!(r=n.next()).done;)(r=r.value)[0]=t(r[0]),r[1]=t(r[1]),e.push(r);return e}clear(){Te(this),super.clear()}delete(t){return Te(this),super.delete(this.S(t,!0,!1))}entries(){var t=this.na();return new gt(t,xe,this)}keys(){return this.Ia()}values(){var t=this.na();return new gt(t,Ae.prototype.get,this)}forEach(t,e){super.forEach(((n,r)=>{t.call(e,this.get(r),r,this)}))}set(t,e){return Te(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.aa(e,!0,!0,this.V,!1,this.L))}Oa(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.V?void 0===t?null:t:this.aa(t,!1,!0,void 0,!1,this.L),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(void 0!==e){var n=this.V;return n?((n=this.aa(e,!1,!0,n,this.ta,this.L))!==e&&super.set(t,n),n):e}}na(){return Array.from(super.keys())}Ia(){return super.keys()}[Symbol.iterator](){return this.entries()}};function be(t,e,n,r,i,s){return t=se(t,r,n,s),i&&(t=Ue(t)),t}function ke(t){return t}function xe(t){return[t,this.get(t)]}let Se;function Le(){return Se||=new Ae(rt([]),void 0,void 0,void 0,ye)}function Fe(t,e,n,r,i){if(null!=t){if(Array.isArray(t))t=ft(t)?void 0:i&&2&tt(t)?t:Re(t,e,n,void 0!==r,i);else if(ut(t)){const s={};for(let o in t)s[o]=Fe(t[o],e,n,r,i);t=s}else t=e(t,r);return t}}function Re(t,e,n,r,i){const s=r||n?tt(t):0;r=r?!!(32&s):void 0;const o=H(t);for(let t=0;t<o.length;t++)o[t]=Fe(o[t],e,n,r,i);return n&&(_t(o,t),n(s,o)),o}function Me(t){return Fe(t,Ie,void 0,void 0,!1)}function Ie(t){return t.Y===at?t.toJSON():t instanceof Ae?t.oa(Me):function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"bigint":return Bt(t)?Number(t):String(t);case"boolean":return t?1:0;case"object":if(t)if(Array.isArray(t)){if(ft(t))return}else{if(I(t))return S(t);if(t instanceof D){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=S(e)}if(t instanceof Ae)return t.oa()}}return t}(t)}function Pe(t,e,n=st){if(null!=t){if(k&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=tt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(nt(t,-12293&(34|r)),t):Re(t,Pe,4&r?st:n,!0,!0))}return t.Y===at?(n=t.u,t=2&(r=et(n))?t:Oe(t,n,r,!0)):t instanceof Ae&&!(2&t.L)&&(n=rt(t.Z(Pe)),t=new Ae(n,t.V,t.S,t.aa)),t}}function Oe(t,e,n,r){return t=t.constructor,le=e=Ce(e,n,r),e=new t(e),le=void 0,e}function Ce(t,e,n){const r=n||2&e?st:it,i=!!(32&e);return t=function(t,e,n){const r=H(t);var i=r.length;const s=256&e?r[i-1]:void 0;for(i+=s?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(s){e=r[e]={};for(const t in s)e[t]=n(s[t])}return _t(r,t),r}(t,e,(t=>Pe(t,i,r))),Z(t,32|(n?2:0)),t}function Ue(t){const e=t.u,n=et(e);return 2&n?Oe(t,e,n,!1):t}function Ne(t,e,n,r){return!(4&e)||null!=n&&(!r&&0===n&&(4096&e||8192&e)&&(t.constructor[J]=1+(0|t.constructor[J]))<5&&j(),0!==n&&!(n&e))}function De(t,e){return Ge(t=t.u,et(t),e)}function Be(t,e,n,r){if(!((e=r+(+!!(512&e)-1))<0||e>=t.length||e>=n))return t[e]}function Ge(t,e,n,r){if(-1===n)return null;const i=e>>14&1023||536870912;if(!(n>=i)){var s=t.length;return r&&256&e&&null!=(r=t[s-1][n])?(Be(t,e,i,n)&&null!=$&&((e=(t=G??={})[$]||0)>=4||(t[$]=e+1,j())),r):Be(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function je(t,e,n,r){const i=t.u;let s=et(i);return pt(s),Ve(i,s,e,n,r),t}function Ve(t,e,n,r,i){const s=e>>14&1023||536870912;if(n>=s||i&&!f){let o=e;if(256&e)i=t[t.length-1];else{if(null==r)return o;i=t[s+(+!!(512&e)-1)]={},o|=256}return i[n]=r,n<s&&(t[n+(+!!(512&e)-1)]=void 0),o!==e&&nt(t,o),o}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Xe(t,e,n,r,i){var s=2&e;let o=Ge(t,e,n,i);Array.isArray(o)||(o=ot);const a=!(2&r);r=!(1&r);const h=!!(32&e);let c=tt(o);return 0!==c||!h||s||a?1&c||(c|=1,nt(o,c)):(c|=33,nt(o,c)),s?(t=!1,2&c||(rt(o),t=!!(4&c)),(r||t)&&Object.freeze(o)):(s=!!(2&c)||!!(2048&c),r&&s?(o=H(o),r=1,h&&!a&&(r|=32),nt(o,r),Ve(t,e,n,o,i)):a&&32&c&&!s&&Q(o,32)),o}function He(t,e){t=t.u;let n=et(t);const r=Ge(t,n,e),i=Wt(r);return null!=i&&i!==r&&Ve(t,n,e,i),i}function We(t){t=t.u;let e=et(t);const n=Ge(t,e,1),r=lt(n,!0,!!(34&e));return null!=r&&r!==n&&Ve(t,e,1,r),r}function ze(t,e,n){var r=void 0===vt?2:5;const i=t.u;var s=et(i);const o=2&s?1:r;r=Ke(i,s,e);var a=tt(r);if(Ne(t,a,void 0,!1)){(4&a||Object.isFrozen(r))&&(r=H(r),a=fn(a,s),s=Ve(i,s,e,r));let o=t=0;for(;t<r.length;t++){const e=n(r[t]);null!=e&&(r[o++]=e)}o<t&&(r.length=o),a=-4097&(20|(a=Ye(a,s))),nt(r,a&=-8193),2&a&&Object.freeze(r)}let h;return 1===o||4===o&&32&a?$e(a)||(s=a,(a|=2)!==s&&nt(r,a),Object.freeze(r)):(n=5===o&&(!!(32&a)||$e(a)||!!he?.get(r)),(2===o||n)&&$e(a)&&(r=H(r),a=dn(a=fn(a,s),s,!1),nt(r,a),s=Ve(i,s,e,r)),$e(a)||(e=a,(a=dn(a,s,!1))!==e&&nt(r,a)),n&&(h=ae(r))),h||r}function Ke(t,e,n){return t=Ge(t,e,n),Array.isArray(t)?t:ot}function Ye(t,e){return 0===t&&(t=fn(t,e)),1|t}function $e(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function qe(t){t=H(t);for(let e=0;e<t.length;e++){const n=t[e]=H(t[e]);Array.isArray(n[1])&&(n[1]=rt(n[1]))}return t}function Je(t,e,n,r){t=t.u;let i=et(t);pt(i),Ve(t,i,e,("0"===r?0===Number(n):n===r)?void 0:n)}function Ze(t,e,n,r){const i=et(t);pt(i),t=Xe(t,i,e,2),r=n(r,(4&(e=tt(t))?4096&e?4096:8192&e?8192:0:void 0)??0),t.push(r)}function Qe(t){return t}function tn(t,e){var n=_s;return rn(en(t=t.u),t,et(t),n)===e?e:-1}function en(t){if(W)return t[q]??(t[q]=new Map);if(q in t)return t[q];const e=new Map;return Object.defineProperty(t,q,{value:e}),e}function nn(t,e,n,r){const i=en(t),s=rn(i,t,e,n);return s!==r&&(s&&(e=Ve(t,e,s)),i.set(n,r)),e}function rn(t,e,n,r){let i=t.get(r);if(null!=i)return i;i=0;for(let t=0;t<r.length;t++){const s=r[t];null!=Ge(e,n,s)&&(0!==i&&(n=Ve(e,n,i)),i=s)}return t.set(r,i),i}function sn(t,e,n,r){let i=et(t);const s=Ge(t,i,n,r);let o;if(null!=s&&s.Y===at)return(e=Ue(s))!==s&&Ve(t,i,n,e,r),e.u;if(Array.isArray(s)){const t=tt(s);o=2&t?Ce(s,t,!1):s,o=ge(o,e)}else o=ge(void 0,e);return o!==s&&Ve(t,i,n,o,r),o}function on(t,e,n,r){t=t.u;let i=et(t);const s=Ge(t,i,n,r);return(e=se(s,e,!1,i))!==s&&null!=e&&Ve(t,i,n,e,r),e}function an(t,e,n,r=!1){if(null==(e=on(t,e,n,r)))return e;t=t.u;let i=et(t);if(!(2&i)){const s=Ue(e);s!==e&&Ve(t,i,n,e=s,r)}return e}function hn(t,e,n,r,i,s,o){var a=!!(2&e);i=a?1:i,s=!!s,o&&=!a,a=Ke(t,e,r);var h=tt(a),c=!!(4&h);if(!c){var u=a,l=e;const t=!!(2&(h=Ye(h,e)));t&&(l|=2);let r=!t,i=!0,s=0,o=0;for(;s<u.length;s++){const e=se(u[s],n,!1,l);if(e instanceof n){if(!t){const t=!!(2&tt(e.u));r&&=!t,i&&=t}u[o++]=e}}o<s&&(u.length=o),h|=4,h=i?16|h:-17&h,nt(u,h=r?8|h:-9&h),t&&Object.freeze(u)}if(o&&!(8&h||!a.length&&(1===i||4===i&&32&h))){for($e(h)&&(a=H(a),h=fn(h,e),e=Ve(t,e,r,a)),n=a,o=h,u=0;u<n.length;u++)(h=n[u])!==(l=Ue(h))&&(n[u]=l);o|=8,o=n.length?-17&o:16|o,nt(n,o),h=o}let f;return 1===i||4===i&&32&h?$e(h)||(e=h,(h|=!a.length||16&h&&(!c||32&h)?2:2048)!==e&&nt(a,h),Object.freeze(a)):(c=5===i&&(!!(32&h)||$e(h)||!!he?.get(a)),(2===i||c)&&$e(h)&&(a=H(a),h=dn(h=fn(h,e),e,s),nt(a,h),e=Ve(t,e,r,a)),$e(h)||(t=h,(h=dn(h,e,s))!==t&&nt(a,h)),c&&(f=ae(a))),f||a}function cn(t,e,n){t=t.u;const r=et(t);return hn(t,r,e,n,void 0===vt?2:5,!1,!(2&r))}function un(t,e,n,r,i){return null==r&&(r=void 0),je(t,n,r,i)}function ln(t,e,n,r){null==r&&(r=void 0);t:{t=t.u;let i=et(t);if(pt(i),null==r){const r=en(t);if(rn(r,t,i,n)!==e)break t;r.set(n,0)}else i=nn(t,i,n,e);Ve(t,i,e,r)}}function fn(t,e){return-2049&(t=32|(2&e?2|t:-3&t))}function dn(t,e,n){return 32&e&&n||(t&=-33),t}function pn(t,e,n,r){t=t.u;const i=et(t);pt(i),e=hn(t,i,n,e,2,!0),n=null!=r?r:new n,e.push(n),2&tt(n.u)?Q(e,8):Q(e,16)}function gn(t,e){return t??e}function mn(t,e){return $t(De(t,e))}function yn(t,e){return gn(He(t,e),0)}function _n(t,e){return gn(ie(De(t,e)),"")}function vn(t,e,n){if(null!=n&&"boolean"!=typeof n)throw t=typeof n,Error(`Expected boolean but got ${"object"!=t?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);je(t,e,n)}function En(t,e,n){if(null!=n){if("number"!=typeof n)throw V("int32");if(!Number.isFinite(n))throw V("int32");n|=0}je(t,e,n)}function wn(t,e,n){if(null!=n&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);je(t,e,n)}function Tn(t,e,n){{const a=t.u;let h=et(a);if(pt(h),null==n)Ve(a,h,e);else{n=ce?.get(n)||n;var r,i=tt(n),s=i,o=!!(2&i)||Object.isFrozen(n);if((r=!o)&&(r=void 0===Et||!1),Ne(t,i))for(i=21,o&&(n=H(n),s=0,i=dn(i=fn(i,h),h,!0)),t=0;t<n.length;t++)n[t]=ne(n[t]);r&&(n=H(n),s=0,i=dn(i=fn(i,h),h,!0)),i!==s&&nt(n,i),Ve(a,h,e,n)}}}function An(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function bn(){return Error("Failed to read varint, encoding is invalid.")}function kn(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function xn(t){if("string"==typeof t)return{buffer:M(t),N:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),N:!1};if(t.constructor===Uint8Array)return{buffer:t,N:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),N:!1};if(t.constructor===D)return{buffer:N(t)||new Uint8Array(0),N:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),N:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Sn(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do{n=o[a++],r|=(127&n)<<s,s+=7}while(s<32&&128&n);for(s>32&&(i|=(127&n)>>4),s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Cn(t,a),n<128)return e(r>>>0,i>>>0);throw bn()}function Ln(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return Cn(t,n),!!(127&e)}throw bn()}function Fn(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw bn();return Cn(t,n),i}function Rn(t){return Fn(t)>>>0}function Mn(t){var e=t.h;const n=t.g,r=e[n],i=e[n+1],s=e[n+2];return e=e[n+3],Cn(t,t.g+4),(r<<0|i<<8|s<<16|e<<24)>>>0}function In(t){var e=Mn(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:t*(1/0):0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function Pn(t){return Fn(t)}function On(t,e,{da:n=!1}={}){t.da=n,e&&(e=xn(e),t.h=e.buffer,t.m=e.N,t.j=0,t.l=t.h.length,t.g=t.j)}function Cn(t,e){if(t.g=e,e>t.l)throw kn(t.l,e)}function Un(t,e){if(e<0)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.l)throw kn(e,t.l-n);return t.g=r,n}function Nn(t,e){if(0==e)return U();var n=Un(t,e);return t.da&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):wt?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?U():new D(n,P)}Ae.prototype.toJSON=void 0,Ae.prototype.Ja=ht;var Dn=[];function Bn(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=Rn(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5))throw An(n,t.l);if(e<1)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function Gn(t){switch(t.h){case 0:0!=t.h?Gn(t):Ln(t.g);break;case 1:Cn(t=t.g,t.g+8);break;case 2:if(2!=t.h)Gn(t);else{var e=Rn(t.g);Cn(t=t.g,t.g+e)}break;case 5:Cn(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Bn(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}Gn(t)}break;default:throw An(t.h,t.l)}}function jn(t,e,n){const r=t.g.l,i=Rn(t.g),s=t.g.g+i;let o=s-r;if(o<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),o=s-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=s,t.g.l=r,e}function Vn(t){var e=Rn(t.g),a=Un(t=t.g,e);if(t=t.h,o){var h,c=t;(h=s)||(h=s=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var u=h.decode(c)}catch(t){if(void 0===i){try{h.decode(new Uint8Array([128]))}catch(t){}try{h.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(s=void 0),t}}else{e=(u=a)+e,a=[];let i,s=null;for(;u<e;){var l=t[u++];l<128?a.push(l):l<224?u>=e?n():(i=t[u++],l<194||128!=(192&i)?(u--,n()):a.push((31&l)<<6|63&i)):l<240?u>=e-1?n():(i=t[u++],128!=(192&i)||224===l&&i<160||237===l&&i>=160||128!=(192&(h=t[u++]))?(u--,n()):a.push((15&l)<<12|(63&i)<<6|63&h)):l<=244?u>=e-2?n():(i=t[u++],128!=(192&i)||i-144+(l<<28)>>30!=0||128!=(192&(h=t[u++]))||128!=(192&(c=t[u++]))?(u--,n()):(l=(7&l)<<18|(63&i)<<12|(63&h)<<6|63&c,l-=65536,a.push(55296+(l>>10&1023),56320+(1023&l)))):n(),a.length>=8192&&(s=r(s,a),a.length=0)}u=r(s,a)}return u}function Xn(t){const e=Rn(t.g);return Nn(t.g,e)}function Hn(t,e,n){var r=Rn(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var Wn=[];let zn;function Kn(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}var Yn=class{constructor(t,e){this.u=me(t,e)}toJSON(){return $n(this)}l(){var t=vo;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.u;return Oe(this,t,et(t),!1)}N(){return!!(2&tt(this.u))}};function $n(t){t=zn?t.u:Re(t.u,Ie,void 0,void 0,!1);{var e=!zn;let c=t.length;if(c){var n=t[c-1],r=ut(n);r?c--:n=void 0;var i=t;if(r){t:{var s=n,o={};if(r=!1,s)for(var a in s){if(isNaN(+a)){o[a]=s[a];continue}let t=s[a];Array.isArray(t)&&(ft(t)||ct(t)&&0===t.size)&&(t=null),null==t&&(r=!0),null!=t&&(o[a]=t)}if(r){for(let t in o)break t;o=null}else o=s}s=null==o?null!=n:o!==n}for(;c>0&&(null==(a=i[c-1])||ft(a)||ct(a)&&0===a.size);c--)var h=!0;(i!==t||s||h)&&(e?(h||s||o)&&(i.length=c):i=Array.prototype.slice.call(i,0,c),o&&i.push(o)),h=i}else h=t}return h}function qn(t){return t?/^\d+$/.test(t)?(It(t),new Jn(At,bt)):null:Zn||=new Jn(0,0)}Yn.prototype.Y=at,Yn.prototype.toString=function(){try{return zn=!0,$n(this).toString()}finally{zn=!1}};var Jn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Zn;function Qn(t){return t?/^-?\d+$/.test(t)?(It(t),new tr(At,bt)):null:er||=new tr(0,0)}var tr=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let er;function nr(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function rr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function ir(t,e){if(e>=0)rr(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function sr(t,e){t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function or(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function ar(t,e,n){rr(t.g,8*e+n)}function hr(t,e){return ar(t,e,2),e=t.g.end(),or(t,e),e.push(t.h),e}function cr(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function ur(t,e,n){ar(t,e,2),rr(t.g,n.length),or(t,t.g.end()),or(t,n)}function lr(t,e,n,r){null!=n&&(e=hr(t,e),r(n,t),cr(t,e))}class fr{constructor(t,e,n,r){this.g=t,this.h=e,this.l=n,this.pa=r}}function dr(t){return Array.isArray(t)?t[0]instanceof fr?t:[gi,t]:[t,void 0]}function pr(t,e){if(Array.isArray(e)){var n=tt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),nt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}const gr=Symbol();function mr(t){let e=t[gr];if(!e){const n=br(t),r=Ur(t),i=r.l;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;Bn(e)&&4!=e.h;){var i=e.m;let n=r[i];const a=!n;let h=!1;if(!n){var s=r.U;if(s){var o=s[i];o&&(h=s.O?.[i],(!d||h)&&(s=yr(o))&&(n=r[i]=s))}}n&&n(e,t,i)||(i=(s=e).l,Gn(s),s.ia?s=void 0:(o=s.g.g-i,s.g.g=i,s=Nn(s.g,o)),i=t,s&&(mt||=Symbol(),(o=i[mt])?o.push(s):i[mt]=[s])),a&&n&&!h&&Wr++<5&&j()}n===vr||n===Er||n.j||(t[yt||=Symbol()]=n)},t[gr]=e}return e}function yr(t){const e=(t=dr(t))[0].g;if(t=t[1]){const n=mr(t),r=Ur(t).T;return(t,i,s)=>e(t,i,s,r,n)}return e}class _r{}let vr,Er;const wr=Symbol();function Tr(t,e,n){const r=n[1];let i;if(r){const n=r[wr];i=n?n.T:pe(r[0]),t[e]=n??r}i&&i===fe?(t.g||(t.g=new Set)).add(e):n[0]&&(t.h||(t.h=new Set)).add(e)}function Ar(t,e){return[t.l,!e||e[0]>0?void 0:e]}function br(t){var e=t[wr];if(e)return e;if(!(e=xr(t,t[wr]=new _r,Ar,Ar,Tr)).U&&!e.h&&!e.g){let n=!0;for(let t in e)isNaN(t)||(n=!1);n?(pe(t[0])===fe?Er?e=Er:((e=new _r).T=pe(!0),e=Er=e):e=vr||=new _r,e=t[wr]=e):e.j=!0}return e}function kr(t,e,n){t[e]=n}function xr(t,e,n,r,i=kr){e.T=pe(t[0]);let s=0;var o=t[++s];o&&o.constructor===Object&&(e.U=o,"function"==typeof(o=t[++s])&&(e.l=o,e.m=t[++s],o=t[++s]));const a={};for(;Array.isArray(o)&&"number"==typeof o[0]&&o[0]>0;){for(var h=0;h<o.length;h++)a[o[h]]=o;o=t[++s]}for(h=1;void 0!==o;){let l;"number"==typeof o&&(h+=o,o=t[++s]);var c=void 0;if(o instanceof fr?l=o:(l=mi,s--),l.pa){o=t[++s],c=t;var u=s;"function"==typeof o&&(o=o(),c[u]=o),c=o}for(u=h+1,"number"==typeof(o=t[++s])&&o<0&&(u-=o,o=t[++s]);h<u;h++){const t=a[h];i(e,h,c?r(l,c,t):n(l,t))}}return e}const Sr=Symbol();function Lr(t){let e=t[Sr];if(!e){const n=Ir(t);e=(t,e)=>Br(t,e,n),t[Sr]=e}return e}const Fr=Symbol();function Rr(t){return t.h}function Mr(t,e){let n,r;const i=t.h;return(t,s,o)=>i(t,s,o,r||=Ir(e).T,n||=Lr(e))}function Ir(t){let e=t[Fr];return e||(e=xr(t,t[Fr]={},Rr,Mr),Nr(t),e)}const Pr=Symbol();function Or(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Cr(t,e,n){const r=t.g;let i,s;return(t,o,a)=>r(t,o,a,s||=Ur(e).T,i||=mr(e),n)}function Ur(t){let e=t[Pr];return e||(br(t),e=xr(t,t[Pr]={},Or,Cr),Nr(t),e)}function Nr(t){Pr in t&&wr in t&&Fr in t&&(t.length=0)}function Dr(t,e){var n=t[e];if(n)return n;if(n=t.U){var r=n[e];if(r){var i=(r=dr(r))[0].h;if(r=r[1],n=n.O?.[e],!d||n){if(r){const e=Lr(r),s=Ir(r).T;n=(n=t.m)?n(s,e):(t,n,r)=>i(t,n,r,s,e)}else n=i;return t[e]=n}}}}function Br(t,e,n){for(var r=et(t),i=+!!(512&r)-1,s=t.length,o=512&r?1:0,a=s+(256&r?-1:0);o<a;o++){const r=t[o];if(null==r)continue;const s=o-i,a=Dr(n,s);if(!a)continue;const h=n.U;h?.[s]&&!h?.O?.[s]&&Wr++<5&&j(),a(e,r,s)}if(256&r){r=t[s-1];for(let t in r)i=+t,!Number.isNaN(i)&&(null!=(s=r[t])&&(a=Dr(n,i)))&&((o=n.U)?.[i]&&!o?.O?.[i]&&Wr++<5&&j(),a(e,s,i))}if(t=mt?t[mt]:void 0)for(or(e,e.g.end()),n=0;n<t.length;n++)or(e,N(t[n])||new Uint8Array(0))}function Gr(t,e){return new fr(t,e,!1,!1)}function jr(t,e){return new fr(t,e,!0,!1)}function Vr(t,e){return new fr(t,e,!1,!0)}function Xr(t,e,n){Ve(t,et(t),e,n)}var Hr=Vr((function(t,e,n,r,i){return 2===t.h&&(t=jn(t,ge([void 0,void 0],r),i),pt(r=et(e)),(i=Ge(e,r,n))instanceof Ae?0!=(2&i.L)?((i=i.Z()).push(t),Ve(e,r,n,i)):i.Oa(t):Array.isArray(i)?(2&tt(i)&&Ve(e,r,n,i=qe(i)),i.push(t)):Ve(e,r,n,[t]),!0)}),(function(t,e,n,r,i){if(e instanceof Ae)e.forEach(((e,s)=>{lr(t,n,ge([s,e],r),i)}));else if(Array.isArray(e))for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&lr(t,n,ge(o,r),i)}}));let Wr=0;function zr(t,e,n){e=function(t){if(null==t)return t;const e=typeof t;if("bigint"===e)return String(BigInt.asIntN(64,t));if(Yt(t)){if("string"===e)return Qt(t);if("number"===e)return Zt(t)}}(e),null!=e&&("string"==typeof e&&Qn(e),null!=e&&(ar(t,n,0),"number"==typeof e?(t=t.g,xt(e),nr(t,At,bt)):(n=Qn(e),nr(t.g,n.h,n.g))))}function Kr(t,e,n){null!=(e=$t(e))&&null!=e&&(ar(t,n,0),ir(t.g,e))}function Yr(t,e,n){null!=(e=zt(e))&&(ar(t,n,0),t.g.g.push(e?1:0))}function $r(t,e,n){null!=(e=ie(e))&&ur(t,n,c(e))}function qr(t,e,n,r,i){lr(t,n,e instanceof Yn?e.u:Array.isArray(e)?ge(e,r):void 0,i)}function Jr(t,e,n){null!=(e=null==e||"string"==typeof e||I(e)||e instanceof D?e:void 0)&&ur(t,n,xn(e).buffer)}function Zr(t,e,n){return(5===t.h||2===t.h)&&(e=Xe(e,et(e),n,2,!1),2==t.h?Hn(t,In,e):e.push(In(t.g)),!0)}var Qr,ti=Gr((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=Mn(r);const i=Mn(r);r=2*(i>>31)+1;const s=i>>>20&2047;return t=4294967296*(1048575&i)+t,Xr(e,n,2047==s?t?NaN:r*(1/0):0==s?r*Math.pow(2,-1074)*t:r*Math.pow(2,s-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=Wt(e))&&(ar(t,n,1),t=t.g,(n=Tt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),At=n.getUint32(0,!0),bt=n.getUint32(4,!0),sr(t,At),sr(t,bt))})),ei=Gr((function(t,e,n){return 5===t.h&&(Xr(e,n,In(t.g)),!0)}),(function(t,e,n){null!=(e=Wt(e))&&(ar(t,n,5),t=t.g,St(e),sr(t,At))})),ni=jr(Zr,(function(t,e,n){if(null!=(e=pr(Wt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(ar(r,i,5),r=r.g,St(s),sr(r,At))}})),ri=jr(Zr,(function(t,e,n){if(null!=(e=pr(Wt,e))&&e.length){ar(t,n,2),rr(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,St(e[r]),sr(n,At)}})),ii=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,Sn(t.g,Ft)),!0)}),zr),si=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,0===(t=Sn(t.g,Ft))?void 0:t),!0)}),zr),oi=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,Sn(t.g,Lt)),!0)}),(function(t,e,n){null!=(e=ee(e))&&("string"==typeof e&&qn(e),null!=e&&(ar(t,n,0),"number"==typeof e?(t=t.g,xt(e),nr(t,At,bt)):(n=qn(e),nr(t.g,n.h,n.g))))})),ai=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,Fn(t.g)),!0)}),Kr),hi=jr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Xe(e,et(e),n,2,!1),2==t.h?Hn(t,Fn,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=pr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)ir(t.g,e[n]);cr(t,n)}})),ci=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,0===(t=Fn(t.g))?void 0:t),!0)}),Kr),ui=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,Ln(t.g)),!0)}),Yr),li=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,!1===(t=Ln(t.g))?void 0:t),!0)}),Yr),fi=jr((function(t,e,n){return 2===t.h&&(Ze(e,n,Qe,t=Vn(t)),!0)}),(function(t,e,n){if(null!=(e=pr(ie,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&ur(r,i,c(s))}})),di=Gr((function(t,e,n){return 2===t.h&&(Xr(e,n,""===(t=Vn(t))?void 0:t),!0)}),$r),pi=Gr((function(t,e,n){return 2===t.h&&(Xr(e,n,Vn(t)),!0)}),$r),gi=Vr((function(t,e,n,r,i){return 2===t.h&&(jn(t,sn(e,r,n,!0),i),!0)}),qr),mi=Vr((function(t,e,n,r,i){return 2===t.h&&(jn(t,sn(e,r,n),i),!0)}),qr);Qr=new fr((function(t,e,n,r,i){if(2!==t.h)return!1;r=ge(void 0,r);let s=et(e);pt(s);let o=Xe(e,s,n,3);return s=et(e),4&tt(o)&&(o=H(o),nt(o,-2079&(1|tt(o))),Ve(e,s,n,o)),o.push(r),jn(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let s=0;s<e.length;s++)qr(t,e[s],n,r,i)}),!0,!0);var yi=Vr((function(t,e,n,r,i,s){return 2===t.h&&(nn(e,et(e),s,n),jn(t,e=sn(e,r,n),i),!0)}),qr),_i=Gr((function(t,e,n){return 2===t.h&&(Xr(e,n,Xn(t)),!0)}),Jr),vi=jr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Xe(e,et(e),n,2,!1),2==t.h?Hn(t,Rn,e):e.push(Rn(t.g)),!0)}),(function(t,e,n){if(null!=(e=pr(qt,e)))for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];null!=s&&(ar(r,i,0),rr(r.g,s))}})),Ei=Gr((function(t,e,n){return 0===t.h&&(Xr(e,n,Fn(t.g)),!0)}),(function(t,e,n){null!=(e=$t(e))&&(e=parseInt(e,10),ar(t,n,0),ir(t.g,e))}));class wi{constructor(t,e){this.h=t,this.g=e,this.l=an,this.m=un,this.defaultValue=void 0}}function Ti(t,e){return new wi(t,e)}function Ai(t,e){return(n,r)=>{if(Wn.length){const t=Wn.pop();t.o(r),On(t.g,n,r),n=t}else n=new class{constructor(t,e){if(Dn.length){const n=Dn.pop();On(n,t,e),t=n}else t=new class{constructor(t,e){this.h=null,this.m=!1,this.g=this.l=this.j=0,On(this,t,e)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.da=!1}}(t,e);this.g=t,this.l=this.g.g,this.h=this.m=-1,this.o(e)}o({ia:t=!1}={}){this.ia=t}}(n,r);try{const r=new t,s=r.u;mr(e)(s,n);var i=r}finally{n.g.clear(),n.m=-1,n.h=-1,Wn.length<100&&Wn.push(n)}return i}}function bi(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Br(this.u,e,Ir(t)),or(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let t=0;t<i;t++){const e=r[t];n.set(e,s),s+=e.length}return e.l=[n],n}}var ki=class extends Yn{constructor(t){super(t)}},xi=[0,di,Gr((function(t,e,n){return 2===t.h&&(Xr(e,n,(t=Xn(t))===U()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Yn){const r=e.Ra;return void(r&&(e=r(e),null!=e&&ur(t,n,xn(e).buffer)))}if(Array.isArray(e))return}Jr(t,e,n)}))],Si=[0,ai,Ei,ui,-1,hi,Ei,-1],Li=class extends Yn{constructor(){super()}},Fi=[0,ui,pi,ui,Ei,-1,jr((function(t,e,n){return(0===t.h||2===t.h)&&(e=Xe(e,et(e),n,2,!1),2==t.h?Hn(t,Pn,e):e.push(Fn(t.g)),!0)}),(function(t,e,n){if(null!=(e=pr($t,e))&&e.length){n=hr(t,n);for(let n=0;n<e.length;n++)ir(t.g,e[n]);cr(t,n)}})),pi,-1,[0,ui,-1],Ei,ui],Ri=[0,pi,-2],Mi=class extends Yn{constructor(){super()}},Ii=[0],Pi=[0,ai,ui,1,ui,-3],Oi=[0,pi,ui,-1,ai,[0,[1,2,3,4,5,6],yi,Ii,yi,Fi,yi,Ri,yi,Pi,yi,Si,yi,[0,pi,-2]],[0,pi],ui,[0,[1,3],[2,4],yi,[0,hi],-1,yi,[0,fi],-1,Qr,[0,pi,-1]],pi],Ci=class extends Yn{constructor(t){super(t,2)}},Ui={},Ni=Ui.O={};Ui[336783863]=Oi,Ni[336783863]=1;var Di=[0,si,-1,li,-3,si,hi,di,ci,si,-1,li,ci,li,-2,di];function Bi(t,e){Je(t,2,re(e),"")}function Gi(t,e){Ze(t.u,3,ne,e)}function ji(t,e){Ze(t.u,4,ne,e)}var Vi=class extends Yn{constructor(t){super(t,500)}o(t){return un(this,0,7,t)}},Xi=[-1,{O:{}}],Hi=[0,pi,1,Xi],Wi=[0,pi,fi,Xi];function zi(t,e){pn(t,1,Vi,e)}function Ki(t,e){Ze(t.u,10,ne,e)}function Yi(t,e){Ze(t.u,15,ne,e)}var $i=class extends Yn{constructor(t){super(t,500)}o(t){return un(this,0,1001,t)}},qi=[-500,Qr,[-500,di,-1,fi,-3,[-2,Ui,ui],Qr,xi,ci,-1,Hi,Wi,Qr,[0,di,li],di,Di,ci,fi,987,fi],4,Qr,[-500,pi,-1,[-1,{O:{}}],998,pi],Qr,[-500,pi,fi,-1,[-2,{O:{}},ui],997,fi,-1],ci,Qr,[-500,pi,fi,Xi,998,fi],fi,ci,Hi,Wi,Qr,[0,di,-1,Xi],fi,-2,Di,di,-1,li,979,Xi,Qr,xi];$i.prototype.g=bi(qi);var Ji=Ai($i,qi),Zi=class extends Yn{constructor(t){super(t)}},Qi=class extends Yn{constructor(t){super(t)}g(){return cn(this,Zi,1)}},ts=[0,Qr,[0,ai,ei,pi,-1]],es=Ai(Qi,ts),ns=class extends Yn{constructor(t){super(t)}},rs=class extends Yn{constructor(t){super(t)}},is=class extends Yn{constructor(t){super(t)}h(){return an(this,ns,2)}g(){return cn(this,rs,5)}},ss=Ai(class extends Yn{constructor(t){super(t)}},[0,fi,hi,ri,[0,Ei,[0,ai,-3],[0,ei,-3],[0,ai,-1,[0,Qr,[0,ai,-2]]],Qr,[0,ei,-1,pi,ei]],pi,-1,ii,Qr,[0,ai,ei],fi,ii]),os=class extends Yn{constructor(t){super(t)}},as=Ai(class extends Yn{constructor(t){super(t)}},[0,Qr,[0,ei,-4]]),hs=class extends Yn{constructor(t){super(t)}},cs=Ai(class extends Yn{constructor(t){super(t)}},[0,Qr,[0,ei,-4]]),us=class extends Yn{constructor(t){super(t)}},ls=[0,ai,-1,ri,Ei],fs=class extends Yn{constructor(){super()}};fs.prototype.g=bi([0,ei,-4,ii]);var ds=class extends Yn{constructor(t){super(t)}},ps=Ai(class extends Yn{constructor(t){super(t)}},[0,Qr,[0,1,ai,pi,ts],ii]),gs=class extends Yn{constructor(t){super(t)}},ms=class extends Yn{constructor(t){super(t)}qa(){const t=We(this);return null==t?U():t}},ys=class extends Yn{constructor(t){super(t)}},_s=[1,2],vs=Ai(class extends Yn{constructor(t){super(t)}},[0,Qr,[0,_s,yi,[0,ri],yi,[0,_i],ai,pi],ii]),Es=class extends Yn{constructor(t){super(t)}},ws=[0,pi,ai,ei,fi,-1],Ts=class extends Yn{constructor(t){super(t)}},As=[0,ui,-1],bs=class extends Yn{constructor(t){super(t)}},ks=[1,2,3,4,5],xs=class extends Yn{constructor(t){super(t)}g(){return null!=We(this)}h(){return null!=ie(De(this,2))}},Ss=class extends Yn{constructor(t){super(t)}g(){return zt(De(this,2))??!1}},Ls=[0,_i,pi,[0,ai,ii,-1],[0,oi,ii]],Fs=[0,Ls,ui,[0,ks,yi,Pi,yi,Fi,yi,Si,yi,Ii,yi,Ri],Ei],Rs=class extends Yn{constructor(t){super(t)}},Ms=[0,Fs,ei,-1,ai],Is=Ti(502141897,Rs);Ui[502141897]=Ms,Ni[502141897]=1;var Ps=[0,Ls];Ui[512499200]=Ps;var Os=[0,Ps];Ui[515723506]=Os;var Cs=Ai(class extends Yn{constructor(t){super(t)}},[0,[0,Ei,-1,ni,vi],ls]),Us=[0,Fs];Ui[508981768]=Us;var Ns=class extends Yn{constructor(t){super(t)}},Ds=class extends Yn{constructor(t){super(t)}},Bs=[0,Fs,ei,Us,ui],Gs=[0,Fs,Ms,Bs,ei,Os];Ui[508968149]=Bs;var js=Ti(508968150,Ds);Ui[508968150]=Gs,Ni[508968150]=1,Ni[508968149]=1;var Vs=class extends Yn{constructor(t){super(t)}},Xs=Ti(513916220,Vs);Ui[513916220]=[0,Fs,Gs,ai],Ni[513916220]=1;var Hs=class extends Yn{constructor(t){super(t)}h(){return an(this,Es,2)}g(){je(this,2)}},Ws=[0,Fs,ws];Ui[478825465]=Ws,Ni[478825465]=1;var zs=[0,Fs];Ui[478825422]=zs;var Ks=class extends Yn{constructor(t){super(t)}},Ys=class extends Yn{constructor(t){super(t)}},$s=class extends Yn{constructor(t){super(t)}},qs=class extends Yn{constructor(t){super(t)}},Js=class extends Yn{constructor(t){super(t)}},Zs=[0,Fs,zs,Ws,-1],Qs=[0,Fs,ei,ai],to=[0,Fs,ei],eo=[0,Fs,Qs,to,ei],no=[0,Fs,eo,Zs];Ui[463370452]=Zs,Ui[464864288]=Qs,Ui[474472470]=to;var ro=Ti(462713202,qs);Ui[462713202]=eo;var io=Ti(479097054,Js);Ui[479097054]=no,Ni[479097054]=1,Ni[463370452]=1,Ni[464864288]=1,Ni[462713202]=1,Ni[474472470]=1;var so=class extends Yn{constructor(t){super(t)}},oo=class extends Yn{constructor(t){super(t)}},ao=class extends Yn{constructor(t){super(t)}},ho=class extends Yn{constructor(){super()}},co=[0,Fs,ei,-1,ai],uo=[0,Fs,ei,ui];ho.prototype.g=bi([0,Fs,to,[0,Fs],Ms,Bs,co,uo]),Ui[514774813]=co,Ui[518928384]=uo;var lo=class extends Yn{constructor(t){super(t)}},fo=Ti(456383383,lo);Ui[456383383]=[0,Fs,ws],Ni[456383383]=1;var po=class extends Yn{constructor(t){super(t)}},go=Ti(476348187,po);Ui[476348187]=[0,Fs,As],Ni[476348187]=1;var mo=class extends Yn{constructor(t){super(t)}},yo=class extends Yn{constructor(t){super(t)}},_o=[0,Ei,-1],vo=Ti(458105876,class extends Yn{constructor(t){super(t)}g(){var t=this.u;const e=et(t);const n=2&e;return t=function(t,e,n){var r=yo;const i=2&e;let s=!1;if(null==n){if(i)return Le();n=[]}else if(n.constructor===Ae){if(0==(2&n.L)||i)return n;n=n.Z()}else Array.isArray(n)?s=!!(2&tt(n)):n=[];if(i){if(!n.length)return Le();s||(s=!0,rt(n))}else s&&(s=!1,n=qe(n));return s||(64&tt(n)?Q(n,32):32&e&&Z(n,32)),Ve(t,e,2,r=new Ae(n,r,oe,void 0),!1),r}(t,e,Ge(t,e,2)),!n&&yo&&(t.ta=!0),t}});Ui[458105876]=[0,_o,Hr,[!0,ii,[0,pi,-1,fi]]],Ni[458105876]=1;var Eo=class extends Yn{constructor(t){super(t)}},wo=Ti(458105758,Eo);Ui[458105758]=[0,Fs,pi,_o],Ni[458105758]=1;var To=class extends Yn{constructor(t){super(t)}},Ao=Ti(443442058,To);Ui[443442058]=[0,Fs,pi,ai,ei,fi,-1],Ni[443442058]=1,Ni[514774813]=1;var bo=class extends Yn{constructor(t){super(t)}},ko=Ti(516587230,bo);function xo(t,e){return e=e?e.clone():new Es,void 0!==t.displayNamesLocale?je(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&je(e,1),void 0!==t.maxResults?En(e,2,t.maxResults):"maxResults"in t&&je(e,2),void 0!==t.scoreThreshold?wn(e,3,t.scoreThreshold):"scoreThreshold"in t&&je(e,3),void 0!==t.categoryAllowlist?Tn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&je(e,4),void 0!==t.categoryDenylist?Tn(e,5,t.categoryDenylist):"categoryDenylist"in t&&je(e,5),e}function So(t,e=-1,n=""){return{categories:t.map((t=>({index:gn(mn(t,1),0)??-1,score:yn(t,2)??0,categoryName:_n(t,3)??"",displayName:_n(t,4)??""}))),headIndex:e,headName:n}}function Lo(t){var e=ze(t,3,Wt),n=ze(t,2,$t),r=ze(t,1,ie),i=ze(t,9,ie);const s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:n[t]??-1,categoryName:r[t]??"",displayName:i[t]??""});if((e=an(t,is,4)?.h())&&(s.boundingBox={originX:mn(e,1)??0,originY:mn(e,2)??0,width:mn(e,3)??0,height:mn(e,4)??0,angle:0}),an(t,is,4)?.g().length)for(const e of an(t,is,4).g())s.keypoints.push({x:He(e,1)??0,y:He(e,2)??0,score:He(e,4)??0,label:ie(De(e,3))??""});return s}function Fo(t){const e=[];for(const n of cn(t,hs,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Ro(t){const e=[];for(const n of cn(t,os,1))e.push({x:yn(n,1)??0,y:yn(n,2)??0,z:yn(n,3)??0,visibility:yn(n,4)??0});return e}function Mo(t){return Array.from(t,(t=>t>127?t-256:t))}function Io(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Po;Ui[516587230]=[0,Fs,co,uo,ei],Ni[516587230]=1,Ni[518928384]=1;const Oo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Co(){if(void 0===Po)try{await WebAssembly.instantiate(Oo),Po=!0}catch{Po=!1}return Po}async function Uo(t,e=""){const n=await Co()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var No=class{};function Do(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Bo(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}function Go(t){return void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function jo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Vo(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=Go(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function Xo(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.i.stringToNewUTF8(e[n]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.i._free(e);t.i._free(e)}function Ho(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Wo(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}No.forVisionTasks=function(t){return Uo("vision",t)},No.forTextTasks=function(t){return Uo("text",t)},No.forGenAiExperimentalTasks=function(t){return Uo("genai_experimental",t)},No.forGenAiTasks=function(t){return Uo("genai",t)},No.forAudioTasks=function(t){return Uo("audio",t)},No.isSimdSupported=function(){return Co()};async function zo(t,e,n,r){return t=await(async(t,e,n,r,i)=>{if(e&&await Bo(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Bo(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,r)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&t.endsWith(".data")?n.assetBinaryPath.toString():t}),await t.o(r),t}function Ko(t,e){const n=an(t.baseOptions,xs,1)||new xs;"string"==typeof e?(je(n,2,re(e)),je(n,1)):e instanceof Uint8Array&&(je(n,1,lt(e,!1,!1)),je(n,2)),un(t.baseOptions,0,1,n)}function Yo(t){try{const e=t.G.length;if(1===e)throw Error(t.G[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.G.map((t=>t.message)).join(", "))}finally{t.G=[]}}function $o(t,e){t.B=Math.max(t.B,e)}function qo(t,e){t.A=new Vi,Bi(t.A,"PassThroughCalculator"),Gi(t.A,"free_memory"),ji(t.A,"free_memory_unused_out"),Ki(e,"free_memory"),zi(e,t.A)}function Jo(t,e){Gi(t.A,e),ji(t.A,e+"_unused_out")}function Zo(t){t.g.addBoolToStream(!0,"free_memory",t.B)}var Qo=class{constructor(t){this.g=t,this.G=[],this.B=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(an(this.baseOptions,xs,1)?.g()||an(this.baseOptions,xs,1)?.h()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){let n=an(t.baseOptions,bs,3);if(!n){var r=n=new bs,i=new Mi;ln(r,4,ks,i)}"delegate"in e&&("GPU"===e.delegate?(e=n,r=new Li,ln(e,2,ks,r)):(e=n,r=new Mi,ln(e,4,ks,r))),un(t.baseOptions,0,3,n)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)})).then((t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Ko(this,"/model.dat"),this.m(),this.I()}));if(e.modelAssetBuffer instanceof Uint8Array)Ko(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){const e=[];for(var n=0;;){const{done:r,value:i}=await t.read();if(r)break;e.push(i),n+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(n),n=0;for(const r of e)t.set(r,n),n+=r.length;return t}(e.modelAssetBuffer).then((t=>{Ko(this,t),this.m(),this.I()}))}return this.m(),this.I(),Promise.resolve()}I(){}fa(){let t;if(this.g.fa((e=>{t=Ji(e)}