@mediapipe/tasks-audio 1.0.0 → 1.0.1-rc.20260729

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/audio_bundle.js CHANGED
@@ -1,2 +1,2 @@
1
- var Audio=function(t){"use strict";var r="undefined"!=typeof self?self:{};function e(t,e){t:{for(var n=["CLOSURE_FLAGS"],i=r,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(t=n&&n[t])?t:e}function n(){throw Error("Invalid UTF8")}function i(t,r){return r=String.fromCharCode.apply(null,r),null==t?r:t+r}var o,a,s=void 0,u="undefined"!=typeof TextDecoder,l="undefined"!=typeof TextEncoder;function c(t){if(l)t=(a||=new TextEncoder).encode(t);else{let e=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var r=t.charCodeAt(i);if(r<128)n[e++]=r;else{if(r<2048)n[e++]=r>>6|192;else{if(r>=55296&&r<=57343){if(r<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){r=1024*(r-55296)+o-56320+65536,n[e++]=r>>18|240,n[e++]=r>>12&63|128,n[e++]=r>>6&63|128,n[e++]=63&r|128;continue}i--}r=65533}n[e++]=r>>12|224,n[e++]=r>>6&63|128}n[e++]=63&r|128}}t=e===n.length?n:n.subarray(0,e)}return t}var h=e(610401301,!1),f=e(748402147,!0);function d(){var t=r.navigator;return t&&(t=t.userAgent)?t:""}var g,v=r.navigator;function p(t){return p[" "](t),t}g=v&&v.userAgentData||null,p[" "]=function(){};var m={},y=null;function w(t){var r=t.length,e=3*r/4;e%3?e=Math.floor(e):-1!="=.".indexOf(t[r-1])&&(e=-1!="=.".indexOf(t[r-2])?e-2:e-1);var n=new Uint8Array(e),i=0;return function(t,r){function e(r){for(;n<t.length;){let r=t.charAt(n++),e=y[r];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return r}b();for(var n=0;;){let t=e(-1),n=e(0),i=e(64),o=e(64);if(64===o&&-1===t)break;r(t<<2|n>>4),64!=i&&(r(n<<4&240|i>>2),64!=o&&r(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==e?n.subarray(0,i):n}function b(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=["+/=","+/","-_=","-_.","-_"];for(let e=0;e<5;e++){let n=t.concat(r[e].split(""));m[e]=n;for(let t=0;t<n.length;t++){let r=n[t];void 0===y[r]&&(y[r]=t)}}}}var _="undefined"!=typeof Uint8Array,S=!(!(h&&g&&g.brands.length>0)&&(-1!=d().indexOf("Trident")||-1!=d().indexOf("MSIE")))&&"function"==typeof btoa,A=/[-_.]/g,I={"-":"+",_:"/",".":"="};function E(t){return I[t]||""}function T(t){if(!S)return w(t);t=A.test(t)?t.replace(A,E):t,t=atob(t);var r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}var B={};function U(){return L||=new x(null,B)}function P(t){N(B);var r=t.g;return null==(r=null==r||_&&null!=r&&r instanceof Uint8Array?r:"string"==typeof r?T(r):null)?r:t.g=r}var L,x=class{constructor(t,r){if(N(r),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function N(t){if(t!==B)throw Error("illegal external caller")}function j(t,r){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=r}var O=void 0;function V(t){return j(t=Error(t),"warning"),t}function k(t,e){if(null!=t){var n=O??={},i=n[t]||0;i>=e||(n[t]=i+1,j(t=Error(),"incident"),function(t){r.setTimeout(()=>{throw t},0)}(t))}}function F(){return"function"==typeof BigInt}var M="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,r,e=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?e&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():r}var D,G=C("jas",void 0,!0),R=C(void 0,"1oa"),W=C(void 0,Symbol()),H=C(void 0,"0ubs"),$=C(void 0,"0ubsb"),z=C(void 0,"0actk"),K=C("m_m","Ka",!0),J={Y:{value:0,configurable:!0,writable:!0,enumerable:!1}},X=Object.defineProperties,Y=M?G:"Y",Z=[];function q(t,r){M||Y in t||X(t,J),t[Y]|=r}function Q(t,r){M||Y in t||X(t,J),t[Y]=r}Q(Z,7),D=Object.freeze(Z);var tt={};function rt(t,r){return void 0===r?t.g!==et&&!!(2&t.l[Y]):!!(2&r)&&t.g!==et}var et={};function nt(t,r){if(null!=t)if("string"==typeof t)t=t?new x(t,B):U();else if(t.constructor!==x)if(_&&null!=t&&t instanceof Uint8Array)t=t.length?new x(new Uint8Array(t),B):U();else{if(!r)throw Error();t=void 0}return t}var it=Object.freeze({});function ot(t,r,e){var n,i=128&r?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var a=o+(n?-1:0);for(r=128&r?1:0;r<a;r++)e(r-i,t[r]);if(n){t=t[o-1];for(let r in t)!isNaN(r)&&e(+r,t[r])}}var at={};function st(t){return 128&t?at:void 0}function ut(t){return t.Ia=!0,t}var lt=ut(t=>"number"==typeof t),ct=ut(t=>"string"==typeof t),ht=ut(t=>"boolean"==typeof t),ft="function"==typeof r.BigInt&&"bigint"==typeof r.BigInt(0);function dt(t){var r=t;if(ct(r)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(r))throw Error(String(r))}else if(lt(r)&&!Number.isSafeInteger(r))throw Error(String(r));return ft?BigInt(t):t=ht(t)?t?"1":"0":ct(t)?t.trim()||"0":String(t)}var gt=ut(t=>ft?t>=pt&&t<=yt:"-"===t[0]?wt(t,vt):wt(t,mt)),vt=Number.MIN_SAFE_INTEGER.toString(),pt=ft?BigInt(Number.MIN_SAFE_INTEGER):void 0,mt=Number.MAX_SAFE_INTEGER.toString(),yt=ft?BigInt(Number.MAX_SAFE_INTEGER):void 0;function wt(t,r){if(t.length>r.length)return!1;if(t.length<r.length||t===r)return!0;for(let e=0;e<t.length;e++){let n=t[e],i=r[e];if(n>i)return!1;if(n<i)return!0}}var bt,_t="function"==typeof Uint8Array.prototype.slice,St=0,At=0;function It(t){var r=t>>>0;St=r,At=(t-r)/4294967296>>>0}function Et(t){if(t<0){It(-t);let[r,e]=jt(St,At);St=r>>>0,At=e>>>0}else It(t)}function Tt(t,r){var e=4294967296*r+(t>>>0);return Number.isSafeInteger(e)?e:Pt(t,r)}function Bt(t,r){return dt(F()?BigInt.asUintN(64,(BigInt(r>>>0)<<BigInt(32))+BigInt(t>>>0)):Pt(t,r))}function Ut(t,r){return F()?dt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(r))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):dt(xt(t,r))}function Pt(t,r){if(t>>>=0,(r>>>=0)<=2097151)var e=""+(4294967296*r+t);else F()?e=""+(BigInt(r)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(e=16777215&(t>>>24|r<<8))+6710656*(r=r>>16&65535),e+=8147497*r,r*=2,t>=1e7&&(e+=t/1e7>>>0,t%=1e7),e>=1e7&&(r+=e/1e7>>>0,e%=1e7),e=r+Lt(e)+Lt(t));return e}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function xt(t,r){if(2147483648&r)if(F())t=""+(BigInt(0|r)<<BigInt(32)|BigInt(t>>>0));else{let[e,n]=jt(t,r);t="-"+Pt(e,n)}else t=Pt(t,r);return t}function Nt(t){if(t.length<16)Et(Number(t));else if(F())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,At=Number(t>>BigInt(32)&BigInt(4294967295));else{let r=+("-"===t[0]);At=St=0;let e=t.length;for(let n=r,i=(e-r)%6+r;i<=e;n=i,i+=6){let r=Number(t.slice(n,i));At*=1e6,(St=1e6*St+r)>=4294967296&&(At+=Math.trunc(St/4294967296),At>>>=0,St>>>=0)}if(r){let[t,r]=jt(St,At);St=t,At=r}}}function jt(t,r){return r=~r,t?t=1+~t:r+=1,[t,r]}function Ot(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,kt="function"==typeof BigInt?BigInt.asUintN:void 0,Ft=Number.isSafeInteger,Mt=Number.isFinite,Ct=Math.trunc;function Dt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}var Gt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Rt(t){switch(typeof t){case"bigint":return!0;case"number":return Mt(t);case"string":return Gt.test(t);default:return!1}}function Wt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?0|t:void 0}function Ht(t){var r=t.length;return("-"===t[0]?r<20||20===r&&t<="-9223372036854775808":r<19||19===r&&t<="9223372036854775807")?t:(Nt(t),xt(St,At))}function $t(t){if("-"===t[0])var r=!1;else r=(r=t.length)<20||20===r&&t<="18446744073709551615";return r?t:(Nt(t),Pt(St,At))}function zt(t){if(t=Ct(t),!Ft(t)){Et(t);var r=St,e=At;(t=2147483648&e)&&(e=~e>>>0,0==(r=1+~r>>>0)&&(e=e+1>>>0)),t="number"==typeof(r=Tt(r,e))?t?-r:r:t?"-"+r:r}return t}function Kt(t){return(t=Ct(t))>=0&&Ft(t)||(Et(t),t=Tt(St,At)),t}function Jt(t){var r=Ct(Number(t));return Ft(r)?String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Ht(t))}function Xt(t){var r=Ct(Number(t));return Ft(r)?dt(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),F()?dt(Vt(64,BigInt(t))):dt(Ht(t)))}function Yt(t){return Ft(t)?t=dt(zt(t)):(t=Ct(t),Ft(t)?t=String(t):(Et(t),t=xt(St,At)),t=dt(t)),t}function Zt(t){var r=typeof t;return null==t?t:"bigint"===r?dt(Vt(64,t)):Rt(t)?"string"===r?Xt(t):Yt(t):void 0}function qt(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(Vt(64,t));if(Rt(t)){if("string"===r)return Jt(t);if("number"===r)return zt(t)}}function Qt(t){if(null==t||"string"==typeof t||t instanceof x)return t}function tr(t){if("string"!=typeof t)throw Error();return t}function rr(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function er(t){return null==t||"string"==typeof t?t:void 0}function nr(t,r,e){if(null!=t&&t[K]===tt)return t;if(Array.isArray(t)){var n=0|t[Y];return(e=n|32&e|2&e)!==n&&Q(t,e),new r(t)}}function ir(t){return t}function or(t){return W?t[W]:void 0}function ar(t,r){for(let e in t)!isNaN(e)&&r(t,+e,t[e])}var sr,ur,lr,cr=class{};function hr(t,r){r<100||k(H,1)}function fr(t,r,e,n){var i=void 0!==n;n=!!n;var o,a=W;!i&&M&&a&&(o=t[a])&&ar(o,hr),a=[];var s=t.length;o=4294967295;var u=!1,l=!!(64&r),c=l?128&r?0:-1:void 0;if(!(1&r)){var h=s&&t[s-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--s:h=void 0,!l||128&r||i||(u=!0,o=(sr??ir)(o-c,c,t,h,void 0)+c)}r=void 0;for(var f=0;f<s;f++){let i=t[f];if(null!=i&&null!=(i=e(i,n)))if(l&&f>=o){let t=f-c;(r??={})[t]=i}else a[f]=i}if(h)for(let t in h){if(null==(s=h[t])||null==(s=e(s,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?a[i]=s:(r??={})[t]=s}return r&&(u?a.push(r):a[o]=r),i&&W&&(t=or(t))&&t instanceof cr&&(a[W]=function(t){var r=new cr;return ar(t,(t,e,n)=>{r[e]=Ot(n)}),r.g=t.g,r}(t)),a}function dr(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return gt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var r=0|t[Y];return 0===t.length&&1&r?void 0:fr(t,r,dr)}if(null!=t&&t[K]===tt)return gr(t);if(t instanceof x){if(null==(r=t.g))t="";else if("string"==typeof r)t=r;else{if(S){for(var e="",n=0,i=r.length-10240;n<i;)e+=String.fromCharCode.apply(null,r.subarray(n,n+=10240));e+=String.fromCharCode.apply(null,n?r.subarray(n):r),r=btoa(e)}else{void 0===e&&(e=0),b(),e=m[e],n=Array(Math.floor(r.length/3)),i=e[64]||"";let t=0,l=0;for(;t<r.length-2;t+=3){var o=r[t],a=r[t+1],s=r[t+2],u=e[o>>2];o=e[(3&o)<<4|a>>4],a=e[(15&a)<<2|s>>6],s=e[63&s],n[l++]=u+o+a+s}switch(u=0,s=i,r.length-t){case 2:s=e[(15&(u=r[t+1]))<<2]||i;case 1:r=r[t],n[l]=e[r>>2]+e[(3&r)<<4|u>>4]+s+i}r=n.join("")}t=t.g=r}return t}return}return t}function gr(t){return fr(t=t.l,0|t[Y],dr)}function vr(t,r){return pr(t,r[0],r[1])}function pr(t,r,e,n=0){if(null==t){var i=32;e?(t=[e],i|=128):t=[],r&&(i=-16760833&i|(1023&r)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],f&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(f)throw Error("carr");k(z,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(e&&(i|=128,e!==t[0]))throw Error("mid");t:{i|=64;var o=(e=t).length;if(o){var a=o-1;let t=e[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=r=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var s in t)(o=+s)<a&&(e[o+r]=t[s],delete t[s]);i=-16760833&i|(1023&a)<<14;break t}}if(r){if((s=Math.max(r,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&s)<<14}}}return Q(t,64|i|n),t}function mr(t,r){if("object"!=typeof t)return t;if(Array.isArray(t)){var e=0|t[Y];return 0===t.length&&1&e?t=void 0:2&e||(!r||4096&e||16&e?t=wr(t,e,!1,r&&!(16&e)):(q(t,34),4&e&&Object.freeze(t))),t}return null!=t&&t[K]===tt?rt(t,e=0|(r=t.l)[Y])?t:Ir(t,r,e)?yr(t,r):wr(r,e):t instanceof x?t:void 0}function yr(t,r,e){return t=new t.constructor(r),e&&(t.g=et),t.m=et,t}function wr(t,r,e,n){return n??=!!(34&r),t=fr(t,r,mr,n),n=32,e&&(n|=2),Q(t,r=16769217&r|n),t}function br(t){var r=t.l,e=0|r[Y];return rt(t,e)?Ir(t,r,e)?yr(t,r,!0):new t.constructor(wr(r,e,!1)):t}function _r(t){if(t.g!==et)return!1;var r=t.l;return q(r=wr(r,0|r[Y]),2048),t.l=r,t.g=void 0,t.m=void 0,!0}function Sr(t){if(!_r(t)&&rt(t,0|t.l[Y]))throw Error()}function Ar(t,r){void 0===r&&(r=0|t[Y]),32&r&&!(4096&r)&&Q(t,4096|r)}function Ir(t,r,e){return!!(2&e)||!(!(32&e)||4096&e)&&(Q(r,2|e),t.g=et,!0)}var Er=dt(0);function Tr(t,r,e,n){if(null!==(t=Br(t.l,r,e,n)))return t}function Br(t,r,e,n){if(-1===r)return null;var i=r+(e?0:-1),o=t.length-1;if(!(o<1+(e?0:-1))){if(i>=o){var a=t[o];if(null!=a&&"object"==typeof a&&a.constructor===Object){e=a[r];var s=!0}else{if(i!==o)return;e=a}}else e=t[i];if(n&&null!=e){if(null==(n=n(e)))return n;if(!Object.is(n,e))return s?a[r]=n:t[i]=n,n}return e}}function Ur(t,r,e,n){Sr(t);var i=t.l;return Pr(i,0|i[Y],r,e,n),t}function Pr(t,r,e,n,i){var o=e+(i?0:-1),a=t.length-1;if(a>=1+(i?0:-1)&&o>=a){let i=t[a];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[e]=n,r}return o<=a?(t[o]=n,r):(void 0!==n&&(e>=(a=(r??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[a+(i?0:-1)]={[e]:n}):t[o]=n),r)}function Lr(t,r,e,n,i,o,a,s){var u=r;return 1===o||4===o&&(2&r||!(16&r)&&32&n)?jr(r)||((r|=!t.length||a&&!(4096&r)||32&n&&!(4096&r||16&r)?2:256)!==u&&Q(t,r),Object.freeze(t)):(2===o&&jr(r)&&(t=Ot(t),u=0,r=Jr(r,n),n=Pr(e,n,i,t)),jr(r)||(s||(r|=16),r!==u&&Q(t,r))),2&r||!(4096&r||16&r)||Ar(e,n),t}function xr(t,r,e){return t=Br(t,r,e),Array.isArray(t)?t:D}function Nr(t,r){return 2&r&&(t|=2),1|t}function jr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Or(t){return nt(t,!0)}function Vr(t,r,e){Sr(t);var n=0|(t=t.l)[Y];if(null==e)Pr(t,n,r);else{var i=e===D?7:0|e[Y],o=i,a=jr(i),s=a||Object.isFrozen(e);for(a||(i=0),s||(e=Ot(e),o=0,i=Jr(i,n),s=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,a=0;a<e.length;a++){let t=e[a],r=tr(t);Object.is(t,r)||(s&&(e=Ot(e),o=0,i=Jr(i,n),s=!1),e[a]=r)}i!==o&&(s&&(e=Ot(e),i=Jr(i,n)),Q(e,i)),Pr(t,n,r,e)}}function kr(t,r,e){if(2&r)throw Error();var n=st(r),i=xr(t,e,n),o=i===D?7:0|i[Y],a=Nr(o,r);return(2&a||jr(a)||16&a)&&(a===o||jr(a)||Q(i,a),i=Ot(i),o=0,a=Jr(a,r),Pr(t,r,e,i,n)),(a&=-13)!==o&&Q(i,a),i}function Fr(t){if(M)return t[R]??(t[R]=new Map);if(R in t)return t[R];var r=new Map;return Object.defineProperty(t,R,{value:r}),r}function Mr(t,r,e,n,i){var o=Fr(t),a=Cr(o,t,r,e,i);return a!==n&&(a&&(r=Pr(t,r,a,void 0,i)),o.set(e,n)),r}function Cr(t,r,e,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let a=n[t];null!=Br(r,a,i)&&(0!==o&&(e=Pr(r,e,o,void 0,i)),o=a)}return t.set(n,o),o}function Dr(t,r,e){var n=0|t[Y],i=st(n),o=Br(t,e,i);if(null!=o&&o[K]===tt){if(!rt(o))return _r(o),o.l;var a=o.l}else Array.isArray(o)&&(a=o);if(a){let t=0|a[Y];2&t&&(a=wr(a,t))}return(a=vr(a,r))!==o&&Pr(t,n,e,a,i),a}function Gr(t,r,e,n){var i=!1;if(null!=(n=Br(t,n,void 0,t=>{var n=nr(t,e,r);return i=n!==t&&null!=n,n})))return i&&!rt(n)&&Ar(t,r),n}function Rr(t,r,e){var n=t.l,i=0|n[Y];if(null==(r=Gr(n,i,r,e)))return r;if(!rt(t,i=0|n[Y])){let o=br(r);o!==r&&(_r(t)&&(i=0|(n=t.l)[Y]),Ar(n,i=Pr(n,i,e,r=o)))}return r}function Wr(t,r,e,n,i,o,a,s){var u=rt(t,e);o=u?1:o,a=!!a||3===o,u=s&&!u,(2===o||u)&&_r(t)&&(e=0|(r=t.l)[Y]);var l=(t=xr(r,i))===D?7:0|t[Y],c=Nr(l,e);if(s=!(4&c)){var h=t,f=e;let r=!!(2&c);r&&(f|=2);let i=!r,o=!0,a=0,s=0;for(;a<h.length;a++){let t=nr(h[a],n,f);if(t instanceof n){if(!r){let r=rt(t);i&&=!r,o&&=r}h[s++]=t}}s<a&&(h.length=s),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Q(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&e)))){for(jr(c)&&(t=Ot(t),c=Jr(c,e),e=Pr(r,e,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=br(h))&&(n[l]=c);u|=8,Q(t,c=u=n.length?4096|u:-4097&u)}return Lr(t,c,r,e,i,o,s,a)}function Hr(t,r){var e=t.l;return Wr(t,e,0|e[Y],r,1,void 0===it?2:4,!1,!0)}function $r(t){return null==t&&(t=void 0),t}function zr(t,r,e,n,i){return Ur(t,e,n=$r(n),i),n&&!rt(n)&&Ar(t.l),t}function Kr(t,r,e,n){t:{var i=n=$r(n);Sr(t);let o=t.l,a=0|o[Y];if(null==i){let t=Fr(o);if(Cr(t,o,a,e)!==r)break t;t.set(e,0)}else a=Mr(o,a,e,r);Pr(o,a,r,i)}return n&&!rt(n)&&Ar(t.l),t}function Jr(t,r){return-273&(t=2&r?2|t:-3&t)}function Xr(t,r,e,n){Sr(t);var i=t.l;t=Wr(t,i,0|i[Y],e,r,2,!0),n=null!=n?n:new e,t.push(n),r=e=t===D?7:0|t[Y],(n=rt(n))?(e&=-9,1===t.length&&(e&=-4097)):e|=4096,e!==r&&Q(t,e),n||Ar(i)}function Yr(t,r,e){if(null!=e)t:{if(!Rt(e))throw V("int64");switch(typeof e){case"string":e=Xt(e);break t;case"bigint":e=dt(Vt(64,e));break t;default:e=Yt(e)}}return Ur(t,r,e)}function Zr(t,r,e){return Ur(t,r,null==e?e:function(t){if(!Rt(t))throw V("uint64");switch(typeof t){case"string":var r=Ct(Number(t));return Ft(r)&&r>=0?t=dt(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=F()?dt(kt(64,BigInt(t))):dt($t(t))),t;case"bigint":return dt(kt(64,t));default:return Ft(t)?t=dt(Kt(t)):((t=Ct(t))>=0&&Ft(t)?t=String(t):(Et(t),t=Pt(St,At)),t=dt(t)),t}}(e))}function qr(t,r,e){if(null!=e){if(!Mt(e))throw V("enum");e|=0}return Ur(t,r,e)}function Qr(t,r,e){Sr(t);var n=t.l,i=0|n[Y],o=rt(t,i)?1:2;2===o&&_r(t)&&(i=0|(n=t.l)[Y]);var a=(t=xr(n,r))===D?7:0|t[Y],s=Nr(a,i),u=!(4&s);if(u){4&s&&(t=Ot(t),a=0,s=Jr(s,i),i=Pr(n,i,r,t));let e=0,o=0;for(;e<t.length;e++){let r=er(t[e]);null!=r&&(t[o++]=r)}o<e&&(t.length=o),s=-513&s|4,s&=-1025,s&=-4097}s!==a&&(Q(t,s),2&s&&Object.freeze(t)),(t=Lr(t,s,n,i,r,o,u,!0)).push(tr(e))}var te=class{constructor(t,r,e){if(this.buffer=t,e&&!r)throw Error();this.g=r}};function re(t,r){if("string"==typeof t)return new te(T(t),r);if(Array.isArray(t))return new te(new Uint8Array(t),r);if(t.constructor===Uint8Array)return new te(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new te(t,!1);if(t.constructor===x)return r=P(t)||new Uint8Array(0),new te(r,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new te(t,!1);throw Error()}function ee(t,r){var e=0,n=0,i=0,o=t.i,a=t.g;do{var s=o[a++];e|=(127&s)<<i,i+=7}while(i<32&&128&s);if(i>32)for(n|=(127&s)>>4,i=3;i<32&&128&s;i+=7)n|=(127&(s=o[a++]))<<i;if(ue(t,a),!(128&s))return r(e>>>0,n>>>0);throw Error()}function ne(t){for(var r=0,e=t.g,n=e+10,i=t.i;e<n;){let n=i[e++];if(r|=n,!(128&n))return ue(t,e),!!(127&r)}throw Error()}function ie(t){var r=t.i,e=t.g,n=r[e++],i=127&n;if(128&n&&(i|=(127&(n=r[e++]))<<7,128&n&&(i|=(127&(n=r[e++]))<<14,128&n&&(i|=(127&(n=r[e++]))<<21,128&n&&(i|=(n=r[e++])<<28,128&n&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++])))))throw Error();return ue(t,e),i}function oe(t){return ee(t,Ut)}function ae(t){var r=t.i,e=t.g,n=r[e],i=r[e+1],o=r[e+2];return r=r[e+3],ue(t,t.g+4),(n|i<<8|o<<16|r<<24)>>>0}function se(t){return ie(t)}function ue(t,r){if(t.g=r,r>t.j)throw Error()}function le(t,r){if(r<0)throw Error();var e=t.g;if((r=e+r)>t.j)throw Error();return t.g=r,e}function ce(t,r){if(0==r)return U();var e=le(t,r);return t.K&&t.o?e=t.i.subarray(e,e+r):(t=t.i,e=e===(r=e+r)?new Uint8Array(0):_t?t.slice(e,r):new Uint8Array(t.subarray(e,r))),0==e.length?U():new x(e,B)}var he=class{constructor(t,r,e,n){this.i=null,this.o=!1,this.g=this.j=this.m=0,this.init(t,r,e,n)}init(t,r,e,{K:n=!1,N:i=!1}={}){this.K=n,this.N=i,t&&(t=re(t,this.N),this.i=t.buffer,this.o=t.g,this.m=r||0,this.j=void 0!==e?this.m+e:this.i.length,this.g=this.m)}clear(){this.i=null,this.o=!1,this.g=this.j=this.m=0,this.K=!1}},fe=[],de=0;function ge(t,r,e,n){if(Ie.length){let i=Ie.pop();return i.F(n),i.g.init(t,r,e,n),i}return new Ae(t,r,e,n)}function ve(t){t.g.clear(),t.j=-1,t.i=-1,Ie.length<100&&Ie.push(t)}function pe(t){var r=t.g;if(r.g==r.j)return!1;t.m=t.g.g;var e=ie(t.g)>>>0;if(r=e>>>3,!((e&=7)>=0&&e<=5))throw Error();if(r<1)throw Error();return t.j=r,t.i=e,!0}function me(t){try{switch(t.i){case 0:0!=t.i?me(t):ne(t.g);break;case 1:var r=t.g;ue(r,r.g+8);break;case 2:if(2!=t.i)me(t);else{var e=ie(t.g)>>>0,n=t.g;ue(n,n.g+e)}break;case 5:var i=t.g;ue(i,i.g+4);break;case 3:ye();let o=t.j;try{for(;;){if(!pe(t))throw Error();if(4==t.i){if(t.j!=o)throw Error();break}me(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function ye(){if(de>=100)throw new SyntaxError;de++}function we(t,r,e){var n=t.g.j,i=ie(t.g)>>>0,o=(i=t.g.g+i)-n;if(o<=0&&(t.g.j=i,e(r,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=n}function be(t){var r=ie(t.g)>>>0,e=le(t=t.g,r);if(t=t.i,u){var a,l=t;(a=o)||(a=o=new TextDecoder("utf-8",{fatal:!0})),r=e+r,l=0===e&&r===l.length?l:l.subarray(e,r);try{var c=a.decode(l)}catch(t){if(void 0===s){try{a.decode(new Uint8Array([128]))}catch(t){}try{a.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(o=void 0),t}}else{r=(c=e)+r,e=[];let o,s=null;for(;c<r;){var h=t[c++];h<128?e.push(h):h<224?c>=r?n():(o=t[c++],h<194||128!=(192&o)?(c--,n()):e.push((31&h)<<6|63&o)):h<240?c>=r-1?n():(o=t[c++],128!=(192&o)||224===h&&o<160||237===h&&o>=160||128!=(192&(a=t[c++]))?(c--,n()):e.push((15&h)<<12|(63&o)<<6|63&a)):h<=244?c>=r-2?n():(o=t[c++],128!=(192&o)||o-144+(h<<28)>>30||128!=(192&(a=t[c++]))||128!=(192&(l=t[c++]))?(c--,n()):(h=(7&h)<<18|(63&o)<<12|(63&a)<<6|63&l,h-=65536,e.push(55296+(h>>10&1023),56320+(1023&h)))):n(),e.length>=8192&&(s=i(s,e),e.length=0)}c=i(s,e)}return c}function _e(t){var r=ie(t.g)>>>0;return ce(t.g,r)}function Se(t,r,e){var n=ie(t.g)>>>0;for(n=t.g.g+n;t.g.g<n;)e.push(r(t.g))}var Ae=class{constructor(t,r,e,n){if(fe.length){let i=fe.pop();i.init(t,r,e,n),t=i}else t=new he(t,r,e,n);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.F(n)}F({P:t=!1}={}){this.P=t}},Ie=[];function Ee(t){return new Ue(4294967295&t,Math.floor(t/4294967296))}function Te(t){return t?/^\d+$/.test(t)?(Nt(t),new Ue(St,At)):null:Be||=new Ue(0,0)}var Be,Ue=class{constructor(t,r){this.i=t>>>0,this.g=r>>>0}};function Pe(t){return new Ce(4294967295&t,Math.floor(t/4294967296))}function Le(t){return t?/^-?\d+$/.test(t)?(Nt(t),new Ce(St,At)):null:xe||=new Ce(0,0)}var xe,Ne,je,Oe,Ve,ke,Fe,Me,Ce=class{constructor(t,r){this.i=t>>>0,this.g=r>>>0}};function De(t,r,e){return"undefined"!=typeof BigInt64Array?(Fe||(Fe=new BigInt64Array(1),Me=new Uint32Array(Fe.buffer),Fe[0]=BigInt(1),ke=1===Me[0]),Fe[0]=t,new r(Me[t=ke?0:1],Me[1-t])):(Ve||(Ne=BigInt(Number.MIN_SAFE_INTEGER),je=BigInt(Number.MAX_SAFE_INTEGER),Oe=BigInt(4294967295),Ve=BigInt(32)),t>=Ne&&t<=je?e(Number(t)):(t=BigInt.asUintN(64,t),new r(Number(t&Oe),Number(t>>Ve))))}function Ge(t,r,e){for(;e>0||r>127;)t.g.push(127&r|128),r=(r>>>7|e<<25)>>>0,e>>>=7;t.g.push(r)}function Re(t,r){for(;r>127;)t.g.push(127&r|128),r>>>=7;t.g.push(r)}function We(t,r){if(r>=0)Re(t,r);else{for(let e=0;e<9;e++)t.g.push(127&r|128),r>>=7;t.g.push(1)}}function He(t,r){Nt(r),function(t){var r=At>>31;t(St<<1^r,(At<<1|St>>>31)^r)}((r,e)=>{Ge(t,r>>>0,e>>>0)})}function $e(t,r){t.g.push(r>>>0&255),t.g.push(r>>>8&255),t.g.push(r>>>16&255),t.g.push(r>>>24&255)}var ze=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Ke(t,r){0!==r.length&&(t.j.push(r),t.i+=r.length)}function Je(t,r,e){Re(t.g,8*r+e)}function Xe(t,r){return Je(t,r,2),r=t.g.end(),Ke(t,r),r.push(t.i),r}function Ye(t,r){var e=r.pop();for(e=t.i+t.g.length()-e;e>127;)r.push(127&e|128),e>>>=7,t.i++;r.push(e),t.i++}function Ze(t,r,e){if(null!=e)switch(Je(t,r,0),typeof e){case"number":t=t.g,Et(e),Ge(t,St,At);break;case"bigint":e=De(e,Ce,Pe),Ge(t.g,e.i,e.g);break;default:e=Le(e),Ge(t.g,e.i,e.g)}}function qe(t,r,e){Je(t,r,2),Re(t.g,e.length),Ke(t,t.g.end()),Ke(t,e)}var Qe=class{constructor(){this.j=[],this.i=0,this.g=new ze}};function tn(t){if("string"==typeof t)Le(t)}function rn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var en=rn(),nn=rn(),on=rn(),an=rn(),sn=rn(),un=rn(),ln=rn(),cn=rn(),hn=rn(),fn=rn(),dn=rn(),gn=rn();var vn=class{constructor(t,r){this.l=pr(t,r,void 0,2048)}toJSON(){return gr(this)}};vn.prototype[K]=tt,vn.prototype.toString=function(){return this.l.toString()};var pn=class{constructor(t,r,e){this.g=t,this.i=r,t=en,this.j=!!t&&e===t||!1}};function mn(t,r){return new pn(t,r,en)}function yn(t,r,e,n,i){null!=(r=Ln(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}var wn,bn,_n=mn(function(t,r,e,n,i){return 2===t.i&&(we(t,Dr(r,n,e),i),!0)},yn),Sn=mn(function(t,r,e,n,i){return 2===t.i&&(we(t,Dr(r,n,e),i),!0)},yn),An=Symbol(),In=Symbol(),En=Symbol(),Tn=Symbol(),Bn=Symbol();function Un(t,r,e,n){var i=n[t];if(i)return i;(i={}).V=n,i.I=function(t){switch(typeof t){case"boolean":return ur||=[0,void 0,!0];case"number":return t>0?void 0:0===t?lr||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],a=1;o&&o.constructor===Object&&(i.L=o,"function"==typeof(o=n[++a])&&(i.R=!0,wn??=o,bn??=n[a+1],o=n[a+=2]));for(var s={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)s[o[u]]=o;o=n[++a]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++a]);var l=void 0;if(o instanceof pn?t=o:(t=_n,a--),t?.j){o=n[++a],l=n;var c=a;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++a])&&o<0&&(c-=o,o=n[++a]);u<c;u++){let n=s[u];l?e(i,u,t,l,n):r(i,u,t,n)}}return n[t]=i}function Pn(t){return Array.isArray(t)?t[0]instanceof pn?t:[Sn,t]:[t,void 0]}function Ln(t,r){return t instanceof vn?t.l:Array.isArray(t)?vr(t,r):void 0}function xn(t,r,e,n){var i=e.g;t[r]=n?(t,r,e)=>i(t,r,e,n):i}function Nn(t,r,e,n,i){var o,a,s=e.g;t[r]=(t,r,e)=>s(t,r,e,a||=Un(In,xn,Nn,n).I,o||=jn(n),i)}function jn(t){var r=t[En];if(null!=r)return r;var e=Un(In,xn,Nn,t);return r=e.R?(t,r)=>wn(t,r,e):(t,r)=>{t:{ye();try{for(;pe(r)&&4!=r.i;){let u=r.j,l=e[u];if(null==l){let t=e.L;if(t){let r=t[u];if(r){let t=Vn(r);null!=t&&(l=e[u]=t)}}}if(null==l||!l(r,t,u)){var n=r;let e=n.m;if(me(n),n.P)var i=void 0;else{let t=n.g.g-e;n.g.g=e,i=ce(n.g,t)}n=void 0;var o=t,a=u,s=i;s&&((n=o[W]??(o[W]=new cr))[a]??(n[a]=[])).push(s)}}let l=or(t);l&&(l.g=e.V[Bn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}u=void 0}return u},t[En]=r,t[Bn]=On.bind(t),r}function On(t,r,e,n){var i=this[In],o=this[En],a=vr(void 0,i.I),s=or(t);if(s){var u=!1,l=i.L;if(l){if(i=(r,e,i)=>{if(0!==i.length)if(l[e])for(let t of i){r=ge(t);try{u=!0,o(a,r)}finally{ve(r)}}else n?.(t,e,i)},null==r)ar(s,i);else if(null!=s){let t=s[r];t&&i(s,r,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!e?.Ma)throw Error();let i=st(n),o=(r,o)=>{if(null!=Br(t,r,i)){if(1===e?.La)return;throw Error()}null!=o&&(n=Pr(t,n,r,o,i)),delete s[r]};null==r?ot(a,0|a[Y],(t,r)=>{o(t,r)}):o(r,Br(a,r,i))}}}}function Vn(t){var r=(t=Pn(t))[0].g;if(t=t[1]){let e=jn(t),n=Un(In,xn,Nn,t).I;return(t,i,o)=>r(t,i,o,n,e)}return r}function kn(t,r,e){t[r]=e.i}function Fn(t,r,e,n){var i,o,a=e.i;t[r]=(t,r,e)=>a(t,r,e,o||=Un(An,kn,Fn,n).I,i||=Mn(n))}function Mn(t){var r=t[Tn];if(!r){let e=Un(An,kn,Fn,t);r=(t,r)=>Cn(t,r,e),t[Tn]=r}return r}function Cn(t,r,e){ot(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,r){var e=t[r];if(e)return e;if((e=t.L)&&(e=e[r])){var n=(e=Pn(e))[0].i;if(e=e[1]){let r=Mn(e),i=Un(An,kn,Fn,e).I;e=t.R?bn(i,r):(t,e,o)=>n(t,e,o,i,r)}else e=n;return t[r]=e}}(e,t);i?i(r,n,t):t<500||k($,3)}}),(t=or(t))&&ar(t,(t,e,n)=>{for(Ke(r,r.g.end()),t=0;t<n.length;t++)Ke(r,P(n[t])||new Uint8Array(0))})}var Dn=dt(0);function Gn(t,r,e){if(Array.isArray(r)){var n=0|r[Y];if(4&n)return r;for(var i=0,o=0;i<r.length;i++){let e=t(r[i]);null!=e&&(r[o++]=e)}return o<i&&(r.length=o),t=1|n,e&&(t=-1537&t|4),t!==n&&Q(r,t),e&&2&t&&Object.freeze(r),r}}var Rn=(t,r)=>{var e=new Qe;Cn(t.l,e,Un(An,kn,Fn,r)),Ke(e,e.g.end()),t=new Uint8Array(e.i);var n=(r=e.j).length,i=0;for(let e=0;e<n;e++){let n=r[e];t.set(n,i),i+=n.length}return e.j=[t],t};function Wn(t,r,e){return new pn(t,r,e)}function Hn(t,r,e){return new pn(t,r,e)}function $n(t,r,e){Pr(t,0|t[Y],r,e,st(0|t[Y]))}function zn(t,r,e){null!=(r=qt(r))&&(tn(r),Ze(t,e,r))}function Kn(t,r,e){null!=(r=Wt(r))&&null!=r&&(Je(t,e,0),We(t.g,r))}function Jn(t,r,e){null!=(r=null==r||"boolean"==typeof r?r:"number"==typeof r?!!r:void 0)&&(Je(t,e,0),t.g.g.push(r?1:0))}function Xn(t,r,e){null!=(r=er(r))&&qe(t,e,c(r))}function Yn(t,r,e,n,i){null!=(r=Ln(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}function Zn(t,r,e){null!=(r=Qt(r))&&qe(t,e,re(r,!0).buffer)}function qn(t,r,e){r=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?t>>>0:void 0}(r),null!=r&&null!=r&&(Je(t,e,0),Re(t.g,r))}function Qn(t,r,e){null!=(r=Wt(r))&&(r=parseInt(r,10),Je(t,e,0),We(t.g,r))}function ti(t,r,e){return 0===t.i&&($n(r,e,oe(t.g)),!0)}function ri(t,r,e){return(0===t.i||2===t.i)&&(r=kr(r,0|r[Y],e),2==t.i?Se(t,ie,r):r.push(ie(t.g)),!0)}function ei(t,r,e){return 2===t.i&&($n(r,e,(t=_e(t))===U()?void 0:t),!0)}var ni=Wn(function(t,r,e){if(1!==t.i)return!1;var n=t.g;t=ae(n);var i=ae(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,$n(r,e,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,r,e){null!=(r=Dt(r))&&(Je(t,e,1),t=t.g,(e=bt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+r,!0),St=e.getUint32(0,!0),At=e.getUint32(4,!0),$e(t,St),$e(t,At))},fn),ii=Wn(function(t,r,e){if(5!==t.i)return!1;var n=ae(t.g);t=2*(n>>31)+1;var i=n>>>23&255;return n&=8388607,$n(r,e,255==i?n?NaN:t*(1/0):0==i?1401298464324817e-60*t*n:t*Math.pow(2,i-150)*(n+8388608)),!0},function(t,r,e){null!=(r=Dt(r))&&(Je(t,e,5),t=t.g,(e=bt||=new DataView(new ArrayBuffer(8))).setFloat32(0,+r,!0),At=0,$e(t,St=e.getUint32(0,!0)))},hn),oi=Wn(function(t,r,e){return ti(t,r,e)},zn,un),ai=Wn(function(t,r,e){return ti(t,r,e)},zn,un),si=Hn(function(t,r,e){return 0!==t.i&&2!==t.i?t=!1:(r=kr(r,0|r[Y],e),2==t.i?Se(t,oe,r):r.push(oe(t.g)),t=!0),t},function(t,r,e){if(null!=(r=Gn(qt,r,!1)))for(let n=0;n<r.length;n++)Ze(t,e,r[n])},un),ui=Wn(function(t,r,e){return 0!==t.i?r=!1:($n(r,e,(t=oe(t.g))===Dn?void 0:t),r=!0),r},zn,un),li=Wn(function(t,r,e){return 0!==t.i?t=!1:($n(r,e,ee(t.g,Bt)),t=!0),t},function(t,r,e){if(r=function(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(kt(64,t));if(Rt(t)){if("string"===r)return r=Ct(Number(t)),Ft(r)&&r>=0?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=$t(t)),t;if("number"===r)return Kt(t)}}(r),null!=r){if("string"==typeof r)Te(r);if(null!=r)switch(Je(t,e,0),typeof r){case"number":t=t.g,Et(r),Ge(t,St,At);break;case"bigint":e=De(r,Ue,Ee),Ge(t.g,e.i,e.g);break;default:e=Te(r),Ge(t.g,e.i,e.g)}}},ln),ci=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)),!0)},Kn,an),hi=Hn(ri,function(t,r,e){if(null!=(r=Gn(Wt,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&(Je(n,i,0),We(n.g,o))}},an),fi=Hn(ri,function(t,r,e){if(null!=(r=Gn(Wt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.g,r[e]);Ye(t,e)}},an),di=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g))?void 0:t),!0)},Kn,an),gi=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ne(t.g)),!0)},Jn,nn),vi=Wn(function(t,r,e){return 0===t.i&&($n(r,e,!1===(t=ne(t.g))?void 0:t),!0)},Jn,nn),pi=Hn(function(t,r,e){return 2===t.i&&(t=be(t),kr(r,0|r[Y],e).push(t),!0)},function(t,r,e){if(null!=(r=Gn(er,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,c(o))}},on),mi=Wn(function(t,r,e){return 2===t.i&&($n(r,e,""===(t=be(t))?void 0:t),!0)},Xn,on),yi=Wn(function(t,r,e){return 2===t.i&&($n(r,e,be(t)),!0)},Xn,on),wi=function(t,r,e=en){return new pn(t,r,e)}(function(t,r,e,n,i){return 2===t.i&&(n=vr(void 0,n),kr(r,0|r[Y],e).push(n),we(t,n,i),!0)},function(t,r,e,n,i){if(Array.isArray(r)){for(let o=0;o<r.length;o++)Yn(t,r[o],e,n,i);1&(t=0|r[Y])||Q(r,1|t)}}),bi=mn(function(t,r,e,n,i,o){if(2!==t.i)return!1;var a=0|r[Y];return Mr(r,a,o,e,st(a)),we(t,r=Dr(r,n,e),i),!0},Yn),_i=Wn(function(t,r,e){return 2===t.i&&($n(r,e,_e(t)),!0)},Zn,dn),Si=Hn(function(t,r,e){return 2===t.i&&(t=_e(t),kr(r,0|r[Y],e).push(t),!0)},function(t,r,e){if(null!=(r=Gn(Qt,r,!1)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,re(o,!0).buffer)}},dn),Ai=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)>>>0),!0)},qn,sn),Ii=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g)>>>0)?void 0:t),!0)},qn,sn),Ei=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)),!0)},Qn,gn),Ti=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g))?void 0:t),!0)},Qn,gn),Bi=Wn(function(t,r,e){return 0!==t.i?t=!1:($n(r,e,function(t){return ee(t,(t,r)=>{var e=-(1&t);return Ut(t=(t>>>1|r<<31)^e,r>>>1^e)})}(t.g)),t=!0),t},function(t,r,e){if(null!=(r=qt(r))&&(tn(r),null!=r))switch(Je(t,e,0),typeof r){case"number":t=t.g,r=(e=r)<0,It(e=2*Math.abs(e)),e=St;let n=At;r&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),Ge(t,St=e,At=n);break;case"bigint":t=t.g,r=r<<BigInt(1)^r>>BigInt(63),St=Number(BigInt.asUintN(32,r)),At=Number(BigInt.asUintN(32,r>>BigInt(32))),Ge(t,St,At);break;default:He(t.g,r)}},cn);function Ui(t){return function(){return Rn(this,t)}}var Pi,Li=[0,_i,Si,gi,yi],xi=[0,mi,[0,Ti,[0,ui,di],Ti,-1,[0,Ei],Ti,-1],Wn(ei,Zn,dn)],Ni=[0,mi,Wn(ei,function(t,r,e){if(null!=r){if(r instanceof vn){let n=r.Oa;return void(n?(r=n(r),null!=r&&qe(t,e,re(r,!0).buffer)):k($,3))}if(Array.isArray(r))return void k($,3)}Zn(t,r,e)},dn)],ji=[0,1,[0,12,ci,10,gi],[0,7,[0,ci,-1]]],Oi=globalThis.trustedTypes;var Vi=class{constructor(t){this.g=t}toString(){return this.g+""}};function ki(t){var r;return void 0===Pi&&(Pi=function(){var t=null;if(!Oi)return t;try{let r=t=>t;t=Oi.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(t){}return t}()),t=(r=Pi)?r.createScriptURL(t):t,new Vi(t)}function Fi(t,...r){if(0===r.length)return ki(t[0]);var e=t[0];for(let n=0;n<r.length;n++)e+=encodeURIComponent(r[n])+t[n+1];return ki(e)}var Mi=[0,ci,Ei,gi,-1,fi,Ei,-1,gi,-1],Ci=[0,Ei,-1,gi],Di=class extends vn{constructor(t){super(t)}},Gi=[0,gi,yi,gi,Ei,-1,Hn(function(t,r,e){return(0===t.i||2===t.i)&&(r=kr(r,0|r[Y],e),2==t.i?Se(t,se,r):r.push(ie(t.g)),!0)},function(t,r,e){if(null!=(r=Gn(Wt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.g,r[e]);Ye(t,e)}},gn),yi,-1,[0,gi,-1],Ei,gi,-1,Ci],Ri=[0,3,gi,-1,2,[0,[2],ci,bi,[0,Ai]],[0,Ei,gi,Ei,gi,Ei,gi,yi,-1],[0,[3,4],yi,-1,bi,[0,ci],bi,[0,Ei,-1]],[0]],Wi=[0,yi,-2],Hi=class extends vn{constructor(t){super(t)}},$i=[0],zi=[0,ci,gi,1,gi,-4],Ki=class extends vn{constructor(t){super(t,2)}},Ji={};Ji[336783863]=[0,yi,gi,-1,ci,[0,[1,2,3,4,5,6,7,8,9],bi,$i,bi,Gi,bi,Wi,bi,zi,bi,Mi,bi,[0,yi,-2],bi,[0,yi,Ei],bi,Ri,bi,Ci],[0,yi],gi,[0,[1,3],[2,4],bi,[0,fi],-1,bi,[0,pi],-1,wi,[0,yi,-1]],yi];var Xi=[0,ui,-1,vi,-3,ui,fi,mi,di,ui,-1,vi,di,vi,-2,mi],Yi=class extends vn{constructor(t){super(t,500)}F(t){return zr(this,0,7,t)}},Zi=[-1,{}],qi=[0,yi,1,Zi],Qi=[0,yi,pi,Zi],to=class extends vn{constructor(t){super(t,500)}F(t){return zr(this,0,1001,t)}};to.prototype.i=Ui([-500,wi,[-500,mi,-1,pi,-3,[-2,Ji,gi],wi,Ni,di,-1,qi,Qi,wi,[0,mi,vi],mi,Xi,di,pi,987,pi],4,wi,[-500,yi,-1,[-1,{}],998,yi],wi,[-500,yi,pi,-1,[-2,{},gi],997,pi,-1],di,wi,[-500,yi,pi,Zi,998,pi],pi,di,qi,Qi,wi,[0,mi,-1,Zi],pi,-2,Xi,mi,-1,vi,[0,vi,Ii],978,Zi,wi,Ni]);var ro,eo=class extends vn{constructor(t){super(t)}},no=class extends vn{constructor(t){super(t)}i(){return Hr(this,eo)}},io=[0,wi,[0,ci,ii,yi,-1]],oo=class extends vn{constructor(t){super(t)}},ao=class extends vn{constructor(t){super(t)}i(){var t=this.l,r=0|t[Y],e=so,n=this.l;return e=2===Cr(Fr(n),n,void 0,e)?2:-1,void 0!==Gr(t,r,Di,e)}},so=[1,2,3,4,5,6],uo=class extends vn{constructor(t){super(t)}i(){return null!=Tr(this,1,void 0,Or)}j(){return null!=er(Tr(this,2))}},lo=class extends vn{constructor(t){super(t)}},co=class extends vn{constructor(t){super(t)}};ro=new class{constructor(){var t=Ki;this.g=co,this.j=zr,this.defaultValue=void 0,this.i=null!=t.Ja?at:void 0}register(){p(this)}},Ji[451755788]=[0,[0,[0,_i,yi,[0,ci,ai,-1],[0,li,ai]],gi,[0,so,bi,zi,bi,Gi,bi,Mi,bi,$i,bi,Wi,bi,Ri],Ei],[0,yi,ci,ii,pi,-1],ni];var ho,fo,go=class extends vn{constructor(t){super(t)}},vo=(ho=class extends vn{constructor(t){super(t)}},fo=[0,wi,[0,1,ci,yi,io],ai],(t,r)=>{t:{let n={N:!0};r&&Object.assign(n,r),t=ge(t,void 0,void 0,n);try{let r=new ho,n=r.l;jn(fo)(n,t);var e=r;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{ve(t)}e=void 0}return e});function po(t){return qr(new mo,1,t)}var mo=class extends vn{constructor(t){super(t)}},yo=class extends vn{constructor(t){super(t)}},wo=[0,Ei,2,li,-2,ai,wi,[0,Ei,ai]],bo=class extends vn{constructor(t){super(t)}},_o=class extends vn{constructor(t){super(t)}};function So(t,r){return qr(t,1,r)}function Ao(t,r){return qr(t,2,r)}var Io=class extends vn{constructor(t){super(t)}},Eo=[3,4,5,6,7],To=class extends vn{constructor(t){super(t)}},Bo=class extends vn{constructor(t){super(t)}};Bo.prototype.i=Ui([0,[0,Ei,yi,-3,Ei],[0,Eo,Ei,-1,bi,[0,Ei,yi,li],bi,wo,bi,[0,1,wo],bi,[0,Ei],bi,[0,Ei,yi,li]]]);var Uo={ia:0,fa:1,ga:2,ha:3,ja:4,ka:5,Da:6,Ea:7,oa:8,pa:9,qa:10,sa:11,ta:12,va:13,Aa:14,la:15,ma:16,na:17,wa:18,xa:25,ua:19,ra:20,za:21,ya:22,Ba:23,Ca:24,Ga:26,Fa:27},Po=class{constructor(){this.g="undefined"!=typeof AbortController}async send(t,r,e){var n=this.g?new AbortController:void 0,i=n&&t.M>0?setTimeout(()=>{n.abort()},t.M):void 0;try{let i=await fetch(t.url,{method:t.da,headers:{...t.ca},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.M&&n?n.signal:null});200===i.status?r?.(await i.text()):e?.(i.status)}catch(t){if("AbortError"===t?.name)e?.(408);else e?.(400)}finally{clearTimeout(i)}}},Lo=class extends vn{constructor(t){super(t,37)}},xo=[-4,{},ji,Ei,xi],No=[0,yi,Ei,1,yi,-1,Ei,1,Ei,1,ai],jo=[0,Ei,yi,-2],Oo=[0,yi,Ei],Vo=[0,yi,Ei],ko=[0,gi,-3],Fo=[0,Ei,yi,-1,ai,ci,-1,yi,-5,wi,[0,yi,-4],-1,gi,[0,gi,-3],Ei];var Mo=class extends vn{constructor(t){super(t,19)}},Co=function(t){return r=>Rn(r,t)}([-19,{},[0,Ei,1,[0,yi,-6,ai,ci,yi,-1,ai],1,[0,yi,1,yi,-5],yi,-1,[0,Ei,yi,-8],[0,yi,-3],[0,yi,Ei,yi,-2],[0,yi,-1,Ei,yi,-1,Ei,yi,-1,[0,wi,[0,yi,-1],gi,yi,-5],[0,Ei,gi,ci,-2]],ai,[0,yi,-3,ai,ci,yi,-1],[0,Ei,yi,-1],[0,yi,-9],[0,yi,-6,Ei,yi,1,yi,gi,Ei,-1,gi,yi,-2,Ei,yi,Ei,yi,ci,-1],1,[0,Ei],1,[0,yi,-4],1,No,[0,[1,2,3,4,5,6],bi,No,bi,Oo,bi,Vo,bi,[0,Ei],bi,Fo,bi,jo],Oo,Vo,Fo,[0,[0,Ei,yi,-1,ai,ci,-1,yi,-4,wi,[0,yi,-4],-1,1,ko],[0,Ei,yi,-1,ai,ci,-1,yi,-4,ko]],jo,[0,yi,[0,ci,-3,Ei],Ei,-2,[0,ci,-1],gi],4,[0,yi,Ei,yi,-1,ai,Ei,yi,-1,Ei,ci,-1]],Ei,wi,[-37,{},oi,yi,wi,[0,yi,-1],_i,1,_i,[0,pi,-1,hi,si,-1],yi,[0,ci,yi,-1],gi,ci,ai,yi,-1,Bi,Li,oi,_i,Ei,hi,ai,-1,[0,Ei,-1],yi,gi,yi,fi,yi,-1,ni,1,ni,xo,gi,[0,Ei,[0,ii,ci,-2],[0,ii]],[0,Ei,ai]],oi,Si,yi,-1,oi,Ei,-1,[0,gi,-1,Ei,gi],[0,ai,-1,yi],[0,oi,gi,ai],ai,1,Ai,1,xo]),Do=class{constructor(t){this.i=[],this.m=new Po,this.j=t??"",this.g=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.g&&(clearInterval(this.g),this.g=void 0),this.flush()}flush(t,r){if(this.error)r?.("net-send-failed");else if(0===this.i.length)t?.();else{var e=this.i;this.i=[],e=function(t){var r=new Mo;{Sr(r=qr(r,2,1786));let l=r.l,c=0|l[Y];if(null==t)Pr(l,c,3);else{var e=t===D?7:0|t[Y],n=e,i=jr(e),o=i||Object.isFrozen(t),a=!0,s=!0;for(let r=0;r<t.length;r++){var u=t[r];i||(u=rt(u),a&&=!u,s&&=u)}i||(e=a?13:5,e=s?-4097&e:4096|e),o&&e===n||(t=Ot(t),n=0,e=Jr(e,c)),e!==n&&Q(t,e),c=Pr(l,c,3,t),2&e||!(4096&e||16&e)||Ar(l,c)}}return r}(e),e=Co(e),this.m.send({url:"https://odml.pa.googleapis.com/v1/log",da:"POST",M:1e4,body:e,Ha:2,ca:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.j},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.i=[],void 0!==this.g&&(clearInterval(this.g),this.g=void 0),r?.("net-send-failed",t)})}}};class Go{constructor(){this.H=this.D=this.B=this.C=this.v=this.A=this.u=0}}function Ro(t,r){var e=new Bo;e=zr(e,0,1,t.U),e=zr(e,0,2,r),r=Ur(r=new Lo,6,nt(e=e.i(),!1)),(t=t.J).error||t.i.push(r)}function Wo(t,r){var e=new yo;return t=Zr(t=Yr(t=qr(e,1,t.S),7,r.C),5,r.D),t=Zr(t,6,r.H),r.v>0&&Zr(t,4,r.B/r.v),0!==r.u&&(e=Yr(e=po(3),2,r.u),Xr(t,8,mo,e)),0!==r.A&&(r=Yr(e=po(4),2,r.A),Xr(t,8,mo,r)),t}var Ho=class{constructor(t,r,e){this.T=performance.now(),this.m=performance.now(),this.i=new Map,this.o=0,this.g=new Go,this.j=new Go,this.J=new Do(e),this.G=Uo["TASKS_"+t.toUpperCase().replace(/_/g,"")]??0,this.S=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(r),t=new To,"undefined"==typeof window?r=0:(r=navigator.userAgent,r=/Android/i.test(r)?1:/iPhone|iPad|iPod/i.test(r)?2:/Windows/i.test(r)?5:/Macintosh/i.test(r)?4:/Linux/i.test(r)?3:0),t=Ur(t=qr(t,1,r),2,rr("")),t=Ur(t,3,rr("")),t=Ur(t,4,rr("1.0.0")),t=Ur(t,5,rr("")),this.U=qr(t,6,4)}aa(){var t=new _o;t=Zr(t=qr(t,1,this.S),3,performance.now()-this.T),Ro(this,t=Kr(Ao(So(new Io,this.G),0),3,Eo,t)),this.m=performance.now()}Z(){var t={u:this.g.u,A:this.g.A,v:this.g.v,C:this.g.C+this.i.size,B:this.g.B,D:this.o,H:performance.now()-this.T},r=new bo;r=zr(r,0,2,t=Wo(this,t)),Ro(this,r=Kr(t=Ao(So(new Io,this.G),2),5,Eo,r))}close(){var t=this.J;"function"==typeof t.close?t.close():t.flush()}};function $o(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function zo(t){if("function"!=typeof importScripts){let r=document.createElement("script");return r.src=t.toString(),r.crossOrigin="anonymous",new Promise((t,e)=>{r.addEventListener("load",()=>{t()},!1),r.addEventListener("error",t=>{e(t)},!1),document.body.appendChild(r)})}try{importScripts(t.toString())}catch(r){if(!(r instanceof TypeError))throw r;{let r=self.import;r?await r(t.toString()):await import(t.toString())}}}function Ko(t,r,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),e(r=t.h.stringToNewUTF8(r)),t.h._free(r)}function Jo(t,r,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t.h.stringToNewUTF8(r[e]);r=t.h._malloc(4*n.length),t.h.HEAPU32.set(n,r>>2),e(r);for(let r of n)t.h._free(r);t.h._free(r)}function Xo(t,r,e){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[r]=e}function Yo(t,r,e){var n=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[r]=(t,r,i)=>{r?(e(n,i),n=[]):n.push(t)}}var Zo=function(t){return class extends t{get O(){return this.h}X(){if("function"==typeof this.O._mediapipeLoggerGetEncodedApiKey){let t=this.O._mediapipeLoggerGetEncodedApiKey();return this.O._decodeBase64(t)}}}}(function(t){return class extends t{ba(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,r){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==r?this.h.canvas=r:$o()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){var r=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(r),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,r){var e=t.length,n=this.h._malloc(e);this.h.HEAPU8.set(t,n),r?this.h._changeBinaryGraph(e,n):this.h._changeTextGraph(e,n),this.h._free(n)}configureAudio(t,r,e,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ko(this,n||"input_audio",n=>{Ko(this,i=i||"audio_header",i=>{this.h._configureAudio(n,i,t,r??0,e)})})}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,r){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=r}addAudioToStream(t,r,e){this.addAudioToStreamWithShape(t,0,0,r,e)}addAudioToStreamWithShape(t,r,e,n,i){var o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Ko(this,n,t=>{this.h._addAudioToInputStream(this.g,r,e,t,i)})}addGpuBufferToStream(t,r,e){Ko(this,r,r=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");r?this.h._bindTextureToStream(r):this.h._bindTextureToCanvas();var n=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);var[a,s]=[i,o];this.h._addBoundTextureToStream(r,a,s,e)})}addBoolToStream(t,r,e){Ko(this,r,r=>{this.h._addBoolToInputStream(t,r,e)})}addDoubleToStream(t,r,e){Ko(this,r,r=>{this.h._addDoubleToInputStream(t,r,e)})}addFloatToStream(t,r,e){Ko(this,r,r=>{this.h._addFloatToInputStream(t,r,e)})}addIntToStream(t,r,e){Ko(this,r,r=>{this.h._addIntToInputStream(t,r,e)})}addUintToStream(t,r,e){Ko(this,r,r=>{this.h._addUintToInputStream(t,r,e)})}addStringToStream(t,r,e){Ko(this,r,r=>{Ko(this,t,t=>{this.h._addStringToInputStream(t,r,e)})})}addStringRecordToStream(t,r,e){Ko(this,r,r=>{Jo(this,Object.keys(t),n=>{Jo(this,Object.values(t),i=>{this.h._addFlatHashMapToInputStream(n,i,Object.keys(t).length,r,e)})})})}addProtoToStream(t,r,e,n){Ko(this,e,e=>{Ko(this,r,r=>{var i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,r,e,n),this.h._free(i)})})}addEmptyPacketToStream(t,r){Ko(this,t,t=>{this.h._addEmptyPacketToInputStream(t,r)})}addBoolVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.h._addBoolVectorEntry(n,r);this.h._addBoolVectorToInputStream(n,r,e)})}addDoubleVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.h._addDoubleVectorEntry(n,r);this.h._addDoubleVectorToInputStream(n,r,e)})}addFloatVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.h._addFloatVectorEntry(n,r);this.h._addFloatVectorToInputStream(n,r,e)})}addIntVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.h._addIntVectorEntry(n,r);this.h._addIntVectorToInputStream(n,r,e)})}addUintVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.h._addUintVectorEntry(n,r);this.h._addUintVectorToInputStream(n,r,e)})}addStringVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Ko(this,r,t=>{this.h._addStringVectorEntry(n,t)});this.h._addStringVectorToInputStream(n,r,e)})}addBoolToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addBoolToInputSidePacket(t,r)})}addDoubleToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addDoubleToInputSidePacket(t,r)})}addFloatToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addFloatToInputSidePacket(t,r)})}addIntToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addIntToInputSidePacket(t,r)})}addUintToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addUintToInputSidePacket(t,r)})}addStringToInputSidePacket(t,r){Ko(this,r,r=>{Ko(this,t,t=>{this.h._addStringToInputSidePacket(t,r)})})}addProtoToInputSidePacket(t,r,e){Ko(this,e,e=>{Ko(this,r,r=>{var n=this.h._malloc(t.length);this.h.HEAPU8.set(t,n),this.h._addProtoToInputSidePacket(n,t.length,r,e),this.h._free(n)})})}addBoolVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateBoolVector(t.length);if(!e)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.h._addBoolVectorEntry(e,r);this.h._addBoolVectorToInputSidePacket(e,r)})}addDoubleVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateDoubleVector(t.length);if(!e)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.h._addDoubleVectorEntry(e,r);this.h._addDoubleVectorToInputSidePacket(e,r)})}addFloatVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateFloatVector(t.length);if(!e)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.h._addFloatVectorEntry(e,r);this.h._addFloatVectorToInputSidePacket(e,r)})}addIntVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateIntVector(t.length);if(!e)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.h._addIntVectorEntry(e,r);this.h._addIntVectorToInputSidePacket(e,r)})}addUintVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateUintVector(t.length);if(!e)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.h._addUintVectorEntry(e,r);this.h._addUintVectorToInputSidePacket(e,r)})}addStringVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateStringVector(t.length);if(!e)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Ko(this,r,t=>{this.h._addStringVectorEntry(e,t)});this.h._addStringVectorToInputSidePacket(e,r)})}attachBoolListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachBoolListener(t)})}attachBoolVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachBoolVectorListener(t)})}attachIntListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachIntListener(t)})}attachIntVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachIntVectorListener(t)})}attachUintListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachUintListener(t)})}attachUintVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachUintVectorListener(t)})}attachDoubleListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachDoubleListener(t)})}attachDoubleVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachDoubleVectorListener(t)})}attachFloatListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachFloatListener(t)})}attachFloatVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachFloatVectorListener(t)})}attachStringListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachStringListener(t)})}attachStringVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachStringVectorListener(t)})}attachProtoListener(t,r,e){Xo(this,t,r),Ko(this,t,t=>{this.h._attachProtoListener(t,e||!1)})}attachProtoVectorListener(t,r,e){Yo(this,t,r),Ko(this,t,t=>{this.h._attachProtoVectorListener(t,e||!1)})}attachAudioListener(t,r,e){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Xo(this,t,(t,e)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),r(t,e)}),Ko(this,t,t=>{this.h._attachAudioListener(t,e||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}})),qo=class extends Zo{};async function Qo(t,r){var e=la,n=await(async(t,r,e,n)=>{if(r&&await zo(r),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(e&&(await zo(e),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((r=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(r.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:r=>r.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&r.endsWith(".data")?t.assetBinaryPath.toString():r});return function(t,r,e){e=e.Na??"";var n=t.g.X();t.i=new Ho(r,e,n)}(n,e.name,r),await n.F(r),n}async function ta(t,r){return Qo(t,r)}function ra(t,r){var e=Rr(t.baseOptions,uo,1)||new uo;"string"==typeof r?(Ur(e,2,rr(r)),Ur(e,1)):r instanceof Uint8Array&&(Ur(e,1,nt(r,!1)),Ur(e,2)),zr(t.baseOptions,0,1,e)}function ea(t,r){var e=r.baseOptions||{};if(r.baseOptions?.modelAssetBuffer&&r.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Rr(t.baseOptions,uo,1)?.i()||Rr(t.baseOptions,uo,1)?.j()||r.baseOptions?.modelAssetBuffer||r.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,r){var e=Rr(t.baseOptions,ao,3);if(!e){var n=e=new ao,i=new Hi;Kr(n,4,so,i)}"delegate"in r&&("GPU"===r.delegate?(r=e,n=new Di,Kr(r,2,so,n)):(r=e,n=new Hi,Kr(r,4,so,n))),zr(t.baseOptions,0,3,e)}(t,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(r=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(r),!0,!1,!1),ra(t,"/model.dat"),ua(t)});if(e.modelAssetBuffer instanceof Uint8Array)ra(t,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var r=[],e=0;;){let{done:n,value:i}=await t.read();if(n)break;r.push(i),e+=i.length}if(0===r.length)return new Uint8Array(0);if(1===r.length)return r[0];t=new Uint8Array(e),e=0;for(let n of r)t.set(n,e),e+=n.length;return t}(e.modelAssetBuffer).then(r=>{ra(t,r),ua(t)});return ua(t),Promise.resolve()}function na(t){try{let r=t.o.length;if(1===r)throw Error(t.o[0].message);if(r>1)throw Error("Encountered multiple errors: "+t.o.map(t=>t.message).join(", "))}finally{t.o=[]}}var ia=class{constructor(t){this.g=t,this.o=[],this.m=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,r){this.g.attachErrorListener((t,r)=>{this.o.push(Error(r))}),this.g.ba(),this.g.setGraph(t,r),this.i?.aa(),na(this)}finishProcessing(t){if(this.g.finishProcessing(),na(this),this.i&&void 0!==t){var r=this.i,e=r.i.get(t);if(void 0!==e&&(r.i.delete(t),t=performance.now()-e,++r.g.v,r.g.B+=t,r.g.D=Math.max(r.g.D,t),r.o=Math.max(r.o,t),performance.now()>r.m+3e4)){for(let[n,i]of r.i.entries())t=n,i<e&&(r.g.C++,r.i.delete(t));e={u:r.g.u,A:r.g.A,v:r.g.v,C:r.g.C,B:r.g.B,D:r.g.D,H:performance.now()-r.m},r.g.D=0,r.m=performance.now();var n={u:e.u-r.j.u,A:e.A-r.j.A,v:e.v-r.j.v,C:e.C-r.j.C,B:e.B-r.j.B,D:e.D,H:e.H};t=Ao(So(new Io,r.G),1),n=Wo(r,n),Ro(r,t=Kr(t,4,Eo,n)),r.j=e}}}close(){this.i?.Z(),this.i?.close(),this.g.closeGraph()}};async function oa(t,r){return ta(t,r)}ia.prototype.close=ia.prototype.close;var aa=class extends ia{constructor(){super(...arguments),this.J=48e3}ea(t){this.J=t}};function sa(t){var r={classifications:Hr(t,go).map(t=>function(t,r=-1,e=""){return{categories:t.map(t=>({index:Wt(Tr(t,1))??0??-1,score:Tr(t,2,void 0,Dt)??0??0,categoryName:er(Tr(t,3))??""??"",displayName:er(Tr(t,4))??""??""})),headIndex:r,headName:e}}(Rr(t,no,4)?.i()??[],Wt(Tr(t,2))??0,er(Tr(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(gt(t)?t=Number(t):(t=Vt(64,t),t=gt(t)?Number(t):String(t)),t):Rt(t)?"number"==typeof t?zt(t):Jt(t):void 0}(Tr(t,2,void 0,Zt))&&(r.timestampMs=function(t){var r=Number(t);return Number.isSafeInteger(r)?r:String(t)}(Tr(t,2,void 0,Zt)??Er)),r}function ua(t){var r=new to;Qr(r,10,"audio_in"),Qr(r,10,"sample_rate"),Qr(r,15,"timestamped_classifications");var e=new Ki;!function(t,r){var e=ro,n=t.l;W&&W in n&&(n=n[W])&&delete n[451755788],e.g?e.j(t,e.g,451755788,r,e.i):e.j(t,451755788,r,e.i)}(e,t.j);var n=new Yi;!function(t){var r=rr("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph");Sr(t),Pr(t=t.l,0|t[Y],2,""===r?void 0:r)}(n),Qr(n,3,"AUDIO:audio_in"),Qr(n,3,"SAMPLE_RATE:sample_rate"),Qr(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.F(e),Xr(r,1,Yi,n),t.g.attachProtoVectorListener("timestamped_classifications",(r,e)=>{!function(t,r){r.forEach(r=>{r=vo(r),t.G.push(sa(r))})}(t,r),t.m=Math.max(t.m,e)}),t.g.attachEmptyPacketListener("timestamped_classifications",r=>{t.m=Math.max(t.m,r)}),r=r.i(),t.setGraph(new Uint8Array(r),!0)}aa.prototype.setDefaultSampleRate=aa.prototype.ea;var la=class extends aa{constructor(t,r){super(new qo(t,r)),this.G=[],zr(t=this.j=new co,0,1,r=new lo)}get baseOptions(){return Rr(this.j,lo,1)}set baseOptions(t){zr(this.j,0,1,t)}F(t){var r=this.j,e=Rr(this.j,oo,2);if(e){var n=e.l;let t=0|n[Y];e=Ir(e,n,t)?yr(e,n,!0):new e.constructor(wr(n,t,!1))}else e=new oo;if(void 0!==t.displayNamesLocale?Ur(e,1,rr(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ur(e,1),void 0!==t.maxResults){if(null!=(n=t.maxResults)){if("number"!=typeof n)throw V("int32");if(!Mt(n))throw V("int32");n|=0}Ur(e,2,n)}else"maxResults"in t&&Ur(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ur(e,3,n)}else"scoreThreshold"in t&&Ur(e,3);return void 0!==t.categoryAllowlist?Vr(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ur(e,4),void 0!==t.categoryDenylist?Vr(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ur(e,5),zr(r,0,2,e),ea(this,t)}W(t,r){r=r??this.J;var e=this.m+1;if(this.i&&void 0!==e)if(Rr(this.baseOptions,ao,3)?.i()){var n=this.i;++n.g.A,n.i.set(e,performance.now())}else++(n=this.i).g.u,n.i.set(e,performance.now());return this.g.addDoubleToStream(r,"sample_rate",e),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",e),this.G=[],this.finishProcessing(e),[...this.G]}};la.prototype.classify=la.prototype.W,la.prototype.setOptions=la.prototype.F,la.createFromModelPath=function(t,r){return ta(t,{baseOptions:{modelAssetPath:r}})},la.createFromModelBuffer=function(t,r){return oa(t,{baseOptions:{modelAssetBuffer:r}})},la.createFromOptions=function(t,r){return oa(t,r)};var ca,ha=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 fa(t){if(t)return!0;if(void 0===ca)try{await WebAssembly.instantiate(ha),ca=!0}catch{ca=!1}return ca}async function da(t,r,e){return{wasmLoaderPath:`${r}/${t}_${e=`wasm${e?"_module":""}${await fa(e)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${r}/${t}_${e}.wasm`}}var ga=class{};return ga.forVisionTasks=function(t,r=!1){return da("vision",t??Fi``,r)},ga.forTextTasks=function(t,r=!1){return da("text",t??Fi``,r)},ga.forGenAiTasks=function(t,r=!1){return da("genai",t??Fi``,r)},ga.forAudioTasks=function(t,r=!1){return da("audio",t??Fi``,r)},ga.isSimdSupported=function(t=!1){return fa(t)},t.AudioClassifier=la,t.AudioTaskRunner=aa,t.FilesetResolver=ga,t.TaskRunner=ia,t}({});
1
+ var Audio=function(t){"use strict";var r="undefined"!=typeof self?self:{};function e(t,e){t:{for(var n=["CLOSURE_FLAGS"],i=r,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(t=n&&n[t])?t:e}function n(){throw Error("Invalid UTF8")}function i(t,r){return r=String.fromCharCode.apply(null,r),null==t?r:t+r}var o,a,s=void 0,u="undefined"!=typeof TextDecoder,l="undefined"!=typeof TextEncoder;function c(t){if(l)t=(a||=new TextEncoder).encode(t);else{let e=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var r=t.charCodeAt(i);if(r<128)n[e++]=r;else{if(r<2048)n[e++]=r>>6|192;else{if(r>=55296&&r<=57343){if(r<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){r=1024*(r-55296)+o-56320+65536,n[e++]=r>>18|240,n[e++]=r>>12&63|128,n[e++]=r>>6&63|128,n[e++]=63&r|128;continue}i--}r=65533}n[e++]=r>>12|224,n[e++]=r>>6&63|128}n[e++]=63&r|128}}t=e===n.length?n:n.subarray(0,e)}return t}var h=e(610401301,!1),f=e(748402147,!0);function d(){var t=r.navigator;return t&&(t=t.userAgent)?t:""}var g,v=r.navigator;function p(t){return p[" "](t),t}g=v&&v.userAgentData||null,p[" "]=function(){};var m={},y=null;function w(t){var r=t.length,e=3*r/4;e%3?e=Math.floor(e):-1!="=.".indexOf(t[r-1])&&(e=-1!="=.".indexOf(t[r-2])?e-2:e-1);var n=new Uint8Array(e),i=0;return function(t,r){function e(r){for(;n<t.length;){let r=t.charAt(n++),e=y[r];if(null!=e)return e;if(!/^[\s\xa0]*$/.test(r))throw Error("Unknown base64 encoding at char: "+r)}return r}b();for(var n=0;;){let t=e(-1),n=e(0),i=e(64),o=e(64);if(64===o&&-1===t)break;r(t<<2|n>>4),64!=i&&(r(n<<4&240|i>>2),64!=o&&r(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==e?n.subarray(0,i):n}function b(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),r=["+/=","+/","-_=","-_.","-_"];for(let e=0;e<5;e++){let n=t.concat(r[e].split(""));m[e]=n;for(let t=0;t<n.length;t++){let r=n[t];void 0===y[r]&&(y[r]=t)}}}}var _="undefined"!=typeof Uint8Array,S=!(!(h&&g&&g.brands.length>0)&&(-1!=d().indexOf("Trident")||-1!=d().indexOf("MSIE")))&&"function"==typeof btoa,A=/[-_.]/g,I={"-":"+",_:"/",".":"="};function E(t){return I[t]||""}function T(t){if(!S)return w(t);t=A.test(t)?t.replace(A,E):t,t=atob(t);var r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}var B={};function U(){return L||=new x(null,B)}function P(t){N(B);var r=t.g;return null==(r=null==r||_&&null!=r&&r instanceof Uint8Array?r:"string"==typeof r?T(r):null)?r:t.g=r}var L,x=class{constructor(t,r){if(N(r),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function N(t){if(t!==B)throw Error("illegal external caller")}function j(t,r){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=r}var O=void 0;function V(t){return j(t=Error(t),"warning"),t}function k(t,e){if(null!=t){var n=O??={},i=n[t]||0;i>=e||(n[t]=i+1,j(t=Error(),"incident"),function(t){r.setTimeout(()=>{throw t},0)}(t))}}function F(){return"function"==typeof BigInt}var M="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,r,e=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?e&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():r}var D,G=C("jas",void 0,!0),R=C(void 0,"1oa"),W=C(void 0,Symbol()),H=C(void 0,"0ubs"),$=C(void 0,"0ubsb"),z=C(void 0,"0actk"),K=C("m_m","Ka",!0),J={Y:{value:0,configurable:!0,writable:!0,enumerable:!1}},X=Object.defineProperties,Y=M?G:"Y",Z=[];function q(t,r){M||Y in t||X(t,J),t[Y]|=r}function Q(t,r){M||Y in t||X(t,J),t[Y]=r}Q(Z,7),D=Object.freeze(Z);var tt={};function rt(t,r){return void 0===r?t.g!==et&&!!(2&t.l[Y]):!!(2&r)&&t.g!==et}var et={};function nt(t,r){if(null!=t)if("string"==typeof t)t=t?new x(t,B):U();else if(t.constructor!==x)if(_&&null!=t&&t instanceof Uint8Array)t=t.length?new x(new Uint8Array(t),B):U();else{if(!r)throw Error();t=void 0}return t}var it=Object.freeze({});function ot(t,r,e){var n,i=128&r?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var a=o+(n?-1:0);for(r=128&r?1:0;r<a;r++)e(r-i,t[r]);if(n){t=t[o-1];for(let r in t)!isNaN(r)&&e(+r,t[r])}}var at={};function st(t){return 128&t?at:void 0}function ut(t){return t.Ia=!0,t}var lt=ut(t=>"number"==typeof t),ct=ut(t=>"string"==typeof t),ht=ut(t=>"boolean"==typeof t),ft="function"==typeof r.BigInt&&"bigint"==typeof r.BigInt(0);function dt(t){var r=t;if(ct(r)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(r))throw Error(String(r))}else if(lt(r)&&!Number.isSafeInteger(r))throw Error(String(r));return ft?BigInt(t):t=ht(t)?t?"1":"0":ct(t)?t.trim()||"0":String(t)}var gt=ut(t=>ft?t>=pt&&t<=yt:"-"===t[0]?wt(t,vt):wt(t,mt)),vt=Number.MIN_SAFE_INTEGER.toString(),pt=ft?BigInt(Number.MIN_SAFE_INTEGER):void 0,mt=Number.MAX_SAFE_INTEGER.toString(),yt=ft?BigInt(Number.MAX_SAFE_INTEGER):void 0;function wt(t,r){if(t.length>r.length)return!1;if(t.length<r.length||t===r)return!0;for(let e=0;e<t.length;e++){let n=t[e],i=r[e];if(n>i)return!1;if(n<i)return!0}}var bt,_t="function"==typeof Uint8Array.prototype.slice,St=0,At=0;function It(t){var r=t>>>0;St=r,At=(t-r)/4294967296>>>0}function Et(t){if(t<0){It(-t);let[r,e]=jt(St,At);St=r>>>0,At=e>>>0}else It(t)}function Tt(t,r){var e=4294967296*r+(t>>>0);return Number.isSafeInteger(e)?e:Pt(t,r)}function Bt(t,r){return dt(F()?BigInt.asUintN(64,(BigInt(r>>>0)<<BigInt(32))+BigInt(t>>>0)):Pt(t,r))}function Ut(t,r){return F()?dt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(r))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):dt(xt(t,r))}function Pt(t,r){if(t>>>=0,(r>>>=0)<=2097151)var e=""+(4294967296*r+t);else F()?e=""+(BigInt(r)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(e=16777215&(t>>>24|r<<8))+6710656*(r=r>>16&65535),e+=8147497*r,r*=2,t>=1e7&&(e+=t/1e7>>>0,t%=1e7),e>=1e7&&(r+=e/1e7>>>0,e%=1e7),e=r+Lt(e)+Lt(t));return e}function Lt(t){return t=String(t),"0000000".slice(t.length)+t}function xt(t,r){if(2147483648&r)if(F())t=""+(BigInt(0|r)<<BigInt(32)|BigInt(t>>>0));else{let[e,n]=jt(t,r);t="-"+Pt(e,n)}else t=Pt(t,r);return t}function Nt(t){if(t.length<16)Et(Number(t));else if(F())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,At=Number(t>>BigInt(32)&BigInt(4294967295));else{let r=+("-"===t[0]);At=St=0;let e=t.length;for(let n=r,i=(e-r)%6+r;i<=e;n=i,i+=6){let r=Number(t.slice(n,i));At*=1e6,(St=1e6*St+r)>=4294967296&&(At+=Math.trunc(St/4294967296),At>>>=0,St>>>=0)}if(r){let[t,r]=jt(St,At);St=t,At=r}}}function jt(t,r){return r=~r,t?t=1+~t:r+=1,[t,r]}function Ot(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,kt="function"==typeof BigInt?BigInt.asUintN:void 0,Ft=Number.isSafeInteger,Mt=Number.isFinite,Ct=Math.trunc;function Dt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}var Gt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Rt(t){switch(typeof t){case"bigint":return!0;case"number":return Mt(t);case"string":return Gt.test(t);default:return!1}}function Wt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?0|t:void 0}function Ht(t){var r=t.length;return("-"===t[0]?r<20||20===r&&t<="-9223372036854775808":r<19||19===r&&t<="9223372036854775807")?t:(Nt(t),xt(St,At))}function $t(t){if("-"===t[0])var r=!1;else r=(r=t.length)<20||20===r&&t<="18446744073709551615";return r?t:(Nt(t),Pt(St,At))}function zt(t){if(t=Ct(t),!Ft(t)){Et(t);var r=St,e=At;(t=2147483648&e)&&(e=~e>>>0,0==(r=1+~r>>>0)&&(e=e+1>>>0)),t="number"==typeof(r=Tt(r,e))?t?-r:r:t?"-"+r:r}return t}function Kt(t){return(t=Ct(t))>=0&&Ft(t)||(Et(t),t=Tt(St,At)),t}function Jt(t){var r=Ct(Number(t));return Ft(r)?String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),Ht(t))}function Xt(t){var r=Ct(Number(t));return Ft(r)?dt(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),F()?dt(Vt(64,BigInt(t))):dt(Ht(t)))}function Yt(t){return Ft(t)?t=dt(zt(t)):(t=Ct(t),Ft(t)?t=String(t):(Et(t),t=xt(St,At)),t=dt(t)),t}function Zt(t){var r=typeof t;return null==t?t:"bigint"===r?dt(Vt(64,t)):Rt(t)?"string"===r?Xt(t):Yt(t):void 0}function qt(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(Vt(64,t));if(Rt(t)){if("string"===r)return Jt(t);if("number"===r)return zt(t)}}function Qt(t){if(null==t||"string"==typeof t||t instanceof x)return t}function tr(t){if("string"!=typeof t)throw Error();return t}function rr(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function er(t){return null==t||"string"==typeof t?t:void 0}function nr(t,r,e){if(null!=t&&t[K]===tt)return t;if(Array.isArray(t)){var n=0|t[Y];return(e=n|32&e|2&e)!==n&&Q(t,e),new r(t)}}function ir(t){return t}function or(t){return W?t[W]:void 0}function ar(t,r){for(let e in t)!isNaN(e)&&r(t,+e,t[e])}var sr,ur,lr,cr=class{};function hr(t,r){r<100||k(H,1)}function fr(t,r,e,n){var i=void 0!==n;n=!!n;var o,a=W;!i&&M&&a&&(o=t[a])&&ar(o,hr),a=[];var s=t.length;o=4294967295;var u=!1,l=!!(64&r),c=l?128&r?0:-1:void 0;if(!(1&r)){var h=s&&t[s-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--s:h=void 0,!l||128&r||i||(u=!0,o=(sr??ir)(o-c,c,t,h,void 0)+c)}r=void 0;for(var f=0;f<s;f++){let i=t[f];if(null!=i&&null!=(i=e(i,n)))if(l&&f>=o){let t=f-c;(r??={})[t]=i}else a[f]=i}if(h)for(let t in h){if(null==(s=h[t])||null==(s=e(s,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?a[i]=s:(r??={})[t]=s}return r&&(u?a.push(r):a[o]=r),i&&W&&(t=or(t))&&t instanceof cr&&(a[W]=function(t){var r=new cr;return ar(t,(t,e,n)=>{r[e]=Ot(n)}),r.g=t.g,r}(t)),a}function dr(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return gt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var r=0|t[Y];return 0===t.length&&1&r?void 0:fr(t,r,dr)}if(null!=t&&t[K]===tt)return gr(t);if(t instanceof x){if(null==(r=t.g))t="";else if("string"==typeof r)t=r;else{if(S){for(var e="",n=0,i=r.length-10240;n<i;)e+=String.fromCharCode.apply(null,r.subarray(n,n+=10240));e+=String.fromCharCode.apply(null,n?r.subarray(n):r),r=btoa(e)}else{void 0===e&&(e=0),b(),e=m[e],n=Array(Math.floor(r.length/3)),i=e[64]||"";let t=0,l=0;for(;t<r.length-2;t+=3){var o=r[t],a=r[t+1],s=r[t+2],u=e[o>>2];o=e[(3&o)<<4|a>>4],a=e[(15&a)<<2|s>>6],s=e[63&s],n[l++]=u+o+a+s}switch(u=0,s=i,r.length-t){case 2:s=e[(15&(u=r[t+1]))<<2]||i;case 1:r=r[t],n[l]=e[r>>2]+e[(3&r)<<4|u>>4]+s+i}r=n.join("")}t=t.g=r}return t}return}return t}function gr(t){return fr(t=t.l,0|t[Y],dr)}function vr(t,r){return pr(t,r[0],r[1])}function pr(t,r,e,n=0){if(null==t){var i=32;e?(t=[e],i|=128):t=[],r&&(i=-16760833&i|(1023&r)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],f&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(f)throw Error("carr");k(z,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(e&&(i|=128,e!==t[0]))throw Error("mid");t:{i|=64;var o=(e=t).length;if(o){var a=o-1;let t=e[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=r=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var s in t)(o=+s)<a&&(e[o+r]=t[s],delete t[s]);i=-16760833&i|(1023&a)<<14;break t}}if(r){if((s=Math.max(r,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&s)<<14}}}return Q(t,64|i|n),t}function mr(t,r){if("object"!=typeof t)return t;if(Array.isArray(t)){var e=0|t[Y];return 0===t.length&&1&e?t=void 0:2&e||(!r||4096&e||16&e?t=wr(t,e,!1,r&&!(16&e)):(q(t,34),4&e&&Object.freeze(t))),t}return null!=t&&t[K]===tt?rt(t,e=0|(r=t.l)[Y])?t:Ir(t,r,e)?yr(t,r):wr(r,e):t instanceof x?t:void 0}function yr(t,r,e){return t=new t.constructor(r),e&&(t.g=et),t.m=et,t}function wr(t,r,e,n){return n??=!!(34&r),t=fr(t,r,mr,n),n=32,e&&(n|=2),Q(t,r=16769217&r|n),t}function br(t){var r=t.l,e=0|r[Y];return rt(t,e)?Ir(t,r,e)?yr(t,r,!0):new t.constructor(wr(r,e,!1)):t}function _r(t){if(t.g!==et)return!1;var r=t.l;return q(r=wr(r,0|r[Y]),2048),t.l=r,t.g=void 0,t.m=void 0,!0}function Sr(t){if(!_r(t)&&rt(t,0|t.l[Y]))throw Error()}function Ar(t,r){void 0===r&&(r=0|t[Y]),32&r&&!(4096&r)&&Q(t,4096|r)}function Ir(t,r,e){return!!(2&e)||!(!(32&e)||4096&e)&&(Q(r,2|e),t.g=et,!0)}var Er=dt(0);function Tr(t,r,e,n){if(null!==(t=Br(t.l,r,e,n)))return t}function Br(t,r,e,n){if(-1===r)return null;var i=r+(e?0:-1),o=t.length-1;if(!(o<1+(e?0:-1))){if(i>=o){var a=t[o];if(null!=a&&"object"==typeof a&&a.constructor===Object){e=a[r];var s=!0}else{if(i!==o)return;e=a}}else e=t[i];if(n&&null!=e){if(null==(n=n(e)))return n;if(!Object.is(n,e))return s?a[r]=n:t[i]=n,n}return e}}function Ur(t,r,e,n){Sr(t);var i=t.l;return Pr(i,0|i[Y],r,e,n),t}function Pr(t,r,e,n,i){var o=e+(i?0:-1),a=t.length-1;if(a>=1+(i?0:-1)&&o>=a){let i=t[a];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[e]=n,r}return o<=a?(t[o]=n,r):(void 0!==n&&(e>=(a=(r??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[a+(i?0:-1)]={[e]:n}):t[o]=n),r)}function Lr(t,r,e,n,i,o,a,s){var u=r;return 1===o||4===o&&(2&r||!(16&r)&&32&n)?jr(r)||((r|=!t.length||a&&!(4096&r)||32&n&&!(4096&r||16&r)?2:256)!==u&&Q(t,r),Object.freeze(t)):(2===o&&jr(r)&&(t=Ot(t),u=0,r=Jr(r,n),n=Pr(e,n,i,t)),jr(r)||(s||(r|=16),r!==u&&Q(t,r))),2&r||!(4096&r||16&r)||Ar(e,n),t}function xr(t,r,e){return t=Br(t,r,e),Array.isArray(t)?t:D}function Nr(t,r){return 2&r&&(t|=2),1|t}function jr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Or(t){return nt(t,!0)}function Vr(t,r,e){Sr(t);var n=0|(t=t.l)[Y];if(null==e)Pr(t,n,r);else{var i=e===D?7:0|e[Y],o=i,a=jr(i),s=a||Object.isFrozen(e);for(a||(i=0),s||(e=Ot(e),o=0,i=Jr(i,n),s=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,a=0;a<e.length;a++){let t=e[a],r=tr(t);Object.is(t,r)||(s&&(e=Ot(e),o=0,i=Jr(i,n),s=!1),e[a]=r)}i!==o&&(s&&(e=Ot(e),i=Jr(i,n)),Q(e,i)),Pr(t,n,r,e)}}function kr(t,r,e){if(2&r)throw Error();var n=st(r),i=xr(t,e,n),o=i===D?7:0|i[Y],a=Nr(o,r);return(2&a||jr(a)||16&a)&&(a===o||jr(a)||Q(i,a),i=Ot(i),o=0,a=Jr(a,r),Pr(t,r,e,i,n)),(a&=-13)!==o&&Q(i,a),i}function Fr(t){if(M)return t[R]??(t[R]=new Map);if(R in t)return t[R];var r=new Map;return Object.defineProperty(t,R,{value:r}),r}function Mr(t,r,e,n,i){var o=Fr(t),a=Cr(o,t,r,e,i);return a!==n&&(a&&(r=Pr(t,r,a,void 0,i)),o.set(e,n)),r}function Cr(t,r,e,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let a=n[t];null!=Br(r,a,i)&&(0!==o&&(e=Pr(r,e,o,void 0,i)),o=a)}return t.set(n,o),o}function Dr(t,r,e){var n=0|t[Y],i=st(n),o=Br(t,e,i);if(null!=o&&o[K]===tt){if(!rt(o))return _r(o),o.l;var a=o.l}else Array.isArray(o)&&(a=o);if(a){let t=0|a[Y];2&t&&(a=wr(a,t))}return(a=vr(a,r))!==o&&Pr(t,n,e,a,i),a}function Gr(t,r,e,n){var i=!1;if(null!=(n=Br(t,n,void 0,t=>{var n=nr(t,e,r);return i=n!==t&&null!=n,n})))return i&&!rt(n)&&Ar(t,r),n}function Rr(t,r,e){var n=t.l,i=0|n[Y];if(null==(r=Gr(n,i,r,e)))return r;if(!rt(t,i=0|n[Y])){let o=br(r);o!==r&&(_r(t)&&(i=0|(n=t.l)[Y]),Ar(n,i=Pr(n,i,e,r=o)))}return r}function Wr(t,r,e,n,i,o,a,s){var u=rt(t,e);o=u?1:o,a=!!a||3===o,u=s&&!u,(2===o||u)&&_r(t)&&(e=0|(r=t.l)[Y]);var l=(t=xr(r,i))===D?7:0|t[Y],c=Nr(l,e);if(s=!(4&c)){var h=t,f=e;let r=!!(2&c);r&&(f|=2);let i=!r,o=!0,a=0,s=0;for(;a<h.length;a++){let t=nr(h[a],n,f);if(t instanceof n){if(!r){let r=rt(t);i&&=!r,o&&=r}h[s++]=t}}s<a&&(h.length=s),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Q(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&e)))){for(jr(c)&&(t=Ot(t),c=Jr(c,e),e=Pr(r,e,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=br(h))&&(n[l]=c);u|=8,Q(t,c=u=n.length?4096|u:-4097&u)}return Lr(t,c,r,e,i,o,s,a)}function Hr(t,r){var e=t.l;return Wr(t,e,0|e[Y],r,1,void 0===it?2:4,!1,!0)}function $r(t){return null==t&&(t=void 0),t}function zr(t,r,e,n,i){return Ur(t,e,n=$r(n),i),n&&!rt(n)&&Ar(t.l),t}function Kr(t,r,e,n){t:{var i=n=$r(n);Sr(t);let o=t.l,a=0|o[Y];if(null==i){let t=Fr(o);if(Cr(t,o,a,e)!==r)break t;t.set(e,0)}else a=Mr(o,a,e,r);Pr(o,a,r,i)}return n&&!rt(n)&&Ar(t.l),t}function Jr(t,r){return-273&(t=2&r?2|t:-3&t)}function Xr(t,r,e,n){Sr(t);var i=t.l;t=Wr(t,i,0|i[Y],e,r,2,!0),n=null!=n?n:new e,t.push(n),r=e=t===D?7:0|t[Y],(n=rt(n))?(e&=-9,1===t.length&&(e&=-4097)):e|=4096,e!==r&&Q(t,e),n||Ar(i)}function Yr(t,r,e){if(null!=e)t:{if(!Rt(e))throw V("int64");switch(typeof e){case"string":e=Xt(e);break t;case"bigint":e=dt(Vt(64,e));break t;default:e=Yt(e)}}return Ur(t,r,e)}function Zr(t,r,e){return Ur(t,r,null==e?e:function(t){if(!Rt(t))throw V("uint64");switch(typeof t){case"string":var r=Ct(Number(t));return Ft(r)&&r>=0?t=dt(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=F()?dt(kt(64,BigInt(t))):dt($t(t))),t;case"bigint":return dt(kt(64,t));default:return Ft(t)?t=dt(Kt(t)):((t=Ct(t))>=0&&Ft(t)?t=String(t):(Et(t),t=Pt(St,At)),t=dt(t)),t}}(e))}function qr(t,r,e){if(null!=e){if(!Mt(e))throw V("enum");e|=0}return Ur(t,r,e)}function Qr(t,r,e){Sr(t);var n=t.l,i=0|n[Y],o=rt(t,i)?1:2;2===o&&_r(t)&&(i=0|(n=t.l)[Y]);var a=(t=xr(n,r))===D?7:0|t[Y],s=Nr(a,i),u=!(4&s);if(u){4&s&&(t=Ot(t),a=0,s=Jr(s,i),i=Pr(n,i,r,t));let e=0,o=0;for(;e<t.length;e++){let r=er(t[e]);null!=r&&(t[o++]=r)}o<e&&(t.length=o),s=-513&s|4,s&=-1025,s&=-4097}s!==a&&(Q(t,s),2&s&&Object.freeze(t)),(t=Lr(t,s,n,i,r,o,u,!0)).push(tr(e))}var te=class{constructor(t,r,e){if(this.buffer=t,e&&!r)throw Error();this.g=r}};function re(t,r){if("string"==typeof t)return new te(T(t),r);if(Array.isArray(t))return new te(new Uint8Array(t),r);if(t.constructor===Uint8Array)return new te(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new te(t,!1);if(t.constructor===x)return r=P(t)||new Uint8Array(0),new te(r,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new te(t,!1);throw Error()}function ee(t,r){var e=0,n=0,i=0,o=t.i,a=t.g;do{var s=o[a++];e|=(127&s)<<i,i+=7}while(i<32&&128&s);if(i>32)for(n|=(127&s)>>4,i=3;i<32&&128&s;i+=7)n|=(127&(s=o[a++]))<<i;if(ue(t,a),!(128&s))return r(e>>>0,n>>>0);throw Error()}function ne(t){for(var r=0,e=t.g,n=e+10,i=t.i;e<n;){let n=i[e++];if(r|=n,!(128&n))return ue(t,e),!!(127&r)}throw Error()}function ie(t){var r=t.i,e=t.g,n=r[e++],i=127&n;if(128&n&&(i|=(127&(n=r[e++]))<<7,128&n&&(i|=(127&(n=r[e++]))<<14,128&n&&(i|=(127&(n=r[e++]))<<21,128&n&&(i|=(n=r[e++])<<28,128&n&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++]&&128&r[e++])))))throw Error();return ue(t,e),i}function oe(t){return ee(t,Ut)}function ae(t){var r=t.i,e=t.g,n=r[e],i=r[e+1],o=r[e+2];return r=r[e+3],ue(t,t.g+4),(n|i<<8|o<<16|r<<24)>>>0}function se(t){return ie(t)}function ue(t,r){if(t.g=r,r>t.j)throw Error()}function le(t,r){if(r<0)throw Error();var e=t.g;if((r=e+r)>t.j)throw Error();return t.g=r,e}function ce(t,r){if(0==r)return U();var e=le(t,r);return t.K&&t.o?e=t.i.subarray(e,e+r):(t=t.i,e=e===(r=e+r)?new Uint8Array(0):_t?t.slice(e,r):new Uint8Array(t.subarray(e,r))),0==e.length?U():new x(e,B)}var he=class{constructor(t,r,e,n){this.i=null,this.o=!1,this.g=this.j=this.m=0,this.init(t,r,e,n)}init(t,r,e,{K:n=!1,N:i=!1}={}){this.K=n,this.N=i,t&&(t=re(t,this.N),this.i=t.buffer,this.o=t.g,this.m=r||0,this.j=void 0!==e?this.m+e:this.i.length,this.g=this.m)}clear(){this.i=null,this.o=!1,this.g=this.j=this.m=0,this.K=!1}},fe=[],de=0;function ge(t,r,e,n){if(Ie.length){let i=Ie.pop();return i.F(n),i.g.init(t,r,e,n),i}return new Ae(t,r,e,n)}function ve(t){t.g.clear(),t.j=-1,t.i=-1,Ie.length<100&&Ie.push(t)}function pe(t){var r=t.g;if(r.g==r.j)return!1;t.m=t.g.g;var e=ie(t.g)>>>0;if(r=e>>>3,!((e&=7)>=0&&e<=5))throw Error();if(r<1)throw Error();return t.j=r,t.i=e,!0}function me(t){try{switch(t.i){case 0:0!=t.i?me(t):ne(t.g);break;case 1:var r=t.g;ue(r,r.g+8);break;case 2:if(2!=t.i)me(t);else{var e=ie(t.g)>>>0,n=t.g;ue(n,n.g+e)}break;case 5:var i=t.g;ue(i,i.g+4);break;case 3:ye();let o=t.j;try{for(;;){if(!pe(t))throw Error();if(4==t.i){if(t.j!=o)throw Error();break}me(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function ye(){if(de>=100)throw new SyntaxError;de++}function we(t,r,e){var n=t.g.j,i=ie(t.g)>>>0,o=(i=t.g.g+i)-n;if(o<=0&&(t.g.j=i,e(r,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=n}function be(t){var r=ie(t.g)>>>0,e=le(t=t.g,r);if(t=t.i,u){var a,l=t;(a=o)||(a=o=new TextDecoder("utf-8",{fatal:!0})),r=e+r,l=0===e&&r===l.length?l:l.subarray(e,r);try{var c=a.decode(l)}catch(t){if(void 0===s){try{a.decode(new Uint8Array([128]))}catch(t){}try{a.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(o=void 0),t}}else{r=(c=e)+r,e=[];let o,s=null;for(;c<r;){var h=t[c++];h<128?e.push(h):h<224?c>=r?n():(o=t[c++],h<194||128!=(192&o)?(c--,n()):e.push((31&h)<<6|63&o)):h<240?c>=r-1?n():(o=t[c++],128!=(192&o)||224===h&&o<160||237===h&&o>=160||128!=(192&(a=t[c++]))?(c--,n()):e.push((15&h)<<12|(63&o)<<6|63&a)):h<=244?c>=r-2?n():(o=t[c++],128!=(192&o)||o-144+(h<<28)>>30||128!=(192&(a=t[c++]))||128!=(192&(l=t[c++]))?(c--,n()):(h=(7&h)<<18|(63&o)<<12|(63&a)<<6|63&l,h-=65536,e.push(55296+(h>>10&1023),56320+(1023&h)))):n(),e.length>=8192&&(s=i(s,e),e.length=0)}c=i(s,e)}return c}function _e(t){var r=ie(t.g)>>>0;return ce(t.g,r)}function Se(t,r,e){var n=ie(t.g)>>>0;for(n=t.g.g+n;t.g.g<n;)e.push(r(t.g))}var Ae=class{constructor(t,r,e,n){if(fe.length){let i=fe.pop();i.init(t,r,e,n),t=i}else t=new he(t,r,e,n);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.F(n)}F({P:t=!1}={}){this.P=t}},Ie=[];function Ee(t){return new Ue(4294967295&t,Math.floor(t/4294967296))}function Te(t){return t?/^\d+$/.test(t)?(Nt(t),new Ue(St,At)):null:Be||=new Ue(0,0)}var Be,Ue=class{constructor(t,r){this.i=t>>>0,this.g=r>>>0}};function Pe(t){return new Ce(4294967295&t,Math.floor(t/4294967296))}function Le(t){return t?/^-?\d+$/.test(t)?(Nt(t),new Ce(St,At)):null:xe||=new Ce(0,0)}var xe,Ne,je,Oe,Ve,ke,Fe,Me,Ce=class{constructor(t,r){this.i=t>>>0,this.g=r>>>0}};function De(t,r,e){return"undefined"!=typeof BigInt64Array?(Fe||(Fe=new BigInt64Array(1),Me=new Uint32Array(Fe.buffer),Fe[0]=BigInt(1),ke=1===Me[0]),Fe[0]=t,new r(Me[t=ke?0:1],Me[1-t])):(Ve||(Ne=BigInt(Number.MIN_SAFE_INTEGER),je=BigInt(Number.MAX_SAFE_INTEGER),Oe=BigInt(4294967295),Ve=BigInt(32)),t>=Ne&&t<=je?e(Number(t)):(t=BigInt.asUintN(64,t),new r(Number(t&Oe),Number(t>>Ve))))}function Ge(t,r,e){for(;e>0||r>127;)t.g.push(127&r|128),r=(r>>>7|e<<25)>>>0,e>>>=7;t.g.push(r)}function Re(t,r){for(;r>127;)t.g.push(127&r|128),r>>>=7;t.g.push(r)}function We(t,r){if(r>=0)Re(t,r);else{for(let e=0;e<9;e++)t.g.push(127&r|128),r>>=7;t.g.push(1)}}function He(t,r){Nt(r),function(t){var r=At>>31;t(St<<1^r,(At<<1|St>>>31)^r)}((r,e)=>{Ge(t,r>>>0,e>>>0)})}function $e(t,r){t.g.push(r>>>0&255),t.g.push(r>>>8&255),t.g.push(r>>>16&255),t.g.push(r>>>24&255)}var ze=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Ke(t,r){0!==r.length&&(t.j.push(r),t.i+=r.length)}function Je(t,r,e){Re(t.g,8*r+e)}function Xe(t,r){return Je(t,r,2),r=t.g.end(),Ke(t,r),r.push(t.i),r}function Ye(t,r){var e=r.pop();for(e=t.i+t.g.length()-e;e>127;)r.push(127&e|128),e>>>=7,t.i++;r.push(e),t.i++}function Ze(t,r,e){if(null!=e)switch(Je(t,r,0),typeof e){case"number":t=t.g,Et(e),Ge(t,St,At);break;case"bigint":e=De(e,Ce,Pe),Ge(t.g,e.i,e.g);break;default:e=Le(e),Ge(t.g,e.i,e.g)}}function qe(t,r,e){Je(t,r,2),Re(t.g,e.length),Ke(t,t.g.end()),Ke(t,e)}var Qe=class{constructor(){this.j=[],this.i=0,this.g=new ze}};function tn(t){if("string"==typeof t)Le(t)}function rn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var en=rn(),nn=rn(),on=rn(),an=rn(),sn=rn(),un=rn(),ln=rn(),cn=rn(),hn=rn(),fn=rn(),dn=rn(),gn=rn();var vn=class{constructor(t,r){this.l=pr(t,r,void 0,2048)}toJSON(){return gr(this)}};vn.prototype[K]=tt,vn.prototype.toString=function(){return this.l.toString()};var pn=class{constructor(t,r,e){this.g=t,this.i=r,t=en,this.j=!!t&&e===t||!1}};function mn(t,r){return new pn(t,r,en)}function yn(t,r,e,n,i){null!=(r=Ln(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}var wn,bn,_n=mn(function(t,r,e,n,i){return 2===t.i&&(we(t,Dr(r,n,e),i),!0)},yn),Sn=mn(function(t,r,e,n,i){return 2===t.i&&(we(t,Dr(r,n,e),i),!0)},yn),An=Symbol(),In=Symbol(),En=Symbol(),Tn=Symbol(),Bn=Symbol();function Un(t,r,e,n){var i=n[t];if(i)return i;(i={}).V=n,i.I=function(t){switch(typeof t){case"boolean":return ur||=[0,void 0,!0];case"number":return t>0?void 0:0===t?lr||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],a=1;o&&o.constructor===Object&&(i.L=o,"function"==typeof(o=n[++a])&&(i.R=!0,wn??=o,bn??=n[a+1],o=n[a+=2]));for(var s={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)s[o[u]]=o;o=n[++a]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++a]);var l=void 0;if(o instanceof pn?t=o:(t=_n,a--),t?.j){o=n[++a],l=n;var c=a;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++a])&&o<0&&(c-=o,o=n[++a]);u<c;u++){let n=s[u];l?e(i,u,t,l,n):r(i,u,t,n)}}return n[t]=i}function Pn(t){return Array.isArray(t)?t[0]instanceof pn?t:[Sn,t]:[t,void 0]}function Ln(t,r){return t instanceof vn?t.l:Array.isArray(t)?vr(t,r):void 0}function xn(t,r,e,n){var i=e.g;t[r]=n?(t,r,e)=>i(t,r,e,n):i}function Nn(t,r,e,n,i){var o,a,s=e.g;t[r]=(t,r,e)=>s(t,r,e,a||=Un(In,xn,Nn,n).I,o||=jn(n),i)}function jn(t){var r=t[En];if(null!=r)return r;var e=Un(In,xn,Nn,t);return r=e.R?(t,r)=>wn(t,r,e):(t,r)=>{t:{ye();try{for(;pe(r)&&4!=r.i;){let u=r.j,l=e[u];if(null==l){let t=e.L;if(t){let r=t[u];if(r){let t=Vn(r);null!=t&&(l=e[u]=t)}}}if(null==l||!l(r,t,u)){var n=r;let e=n.m;if(me(n),n.P)var i=void 0;else{let t=n.g.g-e;n.g.g=e,i=ce(n.g,t)}n=void 0;var o=t,a=u,s=i;s&&((n=o[W]??(o[W]=new cr))[a]??(n[a]=[])).push(s)}}let l=or(t);l&&(l.g=e.V[Bn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{de>0&&de--}u=void 0}return u},t[En]=r,t[Bn]=On.bind(t),r}function On(t,r,e,n){var i=this[In],o=this[En],a=vr(void 0,i.I),s=or(t);if(s){var u=!1,l=i.L;if(l){if(i=(r,e,i)=>{if(0!==i.length)if(l[e])for(let t of i){r=ge(t);try{u=!0,o(a,r)}finally{ve(r)}}else n?.(t,e,i)},null==r)ar(s,i);else if(null!=s){let t=s[r];t&&i(s,r,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!e?.Ma)throw Error();let i=st(n),o=(r,o)=>{if(null!=Br(t,r,i)){if(1===e?.La)return;throw Error()}null!=o&&(n=Pr(t,n,r,o,i)),delete s[r]};null==r?ot(a,0|a[Y],(t,r)=>{o(t,r)}):o(r,Br(a,r,i))}}}}function Vn(t){var r=(t=Pn(t))[0].g;if(t=t[1]){let e=jn(t),n=Un(In,xn,Nn,t).I;return(t,i,o)=>r(t,i,o,n,e)}return r}function kn(t,r,e){t[r]=e.i}function Fn(t,r,e,n){var i,o,a=e.i;t[r]=(t,r,e)=>a(t,r,e,o||=Un(An,kn,Fn,n).I,i||=Mn(n))}function Mn(t){var r=t[Tn];if(!r){let e=Un(An,kn,Fn,t);r=(t,r)=>Cn(t,r,e),t[Tn]=r}return r}function Cn(t,r,e){ot(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,r){var e=t[r];if(e)return e;if((e=t.L)&&(e=e[r])){var n=(e=Pn(e))[0].i;if(e=e[1]){let r=Mn(e),i=Un(An,kn,Fn,e).I;e=t.R?bn(i,r):(t,e,o)=>n(t,e,o,i,r)}else e=n;return t[r]=e}}(e,t);i?i(r,n,t):t<500||k($,3)}}),(t=or(t))&&ar(t,(t,e,n)=>{for(Ke(r,r.g.end()),t=0;t<n.length;t++)Ke(r,P(n[t])||new Uint8Array(0))})}var Dn=dt(0);function Gn(t,r,e){if(Array.isArray(r)){var n=0|r[Y];if(4&n)return r;for(var i=0,o=0;i<r.length;i++){let e=t(r[i]);null!=e&&(r[o++]=e)}return o<i&&(r.length=o),t=1|n,e&&(t=-1537&t|4),t!==n&&Q(r,t),e&&2&t&&Object.freeze(r),r}}var Rn=(t,r)=>{var e=new Qe;Cn(t.l,e,Un(An,kn,Fn,r)),Ke(e,e.g.end()),t=new Uint8Array(e.i);var n=(r=e.j).length,i=0;for(let e=0;e<n;e++){let n=r[e];t.set(n,i),i+=n.length}return e.j=[t],t};function Wn(t,r,e){return new pn(t,r,e)}function Hn(t,r,e){return new pn(t,r,e)}function $n(t,r,e){Pr(t,0|t[Y],r,e,st(0|t[Y]))}function zn(t,r,e){null!=(r=qt(r))&&(tn(r),Ze(t,e,r))}function Kn(t,r,e){null!=(r=Wt(r))&&null!=r&&(Je(t,e,0),We(t.g,r))}function Jn(t,r,e){null!=(r=null==r||"boolean"==typeof r?r:"number"==typeof r?!!r:void 0)&&(Je(t,e,0),t.g.g.push(r?1:0))}function Xn(t,r,e){null!=(r=er(r))&&qe(t,e,c(r))}function Yn(t,r,e,n,i){null!=(r=Ln(r,n))&&(e=Xe(t,e),i(r,t),Ye(t,e))}function Zn(t,r,e){null!=(r=Qt(r))&&qe(t,e,re(r,!0).buffer)}function qn(t,r,e){r=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Mt(t)?t>>>0:void 0}(r),null!=r&&null!=r&&(Je(t,e,0),Re(t.g,r))}function Qn(t,r,e){null!=(r=Wt(r))&&(r=parseInt(r,10),Je(t,e,0),We(t.g,r))}function ti(t,r,e){return 0===t.i&&($n(r,e,oe(t.g)),!0)}function ri(t,r,e){return(0===t.i||2===t.i)&&(r=kr(r,0|r[Y],e),2==t.i?Se(t,ie,r):r.push(ie(t.g)),!0)}function ei(t,r,e){return 2===t.i&&($n(r,e,(t=_e(t))===U()?void 0:t),!0)}var ni=Wn(function(t,r,e){if(1!==t.i)return!1;var n=t.g;t=ae(n);var i=ae(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,$n(r,e,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,r,e){null!=(r=Dt(r))&&(Je(t,e,1),t=t.g,(e=bt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+r,!0),St=e.getUint32(0,!0),At=e.getUint32(4,!0),$e(t,St),$e(t,At))},fn),ii=Wn(function(t,r,e){if(5!==t.i)return!1;var n=ae(t.g);t=2*(n>>31)+1;var i=n>>>23&255;return n&=8388607,$n(r,e,255==i?n?NaN:t*(1/0):0==i?1401298464324817e-60*t*n:t*Math.pow(2,i-150)*(n+8388608)),!0},function(t,r,e){null!=(r=Dt(r))&&(Je(t,e,5),t=t.g,(e=bt||=new DataView(new ArrayBuffer(8))).setFloat32(0,+r,!0),At=0,$e(t,St=e.getUint32(0,!0)))},hn),oi=Wn(function(t,r,e){return ti(t,r,e)},zn,un),ai=Wn(function(t,r,e){return ti(t,r,e)},zn,un),si=Hn(function(t,r,e){return 0!==t.i&&2!==t.i?t=!1:(r=kr(r,0|r[Y],e),2==t.i?Se(t,oe,r):r.push(oe(t.g)),t=!0),t},function(t,r,e){if(null!=(r=Gn(qt,r,!1)))for(let n=0;n<r.length;n++)Ze(t,e,r[n])},un),ui=Wn(function(t,r,e){return 0!==t.i?r=!1:($n(r,e,(t=oe(t.g))===Dn?void 0:t),r=!0),r},zn,un),li=Wn(function(t,r,e){return 0!==t.i?t=!1:($n(r,e,ee(t.g,Bt)),t=!0),t},function(t,r,e){if(r=function(t){if(null==t)return t;var r=typeof t;if("bigint"===r)return String(kt(64,t));if(Rt(t)){if("string"===r)return r=Ct(Number(t)),Ft(r)&&r>=0?t=String(r):(-1!==(r=t.indexOf("."))&&(t=t.substring(0,r)),t=$t(t)),t;if("number"===r)return Kt(t)}}(r),null!=r){if("string"==typeof r)Te(r);if(null!=r)switch(Je(t,e,0),typeof r){case"number":t=t.g,Et(r),Ge(t,St,At);break;case"bigint":e=De(r,Ue,Ee),Ge(t.g,e.i,e.g);break;default:e=Te(r),Ge(t.g,e.i,e.g)}}},ln),ci=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)),!0)},Kn,an),hi=Hn(ri,function(t,r,e){if(null!=(r=Gn(Wt,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&(Je(n,i,0),We(n.g,o))}},an),fi=Hn(ri,function(t,r,e){if(null!=(r=Gn(Wt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.g,r[e]);Ye(t,e)}},an),di=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g))?void 0:t),!0)},Kn,an),gi=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ne(t.g)),!0)},Jn,nn),vi=Wn(function(t,r,e){return 0===t.i&&($n(r,e,!1===(t=ne(t.g))?void 0:t),!0)},Jn,nn),pi=Hn(function(t,r,e){return 2===t.i&&(t=be(t),kr(r,0|r[Y],e).push(t),!0)},function(t,r,e){if(null!=(r=Gn(er,r,!0)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,c(o))}},on),mi=Wn(function(t,r,e){return 2===t.i&&($n(r,e,""===(t=be(t))?void 0:t),!0)},Xn,on),yi=Wn(function(t,r,e){return 2===t.i&&($n(r,e,be(t)),!0)},Xn,on),wi=function(t,r,e=en){return new pn(t,r,e)}(function(t,r,e,n,i){return 2===t.i&&(n=vr(void 0,n),kr(r,0|r[Y],e).push(n),we(t,n,i),!0)},function(t,r,e,n,i){if(Array.isArray(r)){for(let o=0;o<r.length;o++)Yn(t,r[o],e,n,i);1&(t=0|r[Y])||Q(r,1|t)}}),bi=mn(function(t,r,e,n,i,o){if(2!==t.i)return!1;var a=0|r[Y];return Mr(r,a,o,e,st(a)),we(t,r=Dr(r,n,e),i),!0},Yn),_i=Wn(function(t,r,e){return 2===t.i&&($n(r,e,_e(t)),!0)},Zn,dn),Si=Hn(function(t,r,e){return 2===t.i&&(t=_e(t),kr(r,0|r[Y],e).push(t),!0)},function(t,r,e){if(null!=(r=Gn(Qt,r,!1)))for(let a=0;a<r.length;a++){var n=t,i=e,o=r[a];null!=o&&qe(n,i,re(o,!0).buffer)}},dn),Ai=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)>>>0),!0)},qn,sn),Ii=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g)>>>0)?void 0:t),!0)},qn,sn),Ei=Wn(function(t,r,e){return 0===t.i&&($n(r,e,ie(t.g)),!0)},Qn,gn),Ti=Wn(function(t,r,e){return 0===t.i&&($n(r,e,0===(t=ie(t.g))?void 0:t),!0)},Qn,gn),Bi=Wn(function(t,r,e){return 0!==t.i?t=!1:($n(r,e,function(t){return ee(t,(t,r)=>{var e=-(1&t);return Ut(t=(t>>>1|r<<31)^e,r>>>1^e)})}(t.g)),t=!0),t},function(t,r,e){if(null!=(r=qt(r))&&(tn(r),null!=r))switch(Je(t,e,0),typeof r){case"number":t=t.g,r=(e=r)<0,It(e=2*Math.abs(e)),e=St;let n=At;r&&(0==e?0==n?n=e=4294967295:(n--,e=4294967295):e--),Ge(t,St=e,At=n);break;case"bigint":t=t.g,r=r<<BigInt(1)^r>>BigInt(63),St=Number(BigInt.asUintN(32,r)),At=Number(BigInt.asUintN(32,r>>BigInt(32))),Ge(t,St,At);break;default:He(t.g,r)}},cn);function Ui(t){return function(){return Rn(this,t)}}var Pi,Li=[0,_i,Si,gi,yi],xi=[0,mi,[0,Ti,[0,ui,di],Ti,-1,[0,Ei],Ti,-1],Wn(ei,Zn,dn)],Ni=[0,mi,Wn(ei,function(t,r,e){if(null!=r){if(r instanceof vn){let n=r.Oa;return void(n?(r=n(r),null!=r&&qe(t,e,re(r,!0).buffer)):k($,3))}if(Array.isArray(r))return void k($,3)}Zn(t,r,e)},dn)],ji=[0,1,[0,12,ci,10,gi],[0,7,[0,ci,-1]]],Oi=globalThis.trustedTypes;var Vi=class{constructor(t){this.g=t}toString(){return this.g+""}};function ki(t){var r;return void 0===Pi&&(Pi=function(){var t=null;if(!Oi)return t;try{let r=t=>t;t=Oi.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch(t){}return t}()),t=(r=Pi)?r.createScriptURL(t):t,new Vi(t)}function Fi(t,...r){if(0===r.length)return ki(t[0]);var e=t[0];for(let n=0;n<r.length;n++)e+=encodeURIComponent(r[n])+t[n+1];return ki(e)}var Mi=[0,ci,Ei,gi,-1,fi,Ei,-1,gi,-1],Ci=[0,Ei,-1,gi],Di=class extends vn{constructor(t){super(t)}},Gi=[0,gi,yi,gi,Ei,-1,Hn(function(t,r,e){return(0===t.i||2===t.i)&&(r=kr(r,0|r[Y],e),2==t.i?Se(t,se,r):r.push(ie(t.g)),!0)},function(t,r,e){if(null!=(r=Gn(Wt,r,!0))&&r.length){e=Xe(t,e);for(let e=0;e<r.length;e++)We(t.g,r[e]);Ye(t,e)}},gn),yi,-1,[0,gi,-1],Ei,gi,-1,Ci],Ri=[0,3,gi,-1,2,[0,[2],ci,bi,[0,Ai]],[0,Ei,gi,Ei,gi,Ei,4,[0,gi,yi,-1,gi]],[0,[3,4],yi,-1,bi,[0,ci],bi,[0,Ei,-1]],[0]],Wi=[0,yi,-2],Hi=class extends vn{constructor(t){super(t)}},$i=[0],zi=[0,ci,gi,1,gi,-4],Ki=class extends vn{constructor(t){super(t,2)}},Ji={};Ji[336783863]=[0,yi,gi,-1,ci,[0,[1,2,3,4,5,6,7,8,9],bi,$i,bi,Gi,bi,Wi,bi,zi,bi,Mi,bi,[0,yi,-2],bi,[0,yi,Ei],bi,Ri,bi,Ci],[0,yi],gi,[0,[1,3],[2,4],bi,[0,fi],-1,bi,[0,pi],-1,wi,[0,yi,-1]],yi];var Xi=[0,ui,-1,vi,-3,ui,fi,mi,di,ui,-1,vi,di,vi,-2,mi],Yi=class extends vn{constructor(t){super(t,500)}F(t){return zr(this,0,7,t)}},Zi=[-1,{}],qi=[0,yi,1,Zi],Qi=[0,yi,pi,Zi],to=class extends vn{constructor(t){super(t,500)}F(t){return zr(this,0,1001,t)}};to.prototype.i=Ui([-500,wi,[-500,mi,-1,pi,-3,[-2,Ji,gi],wi,Ni,di,-1,qi,Qi,wi,[0,mi,vi],mi,Xi,di,pi,987,pi],4,wi,[-500,yi,-1,[-1,{}],998,yi],wi,[-500,yi,pi,-1,[-2,{},gi],997,pi,-1],di,wi,[-500,yi,pi,Zi,998,pi],pi,di,qi,Qi,wi,[0,mi,-1,Zi],pi,-2,Xi,mi,-1,vi,[0,vi,Ii],978,Zi,wi,Ni]);var ro,eo=class extends vn{constructor(t){super(t)}},no=class extends vn{constructor(t){super(t)}i(){return Hr(this,eo)}},io=[0,wi,[0,ci,ii,yi,-1]],oo=class extends vn{constructor(t){super(t)}},ao=class extends vn{constructor(t){super(t)}i(){var t=this.l,r=0|t[Y],e=so,n=this.l;return e=2===Cr(Fr(n),n,void 0,e)?2:-1,void 0!==Gr(t,r,Di,e)}},so=[1,2,3,4,5,6],uo=class extends vn{constructor(t){super(t)}i(){return null!=Tr(this,1,void 0,Or)}j(){return null!=er(Tr(this,2))}},lo=class extends vn{constructor(t){super(t)}},co=class extends vn{constructor(t){super(t)}};ro=new class{constructor(){var t=Ki;this.g=co,this.j=zr,this.defaultValue=void 0,this.i=null!=t.Ja?at:void 0}register(){p(this)}},Ji[451755788]=[0,[0,[0,_i,yi,[0,ci,ai,-1],[0,li,ai]],gi,[0,so,bi,zi,bi,Gi,bi,Mi,bi,$i,bi,Wi,bi,Ri],Ei],[0,yi,ci,ii,pi,-1],ni];var ho,fo,go=class extends vn{constructor(t){super(t)}},vo=(ho=class extends vn{constructor(t){super(t)}},fo=[0,wi,[0,1,ci,yi,io],ai],(t,r)=>{t:{let n={N:!0};r&&Object.assign(n,r),t=ge(t,void 0,void 0,n);try{let r=new ho,n=r.l;jn(fo)(n,t);var e=r;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{ve(t)}e=void 0}return e});function po(t){return qr(new mo,1,t)}var mo=class extends vn{constructor(t){super(t)}},yo=class extends vn{constructor(t){super(t)}},wo=[0,Ei,2,li,-2,ai,wi,[0,Ei,ai]],bo=class extends vn{constructor(t){super(t)}},_o=class extends vn{constructor(t){super(t)}};function So(t,r){return qr(t,1,r)}function Ao(t,r){return qr(t,2,r)}var Io=class extends vn{constructor(t){super(t)}},Eo=[3,4,5,6,7],To=class extends vn{constructor(t){super(t)}},Bo=class extends vn{constructor(t){super(t)}};Bo.prototype.i=Ui([0,[0,Ei,yi,-3,Ei],[0,Eo,Ei,-1,bi,[0,Ei,yi,li],bi,wo,bi,[0,1,wo],bi,[0,Ei],bi,[0,Ei,yi,li]]]);var Uo={ia:0,fa:1,ga:2,ha:3,ja:4,ka:5,Da:6,Ea:7,oa:8,pa:9,qa:10,sa:11,ta:12,va:13,Aa:14,la:15,ma:16,na:17,wa:18,xa:25,ua:19,ra:20,za:21,ya:22,Ba:23,Ca:24,Ga:26,Fa:27},Po=class{constructor(){this.g="undefined"!=typeof AbortController}async send(t,r,e){var n=this.g?new AbortController:void 0,i=n&&t.M>0?setTimeout(()=>{n.abort()},t.M):void 0;try{let i=await fetch(t.url,{method:t.da,headers:{...t.ca},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.M&&n?n.signal:null});200===i.status?r?.(await i.text()):e?.(i.status)}catch(t){if("AbortError"===t?.name)e?.(408);else e?.(400)}finally{clearTimeout(i)}}},Lo=class extends vn{constructor(t){super(t,37)}},xo=[-4,{},ji,Ei,xi],No=[0,yi,Ei,1,yi,-1,Ei,1,Ei,1,ai],jo=[0,Ei,yi,-2],Oo=[0,yi,Ei],Vo=[0,yi,Ei],ko=[0,gi,-3],Fo=[0,Ei,yi,-1,ai,ci,-1,yi,-5,wi,[0,yi,-4],-1,gi,[0,gi,-3],Ei];var Mo=class extends vn{constructor(t){super(t,19)}},Co=function(t){return r=>Rn(r,t)}([-19,{},[0,Ei,1,[0,yi,-6,ai,ci,yi,-1,ai],1,[0,yi,1,yi,-5],yi,-1,[0,Ei,yi,-8],[0,yi,-3],[0,yi,Ei,yi,-2],[0,yi,-1,Ei,yi,-1,Ei,yi,-1,[0,wi,[0,yi,-1],gi,yi,-5],[0,Ei,gi,ci,-2]],ai,[0,yi,-3,ai,ci,yi,-1],[0,Ei,yi,-1],[0,yi,-9],[0,yi,-6,Ei,yi,1,yi,gi,Ei,-1,gi,yi,-2,Ei,yi,Ei,yi,ci,-1],1,[0,Ei],1,[0,yi,-4],1,No,[0,[1,2,3,4,5,6],bi,No,bi,Oo,bi,Vo,bi,[0,Ei],bi,Fo,bi,jo],Oo,Vo,Fo,[0,[0,Ei,yi,-1,ai,ci,-1,yi,-4,wi,[0,yi,-4],-1,1,ko],[0,Ei,yi,-1,ai,ci,-1,yi,-4,ko]],jo,[0,yi,[0,ci,-3,Ei],Ei,-2,[0,ci,-1],gi],4,[0,yi,Ei,yi,-1,ai,Ei,yi,-1,Ei,ci,-1]],Ei,wi,[-37,{},oi,yi,wi,[0,yi,-1],_i,1,_i,[0,pi,-1,hi,si,-1],yi,[0,ci,yi,-1],gi,ci,ai,yi,-1,Bi,Li,oi,_i,Ei,hi,ai,-1,[0,Ei,-1],yi,gi,yi,fi,yi,-1,ni,1,ni,xo,gi,[0,Ei,[0,ii,ci,-2],[0,ii]],[0,Ei,ai]],oi,Si,yi,-1,oi,Ei,-1,[0,gi,-1,Ei,gi],[0,ai,-1,yi],[0,oi,gi,ai],ai,1,Ai,1,xo]),Do=class{constructor(t){this.i=[],this.m=new Po,this.j=t??"",this.g=setInterval(()=>{this.flush()},6e4)}close(){void 0!==this.g&&(clearInterval(this.g),this.g=void 0),this.flush()}flush(t,r){if(this.error)r?.("net-send-failed");else if(0===this.i.length)t?.();else{var e=this.i;this.i=[],e=function(t){var r=new Mo;{Sr(r=qr(r,2,1786));let l=r.l,c=0|l[Y];if(null==t)Pr(l,c,3);else{var e=t===D?7:0|t[Y],n=e,i=jr(e),o=i||Object.isFrozen(t),a=!0,s=!0;for(let r=0;r<t.length;r++){var u=t[r];i||(u=rt(u),a&&=!u,s&&=u)}i||(e=a?13:5,e=s?-4097&e:4096|e),o&&e===n||(t=Ot(t),n=0,e=Jr(e,c)),e!==n&&Q(t,e),c=Pr(l,c,3,t),2&e||!(4096&e||16&e)||Ar(l,c)}}return r}(e),e=Co(e),this.m.send({url:"https://odml.pa.googleapis.com/v1/log",da:"POST",M:1e4,body:e,Ha:2,ca:{"Content-Type":"application/x-protobuf","x-goog-api-key":this.j},withCredentials:!1},()=>{t?.()},t=>{this.error=Error(`Logging failed with HTTP error: ${t}`),this.i=[],void 0!==this.g&&(clearInterval(this.g),this.g=void 0),r?.("net-send-failed",t)})}}};class Go{constructor(){this.H=this.D=this.B=this.C=this.v=this.A=this.u=0}}function Ro(t,r){var e=new Bo;e=zr(e,0,1,t.U),e=zr(e,0,2,r),r=Ur(r=new Lo,6,nt(e=e.i(),!1)),(t=t.J).error||t.i.push(r)}function Wo(t,r){var e=new yo;return t=Zr(t=Yr(t=qr(e,1,t.S),7,r.C),5,r.D),t=Zr(t,6,r.H),r.v>0&&Zr(t,4,r.B/r.v),0!==r.u&&(e=Yr(e=po(3),2,r.u),Xr(t,8,mo,e)),0!==r.A&&(r=Yr(e=po(4),2,r.A),Xr(t,8,mo,r)),t}var Ho=class{constructor(t,r,e){this.T=performance.now(),this.m=performance.now(),this.i=new Map,this.o=0,this.g=new Go,this.j=new Go,this.J=new Do(e),this.G=Uo["TASKS_"+t.toUpperCase().replace(/_/g,"")]??0,this.S=function(t){switch(t){case"IMAGE":return 11;case"VIDEO":return 12;case"LIVE_STREAM":return 13;case"AUDIO_CLIPS":return 14;case"AUDIO_STREAM":return 15;default:return 10}}(r),t=new To,"undefined"==typeof window?r=0:(r=navigator.userAgent,r=/Android/i.test(r)?1:/iPhone|iPad|iPod/i.test(r)?2:/Windows/i.test(r)?5:/Macintosh/i.test(r)?4:/Linux/i.test(r)?3:0),t=Ur(t=qr(t,1,r),2,rr("")),t=Ur(t,3,rr("")),t=Ur(t,4,rr("1.0.1")),t=Ur(t,5,rr("")),this.U=qr(t,6,4)}aa(){var t=new _o;t=Zr(t=qr(t,1,this.S),3,performance.now()-this.T),Ro(this,t=Kr(Ao(So(new Io,this.G),0),3,Eo,t)),this.m=performance.now()}Z(){var t={u:this.g.u,A:this.g.A,v:this.g.v,C:this.g.C+this.i.size,B:this.g.B,D:this.o,H:performance.now()-this.T},r=new bo;r=zr(r,0,2,t=Wo(this,t)),Ro(this,r=Kr(t=Ao(So(new Io,this.G),2),5,Eo,r))}close(){var t=this.J;"function"==typeof t.close?t.close():t.flush()}};function $o(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function zo(t){if("function"!=typeof importScripts){let r=document.createElement("script");return r.src=t.toString(),r.crossOrigin="anonymous",new Promise((t,e)=>{r.addEventListener("load",()=>{t()},!1),r.addEventListener("error",t=>{e(t)},!1),document.body.appendChild(r)})}try{importScripts(t.toString())}catch(r){if(!(r instanceof TypeError))throw r;{let r=self.import;r?await r(t.toString()):await import(t.toString())}}}function Ko(t,r,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),e(r=t.h.stringToNewUTF8(r)),t.h._free(r)}function Jo(t,r,e){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(r.length);for(let e=0;e<r.length;e++)n[e]=t.h.stringToNewUTF8(r[e]);r=t.h._malloc(4*n.length),t.h.HEAPU32.set(n,r>>2),e(r);for(let r of n)t.h._free(r);t.h._free(r)}function Xo(t,r,e){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[r]=e}function Yo(t,r,e){var n=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[r]=(t,r,i)=>{r?(e(n,i),n=[]):n.push(t)}}var Zo=function(t){return class extends t{get O(){return this.h}X(){if("function"==typeof this.O._mediapipeLoggerGetEncodedApiKey){let t=this.O._mediapipeLoggerGetEncodedApiKey();return this.O._decodeBase64(t)}}}}(function(t){return class extends t{ba(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,r){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==r?this.h.canvas=r:$o()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){var r=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(r),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,r){var e=t.length,n=this.h._malloc(e);this.h.HEAPU8.set(t,n),r?this.h._changeBinaryGraph(e,n):this.h._changeTextGraph(e,n),this.h._free(n)}configureAudio(t,r,e,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Ko(this,n||"input_audio",n=>{Ko(this,i=i||"audio_header",i=>{this.h._configureAudio(n,i,t,r??0,e)})})}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,r){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=r}addAudioToStream(t,r,e){this.addAudioToStreamWithShape(t,0,0,r,e)}addAudioToStreamWithShape(t,r,e,n,i){var o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),Ko(this,n,t=>{this.h._addAudioToInputStream(this.g,r,e,t,i)})}addGpuBufferToStream(t,r,e){Ko(this,r,r=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");r?this.h._bindTextureToStream(r):this.h._bindTextureToCanvas();var n=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);var[a,s]=[i,o];this.h._addBoundTextureToStream(r,a,s,e)})}addBoolToStream(t,r,e){Ko(this,r,r=>{this.h._addBoolToInputStream(t,r,e)})}addDoubleToStream(t,r,e){Ko(this,r,r=>{this.h._addDoubleToInputStream(t,r,e)})}addFloatToStream(t,r,e){Ko(this,r,r=>{this.h._addFloatToInputStream(t,r,e)})}addIntToStream(t,r,e){Ko(this,r,r=>{this.h._addIntToInputStream(t,r,e)})}addUintToStream(t,r,e){Ko(this,r,r=>{this.h._addUintToInputStream(t,r,e)})}addStringToStream(t,r,e){Ko(this,r,r=>{Ko(this,t,t=>{this.h._addStringToInputStream(t,r,e)})})}addStringRecordToStream(t,r,e){Ko(this,r,r=>{Jo(this,Object.keys(t),n=>{Jo(this,Object.values(t),i=>{this.h._addFlatHashMapToInputStream(n,i,Object.keys(t).length,r,e)})})})}addProtoToStream(t,r,e,n){Ko(this,e,e=>{Ko(this,r,r=>{var i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,r,e,n),this.h._free(i)})})}addEmptyPacketToStream(t,r){Ko(this,t,t=>{this.h._addEmptyPacketToInputStream(t,r)})}addBoolVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.h._addBoolVectorEntry(n,r);this.h._addBoolVectorToInputStream(n,r,e)})}addDoubleVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.h._addDoubleVectorEntry(n,r);this.h._addDoubleVectorToInputStream(n,r,e)})}addFloatVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.h._addFloatVectorEntry(n,r);this.h._addFloatVectorToInputStream(n,r,e)})}addIntVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.h._addIntVectorEntry(n,r);this.h._addIntVectorToInputStream(n,r,e)})}addUintVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.h._addUintVectorEntry(n,r);this.h._addUintVectorToInputStream(n,r,e)})}addStringVectorToStream(t,r,e){Ko(this,r,r=>{var n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Ko(this,r,t=>{this.h._addStringVectorEntry(n,t)});this.h._addStringVectorToInputStream(n,r,e)})}addBoolToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addBoolToInputSidePacket(t,r)})}addDoubleToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addDoubleToInputSidePacket(t,r)})}addFloatToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addFloatToInputSidePacket(t,r)})}addIntToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addIntToInputSidePacket(t,r)})}addUintToInputSidePacket(t,r){Ko(this,r,r=>{this.h._addUintToInputSidePacket(t,r)})}addStringToInputSidePacket(t,r){Ko(this,r,r=>{Ko(this,t,t=>{this.h._addStringToInputSidePacket(t,r)})})}addProtoToInputSidePacket(t,r,e){Ko(this,e,e=>{Ko(this,r,r=>{var n=this.h._malloc(t.length);this.h.HEAPU8.set(t,n),this.h._addProtoToInputSidePacket(n,t.length,r,e),this.h._free(n)})})}addBoolVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateBoolVector(t.length);if(!e)throw Error("Unable to allocate new bool vector on heap.");for(let r of t)this.h._addBoolVectorEntry(e,r);this.h._addBoolVectorToInputSidePacket(e,r)})}addDoubleVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateDoubleVector(t.length);if(!e)throw Error("Unable to allocate new double vector on heap.");for(let r of t)this.h._addDoubleVectorEntry(e,r);this.h._addDoubleVectorToInputSidePacket(e,r)})}addFloatVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateFloatVector(t.length);if(!e)throw Error("Unable to allocate new float vector on heap.");for(let r of t)this.h._addFloatVectorEntry(e,r);this.h._addFloatVectorToInputSidePacket(e,r)})}addIntVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateIntVector(t.length);if(!e)throw Error("Unable to allocate new int vector on heap.");for(let r of t)this.h._addIntVectorEntry(e,r);this.h._addIntVectorToInputSidePacket(e,r)})}addUintVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateUintVector(t.length);if(!e)throw Error("Unable to allocate new unsigned int vector on heap.");for(let r of t)this.h._addUintVectorEntry(e,r);this.h._addUintVectorToInputSidePacket(e,r)})}addStringVectorToInputSidePacket(t,r){Ko(this,r,r=>{var e=this.h._allocateStringVector(t.length);if(!e)throw Error("Unable to allocate new string vector on heap.");for(let r of t)Ko(this,r,t=>{this.h._addStringVectorEntry(e,t)});this.h._addStringVectorToInputSidePacket(e,r)})}attachBoolListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachBoolListener(t)})}attachBoolVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachBoolVectorListener(t)})}attachIntListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachIntListener(t)})}attachIntVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachIntVectorListener(t)})}attachUintListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachUintListener(t)})}attachUintVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachUintVectorListener(t)})}attachDoubleListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachDoubleListener(t)})}attachDoubleVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachDoubleVectorListener(t)})}attachFloatListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachFloatListener(t)})}attachFloatVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachFloatVectorListener(t)})}attachStringListener(t,r){Xo(this,t,r),Ko(this,t,t=>{this.h._attachStringListener(t)})}attachStringVectorListener(t,r){Yo(this,t,r),Ko(this,t,t=>{this.h._attachStringVectorListener(t)})}attachProtoListener(t,r,e){Xo(this,t,r),Ko(this,t,t=>{this.h._attachProtoListener(t,e||!1)})}attachProtoVectorListener(t,r,e){Yo(this,t,r),Ko(this,t,t=>{this.h._attachProtoVectorListener(t,e||!1)})}attachAudioListener(t,r,e){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Xo(this,t,(t,e)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),r(t,e)}),Ko(this,t,t=>{this.h._attachAudioListener(t,e||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}})),qo=class extends Zo{};async function Qo(t,r){var e=la,n=await(async(t,r,e,n)=>{if(r&&await zo(r),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(e&&(await zo(e),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((r=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(r.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(e,t.wasmLoaderPath,t.assetLoaderPath,{locateFile:r=>r.endsWith(".wasm")?t.wasmBinaryPath.toString():t.assetBinaryPath&&r.endsWith(".data")?t.assetBinaryPath.toString():r});return function(t,r,e){e=e.Na??"";var n=t.g.X();t.i=new Ho(r,e,n)}(n,e.name,r),await n.F(r),n}async function ta(t,r){return Qo(t,r)}function ra(t,r){var e=Rr(t.baseOptions,uo,1)||new uo;"string"==typeof r?(Ur(e,2,rr(r)),Ur(e,1)):r instanceof Uint8Array&&(Ur(e,1,nt(r,!1)),Ur(e,2)),zr(t.baseOptions,0,1,e)}function ea(t,r){var e=r.baseOptions||{};if(r.baseOptions?.modelAssetBuffer&&r.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Rr(t.baseOptions,uo,1)?.i()||Rr(t.baseOptions,uo,1)?.j()||r.baseOptions?.modelAssetBuffer||r.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,r){var e=Rr(t.baseOptions,ao,3);if(!e){var n=e=new ao,i=new Hi;Kr(n,4,so,i)}"delegate"in r&&("GPU"===r.delegate?(r=e,n=new Di,Kr(r,2,so,n)):(r=e,n=new Hi,Kr(r,4,so,n))),zr(t.baseOptions,0,3,e)}(t,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(r=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(r),!0,!1,!1),ra(t,"/model.dat"),ua(t)});if(e.modelAssetBuffer instanceof Uint8Array)ra(t,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var r=[],e=0;;){let{done:n,value:i}=await t.read();if(n)break;r.push(i),e+=i.length}if(0===r.length)return new Uint8Array(0);if(1===r.length)return r[0];t=new Uint8Array(e),e=0;for(let n of r)t.set(n,e),e+=n.length;return t}(e.modelAssetBuffer).then(r=>{ra(t,r),ua(t)});return ua(t),Promise.resolve()}function na(t){try{let r=t.o.length;if(1===r)throw Error(t.o[0].message);if(r>1)throw Error("Encountered multiple errors: "+t.o.map(t=>t.message).join(", "))}finally{t.o=[]}}var ia=class{constructor(t){this.g=t,this.o=[],this.m=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,r){this.g.attachErrorListener((t,r)=>{this.o.push(Error(r))}),this.g.ba(),this.g.setGraph(t,r),this.i?.aa(),na(this)}finishProcessing(t){if(this.g.finishProcessing(),na(this),this.i&&void 0!==t){var r=this.i,e=r.i.get(t);if(void 0!==e&&(r.i.delete(t),t=performance.now()-e,++r.g.v,r.g.B+=t,r.g.D=Math.max(r.g.D,t),r.o=Math.max(r.o,t),performance.now()>r.m+3e4)){for(let[n,i]of r.i.entries())t=n,i<e&&(r.g.C++,r.i.delete(t));e={u:r.g.u,A:r.g.A,v:r.g.v,C:r.g.C,B:r.g.B,D:r.g.D,H:performance.now()-r.m},r.g.D=0,r.m=performance.now();var n={u:e.u-r.j.u,A:e.A-r.j.A,v:e.v-r.j.v,C:e.C-r.j.C,B:e.B-r.j.B,D:e.D,H:e.H};t=Ao(So(new Io,r.G),1),n=Wo(r,n),Ro(r,t=Kr(t,4,Eo,n)),r.j=e}}}close(){this.i?.Z(),this.i?.close(),this.g.closeGraph()}};async function oa(t,r){return ta(t,r)}ia.prototype.close=ia.prototype.close;var aa=class extends ia{constructor(){super(...arguments),this.J=48e3}ea(t){this.J=t}};function sa(t){var r={classifications:Hr(t,go).map(t=>function(t,r=-1,e=""){return{categories:t.map(t=>({index:Wt(Tr(t,1))??0??-1,score:Tr(t,2,void 0,Dt)??0??0,categoryName:er(Tr(t,3))??""??"",displayName:er(Tr(t,4))??""??""})),headIndex:r,headName:e}}(Rr(t,no,4)?.i()??[],Wt(Tr(t,2))??0,er(Tr(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(gt(t)?t=Number(t):(t=Vt(64,t),t=gt(t)?Number(t):String(t)),t):Rt(t)?"number"==typeof t?zt(t):Jt(t):void 0}(Tr(t,2,void 0,Zt))&&(r.timestampMs=function(t){var r=Number(t);return Number.isSafeInteger(r)?r:String(t)}(Tr(t,2,void 0,Zt)??Er)),r}function ua(t){var r=new to;Qr(r,10,"audio_in"),Qr(r,10,"sample_rate"),Qr(r,15,"timestamped_classifications");var e=new Ki;!function(t,r){var e=ro,n=t.l;W&&W in n&&(n=n[W])&&delete n[451755788],e.g?e.j(t,e.g,451755788,r,e.i):e.j(t,451755788,r,e.i)}(e,t.j);var n=new Yi;!function(t){var r=rr("mediapipe.tasks.audio.audio_classifier.AudioClassifierGraph");Sr(t),Pr(t=t.l,0|t[Y],2,""===r?void 0:r)}(n),Qr(n,3,"AUDIO:audio_in"),Qr(n,3,"SAMPLE_RATE:sample_rate"),Qr(n,4,"TIMESTAMPED_CLASSIFICATIONS:timestamped_classifications"),n.F(e),Xr(r,1,Yi,n),t.g.attachProtoVectorListener("timestamped_classifications",(r,e)=>{!function(t,r){r.forEach(r=>{r=vo(r),t.G.push(sa(r))})}(t,r),t.m=Math.max(t.m,e)}),t.g.attachEmptyPacketListener("timestamped_classifications",r=>{t.m=Math.max(t.m,r)}),r=r.i(),t.setGraph(new Uint8Array(r),!0)}aa.prototype.setDefaultSampleRate=aa.prototype.ea;var la=class extends aa{constructor(t,r){super(new qo(t,r)),this.G=[],zr(t=this.j=new co,0,1,r=new lo)}get baseOptions(){return Rr(this.j,lo,1)}set baseOptions(t){zr(this.j,0,1,t)}F(t){var r=this.j,e=Rr(this.j,oo,2);if(e){var n=e.l;let t=0|n[Y];e=Ir(e,n,t)?yr(e,n,!0):new e.constructor(wr(n,t,!1))}else e=new oo;if(void 0!==t.displayNamesLocale?Ur(e,1,rr(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ur(e,1),void 0!==t.maxResults){if(null!=(n=t.maxResults)){if("number"!=typeof n)throw V("int32");if(!Mt(n))throw V("int32");n|=0}Ur(e,2,n)}else"maxResults"in t&&Ur(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ur(e,3,n)}else"scoreThreshold"in t&&Ur(e,3);return void 0!==t.categoryAllowlist?Vr(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ur(e,4),void 0!==t.categoryDenylist?Vr(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ur(e,5),zr(r,0,2,e),ea(this,t)}W(t,r){r=r??this.J;var e=this.m+1;if(this.i&&void 0!==e)if(Rr(this.baseOptions,ao,3)?.i()){var n=this.i;++n.g.A,n.i.set(e,performance.now())}else++(n=this.i).g.u,n.i.set(e,performance.now());return this.g.addDoubleToStream(r,"sample_rate",e),this.g.addAudioToStreamWithShape(t,1,t.length,"audio_in",e),this.G=[],this.finishProcessing(e),[...this.G]}};la.prototype.classify=la.prototype.W,la.prototype.setOptions=la.prototype.F,la.createFromModelPath=function(t,r){return ta(t,{baseOptions:{modelAssetPath:r}})},la.createFromModelBuffer=function(t,r){return oa(t,{baseOptions:{modelAssetBuffer:r}})},la.createFromOptions=function(t,r){return oa(t,r)};var ca,ha=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 fa(t){if(t)return!0;if(void 0===ca)try{await WebAssembly.instantiate(ha),ca=!0}catch{ca=!1}return ca}async function da(t,r,e){return{wasmLoaderPath:`${r}/${t}_${e=`wasm${e?"_module":""}${await fa(e)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${r}/${t}_${e}.wasm`}}var ga=class{};return ga.forVisionTasks=function(t,r=!1){return da("vision",t??Fi``,r)},ga.forTextTasks=function(t,r=!1){return da("text",t??Fi``,r)},ga.forGenAiTasks=function(t,r=!1){return da("genai",t??Fi``,r)},ga.forAudioTasks=function(t,r=!1){return da("audio",t??Fi``,r)},ga.isSimdSupported=function(t=!1){return fa(t)},t.AudioClassifier=la,t.AudioTaskRunner=aa,t.FilesetResolver=ga,t.TaskRunner=ia,t}({});
2
2
  //# sourceMappingURL=audio_bundle_iife.js.map