@mediapipe/tasks-audio 0.10.8 → 0.10.9-rc.20231208

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