@mediapipe/tasks-audio 0.10.6 → 0.10.8

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/audio.d.ts CHANGED
@@ -51,7 +51,7 @@ export declare class AudioClassifier extends AudioTaskRunner<AudioClassifierResu
51
51
  * @param sampleRate The sample rate in Hz of the provided audio data. If not
52
52
  * set, defaults to the sample rate set via `setDefaultSampleRate()` or
53
53
  * `48000` if no custom default was set.
54
- * @return The classification result of the audio datas
54
+ * @return The classification result of the audio data
55
55
  */
56
56
  classify(audioData: Float32Array, sampleRate?: number): AudioClassifierResult[];
57
57
  }
package/audio_bundle.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=self;function e(t){return t}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;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 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 l,h;t:{for(var f=["CLOSURE_FLAGS"],d=t,g=0;g<f.length;g++)if(null==(d=d[f[g]])){h=null;break t}h=d}var p,m=h&&h[610401301];l=null!=m&&m;const y=t.navigator;function v(t){return!!l&&(!!p&&p.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function b(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function w(){return!!l&&(!!p&&0<p.brands.length)}function A(){return w()?v("Chromium"):(b("Chrome")||b("CriOS"))&&!(!w()&&b("Edge"))||b("Silk")}p=y&&y.userAgentData||null;var _=!w()&&(b("Trident")||b("MSIE"));!b("Android")||A(),A(),b("Safari")&&(A()||!w()&&b("Coast")||!w()&&b("Opera")||!w()&&b("Edge")||(w()?v("Microsoft Edge"):b("Edg/"))||w()&&v("Opera"));var S={},E=null;function T(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=E[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}P();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 P(){if(!E){E={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));S[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===E[o]&&(E[o]=i)}}}}var L="undefined"!=typeof Uint8Array,O=!_&&"function"==typeof btoa;function x(t){if(!O){var e;void 0===e&&(e=0),P(),e=S[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 I=/[-_.]/g,j={"-":"+",_:"/",".":"="};function F(t){return j[t]||""}function U(t){if(!O)return T(t);I.test(t)&&(t=t.replace(I,F)),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 L&&null!=t&&t instanceof Uint8Array}let k;function M(){return k||=new Uint8Array(0)}var C={};let N;function D(t){if(t!==C)throw Error("illegal external caller")}function G(){return N||=new $(null,C)}function R(t){D(C);var e=t.F;return null==(e=null==e||B(e)?e:"string"==typeof e?U(e):null)?e:t.F=e}var $=class{constructor(t,e){if(D(e),this.F=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}L(){const t=R(this);return t?new Uint8Array(t):M()}};function z(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function V(){return Error("Failed to read varint, encoding is invalid.")}function W(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function H(t){return 0==t.length?G():new $(t,C)}function J(t){if("string"==typeof t)return{buffer:U(t),s:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),s:!1};if(t.constructor===Uint8Array)return{buffer:t,s:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),s:!1};if(t.constructor===$)return{buffer:R(t)||M(),s:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),s:!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 q="function"==typeof Uint8Array.prototype.slice;let K,Y=0,X=0;function Q(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=rt(n,t);t=r,n=e}Y=n>>>0,X=t>>>0}function Z(t){const e=K||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),X=0,Y=e.getUint32(0,!0)}function tt(t,e){return 4294967296*e+(t>>>0)}function et(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=tt(t,e),n?-t:t}function nt(t){if(16>t.length)Q(Number(t));else if("function"==typeof BigInt)t=BigInt(t),Y=Number(t&BigInt(4294967295))>>>0,X=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);X=Y=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));X*=1e6,Y=1e6*Y+e,4294967296<=Y&&(X+=Math.trunc(Y/4294967296),X>>>=0,Y>>>=0)}if(e){const[t,e]=rt(Y,X);Y=t,X=e}}}function rt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function it(t,e,{G:n=!1}={}){t.G=n,e&&(e=J(e),t.j=e.buffer,t.A=e.s,t.B=0,t.l=t.j.length,t.g=t.B)}function ot(t,e){if(t.g=e,e>t.l)throw W(t.l,e)}function st(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(ot(t,a),128>n)return e(r>>>0,i>>>0);throw V()}function at(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 ot(t,n),!!(127&e)}throw V()}function ut(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],ot(t,t.g+4),(r<<0|i<<8|o<<16|e<<24)>>>0}function ct(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.l)throw W(e,t.l-n);return t.g=r,n}function lt(t,e){if(0==e)return G();var n=ct(t,e);return t.G&&t.A?n=t.j.subarray(n,n+e):(t=t.j,n=n===(e=n+e)?M():q?t.slice(n,e):new Uint8Array(t.subarray(n,e))),H(n)}var ht=class{constructor(t,e){this.j=null,this.A=!1,this.g=this.l=this.B=0,it(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 V();return ot(this,e),r}u(){var t=ut(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))}C(){return this.h()}},ft=[];function dt(t){var e=t.g;if(e.g==e.l)return!1;t.j=t.g.g;var n=t.g.h()>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw z(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.l=e,t.h=n,!0}function gt(t){switch(t.h){case 0:0!=t.h?gt(t):at(t.g);break;case 1:ot(t=t.g,t.g+8);break;case 2:if(2!=t.h)gt(t);else{var e=t.g.h()>>>0;ot(t=t.g,t.g+e)}break;case 5:ot(t=t.g,t.g+4);break;case 3:for(e=t.l;;){if(!dt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.h){if(t.l!=e)throw Error("Unmatched end-group tag");break}gt(t)}break;default:throw z(t.h,t.j)}}function pt(t,e,n){const r=t.g.l,i=t.g.h()>>>0,o=t.g.g+i;let s=o-r;if(0>=s&&(t.g.l=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.l=r}function mt(t){var e=t.g.h()>>>0,a=ct(t=t.g,e);if(t=t.j,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),t=a+e,c=0===a&&t===c.length?c:c.subarray(a,t);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(i=t[l++],194>h||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):240>h?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&160>i||237===h&&160<=i||128!=(192&(c=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&c)):244>=h?l>=e-2?n():(i=t[l++],128!=(192&i)||0!=i-144+(h<<28)>>30||128!=(192&(c=t[l++]))||128!=(192&(u=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&c)<<6|63&u,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function yt(t){const e=t.g.h()>>>0;return lt(t.g,e)}function vt(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 bt=[];function wt(t){return t?/^\d+$/.test(t)?(nt(t),new At(Y,X)):null:_t||=new At(0,0)}var At=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let _t;function St(t){return t?/^-?\d+$/.test(t)?(nt(t),new Et(Y,X)):null:Tt||=new Et(0,0)}var Et=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Tt;function Pt(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 Ot(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 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 It(t,e){0!==e.length&&(t.j.push(e),t.h+=e.length)}function jt(t,e,n){Lt(t.g,8*e+n)}function Ft(t,e){return jt(t,e,2),e=t.g.end(),It(t,e),e.push(t.h),e}function Ut(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){jt(t,e,2),Lt(t.g,n.length),It(t,t.g.end()),It(t,n)}class kt{constructor(t,e,n){this.g=t,this.h=e,this.j=n}}function Mt(t){return Array.prototype.slice.call(t)}const Ct="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;var Nt=Ct?(t,e)=>{t[Ct]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Dt(t){const e=Rt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Mt(t)),zt(t,1|e))}var Gt=Ct?(t,e)=>{t[Ct]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)},Rt=Ct?t=>0|t[Ct]:t=>0|t.g,$t=Ct?t=>t[Ct]:t=>t.g,zt=Ct?(t,e)=>{t[Ct]=e}:(t,e)=>{void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Vt(t){return Nt(t,1),t}function Wt(t,e){zt(e,-255&(0|t))}function Ht(t,e){zt(e,-221&(34|t))}function Jt(t){return 0===(t=t>>11&1023)?536870912:t}var qt,Kt={};function Yt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}function Xt(t,e,n){if(null!=t)if("string"==typeof t)t=t?new $(t,C):G();else if(t.constructor!==$)if(B(t))t=n?H(t):t.length?new $(new Uint8Array(t),C):G();else{if(!e)throw Error();t=void 0}return t}const Qt=[];function Zt(t){if(2&t)throw Error()}let te,ee,ne,re;function ie(t,e){(e=te?e[te]:void 0)&&(t[te]=Mt(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.D===Kt)return t;if(r){var i=r=Rt(t);return 0===i&&(i|=32&n),(i|=2&n)!==r&&zt(t,i),new e(t)}}function ge(t){switch(typeof t){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=ne),ne=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=Rt(t)))return ee&&delete t[ee],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(Yt(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 zt(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&Rt(t)?void 0:o&&2&Rt(t)?t:ve(t,e,n,void 0!==r,i,o);else if(Yt(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?Rt(t):0;r=r?!!(32&s):void 0;const a=Mt(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.D===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 $){const e=t.F;return null==e?"":"string"==typeof e?e:t.F=x(e)}}}return t}(t)}function we(t,e,n=Ht){if(null!=t){if(L&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){const r=Rt(t);return 2&r?t:!e||68&r||!(32&r||0===r)?ve(t,we,4&r?Ht:n,!0,!1,!0):(zt(t,34|r),t)}return t.D===Kt&&(e=t.m,t=2&(n=$t(e))?t:_e(t,e,n,!0)),t}}function Ae(t){const e=t.m;return _e(t,e,$t(e),!1)}function _e(t,e,n,r){return t=t.constructor,ne=e=Se(e,n,r),e=new t(e),ne=void 0,e}function Se(t,e,n){const r=n||2&e?Ht:Wt,i=!!(32&e);return t=function(t,e,n){const r=Mt(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.m,n=$t(e);return 2&n?_e(t,e,n,!1):t}function Te(t,e){return Pe(t=t.m,$t(t),e)}function Pe(t,e,n,r){if(-1===n)return null;if(n>=Jt(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 Le(t,e,n,r){const i=t.m,o=$t(i);return Zt(o),Oe(i,o,e,n,r),t}function Oe(t,e,n,r,i){var o=Jt(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&&zt(t,i)}else t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n])}function xe(t,e,n,r,i){var o=2&e;let s=Pe(t,e,n,i);Array.isArray(s)||(s=qt);const a=Rt(s);if(1&a||Vt(s),o)2&a||Nt(s,34),1&r||Object.freeze(s);else{o=!(2&r);const u=2&a;1&r||!u?o&&32&a&&!u&&Gt(s,32):(s=Vt(Mt(s)),Oe(t,e,n,s,i))}return s}function Ie(t){t=t.m;const e=$t(t),n=Pe(t,e,1),r=Xt(n,!0,!!(34&e));return null!=r&&r!==n&&Oe(t,e,1,r),r}function je(t,e,n){t=t.m;const r=$t(t);if(Zt(r),null==n)Oe(t,r,e);else{if(!(4&Rt(n))){Object.isFrozen(n)&&(n=Mt(n));for(let t=0;t<n.length;t++)n[t]=le(n[t]);zt(n,5)}Oe(t,r,e,n)}}function Fe(t,e){t=t.m;const n=$t(t);Zt(n),Oe(t,n,2,""===e?void 0:e)}function Ue(t,e){return Be(t=t.m,$t(t),zr)===e?e:-1}function Be(t,e,n){let r=0;for(let i=0;i<n.length;i++){const o=n[i];null!=Pe(t,e,o)&&(0!==r&&Oe(t,e,r),r=o)}return r}function ke(t,e,n,r){const i=$t(t);Zt(i);const o=Pe(t,i,n,r);let s;if(null!=o&&o.D===Kt)return(e=Ee(o))!==o&&Oe(t,i,n,e,r),e.m;if(Array.isArray(o)){const t=Rt(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&&Oe(t,i,n,s,r),s}function Me(t,e,n,r){t=t.m;const i=$t(t),o=Pe(t,i,n,r);return(e=de(o,e,i))!==o&&null!=e&&Oe(t,i,n,e,r),e}function Ce(t,e,n){if(null==(e=Me(t,e,n,!1)))return e;t=t.m;const r=$t(t);if(!(2&r)){const i=Ee(e);i!==e&&Oe(t,r,n,e=i,!1)}return e}function Ne(t,e,n,r){var i=!!(2&e),o=xe(t,e,1,1);if(o===qt||!(4&Rt(o))){var s=o;o=!!(2&e);var a=!!(2&Rt(s));i=s,!o&&a&&(s=Mt(s));var u=e|(a?2:0);a=a||void 0;let c=0,l=0;for(;c<s.length;c++){const t=de(s[c],n,u);void 0!==t&&(a=a||2&$t(t.m),s[l++]=t)}return l<c&&(s.length=l),u=5|(s=Rt(n=s)),s!=(a=a?-9&u:8|u)&&(Object.isFrozen(n)&&(n=Mt(n)),zt(n,a)),i!==(s=n)&&Oe(t,e,1,s),(o&&2!==r||1===r)&&Object.freeze(s),s}return 3===r||(i?2===r&&(r=Rt(o),o=Mt(o),zt(o,r),Oe(t,e,1,o)):(i=Object.isFrozen(o),1===r?i||Object.freeze(o):(n=-35&(r=Rt(o)),i&&(r=0,Oe(t,e,1,o=Mt(o))),r!==n&&zt(o,n)))),o}function De(t,e){var n=t.m,r=$t(n);if(e=Ne(n,r,e,(t=!!(2&r))?1:2),!(t||8&Rt(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),Le(t,n,r,i)}function Re(t,e,n){var r=Lr;null==n&&(n=void 0),t=t.m;const i=$t(t);Zt(i),(r=Be(t,i,r))&&r!==e&&null!=n&&Oe(t,i,r),Oe(t,i,e,n)}function $e(t,e){var n=dr;t=t.m;const r=$t(t);Zt(r),t=Ne(t,r,n,2),e=null!=e?e:new n,t.push(e),e.s()&&Gt(t,8)}function ze(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.m;const r=$t(t);Zt(r),xe(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)}zt(Qt,39),qt=Object.freeze(Qt);var Je=class{constructor(t,e){this.m=pe(t,e)}toJSON(){return qe(this,ve(this.m,be,void 0,void 0,!1,!1),!0)}s(){return!!(2&Rt(this.m))}};function qe(t,e,n){var r=t.constructor.v,i=Jt($t(n?t.m:e)),o=!1;if(r){if(!n){var s;if((e=Mt(e)).length&&Yt(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=Jt(s=$t(t.m)),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?qt:Vt([]):n&&c!==qt&&Dt(c)}else{if(!a){var l=void 0;i.length&&Yt(l=i[i.length-1])?a=l:i.push(a={})}c=a[u],null==a[u]?a[u]=n?qt:Vt([]):n&&c!==qt&&Dt(c)}}}if(!(r=e.length))return e;let h,f;if(Yt(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 Ke(t){return{J:Cn,H:t}}function Ye(t,e){if(Array.isArray(e)){var n=Rt(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),zt(e,5|n),2&n&&Object.freeze(e),e}}Je.prototype.D=Kt,Je.prototype.toString=function(){return qe(this,this.m,!1).toString()};const Xe=Symbol();function Qe(t){let e=t[Xe];if(!e){const n=hn(t),r=n.l;e=r?(t,e)=>r(t,e,n):(t,e)=>{for(;dt(e)&&4!=e.h;){var r=e.l,i=n[r];if(!i){var o=n.h;o&&(o=o[r])&&(i=n[r]=Ze(o))}i&&i(e,t,r)||(r=(i=e).j,gt(i),i.I?i=void 0:(o=i.g.g-r,i.g.g=r,i=lt(i.g,o)),r=t,i&&(te||=Symbol(),(o=r[te])?o.push(i):r[te]=[i]))}(e=n.j)&&(t[ee||=Symbol()]=e)},t[Xe]=e}return e}function Ze(t){const e=function(t){if(t=t.H)return Qe(t)}(t),n=t.J.g;if(e){const r=hn(t.H).g;return(t,i,o)=>n(t,i,o,r,e)}return(t,e,r)=>n(t,e,r)}function tn(t,e,n,r){e.g=ge(t[0]);let i=1;if(t.length>i&&!(t[i]instanceof kt)){var o=t[i++];if(Array.isArray(o))return e.l=o[0],e.h=o[1],e;e.h=o}for(o=0;i<t.length;){const l=t[i++];var s=t[i];for("number"==typeof s?(i++,o+=s):o++,l.j&&((s=e.j)||(e.j=s=[]),s.push(o)),s=i;s<t.length&&!(t[s]instanceof kt);)s++;if(s-=i){var a=t,u=i,c=a[u];if("function"==typeof c&&(c=c(),a[u]=c),(a=Array.isArray(c))&&!(a=un in c||rn in c)&&(a=0<c.length)){const t=ge(u=(a=c)[0]);null!=t&&t!==u&&(a[0]=t),a=null!=t}(c=a?c:void 0)?(i++,e[o]=1===s?r(l,c):r(l,c,t[i++])):e[o]=n(l,t[i++])}else e[o]=n(l)}return e}const en=Symbol();function nn(t){let e=t[en];if(!e){const n=an(t);e=(t,e)=>dn(t,e,n),t[en]=e}return e}const rn=Symbol();function on(t){return t.h}function sn(t,e){let n,r;const i=t.h;return(t,o,s)=>i(t,o,s,r||=an(e).g,n||=nn(e))}function an(t){let e=t[rn];return e||(e=tn(t,t[rn]={},on,sn),un in t&&rn in t&&(t.length=0),e)}const un=Symbol();function cn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function ln(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=hn(e).g,i||=Qe(e),n)}function hn(t){let e=t[un];return e||(e=tn(t,t[un]={},cn,ln),un in t&&rn in t&&(t.length=0),e)}function fn(t,e){var n=t[e];if(n)return n;if((n=t.h)&&(n=n[e])){var r=n.H,i=n.J.h;if(r){const t=nn(r),e=an(r).g;n=(n,r,o)=>i(n,r,o,e,t)}else n=i;return t[e]=n}}function dn(t,e,n){for(var r=$t(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=fn(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=fn(n,i))&&a(e,o,i)}if(t=te?t[te]:void 0)for(It(e,e.g.end()),n=0;n<t.length;n++)It(e,R(t[n])||M())}function gn(t,e){return new kt(t,e,!1)}function pn(t,e){return new kt(t,e,!0)}function mn(t,e,n){Oe(t,$t(t),e,n)}function yn(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&&St(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,Q(e),Pt(t,Y,X)):(n=St(e),Pt(t.g,n.h,n.g))))}function vn(t,e,n){null!=(e=ce(e))&&null!=e&&(jt(t,n,0),Ot(t.g,e))}function bn(t,e,n){null!=(e=null==e?e:"boolean"==typeof e||"number"==typeof e?!!e:void 0)&&(jt(t,n,0),t.g.g.push(e?1:0))}function wn(t,e,n){null!=(e=fe(e))&&Bt(t,n,c(e))}function An(t,e,n,r,i){null!=(e=e instanceof Je?e.m:Array.isArray(e)?pe(e,r[0],r[1]):void 0)&&(n=Ft(t,n),i(e,t),Ut(t,n))}function _n(t,e,n){null!=(e=null==e||"string"==typeof e||B(e)||e instanceof $?e:void 0)&&Bt(t,n,J(e).buffer)}var Sn=gn((function(t,e,n){if(1!==t.h)return!1;var r=t.g;t=ut(r);const i=ut(r);r=2*(i>>31)+1;const o=i>>>20&2047;return t=4294967296*(1048575&i)+t,mn(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))&&(jt(t,n,1),t=t.g,(n=K||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Y=n.getUint32(0,!0),X=n.getUint32(4,!0),xt(t,Y),xt(t,X))})),En=gn((function(t,e,n){return 5===t.h&&(mn(e,n,t.g.u()),!0)}),(function(t,e,n){null!=(e=se(e))&&(jt(t,n,5),t=t.g,Z(e),xt(t,Y))})),Tn=pn((function(t,e,n){return(5===t.h||2===t.h)&&(e=xe(e,$t(e),n,2,!1),2==t.h?vt(t,ht.prototype.u,e):e.push(t.g.u()),!0)}),(function(t,e,n){if(null!=(e=Ye(se,e))&&e.length){jt(t,n,2),Lt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Z(e[r]),xt(n,Y)}})),Pn=gn((function(t,e,n){return 0===t.h&&(mn(e,n,st(t.g,et)),!0)}),yn),Ln=gn((function(t,e,n){return 0===t.h&&(mn(e,n,0===(t=st(t.g,et))?void 0:t),!0)}),yn),On=gn((function(t,e,n){return 0===t.h&&(mn(e,n,st(t.g,tt)),!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&&wt(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,Q(e),Pt(t,Y,X)):(n=wt(e),Pt(t.g,n.h,n.g))))})),xn=gn((function(t,e,n){return 0===t.h&&(mn(e,n,t.g.h()),!0)}),vn),In=pn((function(t,e,n){return(0===t.h||2===t.h)&&(e=xe(e,$t(e),n,2,!1),2==t.h?vt(t,ht.prototype.h,e):e.push(t.g.h()),!0)}),(function(t,e,n){if(null!=(e=Ye(ce,e))&&e.length){n=Ft(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);Ut(t,n)}})),jn=gn((function(t,e,n){return 0===t.h&&(mn(e,n,0===(t=t.g.h())?void 0:t),!0)}),vn),Fn=gn((function(t,e,n){return 0===t.h&&(mn(e,n,at(t.g)),!0)}),bn),Un=gn((function(t,e,n){return 0===t.h&&(mn(e,n,!1===(t=at(t.g))?void 0:t),!0)}),bn),Bn=pn((function(t,e,n){if(2!==t.h)return!1;t=mt(t);const r=$t(e);return Zt(r),xe(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,c(r))}})),kn=gn((function(t,e,n){return 2===t.h&&(mn(e,n,""===(t=mt(t))?void 0:t),!0)}),wn),Mn=gn((function(t,e,n){return 2===t.h&&(mn(e,n,mt(t)),!0)}),wn),Cn=gn((function(t,e,n,r,i){return 2===t.h&&(pt(t,ke(e,r,n,!0),i),!0)}),An),Nn=gn((function(t,e,n,r,i){return 2===t.h&&(pt(t,ke(e,r,n),i),!0)}),An),Dn=pn((function(t,e,n,r,i){if(2!==t.h)return!1;r=pe(void 0,r[0],r[1]);const o=$t(e);Zt(o);let s=xe(e,o,n,3);return(Object.isFrozen(s)||4&Rt(s))&&(s=Mt(s),Oe(e,o,n,s)),s.push(r),pt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)An(t,e[o],n,r,i)})),Gn=gn((function(t,e,n,r,i,o){if(2!==t.h)return!1;const s=$t(e);return Zt(s),(o=Be(e,s,o))&&n!==o&&Oe(e,s,o),pt(t,e=ke(e,r,n),i),!0}),An),Rn=gn((function(t,e,n){return 2===t.h&&(mn(e,n,yt(t)),!0)}),_n),$n=gn((function(t,e,n){return 0===t.h&&(mn(e,n,t.g.h()),!0)}),(function(t,e,n){null!=(e=ce(e))&&(e=parseInt(e,10),jt(t,n,0),Ot(t.g,e))})),zn=pn((function(t,e,n){return(0===t.h||2===t.h)&&(e=xe(e,$t(e),n,2,!1),2==t.h?vt(t,ht.prototype.C,e):e.push(t.g.h()),!0)}),(function(t,e,n){if(null!=(e=Ye(ce,e))&&e.length){n=Ft(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);Ut(t,n)}}));class Vn{constructor(t,e){this.h=t,this.g=e,this.j=Ge,this.defaultValue=void 0}}function Wn(t,e){return(n,r)=>{t:{if(bt.length){const t=bt.pop();t.o(r),it(t.g,n,r),n=t}else n=new class{constructor(t,e){if(ft.length){const n=ft.pop();it(n,t,e),t=n}else t=new ht(t,e);this.g=t,this.j=this.g.g,this.h=this.l=-1,this.o(e)}o({I:t=!1}={}){this.I=t}}(n,r);try{var i=new t;const r=i.m;Qe(e)(r,n),ee&&delete r[ee];var o=i;break t}finally{(i=n.g).j=null,i.A=!1,i.B=0,i.l=0,i.g=0,i.G=!1,n.l=-1,n.h=-1,100>bt.length&&bt.push(n)}o=void 0}return o}}var Hn,Jn=[0,kn,gn((function(t,e,n){return 2===t.h&&(mn(e,n,(t=yt(t))===G()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof Je){const r=e.R;return void(r&&(e=r(e),null!=e&&Bt(t,n,J(e).buffer)))}if(Array.isArray(e))return}_n(t,e,n)}))];function qn(n){if(void 0===Hn){var r=null,i=t.trustedTypes;if(i&&i.createPolicy){try{r=i.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(e){t.console&&t.console.error(e.message)}Hn=r}else Hn=r}return n=(r=Hn)?r.createScriptURL(n):n,new class{constructor(t){this.g=t}toString(){return this.g+""}}(n)}var Kn=[0,Mn],Yn=[0,xn,$n,Fn,Fn,In,$n,$n],Xn=[0,Fn,Fn],Qn=class extends Je{constructor(){super()}};Qn.v=[6];var Zn=[0,Fn,Mn,Fn,$n,$n,zn,Mn,Mn,Nn,Xn,$n],tr=[0,Mn,Mn,Mn],er=class extends Je{constructor(){super()}},nr=[0],rr=[0,xn],ir=[1,2,3,4,5],or=class extends Je{constructor(t){super(t,2)}},sr={},ar=[-2,sr,Fn];sr[336783863]=Ke([0,Mn,Fn,Fn,xn,Nn,[0,Gn,nr,ir,Gn,Zn,ir,Gn,tr,ir,Gn,rr,ir,Gn,Yn,ir],Nn,Kn]);var ur=[0,kn,Un],cr=[0,Ln,Ln,Un,Un,Un,Un,Ln,In,kn,jn,Ln,Ln,Un,jn,Un,Un,Un,kn],lr=[-1,{}],hr=[0,Mn,Nn,2,lr],fr=[0,Mn,Bn,Nn,lr],dr=class extends Je{constructor(t){super(t,500)}o(t){return Ge(this,0,7,t)}};dr.v=[3,4,5,6,8,13,17,1005];var gr,pr=[-500,kn,kn,Bn,Bn,Bn,Bn,Nn,ar,Dn,Jn,jn,jn,Nn,hr,Nn,fr,Dn,ur,kn,Nn,cr,jn,Bn,Bn,988],mr=[0,kn,kn,Nn,lr],yr=[-500,Mn,Mn,Nn,[-1,{}],Mn,999],vr=[-500,Mn,Bn,Bn,Nn,[-2,{},Fn],Bn,998,Bn],br=[-500,Mn,Bn,Nn,lr,Bn,999],wr=class extends Je{constructor(){super(void 0,500)}o(t){return Ge(this,0,1001,t)}};wr.v=[1,6,7,9,10,15,16,17,14,1002],wr.prototype.g=(gr=[-500,Dn,pr,Dn,5,yr,Dn,vr,jn,Dn,br,Bn,jn,Nn,hr,Nn,fr,Dn,mr,Bn,Bn,Bn,Nn,cr,kn,kn,Un,Nn,980,lr,Dn,Jn],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}}}};dn(this.m,t,an(gr)),It(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 Ar=class extends Je{constructor(t){super(t)}},_r=[0,xn,En,Mn,Mn],Sr=class extends Je{constructor(t){super(t)}g(){return De(this,Ar)}};Sr.v=[1];var Er=[0,Dn,_r],Tr=class extends Je{constructor(t){super(t)}};Tr.v=[4,5];var Pr=class extends Je{constructor(t){super(t)}},Lr=[1,2,3,4,5],Or=class extends Je{constructor(t){super(t)}g(){return null!=Ie(this)}h(){return null!=fe(Te(this,2))}},xr=class extends Je{constructor(t){super(t)}},Ir=[0,Nn,[0,Rn,Mn,Nn,[0,xn,Pn,Pn],Nn,[0,On,Pn]],Fn,Nn,[0,Gn,rr,Lr,Gn,Zn,Lr,Gn,Yn,Lr,Gn,nr,Lr,Gn,tr,Lr]],jr=class extends Je{constructor(t){super(t)}},Fr=new Vn(451755788,jr);sr[451755788]=Ke([0,Nn,Ir,Nn,[0,Mn,xn,En,Bn,Bn],Sn]);var Ur=class extends Je{constructor(t){super(t)}},Br=class extends Je{constructor(t){super(t)}},kr=new Vn(487277289,Br);sr[487277289]=Ke([0,Nn,Ir,Nn,[0,Fn,Fn]]);var Mr=class extends Je{constructor(t){super(t)}},Cr=[0,xn,2,Mn,Nn,Er],Nr=class extends Je{constructor(t){super(t)}};Nr.v=[1];var Dr=Wn(Nr,[0,Dn,Cr,Pn]),Gr=class extends Je{constructor(t){super(t)}};Gr.v=[1];var Rr=class extends Je{constructor(t){super(t)}K(){const t=Ie(this);return null==t?G():t}},$r=class extends Je{constructor(t){super(t)}},zr=[1,2],Vr=[0,Gn,[0,Tn],zr,Gn,[0,Rn],zr,xn,Mn],Wr=class extends Je{constructor(t){super(t)}};Wr.v=[1];var Hr=Wn(Wr,[0,Dn,Vr,Pn]);async function Jr(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 qr(t,e,n){t.l||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 Kr(t,e,n){t.l||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 Yr(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Xr(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 Qr=function(t){return class extends t{O(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.i=t,this.g=null,this.h=0,this.l="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?'),qr(this,r||"input_audio",(r=>{qr(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),qr(this,r,(t=>{this.i._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){qr(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){qr(this,e,(e=>{this.i._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){qr(this,e,(e=>{this.i._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){qr(this,e,(e=>{this.i._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){qr(this,e,(e=>{this.i._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){qr(this,e,(e=>{qr(this,t,(t=>{this.i._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){qr(this,e,(e=>{Kr(this,Object.keys(t),(r=>{Kr(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){qr(this,n,(n=>{qr(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){qr(this,t,(t=>{this.i._addEmptyPacketToInputStream(t,e)}))}addBoolToInputSidePacket(t,e){qr(this,e,(e=>{this.i._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){qr(this,e,(e=>{this.i._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){qr(this,e,(e=>{this.i._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){qr(this,e,(e=>{this.i._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){qr(this,e,(e=>{qr(this,t,(t=>{this.i._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){qr(this,n,(n=>{qr(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){Yr(this,t,e),qr(this,t,(t=>{this.i._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Xr(this,t,e),qr(this,t,(t=>{this.i._attachBoolVectorListener(t)}))}attachIntListener(t,e){Yr(this,t,e),qr(this,t,(t=>{this.i._attachIntListener(t)}))}attachIntVectorListener(t,e){Xr(this,t,e),qr(this,t,(t=>{this.i._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Yr(this,t,e),qr(this,t,(t=>{this.i._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Xr(this,t,e),qr(this,t,(t=>{this.i._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Yr(this,t,e),qr(this,t,(t=>{this.i._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Xr(this,t,e),qr(this,t,(t=>{this.i._attachFloatVectorListener(t)}))}attachStringListener(t,e){Yr(this,t,e),qr(this,t,(t=>{this.i._attachStringListener(t)}))}attachStringVectorListener(t,e){Xr(this,t,e),qr(this,t,(t=>{this.i._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Yr(this,t,e),qr(this,t,(t=>{this.i._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Xr(this,t,e),qr(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?'),Yr(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),qr(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 Zr=class extends Qr{};async function ti(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Jr(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Jr(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){var n=e.wasmBinaryPath.toString();return n.includes(t)?n:(n=e.assetBinaryPath?.toString(),n?.includes(t)?n:t)}}),await t.o(n),t}async function ei(t,e,n){return ti(t,e,n)}function ni(t,e){const n=Ce(t.baseOptions,Or,1)||new Or;"string"==typeof e?(Le(n,2,he(e)),Le(n,1)):e instanceof Uint8Array&&(Le(n,1,Xt(e,!1,!1)),Le(n,2)),Ge(t.baseOptions,0,1,n)}function ri(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Ce(t.baseOptions,Or,1)?.g()||Ce(t.baseOptions,Or,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=Ce(t.baseOptions,Pr,3);if(!n){var r=n=new Pr;Re(r,4,new er)}"delegate"in e&&("GPU"===e.delegate?Re(e=n,2,r=new Qn):Re(e=n,4,r=new er)),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),ni(t,"/model.dat"),t.C()})):(ni(t,n.modelAssetBuffer),t.C(),Promise.resolve())}function ii(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 oi(t,e){t.u=Math.max(t.u,e)}var si=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.O(),this.g.setGraph(t,e),ii(this)}finishProcessing(){this.g.finishProcessing(),ii(this)}close(){this.g.closeGraph()}};async function ai(t,e,n){return ei(t,e,n)}si.prototype.close=si.prototype.close;var ui=class extends si{constructor(){super(...arguments),this.B=48e3}P(t){this.B=t}};function ci(t){const e={classifications:De(t,Mr).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=ce(Te(t,1))??0??-1;const n=t.m,r=$t(n),i=Pe(n,r,2),o=se(i);return null!=o&&o!==i&&Oe(n,r,2,o),{index:e,score:o??0??0,categoryName:fe(Te(t,3))??""??"",displayName:fe(Te(t,4))??""??""}})),headIndex:e,headName:n}}(Ce(t,Sr,4)?.g()??[],ce(Te(t,2))??0,fe(Te(t,3))??"")))};return null!=ze(t)&&(e.timestampMs=Ve(ze(t))),e}ui.prototype.setDefaultSampleRate=ui.prototype.P;var li=class extends ui{constructor(t,e){super(new Zr(t,e)),this.l=[],this.h=new jr,t=new xr,Ge(this.h,0,1,t)}get baseOptions(){return Ce(this.h,xr,1)}set baseOptions(t){Ge(this.h,0,1,t)}o(e){var n=this.h,r=Ce(this.h,Tr,2);if(r=r?Ae(r):new Tr,void 0!==e.displayNamesLocale?Le(r,1,he(e.displayNamesLocale)):void 0===e.displayNamesLocale&&Le(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)}}Le(r,2,i)}else"maxResults"in e&&Le(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}`);Le(r,3,i)}else"scoreThreshold"in e&&Le(r,3);return void 0!==e.categoryAllowlist?je(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&Le(r,4),void 0!==e.categoryDenylist?je(r,5,e.categoryDenylist):"categoryDenylist"in e&&Le(r,5),Ge(n,0,2,r),ri(this,e)}M(t,e){return this.A(t,e??this.B,this.u+1)}A(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.l=[],this.finishProcessing(),[...this.l]}C(){var t=new wr;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"timestamped_classifications");const e=new or;He(e,Fr,this.h);const n=new dr;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.o(e),$e(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=Dr(e),t.l.push(ci(e))}))}(this,t),oi(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{oi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function hi(t){return{embeddings:De(t,$r).map((t=>{const e={headIndex:ce(Te(t,3))??0??-1,headName:fe(Te(t,4))??""??""};if(void 0!==Me(t,Gr,Ue(t,1))){t=Ce(t,Gr,Ue(t,1)).m;var n=$t(t);const r=2&n;let i=xe(t,n,1,1),o=Rt(i);if(!(4&o)){Object.isFrozen(i)&&(o=0,i=Mt(i),Oe(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|=5,r&&(o|=34),zt(i,o),2&o&&Object.freeze(i)}!r&&(2&o||Object.isFrozen(i))&&(i=Mt(i),Nt(i,5),Oe(t,n,1,i)),e.floatEmbedding=i}else n=new Uint8Array(0),e.quantizedEmbedding=Ce(t,Rr,Ue(t,2))?.K()?.L()??n;return e})),timestampMs:Ve(ze(t))}}li.prototype.classify=li.prototype.M,li.prototype.setOptions=li.prototype.o,li.createFromModelPath=function(t,e){return ei(li,t,{baseOptions:{modelAssetPath:e}})},li.createFromModelBuffer=function(t,e){return ai(li,t,{baseOptions:{modelAssetBuffer:e}})},li.createFromOptions=function(t,e){return ai(li,t,e)};var fi=class extends ui{constructor(t,e){super(new Zr(t,e)),this.l=[],this.h=new Br,t=new xr,Ge(this.h,0,1,t)}get baseOptions(){return Ce(this.h,xr,1)}set baseOptions(t){Ge(this.h,0,1,t)}o(t){var e=this.h,n=Ce(this.h,Ur,2);return n=n?Ae(n):new Ur,void 0!==t.l2Normalize?Le(n,1,ae(t.l2Normalize)):"l2Normalize"in t&&Le(n,1),void 0!==t.quantize?Le(n,2,ae(t.quantize)):"quantize"in t&&Le(n,2),Ge(e,0,2,n),ri(this,t)}N(t,e){return this.A(t,e??this.B,this.u+1)}A(t,e,n){return this.g.addDoubleToStream(e,"sample_rate",n),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",n),this.l=[],this.finishProcessing(),this.l}C(){var t=new wr;We(t,10,"audio_in"),We(t,10,"sample_rate"),We(t,15,"embeddings_out"),We(t,15,"timestamped_embeddings_out");const e=new or;He(e,kr,this.h);const n=new dr;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.o(e),$e(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=Hr(t),this.l.push(hi(t)),oi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{oi(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=Hr(e),this.l.push(hi(t));oi(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{oi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let di;fi.prototype.embed=fi.prototype.N,fi.prototype.setOptions=fi.prototype.o,fi.createFromModelPath=function(t,e){return ai(fi,t,{baseOptions:{modelAssetPath:e}})},fi.createFromModelBuffer=function(t,e){return ai(fi,t,{baseOptions:{modelAssetBuffer:e}})},fi.createFromOptions=function(t,e){return ai(fi,t,e)};const gi=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 pi(){if(void 0===di)try{await WebAssembly.instantiate(gi),di=!0}catch{di=!1}return di}async function mi(t,e){const n=await pi()?"wasm_internal":"wasm_nosimd_internal";return void 0!==e?{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}:{wasmLoaderPath:qn(`./${encodeURIComponent(t)}_${encodeURIComponent(n)}.js`),wasmBinaryPath:qn(`./${encodeURIComponent(t)}_${encodeURIComponent(n)}.wasm`)}}var yi=class{};yi.forVisionTasks=function(t=""){return mi("vision",t)},yi.forTextTasks=function(t=""){return mi("text",t)},yi.forAudioTasks=function(t=""){return mi("audio",t)},yi.isSimdSupported=function(){return pi()},exports.AudioClassifier=li,exports.AudioEmbedder=fi,exports.AudioTaskRunner=ui,exports.FilesetResolver=yi,exports.TaskRunner=si;
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,e(1,!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 N(null,U)}function M(t){k(U);var e=t.H;return null==(e=null==e||L(e)?e:"string"==typeof e?O(e):null)?e:t.H=e}var N=class{constructor(t,e){if(k(e),this.H=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}P(){const t=M(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 N(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===N)return{buffer:M(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")}var R=!f;let W=!f;const H="function"==typeof Uint8Array.prototype.slice;let J,K=0,q=0;function Y(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}K=n>>>0,q=t>>>0}function X(t){const e=J||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),q=0,K=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function Z(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),n?-t:t}function tt(t){return t=String(t),"0000000".slice(t.length)+t}function et(t){if(16>t.length)Y(Number(t));else if("function"==typeof BigInt)t=BigInt(t),K=Number(t&BigInt(4294967295))>>>0,q=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);q=K=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));q*=1e6,K=1e6*K+e,4294967296<=K&&(q+=Math.trunc(K/4294967296),q>>>=0,K>>>=0)}if(e){const[t,e]=nt(K,q);K=t,q=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=z(e),t.j=e.buffer,t.B=e.A,t.C=0,t.m=t.j.length,t.g=t.C)}function ot(t,e){if(t.g=e,e>t.m)throw G(t.m,e)}function it(t,e){let n,r=0,o=0,i=0;const s=t.j;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(ot(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.j;for(;n<r;){const r=o[n++];if(e|=r,0==(128&r))return ot(t,n),!!(127&e)}throw C()}function at(t){var e=t.j;const n=t.g,r=e[n],o=e[n+1],i=e[n+2];return e=e[n+3],ot(t,t.g+4),(r<<0|o<<8|i<<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 G(e,t.m-n);return t.g=r,n}function ct(t,e){if(0==e)return V();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)?F():H?t.slice(n,e):new Uint8Array(t.subarray(n,e))),$(n)}var lt=class{constructor(t,e){this.j=null,this.B=!1,this.g=this.m=this.C=0,rt(this,t,e)}clear(){this.j=null,this.B=!1,this.g=this.m=this.C=0,this.I=!1}i(){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 C();return ot(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.i()}},ht=[];function ft(t){var e=t.g;if(e.g==e.m)return!1;t.j=t.g.g;var n=t.g.i()>>>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 dt(t){switch(t.i){case 0:0!=t.i?dt(t):st(t.g);break;case 1:ot(t=t.g,t.g+8);break;case 2:if(2!=t.i)dt(t);else{var e=t.g.i()>>>0;ot(t=t.g,t.g+e)}break;case 5:ot(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.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}dt(t)}break;default:throw D(t.i,t.j)}}function gt(t,e,n){const r=t.g.m,o=t.g.i()>>>0,i=t.g.g+o;let s=i-r;if(0>=s&&(t.g.m=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.m=r}function pt(t){var e=t.g.i()>>>0,a=ut(t=t.g,e);if(t=t.j,s){var u,c=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),t=a+e,c=0===a&&t===c.length?c:c.subarray(a,t);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&(c=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&o)<<6|63&c)):244>=h?l>=e-2?n():(o=t[l++],128!=(192&o)||0!=o-144+(h<<28)>>30||128!=(192&(c=t[l++]))||128!=(192&(u=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&o)<<12|(63&c)<<6|63&u,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 mt(t){const e=t.g.i()>>>0;return ct(t.g,e)}function yt(t,e,n){var r=t.g.i()>>>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(K,q)):null:_t||=new wt(0,0)}var wt=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let _t;function At(t){return t?/^-?\d+$/.test(t)?(et(t),new St(K,q)):null:Et||=new St(0,0)}var St=class{constructor(t,e){this.i=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 It(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Pt(t,e){if(0<=e)It(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 Ot(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Lt(t,e,n){It(t.g,8*e+n)}function Bt(t,e){return Lt(t,e,2),e=t.g.end(),Ot(t,e),e.push(t.i),e}function Ft(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 Ut(t,e,n){Lt(t,e,2),It(t.g,n.length),Ot(t,t.g.end()),Ot(t,n)}class jt{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.N=r}}function kt(t){return Array.prototype.slice.call(t)}const Vt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;var Mt=Vt?(t,e)=>{t[Vt]|=e}:(t,e)=>{void 0!==t.o?t.o|=e:Object.defineProperties(t,{o:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Nt(t){const e=Gt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=kt(t)),zt(t,1|e))}var Dt=Vt?(t,e)=>{t[Vt]&=~e}:(t,e)=>{void 0!==t.o&&(t.o&=~e)};function Ct(t,e,n){return n?t|e:t&~e}var Gt=Vt?t=>0|t[Vt]:t=>0|t.o,$t=Vt?t=>t[Vt]:t=>t.o,zt=Vt?(t,e)=>{t[Vt]=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 Mt(t,1),t}function Wt(t,e){zt(e,-14591&(0|t))}function Ht(t,e){zt(e,-14557&(34|t))}function Jt(t){return 0===(t=t>>14&1023)?536870912:t}var Kt={},qt={};function Yt(t){return!(!t||"object"!=typeof t||t.W!==qt)}function Xt(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let Qt=!f;function Zt(t,e,n){if(null!=t)if("string"==typeof t)t=t?new N(t,U):V();else if(t.constructor!==N)if(L(t))t=n?$(t):t.length?new N(new Uint8Array(t),U):V();else{if(!e)throw Error();t=void 0}return t}function te(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Gt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(zt(t,1|r),!0)}var ee;const ne=[];function re(t){if(2&t)throw Error()}let oe,ie;function se(t,e){(e=oe?e[oe]:void 0)&&(t[oe]=kt(e))}function ae(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function ue(t){return null==t?t:"number"==typeof t||"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function ce(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}zt(ne,55),ee=Object.freeze(ne);const le=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function he(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&le.test(t)}function fe(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t?t:void 0}function de(t){return Math.trunc(t)}function ge(t){var e=Math.trunc(Number(t));return Number.isSafeInteger(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t)}function pe(t){if("string"!=typeof t)throw Error();return t}function me(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ye(t){return null==t||"string"==typeof t?t:void 0}function ve(t,e,n){if(null!=t&&"object"==typeof t&&t.G===Kt)return t;if(Array.isArray(t)){var r=Gt(t),o=r;return 0===o&&(o|=32&n),(o|=2&n)!==r&&zt(t,o),new e(t)}}let be,we,_e;function Ae(t){switch(typeof t){case"boolean":return we||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?_e||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Se(t,e,n){if(null==t&&(t=be),be=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=Gt(t)))return ie&&delete t[ie],t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{if(n=r,r=t.length){const o=r-1;if(Xt(t[o])){if(1024<=(e=o-(+!!(512&(n|=256))-1)))throw Error();r=-16760833&n|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,r-(+!!(512&n)-1))))throw Error();r=-16760833&n|(1023&e)<<14}else r=n}}return zt(t,r),t}function Ee(t,e,n,r,o,i){if(null!=t){if(Array.isArray(t))t=o&&0==t.length&&1&Gt(t)?void 0:i&&2&Gt(t)?t:Te(t,e,n,void 0!==r,o,i);else if(Xt(t)){const s={};for(let a in t)s[a]=Ee(t[a],e,n,r,o,i);t=s}else t=e(t,r);return t}}function Te(t,e,n,r,o,i){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]=Ee(a[t],e,n,r,o,i);return n&&(se(a,t),n(s,a)),a}function Ie(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){if(Array.isArray(t))return Qt||!te(t,void 0,9999)?t:void 0;if(L(t))return T(t);if(t instanceof N){const e=t.H;return null==e?"":"string"==typeof e?e:t.H=T(e)}}}return t}(t)}function Pe(t,e,n=Ht){if(null!=t){if(S&&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?(zt(t,-12293&(34|r)),t):Te(t,Pe,4&r?Ht:n,!0,!1,!0))}return t.G===Kt&&(n=t.l,t=2&(r=$t(n))?t:Oe(t,n,r,!0)),t}}function xe(t){const e=t.l;return Oe(t,e,$t(e),!1)}function Oe(t,e,n,r){return t=t.constructor,be=e=Le(e,n,r),e=new t(e),be=void 0,e}function Le(t,e,n){const r=n||2&e?Ht:Wt,o=!!(32&e);return t=function(t,e,n){const r=kt(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 se(r,t),r}(t,e,(t=>Pe(t,o,r))),Mt(t,32|(n?2:0)),t}function Be(t){const e=t.l,n=$t(e);return 2&n?Oe(t,e,n,!1):t}function Fe(t,e){return Ue(t=t.l,$t(t),e)}function Ue(t,e,n,r){if(-1===n)return null;if(n>=Jt(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 je(t,e,n,r){const o=t.l;let i=$t(o);return re(i),ke(o,i,e,n,r),t}function ke(t,e,n,r,o){var i=Jt(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&&zt(t,o),o}return t[n+(+!!(512&e)-1)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ve(t,e,n,r,o){var i=2&e;let s=Ue(t,e,n,o);Array.isArray(s)||(s=ee);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Gt(s);return 0!==c||!u||i||a?1&c||(c|=1,zt(s,c)):(c|=33,zt(s,c)),i?(t=!1,2&c||(Mt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(i=!!(2&c)||!!(2048&c),r&&i?(s=kt(s),r=1,u&&!a&&(r|=32),zt(s,r),ke(t,e,n,s,o)):a&&32&c&&!i&&Dt(s,32)),s}function Me(t){t=t.l;let e=$t(t);const n=Ue(t,e,1),r=Zt(n,!0,!!(34&e));return null!=r&&r!==n&&ke(t,e,1,r),r}function Ne(t,e,n){t=t.l;let r=$t(t);if(re(r),null==n)ke(t,r,e);else{var o=Gt(n),i=o,s=!!(2&o)||Object.isFrozen(n),a=!s&&!1;if(!(4&o)){o=21,s&&(n=kt(n),i=0,o=Xe(o,r,!0)),s=!!(4&o)&&!!(4096&o);for(let t=0;t<n.length;t++)n[t]=pe(n[t])}a&&(o=Ct(o,2,!0)),o!==i&&zt(n,o),a&&Object.freeze(n),ke(t,r,e,n)}}function De(t,e){t=t.l;let n=$t(t);re(n),ke(t,n,2,""===e?void 0:e)}function Ce(t,e,n,r){const o=$t(t);re(o),t=Ve(t,o,e,2),r=n(r,!!(4&(e=Gt(t)))&&!!(4096&e)),t.push(r)}function Ge(t){return t}function $e(t,e){return ze(t=t.l,$t(t),ro)===e?e:-1}function ze(t,e,n){let r=0;for(let o=0;o<n.length;o++){const i=n[o];null!=Ue(t,e,i)&&(0!==r&&(e=ke(t,e,r)),r=i)}return r}function Re(t,e,n,r){let o=$t(t);re(o);const i=Ue(t,o,n,r);let s;if(null!=i&&i.G===Kt)return(e=Be(i))!==i&&ke(t,o,n,e,r),e.l;if(Array.isArray(i)){const t=Gt(i);s=2&t?Le(i,t,!1):i,s=Se(s,e[0],e[1])}else s=Se(void 0,e[0],e[1]);return s!==i&&ke(t,o,n,s,r),s}function We(t,e,n,r){t=t.l;let o=$t(t);const i=Ue(t,o,n,r);return(e=ve(i,e,o))!==i&&null!=e&&ke(t,o,n,e,r),e}function He(t,e,n){if(null==(e=We(t,e,n,!1)))return e;t=t.l;let r=$t(t);if(!(2&r)){const o=Be(e);o!==e&&ke(t,r,n,e=o,!1)}return e}function Je(t,e,n,r,o,i){const s=1===r;r=2===r,o=!!o;var a=!!(2&e)&&r;let u=Ve(t,e,1,3);e=$t(t);var c=Gt(u),l=!!(2&c);const h=!!(4&c),f=!!(32&c);let d=l&&h||!!(2048&c);if(!h){var g,p=u,m=e;(g=!!(2&c))&&(m=Ct(m,2,!0));let t=!g,r=!0,o=0,i=0;for(;o<p.length;o++){const e=ve(p[o],n,m);if(e instanceof n){if(!g){const n=!!(2&Gt(e.l));t&&=!n,r&&=n}p[i++]=e}}i<o&&(p.length=i),c=Ct(c,4,!0),c=Ct(c,16,r),c=Ct(c,8,t),zt(p,c),l&&!a&&(Object.freeze(u),d=!0)}if(n=c,a=!!(8&c)||s&&!u.length,i&&!a){for(d&&(u=kt(u),d=!1,n=0,c=Xe(c,e,o),e=ke(t,e,1,u)),i=u,a=c,l=0;l<i.length;l++)(p=i[l])!==(c=Be(p))&&(i[l]=c);a=Ct(a,8,!0),c=a=Ct(a,16,!i.length)}return d||(s?c=Ct(c,!u.length||16&c&&(!h||f)?2:2048,!0):o||(c=Ct(c,32,!1)),c!==n&&zt(u,c),s&&(Object.freeze(u),d=!0)),r&&d&&(u=kt(u),c=Xe(c,e,o),zt(u,c),ke(t,e,1,u)),u}function Ke(t,e){t=t.l;const n=$t(t),r=!!(2&n);return Je(t,n,e,r?1:2,!1,!r)}function qe(t,e,n,r,o){return null==r&&(r=void 0),je(t,n,r,o)}function Ye(t,e,n){var r=Gr;null==n&&(n=void 0),t=t.l;let o=$t(t);re(o),(r=ze(t,o,r))&&r!==e&&null!=n&&(o=ke(t,o,r)),ke(t,o,e,n)}function Xe(t,e,n){return t=Ct(t,2,!!(2&e)),t=Ct(t,32,!!(32&e)&&n),Ct(t,2048,!1)}function Qe(t,e){var n=Pr;t=t.l;const r=$t(t);re(r),t=Je(t,r,n,2),e=null!=e?e:new n,t.push(e),2&Gt(e.l)?Dt(t,8):Dt(t,16)}function Ze(t){return t=null==(t=Fe(t,2))?t:he(t)?"number"==typeof t?de(t):ge(t):void 0}function tn(t){return t??0}function en(t,e,n){Ce(t.l,e,pe,n)}function nn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}Object.freeze({});var rn=class{constructor(t,e){this.l=Se(t,e)}toJSON(){return on(this,Te(this.l,Ie,void 0,void 0,!1,!1),!0)}A(){return!!(2&Gt(this.l))}};function on(t,e,n){const r=t.constructor.v;var o=$t(n?t.l:e),i=Jt(o),s=!1;if(r&&Qt){if(!n){var a;if((e=kt(e)).length&&Xt(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=Jt(a=$t(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?ee:Rt():n&&l!==ee&&Nt(l)}else{if(!u){var h=void 0;i.length&&Xt(h=i[i.length-1])?u=h:i.push(u={})}l=u[c],null==u[c]?u[c]=n?ee:Rt():n&&l!==ee&&Nt(l)}}}if(!(u=e.length))return e;let f,d;if(Xt(h=e[u-1])){t:{var g=h;for(var p in i={},n=!1,g)t=g[p],Array.isArray(t)&&(a=t,(!W&&te(t,r,+p)||!R&&Yt(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])||!W&&te(h,r,p-o)||!R&&Yt(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 sn(t){return Array.isArray(t)?t[0]instanceof jt?t:[er,t]:[t,void 0]}function an(t,e){if(Array.isArray(e)){var n=Gt(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),zt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}rn.prototype.G=Kt,rn.prototype.toString=function(){return on(this,this.l,!1).toString()};const un=Symbol();function cn(t){let e=t[un];if(!e){const n=mn(t),r=xn(t),o=r.g;e=o?(t,e)=>o(t,e,r):(t,e)=>{for(;ft(e)&&4!=e.i;){var o=e.m,i=r[o];if(!i){var s=r.K;s&&(s=s[o])&&(i=r[o]=ln(s))}i&&i(e,t,o)||(o=(i=e).j,dt(i),i.J?i=void 0:(s=i.g.g-o,i.g.g=o,i=ct(i.g,s)),o=t,i&&(oe||=Symbol(),(s=o[oe])?s.push(i):o[oe]=[i]))}n===hn||n===fn||n.T||(t[ie||=Symbol()]=n)},t[un]=e}return e}function ln(t){const e=(t=sn(t))[0].g;if(t=t[1]){const n=cn(t),r=xn(t).D;return(t,o,i)=>e(t,o,i,r,n)}return e}let hn,fn;const dn=Symbol();function gn(t,e,n){const r=n[1];let o;if(r){const n=r[dn];o=n?n.D:Ae(r[0]),t[e]=n??r}o&&o===we?(t.L||(t.L=[])).push(e):n[0]&&(t.M||(t.M=[])).push(e)}function pn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function mn(t){var e=t[dn];if(e)return e;if(!(e=vn(t,t[dn]={},pn,pn,gn)).M&&!e.L){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=Ae(t[0])===we,e=t[dn]=e?fn||={D:Ae(!0)}:hn||={}):e.T=!0}return e}function yn(t,e,n){t[e]=n}function vn(t,e,n,r,o=yn){e.D=Ae(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 jt?h=s:(h=nr,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 bn=Symbol();function wn(t){let e=t[bn];if(!e){const n=En(t);e=(t,e)=>Ln(t,e,n),t[bn]=e}return e}const _n=Symbol();function An(t){return t.i}function Sn(t,e){let n,r;const o=t.i;return(t,i,s)=>o(t,i,s,r||=En(e).D,n||=wn(e))}function En(t){let e=t[_n];return e||(e=vn(t,t[_n]={},An,Sn),Tn in t&&_n in t&&(t.length=0),e)}const Tn=Symbol();function In(t,e){const n=t.g;return e?(t,r,o)=>n(t,r,o,e):n}function Pn(t,e,n){const r=t.g;let o,i;return(t,s,a)=>r(t,s,a,i||=xn(e).D,o||=cn(e),n)}function xn(t){let e=t[Tn];return e||(mn(t),e=vn(t,t[Tn]={},In,Pn),Tn in t&&_n in t&&(t.length=0),e)}function On(t,e){var n=t[e];if(n)return n;if((n=t.K)&&(n=n[e])){var r=(n=sn(n))[0].i;if(n=n[1]){const e=wn(n),o=En(n).D;n=(n=t.i)?n(o,e):(t,n,i)=>r(t,n,i,o,e)}else n=r;return t[e]=n}}function Ln(t,e,n){for(var r=$t(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=On(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=On(n,o))&&a(e,i,o)}if(t=oe?t[oe]:void 0)for(Ot(e,e.g.end()),n=0;n<t.length;n++)Ot(e,M(t[n])||F())}function Bn(t,e){return new jt(t,e,!1,!1)}function Fn(t,e){return new jt(t,e,!0,!1)}function Un(t,e,n){ke(t,$t(t),e,n)}function jn(t,e,n){t:if(null!=e){if(he(e)){if("string"==typeof e){e=ge(e);break t}if("number"==typeof e){e=de(e);break t}}e=void 0}null!=e&&("string"==typeof e&&At(e),null!=e&&(Lt(t,n,0),"number"==typeof e?(t=t.g,Y(e),Tt(t,K,q)):(n=At(e),Tt(t.g,n.i,n.g))))}function kn(t,e,n){null!=(e=fe(e))&&null!=e&&(Lt(t,n,0),Pt(t.g,e))}function Vn(t,e,n){null!=(e=null==e?e:"boolean"==typeof e||"number"==typeof e?!!e:void 0)&&(Lt(t,n,0),t.g.g.push(e?1:0))}function Mn(t,e,n){null!=(e=ye(e))&&Ut(t,n,c(e))}function Nn(t,e,n,r,o){null!=(e=e instanceof rn?e.l:Array.isArray(e)?Se(e,r[0],r[1]):void 0)&&(n=Bt(t,n),o(e,t),Ft(t,n))}function Dn(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof N?e:void 0)&&Ut(t,n,z(e).buffer)}var Cn,Gn=Bn((function(t,e,n){if(1!==t.i)return!1;var r=t.g;t=at(r);const o=at(r);r=2*(o>>31)+1;const i=o>>>20&2047;return t=4294967296*(1048575&o)+t,Un(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=ue(e))&&(Lt(t,n,1),t=t.g,(n=J||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),K=n.getUint32(0,!0),q=n.getUint32(4,!0),xt(t,K),xt(t,q))})),$n=Bn((function(t,e,n){return 5===t.i&&(Un(e,n,t.g.u()),!0)}),(function(t,e,n){null!=(e=ue(e))&&(Lt(t,n,5),t=t.g,X(e),xt(t,K))})),zn=Fn((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ve(e,$t(e),n,2,!1),2==t.i?yt(t,lt.prototype.u,e):e.push(t.g.u()),!0)}),(function(t,e,n){if(null!=(e=an(ue,e))&&e.length){Lt(t,n,2),It(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,X(e[r]),xt(n,K)}})),Rn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,it(t.g,Z)),!0)}),jn),Wn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,0===(t=it(t.g,Z))?void 0:t),!0)}),jn),Hn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,it(t.g,Q)),!0)}),(function(t,e,n){t:if(null!=e){if(he(e)){if("string"==typeof e){var r=Math.trunc(Number(e));if(Number.isSafeInteger(r))e=String(r);else{-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),et(e);var o=K;r=q,o>>>=0,2097151>=(r>>>=0)?e=""+(4294967296*r+o):"function"==typeof BigInt?e=""+(BigInt(r)<<BigInt(32)|BigInt(o)):(o=(16777215&o)+6777216*(e=16777215&(o>>>24|r<<8))+6710656*(r=r>>16&65535),e+=8147497*r,r*=2,1e7<=o&&(e+=Math.floor(o/1e7),o%=1e7),1e7<=e&&(r+=Math.floor(e/1e7),e%=1e7),e=r+tt(e)+tt(o))}break t}if("number"==typeof e){e=Math.trunc(e);break t}}e=void 0}null!=e&&("string"==typeof e&&bt(e),null!=e&&(Lt(t,n,0),"number"==typeof e?(t=t.g,Y(e),Tt(t,K,q)):(n=bt(e),Tt(t.g,n.i,n.g))))})),Jn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,t.g.i()),!0)}),kn),Kn=Fn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ve(e,$t(e),n,2,!1),2==t.i?yt(t,lt.prototype.i,e):e.push(t.g.i()),!0)}),(function(t,e,n){if(null!=(e=an(fe,e))&&e.length){n=Bt(t,n);for(let n=0;n<e.length;n++)Pt(t.g,e[n]);Ft(t,n)}})),qn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,0===(t=t.g.i())?void 0:t),!0)}),kn),Yn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,st(t.g)),!0)}),Vn),Xn=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,!1===(t=st(t.g))?void 0:t),!0)}),Vn),Qn=Fn((function(t,e,n){return 2===t.i&&(Ce(e,n,Ge,t=pt(t)),!0)}),(function(t,e,n){if(null!=(e=an(ye,e)))for(let o=0;o<e.length;o++){var r=e[o];null!=r&&Ut(t,n,c(r))}})),Zn=Bn((function(t,e,n){return 2===t.i&&(Un(e,n,""===(t=pt(t))?void 0:t),!0)}),Mn),tr=Bn((function(t,e,n){return 2===t.i&&(Un(e,n,pt(t)),!0)}),Mn),er=new jt((function(t,e,n,r,o){return 2===t.i&&(gt(t,Re(e,r,n,!0),o),!0)}),Nn,!1,!0),nr=new jt((function(t,e,n,r,o){return 2===t.i&&(gt(t,Re(e,r,n),o),!0)}),Nn,!1,!0);Cn=new jt((function(t,e,n,r,o){if(2!==t.i)return!1;r=Se(void 0,r[0],r[1]);let i=$t(e);re(i);let s=Ve(e,i,n,3);return i=$t(e),4&Gt(s)&&(s=kt(s),zt(s,-2079&(1|Gt(s))),ke(e,i,n,s)),s.push(r),gt(t,r,o),!0}),(function(t,e,n,r,o){if(Array.isArray(e))for(let i=0;i<e.length;i++)Nn(t,e[i],n,r,o)}),!0,!0);var rr=new jt((function(t,e,n,r,o,i){if(2!==t.i)return!1;let s=$t(e);return re(s),(i=ze(e,s,i))&&n!==i&&ke(e,s,i),gt(t,e=Re(e,r,n),o),!0}),Nn,!1,!0),or=Bn((function(t,e,n){return 2===t.i&&(Un(e,n,mt(t)),!0)}),Dn),ir=Bn((function(t,e,n){return 0===t.i&&(Un(e,n,t.g.i()),!0)}),(function(t,e,n){null!=(e=fe(e))&&(e=parseInt(e,10),Lt(t,n,0),Pt(t.g,e))})),sr=Fn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ve(e,$t(e),n,2,!1),2==t.i?yt(t,lt.prototype.F,e):e.push(t.g.i()),!0)}),(function(t,e,n){if(null!=(e=an(fe,e))&&e.length){n=Bt(t,n);for(let n=0;n<e.length;n++)Pt(t.g,e[n]);Ft(t,n)}}));class ar{constructor(t,e){this.i=t,this.g=e,this.j=qe,this.defaultValue=void 0}}function ur(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.i=this.m=-1,this.s(e)}s({J:t=!1}={}){this.J=t}}(n,r);try{const r=new t,i=r.l;cn(e)(i,n),ie&&delete i[ie];var o=r;break t}finally{n.g.clear(),n.m=-1,n.i=-1,100>vt.length&&vt.push(n)}o=void 0}return o}}var cr=[0,Zn,Bn((function(t,e,n){return 2===t.i&&(Un(e,n,(t=mt(t))===V()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof rn){const r=e.X;return void(r&&(e=r(e),null!=e&&Ut(t,n,z(e).buffer)))}if(Array.isArray(e))return}Dn(t,e,n)}))],lr=[0,tr],hr=[0,Jn,ir,Yn,-1,Kn,ir,-1],fr=[0,Yn,-1],dr=class extends rn{constructor(){super()}};dr.v=[6];var gr=[0,Yn,tr,Yn,ir,-1,sr,tr,-1,fr,ir],pr=[0,tr,-2],mr=class extends rn{constructor(){super()}},yr=[0],vr=[0,Jn,Yn,-2],br=class extends rn{constructor(t){super(t,2)}},wr={},_r=[-2,wr,Yn];wr[336783863]=[0,tr,Yn,-1,Jn,[0,[1,2,3,4,5],rr,yr,rr,gr,rr,pr,rr,vr,rr,hr],lr];var Ar=[0,Zn,Xn],Sr=[0,Wn,-1,Xn,-3,Wn,Kn,Zn,qn,Wn,-1,Xn,qn,Xn,-2,Zn],Er=[-1,{}],Tr=[0,tr,1,Er],Ir=[0,tr,Qn,Er],Pr=class extends rn{constructor(t){super(t,500)}s(t){return qe(this,0,7,t)}};Pr.v=[3,4,5,6,8,13,17,1005];var xr,Or=[-500,Zn,-1,Qn,-3,_r,Cn,cr,qn,-1,Tr,Ir,Cn,Ar,Zn,Sr,qn,Qn,987,Qn],Lr=[0,Zn,-1,Er],Br=[-500,tr,-1,[-1,{}],998,tr],Fr=[-500,tr,Qn,-1,[-2,{},Yn],997,Qn,-1],Ur=[-500,tr,Qn,Er,998,Qn],jr=class extends rn{constructor(){super(void 0,500)}s(t){return qe(this,0,1001,t)}};jr.v=[1,6,7,9,10,15,16,17,14,1002],jr.prototype.g=(xr=[-500,Cn,Or,4,Cn,Br,Cn,Fr,qn,Cn,Ur,Qn,qn,Tr,Ir,Cn,Lr,Qn,-2,Sr,Zn,-1,Xn,979,Er,Cn,cr],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}}}};Ln(this.l,t,En(xr)),Ot(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 kr=class extends rn{constructor(t){super(t)}},Vr=[0,Jn,$n,tr,-1],Mr=class extends rn{constructor(t){super(t)}g(){return Ke(this,kr)}};Mr.v=[1];var Nr=[0,Cn,Vr],Dr=class extends rn{constructor(t){super(t)}};Dr.v=[4,5];var Cr=class extends rn{constructor(t){super(t)}},Gr=[1,2,3,4,5],$r=class extends rn{constructor(t){super(t)}g(){return null!=Me(this)}i(){return null!=ye(Fe(this,2))}},zr=class extends rn{constructor(t){super(t)}},Rr=[0,[0,or,tr,[0,Jn,Rn,-1],[0,Hn,Rn]],Yn,[0,Gr,rr,vr,rr,gr,rr,hr,rr,yr,rr,pr],ir],Wr=class extends rn{constructor(t){super(t)}},Hr=new ar(451755788,Wr);wr[451755788]=[0,Rr,[0,tr,Jn,$n,Qn,-1],Gn];var Jr=class extends rn{constructor(t){super(t)}},Kr=class extends rn{constructor(t){super(t)}},qr=new ar(487277289,Kr);wr[487277289]=[0,Rr,[0,Yn,-1]];var Yr=class extends rn{constructor(t){super(t)}},Xr=[0,1,Jn,tr,Nr],Qr=class extends rn{constructor(t){super(t)}};Qr.v=[1];var Zr=ur(Qr,[0,Cn,Xr,Rn]),to=class extends rn{constructor(t){super(t)}};to.v=[1];var eo=class extends rn{constructor(t){super(t)}O(){const t=Me(this);return null==t?V():t}},no=class extends rn{constructor(t){super(t)}},ro=[1,2],oo=[0,ro,rr,[0,zn],rr,[0,or],Jn,tr],io=class extends rn{constructor(t){super(t)}};io.v=[1];var so=ur(io,[0,Cn,oo,Rn]);async function ao(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 uo(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 co(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 lo(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function ho(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 fo=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?'),uo(this,r||"input_audio",(r=>{uo(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),uo(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,o)}))}addGpuBufferToStream(t,e,n){uo(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){uo(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){uo(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){uo(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){uo(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){uo(this,e,(e=>{uo(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){uo(this,e,(e=>{co(this,Object.keys(t),(r=>{co(this,Object.values(t),(o=>{this.h._addFlatHashMapToInputStream(r,o,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){uo(this,n,(n=>{uo(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){uo(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){uo(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){uo(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){uo(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){uo(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){uo(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)uo(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){uo(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){uo(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){uo(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){uo(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){uo(this,e,(e=>{uo(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){uo(this,n,(n=>{uo(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){uo(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){uo(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){uo(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){uo(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){uo(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)uo(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){lo(this,t,e),uo(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){ho(this,t,e),uo(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){lo(this,t,e),uo(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){ho(this,t,e),uo(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachDoubleListener(t,e){lo(this,t,e),uo(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){ho(this,t,e),uo(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){lo(this,t,e),uo(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){ho(this,t,e),uo(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){lo(this,t,e),uo(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){ho(this,t,e),uo(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){lo(this,t,e),uo(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){ho(this,t,e),uo(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?'),lo(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),uo(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 go=class extends fo{};async function po(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await ao(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await ao(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 mo(t,e,n){return po(t,e,n)}function yo(t,e){const n=He(t.baseOptions,$r,1)||new $r;"string"==typeof e?(je(n,2,me(e)),je(n,1)):e instanceof Uint8Array&&(je(n,1,Zt(e,!1,!1)),je(n,2)),qe(t.baseOptions,0,1,n)}function vo(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(He(t.baseOptions,$r,1)?.g()||He(t.baseOptions,$r,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=He(t.baseOptions,Cr,3);if(!n){var r=n=new Cr;Ye(r,4,new mr)}"delegate"in e&&("GPU"===e.delegate?Ye(e=n,2,r=new dr):Ye(e=n,4,r=new mr)),qe(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),yo(t,"/model.dat"),t.F()})):(yo(t,n.modelAssetBuffer),t.F(),Promise.resolve())}function bo(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 wo(t,e){t.u=Math.max(t.u,e)}var _o=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),bo(this)}finishProcessing(){this.g.finishProcessing(),bo(this)}close(){this.g.closeGraph()}};async function Ao(t,e,n){return mo(t,e,n)}_o.prototype.close=_o.prototype.close;var So=class extends _o{constructor(){super(...arguments),this.C=48e3}V(t){this.C=t}};function Eo(t){const e={classifications:Ke(t,Yr).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=fe(Fe(t,1))??0??-1;const n=t.l;let r=$t(n);const o=Ue(n,r,2),i=ue(o);return null!=i&&i!==o&&ke(n,r,2,i),{index:e,score:i??0??0,categoryName:ye(Fe(t,3))??""??"",displayName:ye(Fe(t,4))??""??""}})),headIndex:e,headName:n}}(He(t,Mr,4)?.g()??[],fe(Fe(t,2))??0,ye(Fe(t,3))??"")))};return null!=Ze(t)&&(e.timestampMs=tn(Ze(t))),e}So.prototype.setDefaultSampleRate=So.prototype.V;var To=class extends So{constructor(t,e){super(new go(t,e)),this.m=[],this.i=new Wr,t=new zr,qe(this.i,0,1,t)}get baseOptions(){return He(this.i,zr,1)}set baseOptions(t){qe(this.i,0,1,t)}s(e){var n=this.i,r=He(this.i,Dr,2);if(r=r?xe(r):new Dr,void 0!==e.displayNamesLocale?je(r,1,me(e.displayNamesLocale)):void 0===e.displayNamesLocale&&je(r,1),void 0!==e.maxResults){var o=e.maxResults;if(null!=o){if("number"!=typeof o)throw ae(e=Error("int32"),"warning"),e;if(!Number.isFinite(o)){const e=Error();ae(e,"incident"),function(e){t.setTimeout((()=>{throw e}),0)}(e)}}je(r,2,o)}else"maxResults"in e&&je(r,2);if(void 0!==e.scoreThreshold){if(null!=(o=e.scoreThreshold)&&"number"!=typeof o)throw Error(`Value of float/double field must be a number, found ${typeof o}: ${o}`);je(r,3,o)}else"scoreThreshold"in e&&je(r,3);return void 0!==e.categoryAllowlist?Ne(r,4,e.categoryAllowlist):"categoryAllowlist"in e&&je(r,4),void 0!==e.categoryDenylist?Ne(r,5,e.categoryDenylist):"categoryDenylist"in e&&je(r,5),qe(n,0,2,r),vo(this,e)}R(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 jr;en(t,10,"audio_in"),en(t,10,"sample_rate"),en(t,15,"timestamped_classifications");const e=new br;nn(e,Hr,this.i);const n=new Pr;De(n,me("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph")),en(n,3,"AUDIO:audio_in"),en(n,3,"SAMPLE_RATE:sample_rate"),en(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.s(e),Qe(t,n),this.g.attachProtoVectorListener("timestamped_classifications",((t,e)=>{!function(t,e){e.forEach((e=>{e=Zr(e),t.m.push(Eo(e))}))}(this,t),wo(this,e)})),this.g.attachEmptyPacketListener("timestamped_classifications",(t=>{wo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function Io(t){return{embeddings:Ke(t,no).map((t=>{const e={headIndex:fe(Fe(t,3))??0??-1,headName:ye(Fe(t,4))??""??""};if(void 0!==We(t,to,$e(t,1))){var n=2,r=void 0;t=He(t,to,$e(t,1)).l;let s=$t(t);2&s&&(n=1);let a=Ve(t,s,1,1|((r=!!r)?2:0));s=$t(t);var o=Gt(a);let u=o,c=!!(2&o);var i=c&&!!(4&o);if(!(4&o)){Object.isFrozen(a)&&(a=kt(a),u=0,c=!!(2&(o=Xe(o,s,r))),s=ke(t,s,1,a)),o=Ct(o,4,!1),o=Ct(o,4096,!1),o=Ct(o,8192,!1);let e=0,n=0;for(;e<a.length;e++){const t=ue(a[e]);null!=t&&(a[n++]=t)}n<e&&(a.length=n),o=Ct(o,20,!0)}i||((i=1===n)&&(o=Ct(o,2,!0)),o!==u&&zt(a,o),(i||c)&&Object.freeze(a)),2===n&&c&&(a=kt(a),o=Xe(o,s,r),zt(a,o),ke(t,s,1,a)),e.floatEmbedding=a}else n=new Uint8Array(0),e.quantizedEmbedding=He(t,eo,$e(t,2))?.O()?.P()??n;return e})),timestampMs:tn(Ze(t))}}To.prototype.classify=To.prototype.R,To.prototype.setOptions=To.prototype.s,To.createFromModelPath=function(t,e){return mo(To,t,{baseOptions:{modelAssetPath:e}})},To.createFromModelBuffer=function(t,e){return Ao(To,t,{baseOptions:{modelAssetBuffer:e}})},To.createFromOptions=function(t,e){return Ao(To,t,e)};var Po=class extends So{constructor(t,e){super(new go(t,e)),this.m=[],this.i=new Kr,t=new zr,qe(this.i,0,1,t)}get baseOptions(){return He(this.i,zr,1)}set baseOptions(t){qe(this.i,0,1,t)}s(t){var e=this.i,n=He(this.i,Jr,2);return n=n?xe(n):new Jr,void 0!==t.l2Normalize?je(n,1,ce(t.l2Normalize)):"l2Normalize"in t&&je(n,1),void 0!==t.quantize?je(n,2,ce(t.quantize)):"quantize"in t&&je(n,2),qe(e,0,2,n),vo(this,t)}S(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 jr;en(t,10,"audio_in"),en(t,10,"sample_rate"),en(t,15,"embeddings_out"),en(t,15,"timestamped_embeddings_out");const e=new br;nn(e,qr,this.i);const n=new Pr;De(n,me("mediapipe.tasks.audio.audio_embedder.AudioEmbedderGraph")),en(n,3,"AUDIO:audio_in"),en(n,3,"SAMPLE_RATE:sample_rate"),en(n,4,"EMBEDDINGS:embeddings_out"),en(n,4,"TIMESTAMPED_EMBEDDINGS:timestamped_embeddings_out"),n.s(e),Qe(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=so(t),this.m.push(Io(t)),wo(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{wo(this,t)})),this.g.attachProtoVectorListener("timestamped_embeddings_out",((t,e)=>{for(const e of t)t=so(e),this.m.push(Io(t));wo(this,e)})),this.g.attachEmptyPacketListener("timestamped_embeddings_out",(t=>{wo(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};let xo;Po.prototype.embed=Po.prototype.S,Po.prototype.setOptions=Po.prototype.s,Po.createFromModelPath=function(t,e){return Ao(Po,t,{baseOptions:{modelAssetPath:e}})},Po.createFromModelBuffer=function(t,e){return Ao(Po,t,{baseOptions:{modelAssetBuffer:e}})},Po.createFromOptions=function(t,e){return Ao(Po,t,e)};const Oo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Lo(){if(void 0===xo)try{await WebAssembly.instantiate(Oo),xo=!0}catch{xo=!1}return xo}async function Bo(t,e=""){const n=await Lo()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Fo=class{};Fo.forVisionTasks=function(t){return Bo("vision",t)},Fo.forTextTasks=function(t){return Bo("text",t)},Fo.forAudioTasks=function(t){return Bo("audio",t)},Fo.isSimdSupported=function(){return Lo()},exports.AudioClassifier=To,exports.AudioEmbedder=Po,exports.AudioTaskRunner=So,exports.FilesetResolver=Fo,exports.TaskRunner=_o;
2
2
  //# sourceMappingURL=audio_bundle_cjs.js.map