@mediapipe/tasks-audio 0.10.7 → 0.10.9-rc.20231208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/audio_bundle.cjs +1 -1
- package/audio_bundle.cjs.map +1 -1
- package/audio_bundle.mjs +1 -1
- package/audio_bundle.mjs.map +1 -1
- package/package.json +1 -1
- package/wasm/audio_wasm_internal.js +2 -2
- package/wasm/audio_wasm_internal.wasm +0 -0
- package/wasm/audio_wasm_nosimd_internal.js +2 -2
- package/wasm/audio_wasm_nosimd_internal.wasm +0 -0
package/README.md
CHANGED
|
File without changes
|
package/audio_bundle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=self;function e(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let r,i;const o="undefined"!=typeof TextDecoder;let s;const a="undefined"!=typeof TextEncoder;function u(t){if(a)t=(s||=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(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const o=t.charCodeAt(++i);if(56320<=o&&57343>=o){e=1024*(e-55296)+o-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 c,l;t:{for(var h=["CLOSURE_FLAGS"],f=t,d=0;d<h.length;d++)if(null==(f=f[h[d]])){l=null;break t}l=f}var g,p=l&&l[610401301];c=null!=p&&p;const m=t.navigator;function y(t){return!!c&&(!!g&&g.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function v(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function b(){return!!c&&(!!g&&0<g.brands.length)}function w(){return b()?y("Chromium"):(v("Chrome")||v("CriOS"))&&!(!b()&&v("Edge"))||v("Silk")}g=m&&m.userAgentData||null;var A=!b()&&(v("Trident")||v("MSIE"));!v("Android")||w(),w(),v("Safari")&&(w()||!b()&&v("Coast")||!b()&&v("Opera")||!b()&&v("Edge")||(b()?y("Microsoft Edge"):v("Edg/"))||b()&&y("Opera"));var _={},S=null;function E(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=S[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}T();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function T(){if(!S){S={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));_[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===S[o]&&(S[o]=i)}}}}var O="undefined"!=typeof Uint8Array,P=!A&&"function"==typeof btoa;function x(t){if(!P){var e;void 0===e&&(e=0),T(),e=_[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+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,I={"-":"+",_:"/",".":"="};function j(t){return I[t]||""}function F(t){if(!P)return E(t);L.test(t)&&(t=t.replace(L,j)),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 B(t){return O&&null!=t&&t instanceof Uint8Array}let U;function k(){return U||=new Uint8Array(0)}var M={};let N;function C(t){if(t!==M)throw Error("illegal external caller")}function D(){return N||=new z(null,M)}function G(t){C(M);var e=t.H;return null==(e=null==e||B(e)?e:"string"==typeof e?F(e):null)?e:t.H=e}var z=class{constructor(t,e){if(C(e),this.H=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}N(){const t=G(this);return t?new Uint8Array(t):k()}};function $(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function R(){return Error("Failed to read varint, encoding is invalid.")}function V(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function W(t){return 0==t.length?D():new z(t,M)}function H(t){if("string"==typeof t)return{buffer:F(t),A:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),A:!1};if(t.constructor===Uint8Array)return{buffer:t,A:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),A:!1};if(t.constructor===z)return{buffer:G(t)||k(),A:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),A:!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")}const J="function"==typeof Uint8Array.prototype.slice;let K,q=0,Y=0;function X(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=nt(n,t);t=r,n=e}q=n>>>0,Y=t>>>0}function Q(t){const e=K||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Y=0,q=e.getUint32(0,!0)}function Z(t,e){return 4294967296*e+(t>>>0)}function tt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Z(t,e),n?-t:t}function et(t){if(16>t.length)X(Number(t));else if("function"==typeof BigInt)t=BigInt(t),q=Number(t&BigInt(4294967295))>>>0,Y=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Y=q=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));Y*=1e6,q=1e6*q+e,4294967296<=q&&(Y+=Math.trunc(q/4294967296),Y>>>=0,q>>>=0)}if(e){const[t,e]=nt(q,Y);q=t,Y=e}}}function nt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function rt(t,e,{I:n=!1}={}){t.I=n,e&&(e=H(e),t.j=e.buffer,t.B=e.A,t.C=0,t.m=t.j.length,t.g=t.C)}function it(t,e){if(t.g=e,e>t.m)throw V(t.m,e)}function ot(t,e){let n,r=0,i=0,o=0;const s=t.j;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(32>o&&128&n);for(32<o&&(i|=(127&n)>>4),o=3;32>o&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(it(t,a),128>n)return e(r>>>0,i>>>0);throw R()}function st(t){let e=0,n=t.g;const r=n+10,i=t.j;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return it(t,n),!!(127&e)}throw R()}function at(t){var e=t.j;const n=t.g,r=e[n],i=e[n+1],o=e[n+2];return e=e[n+3],it(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function ut(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.m)throw V(e,t.m-n);return t.g=r,n}function ct(t,e){if(0==e)return D();var n=ut(t,e);return t.I&&t.B?n=t.j.subarray(n,n+e):(t=t.j,n=n===(e=n+e)?k():J?t.slice(n,e):new Uint8Array(t.subarray(n,e))),W(n)}var lt=class{constructor(t,e){this.j=null,this.B=!1,this.g=this.m=this.C=0,rt(this,t,e)}h(){const t=this.j;let e=this.g,n=t[e++],r=127&n;if(128&n&&(n=t[e++],r|=(127&n)<<7,128&n&&(n=t[e++],r|=(127&n)<<14,128&n&&(n=t[e++],r|=(127&n)<<21,128&n&&(n=t[e++],r|=n<<28,128&n&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++]&&128&t[e++])))))throw R();return it(this,e),r}u(){var t=at(this);const e=2*(t>>31)+1,n=t>>>23&255;return t&=8388607,255==n?t?NaN:1/0*e:0==n?e*Math.pow(2,-149)*t:e*Math.pow(2,n-150)*(t+Math.pow(2,23))}F(){return this.h()}},ht=[];function ft(t){var e=t.g;if(e.g==e.m)return!1;t.j=t.g.g;var n=t.g.h()>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw $(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.h=n,!0}function dt(t){switch(t.h){case 0:0!=t.h?dt(t):st(t.g);break;case 1:it(t=t.g,t.g+8);break;case 2:if(2!=t.h)dt(t);else{var e=t.g.h()>>>0;it(t=t.g,t.g+e)}break;case 5:it(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!ft(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.m!=e)throw Error("Unmatched end-group tag");break}dt(t)}break;default:throw $(t.h,t.j)}}function gt(t,e,n){const r=t.g.m,i=t.g.h()>>>0,o=t.g.g+i;let s=o-r;if(0>=s&&(t.g.m=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.m=r}function pt(t){var s=t.g.h()>>>0,a=ut(t=t.g,s);if(t=t.j,o){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),t=a+s,c=0===a&&t===c.length?c:c.subarray(a,t);try{var l=u.decode(c)}catch(t){if(void 0===r){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),r=!0}catch(t){r=!1}}throw!r&&(i=void 0),t}}else{s=(l=a)+s,a=[];let r,i=null;for(;l<s;){var h=t[l++];128>h?a.push(h):224>h?l>=s?e():(r=t[l++],194>h||128!=(192&r)?(l--,e()):a.push((31&h)<<6|63&r)):240>h?l>=s-1?e():(r=t[l++],128!=(192&r)||224===h&&160>r||237===h&&160<=r||128!=(192&(c=t[l++]))?(l--,e()):a.push((15&h)<<12|(63&r)<<6|63&c)):244>=h?l>=s-2?e():(r=t[l++],128!=(192&r)||0!=r-144+(h<<28)>>30||128!=(192&(c=t[l++]))||128!=(192&(u=t[l++]))?(l--,e()):(h=(7&h)<<18|(63&r)<<12|(63&c)<<6|63&u,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):e(),8192<=a.length&&(i=n(i,a),a.length=0)}l=n(i,a)}return l}function mt(t){const e=t.g.h()>>>0;return ct(t.g,e)}function yt(t,e,n){var r=t.g.h()>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e.call(t.g))}var vt=[];function bt(t){return t?/^\d+$/.test(t)?(et(t),new wt(q,Y)):null:At||=new wt(0,0)}var wt=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let At;function _t(t){return t?/^-?\d+$/.test(t)?(et(t),new St(q,Y)):null:Et||=new St(0,0)}var St=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Et;function Tt(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Ot(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Pt(t,e){if(0<=e)Ot(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function xt(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 Lt(t,e){0!==e.length&&(t.j.push(e),t.h+=e.length)}function It(t,e,n){Ot(t.g,8*e+n)}function jt(t,e){return It(t,e,2),e=t.g.end(),Lt(t,e),e.push(t.h),e}function Ft(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function Bt(t,e,n){It(t,e,2),Ot(t.g,n.length),Lt(t,t.g.end()),Lt(t,n)}class Ut{constructor(t,e,n){this.g=t,this.h=e,this.j=n}}function kt(t){return Array.prototype.slice.call(t)}const Mt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;var Nt=Mt?(t,e)=>{t[Mt]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Ct(t){const e=Gt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=kt(t)),$t(t,1|e))}var Dt=Mt?(t,e)=>{t[Mt]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)},Gt=Mt?t=>0|t[Mt]:t=>0|t.o,zt=Mt?t=>t[Mt]:t=>t.o,$t=Mt?(t,e)=>{t[Mt]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Rt(){var t=[];return Nt(t,1),t}function Vt(t,e){$t(e,-255&(0|t))}function Wt(t,e){$t(e,-221&(34|t))}function Ht(t){return 0===(t=t>>11&1023)?536870912:t}var Jt,Kt={};function qt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function Yt(t,e,n){if(null!=t)if("string"==typeof t)t=t?new z(t,M):D();else if(t.constructor!==z)if(B(t))t=n?W(t):t.length?new z(new Uint8Array(t),M):D();else{if(!e)throw Error();t=void 0}return t}const Xt=[];function Qt(t){if(2&t)throw Error()}let Zt,te,ee,ne,re;function ie(t,e){(e=Zt?e[Zt]:void 0)&&(t[Zt]=kt(e))}function oe(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function se(t){return null==t?t:"number"==typeof t||"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function ae(t){if(null!=t){if("boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}t=!!t}return t}function ue(t){return"number"==typeof t&&Number.isFinite(t)||!!t&&"string"==typeof t&&isFinite(t)}function ce(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function le(t){if("string"!=typeof t)throw Error();return t}function he(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function fe(t){return null==t||"string"==typeof t?t:void 0}function de(t,e,n){var r=!1;if(null!=t&&"object"==typeof t&&!(r=Array.isArray(t))&&t.G===Kt)return t;if(r){var i=r=Gt(t);return 0===i&&(i|=32&n),(i|=2&n)!==r&&$t(t,i),new e(t)}}function ge(t){switch(typeof t){case"boolean":return ne||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?re||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function pe(t,e,n){if(null==t&&(t=ee),ee=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-2095105&r|(1023&e)<<11)}else{if(!Array.isArray(t))throw Error();if(64&(r=Gt(t)))return te&&delete t[te],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{var i=(n=t).length;if(i){const t=i-1;var o=n[t];if(qt(o)){1024<=(i=t-(e=+!!(512&(r|=256))-1))&&(me(n,e,o),i=1023),r=-2095105&r|(1023&i)<<11;break t}}e&&(o=+!!(512&r)-1,1024<(e=Math.max(e,i-o))&&(me(n,o,{}),r|=256,e=1023),r=-2095105&r|(1023&e)<<11)}}return $t(t,r),t}function me(t,e,n){const r=1023+e,i=t.length;for(let o=r;o<i;o++){const r=t[o];null!=r&&r!==n&&(n[o-e]=r)}t.length=r+1,t[r]=n}function ye(t,e,n,r,i,o){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&Gt(t)?void 0:o&&2&Gt(t)?t:ve(t,e,n,void 0!==r,i,o);else if(qt(t)){const s={};for(let a in t)s[a]=ye(t[a],e,n,r,i,o);t=s}else t=e(t,r);return t}}function ve(t,e,n,r,i,o){const s=r||n?Gt(t):0;r=r?!!(32&s):void 0;const a=kt(t);for(let t=0;t<a.length;t++)a[t]=ye(a[t],e,n,r,i,o);return n&&(ie(a,t),n(s,a)),a}function be(t){return t.G===Kt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t&&!Array.isArray(t)){if(B(t))return x(t);if(t instanceof z){const e=t.H;return null==e?"":"string"==typeof e?e:t.H=x(e)}}}return t}(t)}function we(t,e,n=Wt){if(null!=t){if(O&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Gt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?($t(t,34|r),4&r&&Object.freeze(t),t):ve(t,we,4&r?Wt:n,!0,!1,!0))}return t.G===Kt&&(n=t.l,t=2&(r=zt(n))?t:_e(t,n,r,!0)),t}}function Ae(t){const e=t.l;return _e(t,e,zt(e),!1)}function _e(t,e,n,r){return t=t.constructor,ee=e=Se(e,n,r),e=new t(e),ee=void 0,e}function Se(t,e,n){const r=n||2&e?Wt:Vt,i=!!(32&e);return t=function(t,e,n){const r=kt(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return ie(r,t),r}(t,e,(t=>we(t,i,r))),Nt(t,32|(n?2:0)),t}function Ee(t){const e=t.l,n=zt(e);return 2&n?_e(t,e,n,!1):t}function Te(t,e){return Oe(t=t.l,zt(t),e)}function Oe(t,e,n,r){if(-1===n)return null;if(n>=Ht(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+(+!!(512&e)-1))<i)return t[e]}}function Pe(t,e,n,r){const i=t.l,o=zt(i);return Qt(o),xe(i,o,e,n,r),t}function xe(t,e,n,r,i){var o=Ht(e);if(n>=o||i){if(i=e,256&e)o=t[t.length-1];else{if(null==r)return;o=t[o+(+!!(512&e)-1)]={},i|=256}o[n]=r,i!==e&&$t(t,i)}else t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n])}function Le(t,e,n,r,i){var o=2&e;let s=Oe(t,e,n,i);Array.isArray(s)||(s=Jt);const a=!(2&r),u=!(1&r);r=!!(32&e);let c=Gt(s);return 0!==c||!r||o||a?1&c||(c|=1,$t(s,c)):(c|=33,$t(s,c)),o?(2&c||Nt(s,34),u&&Object.freeze(s)):(o=2&c,u&&o?(s=kt(s),o=1,r&&!a&&(o|=32),$t(s,o),xe(t,e,n,s,i)):a&&32&c&&!o&&Dt(s,32)),s}function Ie(t){t=t.l;const e=zt(t),n=Oe(t,e,1),r=Yt(n,!0,!!(34&e));return null!=r&&r!==n&&xe(t,e,1,r),r}function je(t,e,n){t=t.l;const r=zt(t);if(Qt(r),null==n)xe(t,r,e);else{if(!(4&Gt(n))){Object.isFrozen(n)&&(n=kt(n));for(let t=0;t<n.length;t++)n[t]=le(n[t]);$t(n,5)}xe(t,r,e,n)}}function Fe(t,e){t=t.l;const n=zt(t);Qt(n),xe(t,n,2,""===e?void 0:e)}function Be(t,e){return Ue(t=t.l,zt(t),Hr)===e?e:-1}function Ue(t,e,n){let r=0;for(let i=0;i<n.length;i++){const o=n[i];null!=Oe(t,e,o)&&(0!==r&&xe(t,e,r),r=o)}return r}function ke(t,e,n,r){const i=zt(t);Qt(i);const o=Oe(t,i,n,r);let s;if(null!=o&&o.G===Kt)return(e=Ee(o))!==o&&xe(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=Gt(o);s=2&t?Se(o,t,!1):o,s=pe(s,e[0],e[1])}else s=pe(void 0,e[0],e[1]);return s!==o&&xe(t,i,n,s,r),s}function Me(t,e,n,r){t=t.l;const i=zt(t),o=Oe(t,i,n,r);return(e=de(o,e,i))!==o&&null!=e&&xe(t,i,n,e,r),e}function Ne(t,e,n){if(null==(e=Me(t,e,n,!1)))return e;t=t.l;const r=zt(t);if(!(2&r)){const i=Ee(e);i!==e&&xe(t,r,n,e=i,!1)}return e}function Ce(t,e,n,r){var i=!!(2&e),o=Le(t,e,1,1),s=o===Jt;if(s&&2!==r)return o;if(s||!(4&Gt(o))){var a=o;o=!!(2&e),s=!!(2&Gt(a)),i=a,!o&&s&&(a=kt(a));var u=e|((s=s||void 0)?2:0),c=s;s=!1;let l=0,h=0;for(;l<a.length;l++){const t=de(a[l],n,u);if(null==t)continue;const e=!!(2&Gt(t.l));c=c||e,s=s||!e,a[h++]=t}return h<l&&(a.length=h),u=5|(a=Gt(n=a)),c=c?-9&u:8|u,a!=(c=s?-17&c:16|c)&&(Object.isFrozen(n)&&(n=kt(n)),$t(n,c)),i!==(a=n)&&xe(t,e,1,a),(o&&2!==r||1===r)&&Object.freeze(a),a}return 3===r||(i?2===r&&(r=Gt(o),o=kt(o),$t(o,r),xe(t,e,1,o)):(i=Object.isFrozen(o),1===r?i||Object.freeze(o):(n=-33&(r=Gt(o)),i||2&r?(o=kt(o),$t(o,-3&n),xe(t,e,1,o)):r!==n&&$t(o,n)))),o}function De(t,e){var n=t.l,r=zt(n);if(e=Ce(n,r,e,(t=!!(2&r))?1:2),!(t||8&Gt(e))){for(t=0;t<e.length;t++)(n=e[t])!==(r=Ee(n))&&(e[t]=r);Nt(e,8)}return e}function Ge(t,e,n,r,i){return null==r&&(r=void 0),Pe(t,n,r,i)}function ze(t,e,n){var r=Ir;null==n&&(n=void 0),t=t.l;const i=zt(t);Qt(i),(r=Ue(t,i,r))&&r!==e&&null!=n&&xe(t,i,r),xe(t,i,e,n)}function $e(t,e){var n=mr;t=t.l;const r=zt(t);Qt(r),t=Ce(t,r,n,2),e=null!=e?e:new n,t.push(e),2&Gt(e.l)?Dt(t,8):Dt(t,16)}function Re(t){return t=null==(t=Te(t,2))||ue(t)?t:void 0}function Ve(t){return t??0}function We(t,e,n){n=le(n),t=t.l;const r=zt(t);Qt(r),Le(t,r,e,2).push(n)}function He(t,e,n){e.g?e.j(t,e.g,e.h,n,!0):e.j(t,e.h,n,!0)}$t(Xt,55),Jt=Object.freeze(Xt);var Je=class{constructor(t,e){this.l=pe(t,e)}toJSON(){return Ke(this,ve(this.l,be,void 0,void 0,!1,!1),!0)}A(){return!!(2&Gt(this.l))}};function Ke(t,e,n){var r=t.constructor.v,i=Ht(zt(n?t.l:e)),o=!1;if(r){if(!n){var s;if((e=kt(e)).length&&qt(s=e[e.length-1]))for(o=0;o<r.length;o++)if(r[o]>=i){Object.assign(e[e.length-1]={},s);break}o=!0}var a;i=e,n=!n,t=Ht(s=zt(t.l)),s=+!!(512&s)-1;for(let e=0;e<r.length;e++){var u=r[e];if(u<t){var c=i[u+=s];null==c?i[u]=n?Jt:Rt():n&&c!==Jt&&Ct(c)}else{if(!a){var l=void 0;i.length&&qt(l=i[i.length-1])?a=l:i.push(a={})}c=a[u],null==a[u]?a[u]=n?Jt:Rt():n&&c!==Jt&&Ct(c)}}}if(!(r=e.length))return e;let h,f;if(qt(a=e[r-1])){t:{var d=a;l={},i=!1;for(let t in d)n=d[t],Array.isArray(n)&&n!=n&&(i=!0),null!=n?l[t]=n:i=!0;if(i){for(let t in l){d=l;break t}d=null}}d!=a&&(h=!0),r--}for(;0<r&&null==(a=e[r-1]);r--)f=!0;return h||f?(e=o?e:Array.prototype.slice.call(e,0,r),o&&(e.length=r),d&&e.push(d),e):e}function qe(t){return{L:$n,J:t}}function Ye(t,e){if(Array.isArray(e)){var n=Gt(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),$t(e,5|n),2&n&&Object.freeze(e),e}}Je.prototype.G=Kt,Je.prototype.toString=function(){return Ke(this,this.l,!1).toString()};const Xe=Symbol();function Qe(t){let e=t[Xe];if(!e){const n=on(t),r=mn(t),i=r.h;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;ft(e)&&4!=e.h;){var i=e.m,o=r[i];if(!o){var s=r.g;s&&(s=s[i])&&(o=r[i]=Ze(s))}o&&o(e,t,i)||(i=(o=e).j,dt(o),o.K?o=void 0:(s=o.g.g-i,o.g.g=i,o=ct(o.g,s)),i=t,o&&(Zt||=Symbol(),(s=i[Zt])?s.push(o):i[Zt]=[o]))}for(const e in n){t[te||=Symbol()]=n;break}},t[Xe]=e}return e}function Ze(t){const e=function(t){if(t=t.J)return Qe(t)}(t),n=t.L.g;if(e){const r=mn(t.J).D;return(t,i,o)=>n(t,i,o,r,e)}return(t,e,r)=>n(t,e,r)}const tn=Symbol();function en(t,e,n,r){let i;if(r){const e=r[tn];i=e?e.D:ge(r[0]),n[t]=e??r}i&&i===ne?((e=n.R)||(n.R=e=[]),e.push(t)):e.j&&((e=n.T)||(n.T=e=[]),e.push(t))}function nn(t,e,n,r){en(t,e,r)}function rn(t,e,n,r,i){en(t,e,i,n)}function on(t){let e=t[tn];return e||(e=t[tn]={},sn(t,e,nn,rn,e))}function sn(t,e,n,r,i){e.D=ge(t[0]);let o=1;if(t.length>o&&!(t[o]instanceof Ut)){var s=t[o++];if(Array.isArray(s))return e.h=s[0],e.g=s[1],e;e.g=s}for(s=0;o<t.length;){var a=t[o++],u=t[o];for("number"==typeof u?(o++,s+=u):s++,u=o;u<t.length&&!(t[u]instanceof Ut);)u++;if(u-=o){var c=t,l=o,h=c[l];if("function"==typeof h&&(h=h(),c[l]=h),(c=Array.isArray(h))&&!(c=dn in h||cn in h)&&(c=0<h.length)){const t=ge(l=(c=h)[0]);null!=t&&t!==l&&(c[0]=t),c=null!=t}(h=c?h:void 0)?(o++,1===u?void 0!==(a=r(s,a,h,void 0,i))&&(e[s]=a):void 0!==(a=r(s,a,h,t[o++],i))&&(e[s]=a)):void 0!==(a=n(s,a,t[o++],i))&&(e[s]=a)}else void 0!==(a=n(s,a,void 0,i))&&(e[s]=a)}return e}const an=Symbol();function un(t){let e=t[an];if(!e){const n=fn(t);e=(t,e)=>vn(t,e,n),t[an]=e}return e}const cn=Symbol();function ln(t,e){return e.h}function hn(t,e,n){let r,i;const o=e.h;return(t,e,s)=>o(t,e,s,i||=fn(n).D,r||=un(n))}function fn(t){let e=t[cn];return e||(e=sn(t,t[cn]={},ln,hn),dn in t&&cn in t&&(t.length=0),e)}const dn=Symbol();function gn(t,e,n){const r=e.g;return n?(t,e,i)=>r(t,e,i,n):r}function pn(t,e,n,r){const i=e.g;let o,s;return(t,e,a)=>i(t,e,a,s||=mn(n).D,o||=Qe(n),r)}function mn(t){let e=t[dn];return e||(on(t),e=sn(t,t[dn]={},gn,pn),dn in t&&cn in t&&(t.length=0),e)}function yn(t,e){var n=t[e];if(n)return n;if((n=t.g)&&(n=n[e])){var r=n.J,i=n.L.h;if(r){const t=un(r),e=fn(r).D;n=(n,r,o)=>i(n,r,o,e,t)}else n=i;return t[e]=n}}function vn(t,e,n){for(var r=zt(t),i=+!!(512&r)-1,o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=yn(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=yn(n,i))&&a(e,o,i)}if(t=Zt?t[Zt]:void 0)for(Lt(e,e.g.end()),n=0;n<t.length;n++)Lt(e,G(t[n])||k())}function bn(t,e){return new Ut(t,e,!1)}function wn(t,e){return new Ut(t,e,!0)}function An(t,e,n){xe(t,zt(t),e,n)}function _n(t,e,n){t:if(null!=e){if(ue(e)){if("string"==typeof e)break t;if("number"==typeof e)break t}e=void 0}null!=e&&("string"==typeof e&&_t(e),null!=e&&(It(t,n,0),"number"==typeof e?(t=t.g,X(e),Tt(t,q,Y)):(n=_t(e),Tt(t.g,n.h,n.g))))}function Sn(t,e,n){null!=(e=ce(e))&&null!=e&&(It(t,n,0),Pt(t.g,e))}function En(t,e,n){null!=(e=null==e?e:"boolean"==typeof e||"number"==typeof e?!!e:void 0)&&(It(t,n,0),t.g.g.push(e?1:0))}function Tn(t,e,n){null!=(e=fe(e))&&Bt(t,n,u(e))}function On(t,e,n,r,i){null!=(e=e instanceof Je?e.l:Array.isArray(e)?pe(e,r[0],r[1]):void 0)&&(n=jt(t,n),i(e,t),Ft(t,n))}function Pn(t,e,n){null!=(e=null==e||"string"==typeof e||B(e)||e instanceof z?e:void 0)&&Bt(t,n,H(e).buffer)}var xn=bn((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=at(r);const i=at(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,An(e,n,2047==o?t?NaN:1/0*r:0==o?r*Math.pow(2,-1074)*t:r*Math.pow(2,o-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=se(e))&&(It(t,n,1),t=t.g,(n=K||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),q=n.getUint32(0,!0),Y=n.getUint32(4,!0),xt(t,q),xt(t,Y))})),Ln=bn((function(t,e,n){return 5===t.h&&(An(e,n,t.g.u()),!0)}),(function(t,e,n){null!=(e=se(e))&&(It(t,n,5),t=t.g,Q(e),xt(t,q))})),In=wn((function(t,e,n){return(5===t.h||2===t.h)&&(e=Le(e,zt(e),n,2,!1),2==t.h?yt(t,lt.prototype.u,e):e.push(t.g.u()),!0)}),(function(t,e,n){if(null!=(e=Ye(se,e))&&e.length){It(t,n,2),Ot(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Q(e[r]),xt(n,q)}})),jn=bn((function(t,e,n){return 0===t.h&&(An(e,n,ot(t.g,tt)),!0)}),_n),Fn=bn((function(t,e,n){return 0===t.h&&(An(e,n,0===(t=ot(t.g,tt))?void 0:t),!0)}),_n),Bn=bn((function(t,e,n){return 0===t.h&&(An(e,n,ot(t.g,Z)),!0)}),(function(t,e,n){t:if(null!=e){if(ue(e)){if("string"==typeof e)break t;if("number"==typeof e)break t}e=void 0}null!=e&&("string"==typeof e&&bt(e),null!=e&&(It(t,n,0),"number"==typeof e?(t=t.g,X(e),Tt(t,q,Y)):(n=bt(e),Tt(t.g,n.h,n.g))))})),Un=bn((function(t,e,n){return 0===t.h&&(An(e,n,t.g.h()),!0)}),Sn),kn=wn((function(t,e,n){return(0===t.h||2===t.h)&&(e=Le(e,zt(e),n,2,!1),2==t.h?yt(t,lt.prototype.h,e):e.push(t.g.h()),!0)}),(function(t,e,n){if(null!=(e=Ye(ce,e))&&e.length){n=jt(t,n);for(let n=0;n<e.length;n++)Pt(t.g,e[n]);Ft(t,n)}})),Mn=bn((function(t,e,n){return 0===t.h&&(An(e,n,0===(t=t.g.h())?void 0:t),!0)}),Sn),Nn=bn((function(t,e,n){return 0===t.h&&(An(e,n,st(t.g)),!0)}),En),Cn=bn((function(t,e,n){return 0===t.h&&(An(e,n,!1===(t=st(t.g))?void 0:t),!0)}),En),Dn=wn((function(t,e,n){if(2!==t.h)return!1;t=pt(t);const r=zt(e);return Qt(r),Le(e,r,n,2).push(t),!0}),(function(t,e,n){if(null!=(e=Ye(fe,e)))for(let i=0;i<e.length;i++){var r=e[i];null!=r&&Bt(t,n,u(r))}})),Gn=bn((function(t,e,n){return 2===t.h&&(An(e,n,""===(t=pt(t))?void 0:t),!0)}),Tn),zn=bn((function(t,e,n){return 2===t.h&&(An(e,n,pt(t)),!0)}),Tn),$n=bn((function(t,e,n,r,i){return 2===t.h&&(gt(t,ke(e,r,n,!0),i),!0)}),On),Rn=bn((function(t,e,n,r,i){return 2===t.h&&(gt(t,ke(e,r,n),i),!0)}),On),Vn=wn((function(t,e,n,r,i){if(2!==t.h)return!1;r=pe(void 0,r[0],r[1]);const o=zt(e);Qt(o);let s=Le(e,o,n,3);return(Object.isFrozen(s)||4&Gt(s))&&(s=kt(s),xe(e,o,n,s)),s.push(r),gt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)On(t,e[o],n,r,i)})),Wn=bn((function(t,e,n,r,i,o){if(2!==t.h)return!1;const s=zt(e);return Qt(s),(o=Ue(e,s,o))&&n!==o&&xe(e,s,o),gt(t,e=ke(e,r,n),i),!0}),On),Hn=bn((function(t,e,n){return 2===t.h&&(An(e,n,mt(t)),!0)}),Pn),Jn=bn((function(t,e,n){return 0===t.h&&(An(e,n,t.g.h()),!0)}),(function(t,e,n){null!=(e=ce(e))&&(e=parseInt(e,10),It(t,n,0),Pt(t.g,e))})),Kn=wn((function(t,e,n){return(0===t.h||2===t.h)&&(e=Le(e,zt(e),n,2,!1),2==t.h?yt(t,lt.prototype.F,e):e.push(t.g.h()),!0)}),(function(t,e,n){if(null!=(e=Ye(ce,e))&&e.length){n=jt(t,n);for(let n=0;n<e.length;n++)Pt(t.g,e[n]);Ft(t,n)}}));class qn{constructor(t,e){this.h=t,this.g=e,this.j=Ge,this.defaultValue=void 0}}function Yn(t,e){return(n,r)=>{t:{if(vt.length){const t=vt.pop();t.s(r),rt(t.g,n,r),n=t}else n=new class{constructor(t,e){if(ht.length){const n=ht.pop();rt(n,t,e),t=n}else t=new lt(t,e);this.g=t,this.j=this.g.g,this.h=this.m=-1,this.s(e)}s({K:t=!1}={}){this.K=t}}(n,r);try{var i=new t;const r=i.l;Qe(e)(r,n),te&&delete r[te];var o=i;break t}finally{(i=n.g).j=null,i.B=!1,i.C=0,i.m=0,i.g=0,i.I=!1,n.m=-1,n.h=-1,100>vt.length&&vt.push(n)}o=void 0}return o}}var Xn=[0,Gn,bn((function(t,e,n){return 2===t.h&&(An(e,n,(t=mt(t))===D()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Je){const r=e.V;return void(r&&(e=r(e),null!=e&&Bt(t,n,H(e).buffer)))}if(Array.isArray(e))return}Pn(t,e,n)}))],Qn=[0,zn],Zn=[0,Un,Jn,Nn,Nn,kn,Jn,Jn],tr=[0,Nn,Nn],er=class extends Je{constructor(){super()}};er.v=[6];var nr=[0,Nn,zn,Nn,Jn,Jn,Kn,zn,zn,Rn,tr,Jn],rr=[0,zn,zn,zn],ir=class extends Je{constructor(){super()}},or=[0],sr=[0,Un],ar=[1,2,3,4,5],ur=class extends Je{constructor(t){super(t,2)}},cr={},lr=[-2,cr,Nn];cr[336783863]=qe([0,zn,Nn,Nn,Un,Rn,[0,Wn,or,ar,Wn,nr,ar,Wn,rr,ar,Wn,sr,ar,Wn,Zn,ar],Rn,Qn]);var hr=[0,Gn,Cn],fr=[0,Fn,Fn,Cn,Cn,Cn,Cn,Fn,kn,Gn,Mn,Fn,Fn,Cn,Mn,Cn,Cn,Cn,Gn],dr=[-1,{}],gr=[0,zn,Rn,2,dr],pr=[0,zn,Dn,Rn,dr],mr=class extends Je{constructor(t){super(t,500)}s(t){return Ge(this,0,7,t)}};mr.v=[3,4,5,6,8,13,17,1005];var yr,vr=[-500,Gn,Gn,Dn,Dn,Dn,Dn,Rn,lr,Vn,Xn,Mn,Mn,Rn,gr,Rn,pr,Vn,hr,Gn,Rn,fr,Mn,Dn,Dn,988],br=[0,Gn,Gn,Rn,dr],wr=[-500,zn,zn,Rn,[-1,{}],zn,999],Ar=[-500,zn,Dn,Dn,Rn,[-2,{},Nn],Dn,998,Dn],_r=[-500,zn,Dn,Rn,dr,Dn,999],Sr=class extends Je{constructor(){super(void 0,500)}s(t){return Ge(this,0,1001,t)}};Sr.v=[1,6,7,9,10,15,16,17,14,1002],Sr.prototype.g=(yr=[-500,Vn,vr,Vn,5,wr,Vn,Ar,Mn,Vn,_r,Dn,Mn,Rn,gr,Rn,pr,Vn,br,Dn,Dn,Dn,Rn,fr,Gn,Gn,Cn,Rn,980,dr,Vn,Xn],function(){const t=new class{constructor(){this.j=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};vn(this.l,t,fn(yr)),Lt(t,t.g.end());const e=new Uint8Array(t.h),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var Er=class extends Je{constructor(t){super(t)}},Tr=[0,Un,Ln,zn,zn],Or=class extends Je{constructor(t){super(t)}g(){return De(this,Er)}};Or.v=[1];var Pr=[0,Vn,Tr],xr=class extends Je{constructor(t){super(t)}};xr.v=[4,5];var Lr=class extends Je{constructor(t){super(t)}},Ir=[1,2,3,4,5],jr=class extends Je{constructor(t){super(t)}g(){return null!=Ie(this)}h(){return null!=fe(Te(this,2))}},Fr=class extends Je{constructor(t){super(t)}},Br=[0,Rn,[0,Hn,zn,Rn,[0,Un,jn,jn],Rn,[0,Bn,jn]],Nn,Rn,[0,Wn,sr,Ir,Wn,nr,Ir,Wn,Zn,Ir,Wn,or,Ir,Wn,rr,Ir]],Ur=class extends Je{constructor(t){super(t)}},kr=new qn(451755788,Ur);cr[451755788]=qe([0,Rn,Br,Rn,[0,zn,Un,Ln,Dn,Dn],xn]);var Mr=class extends Je{constructor(t){super(t)}},Nr=class extends Je{constructor(t){super(t)}},Cr=new qn(487277289,Nr);cr[487277289]=qe([0,Rn,Br,Rn,[0,Nn,Nn]]);var Dr=class extends Je{constructor(t){super(t)}},Gr=[0,Un,2,zn,Rn,Pr],zr=class extends Je{constructor(t){super(t)}};zr.v=[1];var $r=Yn(zr,[0,Vn,Gr,jn]),Rr=class extends Je{constructor(t){super(t)}};Rr.v=[1];var Vr=class extends Je{constructor(t){super(t)}M(){const t=Ie(this);return null==t?D():t}},Wr=class extends Je{constructor(t){super(t)}},Hr=[1,2],Jr=[0,Wn,[0,In],Hr,Wn,[0,Hn],Hr,Un,zn],Kr=class extends Je{constructor(t){super(t)}};Kr.v=[1];var qr=Yn(Kr,[0,Vn,Jr,jn]);async function Yr(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 Xr(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 Qr(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 Zr(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function ti(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)}}const ei=function(t){return class extends t{S(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:((t="undefined"==typeof OffscreenCanvas)||(t=(t=navigator.userAgent).includes("Safari")&&!t.includes("Chrome")),t?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas")):this.i.canvas=new OffscreenCanvas(1,1))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Xr(this,r||"input_audio",(r=>{Xr(this,i=i||"audio_header",(i=>{this.i._configureAudio(r,i,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const o=4*t.length;this.h!==o&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(o),this.h=o),this.i.HEAPF32.set(t,this.g/4),Xr(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Xr(this,e,(e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var r=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");let i;this.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),t.videoWidth?(r=t.videoWidth,i=t.videoHeight):t.naturalWidth?(r=t.naturalWidth,i=t.naturalHeight):(r=t.width,i=t.height),!this.j||r===this.i.canvas.width&&i===this.i.canvas.height||(this.i.canvas.width=r,this.i.canvas.height=i);const[o,s]=[r,i];this.i._addBoundTextureToStream(e,o,s,n)}))}addBoolToStream(t,e,n){Xr(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Xr(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Xr(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Xr(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){Xr(this,e,(e=>{Xr(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Xr(this,e,(e=>{Qr(this,Object.keys(t),(r=>{Qr(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Xr(this,n,(n=>{Xr(this,e,(e=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,n,r),this.i._free(i)}))}))}addEmptyPacketToStream(t,e){Xr(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolToInputSidePacket(t,e){Xr(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Xr(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Xr(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Xr(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Xr(this,e,(e=>{Xr(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Xr(this,n,(n=>{Xr(this,e,(e=>{const r=this.i._malloc(t.length);this.i.HEAPU8.set(t,r),this.i._addProtoToInputSidePacket(r,t.length,e,n),this.i._free(r)}))}))}attachBoolListener(t,e){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){ti(this,t,e),Xr(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){ti(this,t,e),Xr(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){ti(this,t,e),Xr(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){ti(this,t,e),Xr(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){ti(this,t,e),Xr(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Zr(this,t,e),Xr(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){ti(this,t,e),Xr(this,t,(t=>{this.i._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Zr(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Xr(this,t,(t=>{this.i._attachAudioListener(t,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}});var ni=class extends ei{};async function ri(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Yr(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Yr(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.s(n),t}async function ii(t,e,n){return ri(t,e,n)}function oi(t,e){const n=Ne(t.baseOptions,jr,1)||new jr;"string"==typeof e?(Pe(n,2,he(e)),Pe(n,1)):e instanceof Uint8Array&&(Pe(n,1,Yt(e,!1,!1)),Pe(n,2)),Ge(t.baseOptions,0,1,n)}function si(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ne(t.baseOptions,jr,1)?.g()||Ne(t.baseOptions,jr,1)?.h()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(t,e){let n=Ne(t.baseOptions,Lr,3);if(!n){var r=n=new Lr;ze(r,4,new ir)}"delegate"in e&&("GPU"===e.delegate?ze(e=n,2,r=new er):ze(e=n,4,r=new ir)),Ge(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath?fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.i.FS_unlink("/model.dat")}catch{}t.g.i.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),oi(t,"/model.dat"),t.F()})):(oi(t,n.modelAssetBuffer),t.F(),Promise.resolve())}function ai(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function ui(t,e){t.u=Math.max(t.u,e)}var ci=class{constructor(t){this.g=t,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.S(),this.g.setGraph(t,e),ai(this)}finishProcessing(){this.g.finishProcessing(),ai(this)}close(){this.g.closeGraph()}};async function li(t,e,n){return ii(t,e,n)}ci.prototype.close=ci.prototype.close;var hi=class extends ci{constructor(){super(...arguments),this.C=48e3}U(t){this.C=t}};function fi(t){const e={classifications:De(t,Dr).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=ce(Te(t,1))??0??-1;const n=t.l,r=zt(n),i=Oe(n,r,2),o=se(i);return null!=o&&o!==i&&xe(n,r,2,o),{index:e,score:o??0??0,categoryName:fe(Te(t,3))??""??"",displayName:fe(Te(t,4))??""??""}})),headIndex:e,headName:n}}(Ne(t,Or,4)?.g()??[],ce(Te(t,2))??0,fe(Te(t,3))??"")))};return null!=Re(t)&&(e.timestampMs=Ve(Re(t))),e}hi.prototype.setDefaultSampleRate=hi.prototype.U;var di=class extends hi{constructor(t,e){super(new ni(t,e)),this.m=[],this.h=new Ur,t=new Fr,Ge(this.h,0,1,t)}get baseOptions(){return Ne(this.h,Fr,1)}set baseOptions(t){Ge(this.h,0,1,t)}s(e){var n=this.h,r=Ne(this.h,xr,2);if(r=r?Ae(r):new xr,void 0!==e.displayNamesLocale?Pe(r,1,he(e.displayNamesLocale)):void 0===e.displayNamesLocale&&Pe(r,1),void 0!==e.maxResults){var i=e.maxResults;if(null!=i){if("number"!=typeof i)throw oe(e=Error(),"warning"),e;if(!Number.isFinite(i)){const e=Error();oe(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}}Pe(r,2,i)}else"maxResults"in e&&Pe(r,2);if(void 0!==e.scoreThreshold){if(null!=(i=e.scoreThreshold)&&"number"!=typeof i)throw Error(`Value of float/double field must be a number, found ${typeof i}: ${i}`);Pe(r,3,i)}else"scoreThreshold"in e&&Pe(r,3);return void 0!==e.categoryAllowlist?je(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&Pe(r,4),void 0!==e.categoryDenylist?je(r,5,e.categoryDenylist):"categoryDenylist"in e&&Pe(r,5),Ge(n,0,2,r),si(this,e)}O(t,e){return this.B(t,e??this.C,this.u+1)}B(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}F(){var t=new Sr;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"timestamped_classifications");const e=new ur;He(e,kr,this.h);const n=new mr;Fe(n,he("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),We(n,3,"AUDIO:audio_in"),We(n,3,"SAMPLE_RATE:sample_rate"),We(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),$e(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=$r(e),t.m.push(fi(e))}))}(this,t),ui(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{ui(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function gi(t){return{embeddings:De(t,Wr).map((t=>{const e={headIndex:ce(Te(t,3))??0??-1,headName:fe(Te(t,4))??""??""};if(void 0!==Me(t,Rr,Be(t,1))){t=Ne(t,Rr,Be(t,1)).l;var n=zt(t);const r=2&n;let i=Le(t,n,1,1),o=Gt(i);if(!(4&o)){Object.isFrozen(i)&&(i=kt(i),$t(i,o=-3&o|32),xe(t,n,1,i));let e=0,s=0;for(;e<i.length;e++){const t=se(i[e]);null!=t&&(i[s++]=t)}s<e&&(i.length=s),o|=21,r?o|=34:o&=-33,$t(i,o),2&o&&Object.freeze(i)}!r&&(2&o||Object.isFrozen(i))&&(i=kt(i),$t(i,-35&o),xe(t,n,1,i)),e.floatEmbedding=i}else n=new Uint8Array(0),e.quantizedEmbedding=Ne(t,Vr,Be(t,2))?.M()?.N()??n;return e})),timestampMs:Ve(Re(t))}}di.prototype.classify=di.prototype.O,di.prototype.setOptions=di.prototype.s,di.createFromModelPath=function(t,e){return ii(di,t,{baseOptions:{modelAssetPath:e}})},di.createFromModelBuffer=function(t,e){return li(di,t,{baseOptions:{modelAssetBuffer:e}})},di.createFromOptions=function(t,e){return li(di,t,e)};var pi=class extends hi{constructor(t,e){super(new ni(t,e)),this.m=[],this.h=new Nr,t=new Fr,Ge(this.h,0,1,t)}get baseOptions(){return Ne(this.h,Fr,1)}set baseOptions(t){Ge(this.h,0,1,t)}s(t){var e=this.h,n=Ne(this.h,Mr,2);return n=n?Ae(n):new Mr,void 0!==t.l2Normalize?Pe(n,1,ae(t.l2Normalize)):"l2Normalize"in t&&Pe(n,1),void 0!==t.quantize?Pe(n,2,ae(t.quantize)):"quantize"in t&&Pe(n,2),Ge(e,0,2,n),si(this,t)}P(t,e){return this.B(t,e??this.C,this.u+1)}B(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}F(){var t=new Sr;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"embeddings_out"),We(t,15,"timestamped_embeddings_out");const e=new ur;He(e,Cr,this.h);const n=new mr;Fe(n,he("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),We(n,3,"AUDIO:audio_in"),We(n,3,"SAMPLE_RATE:sample_rate"),We(n,4,"EMBEDDINGS:embeddings_out"),We(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),$e(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=qr(t),this.m.push(gi(t)),ui(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{ui(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=qr(e),this.m.push(gi(t));ui(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{ui(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let mi;pi.prototype.embed=pi.prototype.P,pi.prototype.setOptions=pi.prototype.s,pi.createFromModelPath=function(t,e){return li(pi,t,{baseOptions:{modelAssetPath:e}})},pi.createFromModelBuffer=function(t,e){return li(pi,t,{baseOptions:{modelAssetBuffer:e}})},pi.createFromOptions=function(t,e){return li(pi,t,e)};const yi=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 vi(){if(void 0===mi)try{await WebAssembly.instantiate(yi),mi=!0}catch{mi=!1}return mi}async function bi(t,e=""){const n=await vi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var wi=class{};wi.forVisionTasks=function(t){return bi("vision",t)},wi.forTextTasks=function(t){return bi("text",t)},wi.forAudioTasks=function(t){return bi("audio",t)},wi.isSimdSupported=function(){return vi()},exports.AudioClassifier=di,exports.AudioEmbedder=pi,exports.AudioTaskRunner=hi,exports.FilesetResolver=wi,exports.TaskRunner=ci;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],o=t,i=0;i<r.length;i++)if(null==(o=o[r[i]])){r=null;break t}r=o}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 o,i;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let o=0;o<t.length;o++){var e=t.charCodeAt(o);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&o<t.length){const i=t.charCodeAt(++o);if(56320<=i&&57343>=i){e=1024*(e-55296)+i-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}o--}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 l,h=e(610401301,!1),f=e(572417392,!0);const d=t.navigator;function g(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function p(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function m(){return!!h&&(!!l&&0<l.brands.length)}function y(){return m()?g("Chromium"):(p("Chrome")||p("CriOS"))&&!(!m()&&p("Edge"))||p("Silk")}l=d&&d.userAgentData||null;var v=!m()&&(p("Trident")||p("MSIE"));!p("Android")||y(),y(),p("Safari")&&(y()||!m()&&p("Coast")||!m()&&p("Opera")||!m()&&p("Edge")||(m()?g("Microsoft Edge"):p("Edg/"))||m()&&g("Opera"));var b={},w=null;function _(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),o=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),o=w[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}A();for(var r=0;;){var o=n(-1),i=n(0),s=n(64),a=n(64);if(64===a&&-1===o)break;e(o<<2|i>>4),64!=s&&(e(i<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[o++]=t})),o!==n?r.subarray(0,o):r}function A(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));b[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===w[i]&&(w[i]=o)}}}}var S="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),A(),e=b[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var o=t[u],i=t[u+1],s=t[u+2],a=e[o>>2];o=e[(3&o)<<4|i>>4],i=e[(15&i)<<2|s>>6],s=e[63&s],n[c++]=a+o+i+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+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 I=/[-_.]/g,P={"-":"+",_:"/",".":"="};function x(t){return P[t]||""}function O(t){if(!E)return _(t);I.test(t)&&(t=t.replace(I,x)),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 L(t){return S&&null!=t&&t instanceof Uint8Array}let B;function F(){return B||=new Uint8Array(0)}var U={};let j;function k(t){if(t!==U)throw Error("illegal external caller")}function V(){return j||=new M(null,U)}function N(t){k(U);var e=t.D;return null==(e=null==e||L(e)?e:"string"==typeof e?O(e):null)?e:t.D=e}var M=class{constructor(t,e){if(k(e),this.D=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}P(){const t=N(this);return t?new Uint8Array(t):F()}};function D(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function C(){return Error("Failed to read varint, encoding is invalid.")}function G(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function $(t){return 0==t.length?V():new M(t,U)}function z(t){if("string"==typeof t)return{buffer:O(t),A:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),A:!1};if(t.constructor===Uint8Array)return{buffer:t,A:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),A:!1};if(t.constructor===M)return{buffer:N(t)||F(),A:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),A:!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 R(){return"function"==typeof BigInt}var W=!f;let H=!f;const J="function"==typeof Uint8Array.prototype.slice;let K,q=0,Y=0;function X(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=ot(n,t);t=r,n=e}q=n>>>0,Y=t>>>0}function Q(t){const e=K||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Y=0,q=e.getUint32(0,!0)}function Z(t,e){return 4294967296*e+(t>>>0)}function tt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Z(t,e),n?-t:t}function et(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else R()?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,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+nt(n)+nt(t));return n}function nt(t){return t=String(t),"0000000".slice(t.length)+t}function rt(t){if(16>t.length)X(Number(t));else if(R())t=BigInt(t),q=Number(t&BigInt(4294967295))>>>0,Y=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Y=q=0;const n=t.length;for(let r=e,o=(n-e)%6+e;o<=n;r=o,o+=6){const e=Number(t.slice(r,o));Y*=1e6,q=1e6*q+e,4294967296<=q&&(Y+=Math.trunc(q/4294967296),Y>>>=0,q>>>=0)}if(e){const[t,e]=ot(q,Y);q=t,Y=e}}}function ot(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function it(t,e){let n,r=0,o=0,i=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<i,i+=7}while(32>i&&128&n);for(32<i&&(o|=(127&n)>>4),i=3;32>i&&128&n;i+=7)n=s[a++],o|=(127&n)<<i;if(ft(t,a),128>n)return e(r>>>0,o>>>0);throw C()}function st(t){let e=0,n=t.g;const r=n+10,o=t.i;for(;n<r;){const r=o[n++];if(e|=r,0==(128&r))return ft(t,n),!!(127&e)}throw C()}function at(t){const e=t.i;let n=t.g,r=e[n++],o=127&r;if(128&r&&(r=e[n++],o|=(127&r)<<7,128&r&&(r=e[n++],o|=(127&r)<<14,128&r&&(r=e[n++],o|=(127&r)<<21,128&r&&(r=e[n++],o|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw C();return ft(t,n),o}function ut(t){var e=t.i;const n=t.g,r=e[n],o=e[n+1],i=e[n+2];return e=e[n+3],ft(t,t.g+4),(r<<0|o<<8|i<<16|e<<24)>>>0}function ct(t){var e=ut(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,255==n?e?NaN:1/0*t:0==n?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function lt(t){return at(t)}function ht(t,e,{F:n=!1}={}){t.F=n,e&&(e=z(e),t.i=e.buffer,t.m=e.A,t.u=0,t.j=t.i.length,t.g=t.u)}function ft(t,e){if(t.g=e,e>t.j)throw G(t.j,e)}function dt(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw G(e,t.j-n);return t.g=r,n}function gt(t,e){if(0==e)return V();var n=dt(t,e);return t.F&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?F():J?t.slice(n,e):new Uint8Array(t.subarray(n,e))),$(n)}var pt=[];function mt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=at(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw D(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function yt(t){switch(t.i){case 0:0!=t.i?yt(t):st(t.g);break;case 1:ft(t=t.g,t.g+8);break;case 2:if(2!=t.i)yt(t);else{var e=at(t.g)>>>0;ft(t=t.g,t.g+e)}break;case 5:ft(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!mt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}yt(t)}break;default:throw D(t.i,t.j)}}function vt(t,e,n){const r=t.g.j,o=at(t.g)>>>0,i=t.g.g+o;let s=i-r;if(0>=s&&(t.g.j=i,n(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${o} bytes, instead read ${o-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=i,t.g.j=r}function bt(t){var e=at(t.g)>>>0,a=dt(t=t.g,e);if(t=t.i,s){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===o){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),o=!0}catch(t){o=!1}}throw!o&&(i=void 0),t}}else{e=(l=a)+e,a=[];let o,i=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(o=t[l++],194>h||128!=(192&o)?(l--,n()):a.push((31&h)<<6|63&o)):240>h?l>=e-1?n():(o=t[l++],128!=(192&o)||224===h&&160>o||237===h&&160<=o||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&o)<<6|63&u)):244>=h?l>=e-2?n():(o=t[l++],128!=(192&o)||0!=o-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&o)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(i=r(i,a),a.length=0)}l=r(i,a)}return l}function wt(t){const e=at(t.g)>>>0;return gt(t.g,e)}function _t(t,e,n){var r=at(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var At=[];function St(t){return t?/^\d+$/.test(t)?(rt(t),new Et(q,Y)):null:Tt||=new Et(0,0)}var Et=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Tt;function It(t){return t?/^-?\d+$/.test(t)?(rt(t),new Pt(q,Y)):null:xt||=new Pt(0,0)}var Pt=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let xt;function Ot(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Lt(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Bt(t,e){if(0<=e)Lt(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Ft(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 Ut(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function jt(t,e,n){Lt(t.g,8*e+n)}function kt(t,e){return jt(t,e,2),e=t.g.end(),Ut(t,e),e.push(t.i),e}function Vt(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function Nt(t,e,n){jt(t,e,2),Lt(t.g,n.length),Ut(t,t.g.end()),Ut(t,n)}var Mt;class Dt{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.N=r}}function Ct(t){return Array.prototype.slice.call(t)}var Gt=(Mt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0)?(t,e)=>{t[Mt]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function $t(t){const e=Wt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Ct(t)),Jt(t,1|e))}var zt=Mt?(t,e)=>{t[Mt]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)};function Rt(t,e,n){return n?t|e:t&~e}var Wt=Mt?t=>0|t[Mt]:t=>0|t.o,Ht=Mt?t=>t[Mt]:t=>t.o,Jt=Mt?(t,e)=>{t[Mt]=e}:(t,e)=>{void 0!==t.o?t.o=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Kt(){var t=[];return Gt(t,1),t}function qt(t,e){Jt(e,-14591&(0|t))}function Yt(t,e){Jt(e,-14557&(34|t))}function Xt(t){return 0===(t=t>>14&1023)?536870912:t}var Qt={},Zt={};function te(t){return!(!t||"object"!=typeof t||t.W!==Zt)}function ee(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let ne=!f;function re(t,e,n){if(null!=t)if("string"==typeof t)t=t?new M(t,U):V();else if(t.constructor!==M)if(L(t))t=n?$(t):t.length?new M(new Uint8Array(t),U):V();else{if(!e)throw Error();t=void 0}return t}function oe(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Wt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Jt(t,1|r),!0)}var ie;const se=[];function ae(t){if(2&t)throw Error()}let ue,ce;function le(t,e){(e=ue?e[ue]:void 0)&&(t[ue]=Ct(e))}Jt(se,55),ie=Object.freeze(se);function he(){const t=Error("int32");return t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity="warning",t}function fe(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function de(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}Object.freeze(new class{}),Object.freeze(new class{});const ge=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function pe(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ge.test(t)}function me(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 ye(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function ve(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(X(t),t=tt(q,Y)),t}function be(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]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))))if(rt(t),t=q,2147483648&(e=Y))if(R())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=ot(t,e);t="-"+et(n,r)}else t=et(t,e);return t}function we(t){if("string"!=typeof t)throw Error();return t}function _e(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Ae(t){return null==t||"string"==typeof t?t:void 0}function Se(t,e,n){if(null!=t&&"object"==typeof t&&t.C===Qt)return t;if(Array.isArray(t)){var r=Wt(t),o=r;return 0===o&&(o|=32&n),(o|=2&n)!==r&&Jt(t,o),new e(t)}}let Ee,Te,Ie;function Pe(t){switch(typeof t){case"boolean":return Te||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function xe(t,e,n){if(null==t&&(t=Ee),Ee=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();if(64&(r=Wt(t)))return ce&&delete t[ce],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{const o=(n=t).length;if(o){const t=o-1;if(ee(n[t])){if(1024<=(e=t-(+!!(512&(r|=256))-1)))throw Error();r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,o-(+!!(512&r)-1))))throw Error();r=-16760833&r|(1023&e)<<14}}}return Jt(t,r),t}function Oe(t,e,n,r,o,i){if(null!=t){if(Array.isArray(t))t=o&&0==t.length&&1&Wt(t)?void 0:i&&2&Wt(t)?t:Le(t,e,n,void 0!==r,o,i);else if(ee(t)){const s={};for(let a in t)s[a]=Oe(t[a],e,n,r,o,i);t=s}else t=e(t,r);return t}}function Le(t,e,n,r,o,i){const s=r||n?Wt(t):0;r=r?!!(32&s):void 0;const a=Ct(t);for(let t=0;t<a.length;t++)a[t]=Oe(a[t],e,n,r,o,i);return n&&(le(a,t),n(s,a)),a}function Be(t){return t.C===Qt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t){if(Array.isArray(t))return ne||!oe(t,void 0,9999)?t:void 0;if(L(t))return T(t);if(t instanceof M){const e=t.D;return null==e?"":"string"==typeof e?e:t.D=T(e)}}}return t}(t)}function Fe(t,e,n=Yt){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Wt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(Jt(t,-12293&(34|r)),t):Le(t,Fe,4&r?Yt:n,!0,!1,!0))}return t.C===Qt&&(n=t.l,t=2&(r=Ht(n))?t:je(t,n,r,!0)),t}}function Ue(t){const e=t.l;return je(t,e,Ht(e),!1)}function je(t,e,n,r){return t=t.constructor,Ee=e=ke(e,n,r),e=new t(e),Ee=void 0,e}function ke(t,e,n){const r=n||2&e?Yt:qt,o=!!(32&e);return t=function(t,e,n){const r=Ct(t);var o=r.length;const i=256&e?r[o-1]:void 0;for(o+=i?-1:0,e=512&e?1:0;e<o;e++)r[e]=n(r[e]);if(i){e=r[e]={};for(const t in i)e[t]=n(i[t])}return le(r,t),r}(t,e,(t=>Fe(t,o,r))),Gt(t,32|(n?2:0)),t}function Ve(t){const e=t.l,n=Ht(e);return 2&n?je(t,e,n,!1):t}function Ne(t,e){return Me(t=t.l,Ht(t),e)}function Me(t,e,n,r){if(-1===n)return null;if(n>=Xt(e)){if(256&e)return t[t.length-1][n]}else{var o=t.length;if(r&&256&e&&null!=(r=t[o-1][n]))return r;if((e=n+(+!!(512&e)-1))<o)return t[e]}}function De(t,e,n,r){const o=t.l;let i=Ht(o);return ae(i),Ce(o,i,e,n,r),t}function Ce(t,e,n,r,o){var i=Xt(e);if(n>=i||o){if(o=e,256&e)i=t[t.length-1];else{if(null==r)return o;i=t[i+(+!!(512&e)-1)]={},o|=256}return i[n]=r,o!==e&&Jt(t,o),o}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ge(t,e,n,r,o){var i=2&e;let s=Me(t,e,n,o);Array.isArray(s)||(s=ie);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Wt(s);return 0!==c||!u||i||a?1&c||(c|=1,Jt(s,c)):(c|=33,Jt(s,c)),i?(t=!1,2&c||(Gt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(i=!!(2&c)||!!(2048&c),r&&i?(s=Ct(s),r=1,u&&!a&&(r|=32),Jt(s,r),Ce(t,e,n,s,o)):a&&32&c&&!i&&zt(s,32)),s}function $e(t){t=t.l;let e=Ht(t);const n=Me(t,e,1),r=re(n,!0,!!(34&e));return null!=r&&r!==n&&Ce(t,e,1,r),r}function ze(t,e,n){{const s=t.l;let a=Ht(s);if(ae(a),null==n)Ce(s,a,e);else{var r,o=t=Wt(n),i=!!(2&t)||Object.isFrozen(n);if((r=!i)&&(r=!1),!(4&t))for(t=21,i&&(n=Ct(n),o=0,t=nn(t,a,!0)),i=0;i<n.length;i++)n[i]=we(n[i]);r&&(n=Ct(n),o=0,t=nn(t,a,!0)),t!==o&&Jt(n,t),Ce(s,a,e,n)}}}function Re(t,e){t=t.l;let n=Ht(t);ae(n),Ce(t,n,2,""===e?void 0:e)}function We(t,e,n,r){const o=Ht(t);ae(o),t=Ge(t,o,e,2),r=n(r,!!(4&(e=Wt(t)))&&!!(4096&e)),t.push(r)}function He(t){return t}function Je(t,e){return Ke(t=t.l,Ht(t),uo)===e?e:-1}function Ke(t,e,n){let r=0;for(let o=0;o<n.length;o++){const i=n[o];null!=Me(t,e,i)&&(0!==r&&(e=Ce(t,e,r)),r=i)}return r}function qe(t,e,n,r){let o=Ht(t);ae(o);const i=Me(t,o,n,r);let s;if(null!=i&&i.C===Qt)return(e=Ve(i))!==i&&Ce(t,o,n,e,r),e.l;if(Array.isArray(i)){const t=Wt(i);s=2&t?ke(i,t,!1):i,s=xe(s,e[0],e[1])}else s=xe(void 0,e[0],e[1]);return s!==i&&Ce(t,o,n,s,r),s}function Ye(t,e,n,r){t=t.l;let o=Ht(t);const i=Me(t,o,n,r);return(e=Se(i,e,o))!==i&&null!=e&&Ce(t,o,n,e,r),e}function Xe(t,e,n){if(null==(e=Ye(t,e,n,!1)))return e;t=t.l;let r=Ht(t);if(!(2&r)){const o=Ve(e);o!==e&&Ce(t,r,n,e=o,!1)}return e}function Qe(t,e,n,r,o){var i=2&e?1:2;const s=1===i;i=2===i,r=!!r;let a=Ge(t,e,1,3);e=Ht(t);var u=Wt(a),c=!!(2&u);const l=!!(4&u),h=!!(32&u);let f=c&&l||!!(2048&u);if(!l){var d,g=a,p=e;(d=!!(2&u))&&(p=Rt(p,2,!0));let t=!d,r=!0,o=0,i=0;for(;o<g.length;o++){const e=Se(g[o],n,p);if(e instanceof n){if(!d){const n=!!(2&Wt(e.l));t&&=!n,r&&=n}g[i++]=e}}i<o&&(g.length=i),u=Rt(u,4,!0),u=Rt(u,16,r),u=Rt(u,8,t),Jt(g,u),c&&(Object.freeze(a),f=!0)}if(n=u,c=!!(8&u)||s&&!a.length,o&&!c){for(f&&(a=Ct(a),f=!1,n=0,u=nn(u,e,r),e=Ce(t,e,1,a)),o=a,c=u,g=0;g<o.length;g++)(u=o[g])!==(p=Ve(u))&&(o[g]=p);c=Rt(c,8,!0),u=c=Rt(c,16,!o.length)}return f||(s?u=Rt(u,!a.length||16&u&&(!l||h)?2:2048,!0):r||(u=Rt(u,32,!1)),u!==n&&Jt(a,u),s&&(Object.freeze(a),f=!0)),i&&f&&(a=Ct(a),u=nn(u,e,r),Jt(a,u),Ce(t,e,1,a)),a}function Ze(t,e){t=t.l;const n=Ht(t);return Qe(t,n,e,!1,!(2&n))}function tn(t,e,n,r,o){return null==r&&(r=void 0),De(t,n,r,o)}function en(t,e,n){var r=Hr;null==n&&(n=void 0),t=t.l;let o=Ht(t);ae(o),(r=Ke(t,o,r))&&r!==e&&null!=n&&(o=Ce(t,o,r)),Ce(t,o,e,n)}function nn(t,e,n){return t=Rt(t,2,!!(2&e)),t=Rt(t,32,!!(32&e)&&n),Rt(t,2048,!1)}function rn(t,e){var n=Fr;t=t.l;const r=Ht(t);ae(r),t=Qe(t,r,n,!0),e=null!=e?e:new n,t.push(e),2&Wt(e.l)?zt(t,8):zt(t,16)}function on(t){return null==(t=Ne(t,2))?t:pe(t)?"number"==typeof t?ve(t):be(t):void 0}function sn(t){return t??0}function an(t,e,n){We(t.l,e,we,n)}function un(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var cn=class{constructor(t,e){this.l=xe(t,e)}toJSON(){return ln(this,Le(this.l,Be,void 0,void 0,!1,!1),!0)}A(){return!!(2&Wt(this.l))}};function ln(t,e,n){const r=t.constructor.v;var o=Ht(n?t.l:e),i=Xt(o),s=!1;if(r&&ne){if(!n){var a;if((e=Ct(e)).length&&ee(a=e[e.length-1]))for(s=0;s<r.length;s++)if(r[s]>=i){Object.assign(e[e.length-1]={},a);break}s=!0}var u;i=e,n=!n,t=Xt(a=Ht(t.l)),a=+!!(512&a)-1;for(let e=0;e<r.length;e++){var c=r[e];if(c<t){var l=i[c+=a];null==l?i[c]=n?ie:Kt():n&&l!==ie&&$t(l)}else{if(!u){var h=void 0;i.length&&ee(h=i[i.length-1])?u=h:i.push(u={})}l=u[c],null==u[c]?u[c]=n?ie:Kt():n&&l!==ie&&$t(l)}}}if(!(u=e.length))return e;let f,d;if(ee(h=e[u-1])){t:{var g=h;for(var p in i={},n=!1,g)t=g[p],Array.isArray(t)&&(a=t,(!H&&oe(t,r,+p)||!W&&te(t)&&0===t.size)&&(t=null),t!=a&&(n=!0)),null!=t?i[p]=t:n=!0;if(n){for(let t in i){g=i;break t}g=null}}g!=h&&(f=!0),u--}for(o=+!!(512&o)-1;0<u&&(null==(h=e[p=u-1])||!H&&oe(h,r,p-o)||!W&&te(h)&&0===h.size);u--)d=!0;return f||d?(e=s?e:Array.prototype.slice.call(e,0,u),s&&(e.length=u),g&&e.push(g),e):e}function hn(t){return Array.isArray(t)?t[0]instanceof Dt?t:[sr,t]:[t,void 0]}function fn(t,e){if(Array.isArray(e)){var n=Wt(e);if(4&n)return e;for(var r=0,o=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[o++]=n)}return o<r&&(e.length=o),Jt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}cn.prototype.C=Qt,cn.prototype.toString=function(){return ln(this,this.l,!1).toString()};const dn=Symbol();function gn(t){let e=t[dn];if(!e){const n=_n(t),r=Un(t),o=r.g;e=o?(t,e)=>o(t,e,r):(t,e)=>{for(;mt(e)&&4!=e.i;){var o=e.m,i=r[o];if(!i){var s=r.K;s&&(s=s[o])&&(i=r[o]=pn(s))}i&&i(e,t,o)||(o=(i=e).j,yt(i),i.J?i=void 0:(s=i.g.g-o,i.g.g=o,i=gt(i.g,s)),o=t,i&&(ue||=Symbol(),(s=o[ue])?s.push(i):o[ue]=[i]))}n===mn||n===yn||n.T||(t[ce||=Symbol()]=n)},t[dn]=e}return e}function pn(t){const e=(t=hn(t))[0].g;if(t=t[1]){const n=gn(t),r=Un(t).B;return(t,o,i)=>e(t,o,i,r,n)}return e}let mn,yn;const vn=Symbol();function bn(t,e,n){const r=n[1];let o;if(r){const n=r[vn];o=n?n.B:Pe(r[0]),t[e]=n??r}o&&o===Te?(t.L||(t.L=[])).push(e):n[0]&&(t.M||(t.M=[])).push(e)}function wn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function _n(t){var e=t[vn];if(e)return e;if(!(e=Sn(t,t[vn]={},wn,wn,bn)).M&&!e.L){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=Pe(t[0])===Te,e=t[vn]=e?yn||={B:Pe(!0)}:mn||={}):e.T=!0}return e}function An(t,e,n){t[e]=n}function Sn(t,e,n,r,o=An){e.B=Pe(t[0]);let i=0;var s=t[++i];s&&s.constructor===Object&&(e.K=s,"function"==typeof(s=t[++i])&&(e.g=s,e.i=t[++i],s=t[++i]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&0<s[0];){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++i]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++i]);var c=void 0;if(s instanceof Dt?h=s:(h=ar,i--),h.N){s=t[++i],c=t;var l=i;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++i])&&0>s&&(l-=s,s=t[++i]);u<l;u++){const t=a[u];o(e,u,c?r(h,c,t):n(h,t))}}return e}const En=Symbol();function Tn(t){let e=t[En];if(!e){const n=On(t);e=(t,e)=>kn(t,e,n),t[En]=e}return e}const In=Symbol();function Pn(t){return t.i}function xn(t,e){let n,r;const o=t.i;return(t,i,s)=>o(t,i,s,r||=On(e).B,n||=Tn(e))}function On(t){let e=t[In];return e||(e=Sn(t,t[In]={},Pn,xn),Ln in t&&In in t&&(t.length=0),e)}const Ln=Symbol();function Bn(t,e){const n=t.g;return e?(t,r,o)=>n(t,r,o,e):n}function Fn(t,e,n){const r=t.g;let o,i;return(t,s,a)=>r(t,s,a,i||=Un(e).B,o||=gn(e),n)}function Un(t){let e=t[Ln];return e||(_n(t),e=Sn(t,t[Ln]={},Bn,Fn),Ln in t&&In in t&&(t.length=0),e)}function jn(t,e){var n=t[e];if(n)return n;if((n=t.K)&&(n=n[e])){var r=(n=hn(n))[0].i;if(n=n[1]){const e=Tn(n),o=On(n).B;n=(n=t.i)?n(o,e):(t,n,i)=>r(t,n,i,o,e)}else n=r;return t[e]=n}}function kn(t,e,n){for(var r=Ht(t),o=+!!(512&r)-1,i=t.length,s=512&r?1:0,a=i+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const i=s-o,a=jn(n,i);a&&a(e,r,i)}if(256&r){r=t[i-1];for(let t in r)o=+t,Number.isNaN(o)||null!=(i=r[t])&&(a=jn(n,o))&&a(e,i,o)}if(t=ue?t[ue]:void 0)for(Ut(e,e.g.end()),n=0;n<t.length;n++)Ut(e,N(t[n])||F())}function Vn(t,e){return new Dt(t,e,!1,!1)}function Nn(t,e){return new Dt(t,e,!0,!1)}function Mn(t,e,n){Ce(t,Ht(t),e,n)}function Dn(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){e=be(e);break t}if("number"==typeof e){e=ve(e);break t}}e=void 0}null!=e&&("string"==typeof e&&It(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,X(e),Ot(t,q,Y)):(n=It(e),Ot(t.g,n.i,n.g))))}function Cn(t,e,n){null!=(e=me(e))&&null!=e&&(jt(t,n,0),Bt(t.g,e))}function Gn(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(jt(t,n,0),t.g.g.push(e?1:0))}function $n(t,e,n){null!=(e=Ae(e))&&Nt(t,n,c(e))}function zn(t,e,n,r,o){null!=(e=e instanceof cn?e.l:Array.isArray(e)?xe(e,r[0],r[1]):void 0)&&(n=kt(t,n),o(e,t),Vt(t,n))}function Rn(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof M?e:void 0)&&Nt(t,n,z(e).buffer)}var Wn,Hn=Vn((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=ut(r);const o=ut(r);r=2*(o>>31)+1;const i=o>>>20&2047;return t=4294967296*(1048575&o)+t,Mn(e,n,2047==i?t?NaN:1/0*r:0==i?r*Math.pow(2,-1074)*t:r*Math.pow(2,i-1075)*(t+4503599627370496)),!0}),(function(t,e,n){null!=(e=fe(e))&&(jt(t,n,1),t=t.g,(n=K||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),q=n.getUint32(0,!0),Y=n.getUint32(4,!0),Ft(t,q),Ft(t,Y))})),Jn=Vn((function(t,e,n){return 5===t.i&&(Mn(e,n,ct(t.g)),!0)}),(function(t,e,n){null!=(e=fe(e))&&(jt(t,n,5),t=t.g,Q(e),Ft(t,q))})),Kn=Nn((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ge(e,Ht(e),n,2,!1),2==t.i?_t(t,ct,e):e.push(ct(t.g)),!0)}),(function(t,e,n){if(null!=(e=fn(fe,e))&&e.length){jt(t,n,2),Lt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Q(e[r]),Ft(n,q)}})),qn=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,it(t.g,tt)),!0)}),Dn),Yn=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,0===(t=it(t.g,tt))?void 0:t),!0)}),Dn),Xn=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,it(t.g,Z)),!0)}),(function(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),ye(e)||(rt(e),e=et(q,Y)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){X(t);const e=et(q,Y);return t=Number(e),Number.isSafeInteger(t)?t:e}return ye(String(t))?t:(X(t),Z(q,Y))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&St(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,X(e),Ot(t,q,Y)):(n=St(e),Ot(t.g,n.i,n.g))))})),Qn=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,at(t.g)),!0)}),Cn),Zn=Nn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ge(e,Ht(e),n,2,!1),2==t.i?_t(t,at,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=fn(me,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Bt(t.g,e[n]);Vt(t,n)}})),tr=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,0===(t=at(t.g))?void 0:t),!0)}),Cn),er=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,st(t.g)),!0)}),Gn),nr=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,!1===(t=st(t.g))?void 0:t),!0)}),Gn),rr=Nn((function(t,e,n){return 2===t.i&&(We(e,n,He,t=bt(t)),!0)}),(function(t,e,n){if(null!=(e=fn(Ae,e)))for(let s=0;s<e.length;s++){var r=t,o=n,i=e[s];null!=i&&Nt(r,o,c(i))}})),or=Vn((function(t,e,n){return 2===t.i&&(Mn(e,n,""===(t=bt(t))?void 0:t),!0)}),$n),ir=Vn((function(t,e,n){return 2===t.i&&(Mn(e,n,bt(t)),!0)}),$n),sr=new Dt((function(t,e,n,r,o){return 2===t.i&&(vt(t,qe(e,r,n,!0),o),!0)}),zn,!1,!0),ar=new Dt((function(t,e,n,r,o){return 2===t.i&&(vt(t,qe(e,r,n),o),!0)}),zn,!1,!0);Wn=new Dt((function(t,e,n,r,o){if(2!==t.i)return!1;r=xe(void 0,r[0],r[1]);let i=Ht(e);ae(i);let s=Ge(e,i,n,3);return i=Ht(e),4&Wt(s)&&(s=Ct(s),Jt(s,-2079&(1|Wt(s))),Ce(e,i,n,s)),s.push(r),vt(t,r,o),!0}),(function(t,e,n,r,o){if(Array.isArray(e))for(let i=0;i<e.length;i++)zn(t,e[i],n,r,o)}),!0,!0);var ur=new Dt((function(t,e,n,r,o,i){if(2!==t.i)return!1;let s=Ht(e);return ae(s),(i=Ke(e,s,i))&&n!==i&&Ce(e,s,i),vt(t,e=qe(e,r,n),o),!0}),zn,!1,!0),cr=Vn((function(t,e,n){return 2===t.i&&(Mn(e,n,wt(t)),!0)}),Rn),lr=Vn((function(t,e,n){return 0===t.i&&(Mn(e,n,at(t.g)),!0)}),(function(t,e,n){null!=(e=me(e))&&(e=parseInt(e,10),jt(t,n,0),Bt(t.g,e))})),hr=Nn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ge(e,Ht(e),n,2,!1),2==t.i?_t(t,lt,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=fn(me,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Bt(t.g,e[n]);Vt(t,n)}}));class fr{constructor(t,e){this.i=t,this.g=e,this.j=tn,this.defaultValue=void 0}}function dr(t,e){return(n,r)=>{t:{if(At.length){const t=At.pop();t.s(r),ht(t.g,n,r),n=t}else n=new class{constructor(t,e){if(pt.length){const n=pt.pop();ht(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.u=0,ht(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.F=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.s(e)}s({J:t=!1}={}){this.J=t}}(n,r);try{const r=new t,i=r.l;gn(e)(i,n),ce&&delete i[ce];var o=r;break t}finally{n.g.clear(),n.m=-1,n.i=-1,100>At.length&&At.push(n)}o=void 0}return o}}var gr=[0,or,Vn((function(t,e,n){return 2===t.i&&(Mn(e,n,(t=wt(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof cn){const r=e.X;return void(r&&(e=r(e),null!=e&&Nt(t,n,z(e).buffer)))}if(Array.isArray(e))return}Rn(t,e,n)}))],pr=[0,ir],mr=[0,Qn,lr,er,-1,Zn,lr,-1],yr=[0,er,-1],vr=class extends cn{constructor(){super()}};vr.v=[6];var br=[0,er,ir,er,lr,-1,hr,ir,-1,yr,lr],wr=[0,ir,-2],_r=class extends cn{constructor(){super()}},Ar=[0],Sr=[0,Qn,er,-2],Er=class extends cn{constructor(t){super(t,2)}},Tr={},Ir=[-2,Tr,er];Tr[336783863]=[0,ir,er,-1,Qn,[0,[1,2,3,4,5],ur,Ar,ur,br,ur,wr,ur,Sr,ur,mr],pr];var Pr=[0,or,nr],xr=[0,Yn,-1,nr,-3,Yn,Zn,or,tr,Yn,-1,nr,tr,nr,-2,or],Or=[-1,{}],Lr=[0,ir,1,Or],Br=[0,ir,rr,Or],Fr=class extends cn{constructor(t){super(t,500)}s(t){return tn(this,0,7,t)}};Fr.v=[3,4,5,6,8,13,17,1005];var Ur,jr=[-500,or,-1,rr,-3,Ir,Wn,gr,tr,-1,Lr,Br,Wn,Pr,or,xr,tr,rr,987,rr],kr=[0,or,-1,Or],Vr=[-500,ir,-1,[-1,{}],998,ir],Nr=[-500,ir,rr,-1,[-2,{},er],997,rr,-1],Mr=[-500,ir,rr,Or,998,rr],Dr=class extends cn{constructor(){super(void 0,500)}s(t){return tn(this,0,1001,t)}};Dr.v=[1,6,7,9,10,15,16,17,14,1002],Dr.prototype.g=(Ur=[-500,Wn,jr,4,Wn,Vr,Wn,Nr,tr,Wn,Mr,rr,tr,Lr,Br,Wn,kr,rr,-2,xr,or,-1,nr,979,Or,Wn,gr],function(){const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};kn(this.l,t,On(Ur)),Ut(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let o=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,o),o+=r.length}return t.j=[e],e});var Cr=class extends cn{constructor(t){super(t)}},Gr=[0,Qn,Jn,ir,-1],$r=class extends cn{constructor(t){super(t)}g(){return Ze(this,Cr)}};$r.v=[1];var zr=[0,Wn,Gr],Rr=class extends cn{constructor(t){super(t)}};Rr.v=[4,5];var Wr=class extends cn{constructor(t){super(t)}},Hr=[1,2,3,4,5],Jr=class extends cn{constructor(t){super(t)}g(){return null!=$e(this)}i(){return null!=Ae(Ne(this,2))}},Kr=class extends cn{constructor(t){super(t)}},qr=[0,[0,cr,ir,[0,Qn,qn,-1],[0,Xn,qn]],er,[0,Hr,ur,Sr,ur,br,ur,mr,ur,Ar,ur,wr],lr],Yr=class extends cn{constructor(t){super(t)}},Xr=new fr(451755788,Yr);Tr[451755788]=[0,qr,[0,ir,Qn,Jn,rr,-1],Hn];var Qr=class extends cn{constructor(t){super(t)}},Zr=class extends cn{constructor(t){super(t)}},to=new fr(487277289,Zr);Tr[487277289]=[0,qr,[0,er,-1]];var eo=class extends cn{constructor(t){super(t)}},no=[0,1,Qn,ir,zr],ro=class extends cn{constructor(t){super(t)}};ro.v=[1];var oo=dr(ro,[0,Wn,no,qn]),io=class extends cn{constructor(t){super(t)}};io.v=[1];var so=class extends cn{constructor(t){super(t)}O(){const t=$e(this);return null==t?V():t}},ao=class extends cn{constructor(t){super(t)}},uo=[1,2],co=[0,uo,ur,[0,Kn],ur,[0,cr],Qn,ir],lo=class extends cn{constructor(t){super(t)}};lo.v=[1];var ho=dr(lo,[0,Wn,co,qn]);async function fo(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,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.h.stringToNewUTF8(e)),t.h._free(e)}function po(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.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function mo(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function yo(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,o)=>{e?(n(r,o),r=[]):r.push(t)}}const vo=function(t){return class extends t{U(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:((t="undefined"==typeof OffscreenCanvas)||(t=(t=navigator.userAgent).includes("Safari")&&!t.includes("Chrome")),t?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas")):this.h.canvas=new OffscreenCanvas(1,1))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,o){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),go(this,r||"input_audio",(r=>{go(this,o=o||"audio_header",(o=>{this.h._configureAudio(r,o,t,e,n)}))}))}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,o){const i=4*t.length;this.i!==i&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(i),this.i=i),this.h.HEAPF32.set(t,this.g/4),go(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,o)}))}addGpuBufferToStream(t,e,n){go(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();var r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");let o;this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1),t.videoWidth?(r=t.videoWidth,o=t.videoHeight):t.naturalWidth?(r=t.naturalWidth,o=t.naturalHeight):(r=t.width,o=t.height),!this.j||r===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=r,this.h.canvas.height=o);const[i,s]=[r,o];this.h._addBoundTextureToStream(e,i,s,n)}))}addBoolToStream(t,e,n){go(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){go(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){go(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){go(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){go(this,e,(e=>{go(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){go(this,e,(e=>{po(this,Object.keys(t),(r=>{po(this,Object.values(t),(o=>{this.h._addFlatHashMapToInputStream(r,o,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){go(this,n,(n=>{go(this,e,(e=>{const o=this.h._malloc(t.length);this.h.HEAPU8.set(t,o),this.h._addProtoToInputStream(o,t.length,e,n,r),this.h._free(o)}))}))}addEmptyPacketToStream(t,e){go(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){go(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){go(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){go(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){go(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){go(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)go(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){go(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){go(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){go(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){go(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){go(this,e,(e=>{go(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){go(this,n,(n=>{go(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){go(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){go(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){go(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){go(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){go(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)go(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){mo(this,t,e),go(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){yo(this,t,e),go(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){mo(this,t,e),go(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){yo(this,t,e),go(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachDoubleListener(t,e){mo(this,t,e),go(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){yo(this,t,e),go(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){mo(this,t,e),go(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){yo(this,t,e),go(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){mo(this,t,e),go(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){yo(this,t,e),go(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){mo(this,t,e),go(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){yo(this,t,e),go(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),mo(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),go(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var bo=class extends vo{};async function wo(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await fo(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await fo(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.s(n),t}async function _o(t,e,n){return wo(t,e,n)}function Ao(t,e){const n=Xe(t.baseOptions,Jr,1)||new Jr;"string"==typeof e?(De(n,2,_e(e)),De(n,1)):e instanceof Uint8Array&&(De(n,1,re(e,!1,!1)),De(n,2)),tn(t.baseOptions,0,1,n)}function So(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Xe(t.baseOptions,Jr,1)?.g()||Xe(t.baseOptions,Jr,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(t,e){let n=Xe(t.baseOptions,Wr,3);if(!n){var r=n=new Wr;en(r,4,new _r)}"delegate"in e&&("GPU"===e.delegate?en(e=n,2,r=new vr):en(e=n,4,r=new _r)),tn(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath?fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${t.status})`)})).then((e=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Ao(t,"/model.dat"),t.I()})):(Ao(t,n.modelAssetBuffer),t.I(),Promise.resolve())}function Eo(t){try{const e=t.j.length;if(1===e)throw Error(t.j[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.j.map((t=>t.message)).join(", "))}finally{t.j=[]}}function To(t,e){t.u=Math.max(t.u,e)}var Io=class{constructor(t){this.g=t,this.j=[],this.u=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener(((t,e)=>{this.j.push(Error(e))})),this.g.U(),this.g.setGraph(t,e),Eo(this)}finishProcessing(){this.g.finishProcessing(),Eo(this)}close(){this.g.closeGraph()}};async function Po(t,e,n){return _o(t,e,n)}Io.prototype.close=Io.prototype.close;var xo=class extends Io{constructor(){super(...arguments),this.H=48e3}V(t){this.H=t}};function Oo(t){const e={classifications:Ze(t,eo).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=me(Ne(t,1))??0??-1;const n=t.l;let r=Ht(n);const o=Me(n,r,2),i=fe(o);return null!=i&&i!==o&&Ce(n,r,2,i),{index:e,score:i??0??0,categoryName:Ae(Ne(t,3))??""??"",displayName:Ae(Ne(t,4))??""??""}})),headIndex:e,headName:n}}(Xe(t,$r,4)?.g()??[],me(Ne(t,2))??0,Ae(Ne(t,3))??"")))};return null!=on(t)&&(e.timestampMs=sn(on(t))),e}xo.prototype.setDefaultSampleRate=xo.prototype.V;var Lo=class extends xo{constructor(t,e){super(new bo(t,e)),this.m=[],tn(t=this.i=new Yr,0,1,e=new Kr)}get baseOptions(){return Xe(this.i,Kr,1)}set baseOptions(t){tn(this.i,0,1,t)}s(t){var e=this.i,n=Xe(this.i,Rr,2);if(n=n?Ue(n):new Rr,void 0!==t.displayNamesLocale?De(n,1,_e(t.displayNamesLocale)):void 0===t.displayNamesLocale&&De(n,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw he();if(!Number.isFinite(r))throw he();r|=0}De(n,2,r)}else"maxResults"in t&&De(n,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);De(n,3,r)}else"scoreThreshold"in t&&De(n,3);return void 0!==t.categoryAllowlist?ze(n,4,t.categoryAllowlist):"categoryAllowlist"in t&&De(n,4),void 0!==t.categoryDenylist?ze(n,5,t.categoryDenylist):"categoryDenylist"in t&&De(n,5),tn(e,0,2,n),So(this,t)}R(t,e){return this.G(t,e??this.H,this.u+1)}G(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),[...this.m]}I(){var t=new Dr;an(t,10,"audio_in"),an(t,10,"sample_rate"),an(t,15,"timestamped_classifications");const e=new Er;un(e,Xr,this.i);const n=new Fr;Re(n,_e("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),an(n,3,"AUDIO:audio_in"),an(n,3,"SAMPLE_RATE:sample_rate"),an(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),rn(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=oo(e),t.m.push(Oo(e))}))}(this,t),To(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{To(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Bo(t){return{embeddings:Ze(t,ao).map((t=>{const e={headIndex:me(Ne(t,3))??0??-1,headName:Ae(Ne(t,4))??""??""};if(void 0!==Ye(t,io,Je(t,1))){var n=void 0;t=Xe(t,io,Je(t,1)).l;let s=Ht(t);const a=2&s?1:2;let u=Ge(t,s,1,1|((n=!!n)?2:0));s=Ht(t);var r=Wt(u);let c=r,l=!!(2&r);var o=!!(4&r),i=l&&o;if(!(4&r)){(o||Object.isFrozen(u))&&(u=Ct(u),c=0,l=!!(2&(r=nn(r,s,n))),s=Ce(t,s,1,u));let e=o=0;for(;o<u.length;o++){const t=fe(u[o]);null!=t&&(u[e++]=t)}e<o&&(u.length=e),r=Rt(r,4096,!1),r=Rt(r,8192,!1),r=Rt(r,20,!0)}i||((i=1===a)&&(r=Rt(r,2,!0)),r!==c&&Jt(u,r),(i||l)&&Object.freeze(u)),2===a&&l&&(u=Ct(u),r=nn(r,s,n),Jt(u,r),Ce(t,s,1,u)),e.floatEmbedding=u}else n=new Uint8Array(0),e.quantizedEmbedding=Xe(t,so,Je(t,2))?.O()?.P()??n;return e})),timestampMs:sn(on(t))}}Lo.prototype.classify=Lo.prototype.R,Lo.prototype.setOptions=Lo.prototype.s,Lo.createFromModelPath=function(t,e){return _o(Lo,t,{baseOptions:{modelAssetPath:e}})},Lo.createFromModelBuffer=function(t,e){return Po(Lo,t,{baseOptions:{modelAssetBuffer:e}})},Lo.createFromOptions=function(t,e){return Po(Lo,t,e)};var Fo=class extends xo{constructor(t,e){super(new bo(t,e)),this.m=[],tn(t=this.i=new Zr,0,1,e=new Kr)}get baseOptions(){return Xe(this.i,Kr,1)}set baseOptions(t){tn(this.i,0,1,t)}s(t){var e=this.i,n=Xe(this.i,Qr,2);return n=n?Ue(n):new Qr,void 0!==t.l2Normalize?De(n,1,de(t.l2Normalize)):"l2Normalize"in t&&De(n,1),void 0!==t.quantize?De(n,2,de(t.quantize)):"quantize"in t&&De(n,2),tn(e,0,2,n),So(this,t)}S(t,e){return this.G(t,e??this.H,this.u+1)}G(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.m=[],this.finishProcessing(),this.m}I(){var t=new Dr;an(t,10,"audio_in"),an(t,10,"sample_rate"),an(t,15,"embeddings_out"),an(t,15,"timestamped_embeddings_out");const e=new Er;un(e,to,this.i);const n=new Fr;Re(n,_e("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),an(n,3,"AUDIO:audio_in"),an(n,3,"SAMPLE_RATE:sample_rate"),an(n,4,"EMBEDDINGS:embeddings_out"),an(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),rn(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ho(t),this.m.push(Bo(t)),To(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{To(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=ho(e),this.m.push(Bo(t));To(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{To(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let Uo;Fo.prototype.embed=Fo.prototype.S,Fo.prototype.setOptions=Fo.prototype.s,Fo.createFromModelPath=function(t,e){return Po(Fo,t,{baseOptions:{modelAssetPath:e}})},Fo.createFromModelBuffer=function(t,e){return Po(Fo,t,{baseOptions:{modelAssetBuffer:e}})},Fo.createFromOptions=function(t,e){return Po(Fo,t,e)};const jo=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 ko(){if(void 0===Uo)try{await WebAssembly.instantiate(jo),Uo=!0}catch{Uo=!1}return Uo}async function Vo(t,e=""){const n=await ko()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var No=class{};No.forVisionTasks=function(t){return Vo("vision",t)},No.forTextTasks=function(t){return Vo("text",t)},No.forAudioTasks=function(t){return Vo("audio",t)},No.isSimdSupported=function(){return ko()},exports.AudioClassifier=Lo,exports.AudioEmbedder=Fo,exports.AudioTaskRunner=xo,exports.FilesetResolver=No,exports.TaskRunner=Io;
|
|
2
2
|
//# sourceMappingURL=audio_bundle_cjs.js.map
|