@mediapipe/tasks-audio 1.2.0 → 1.2.1-rc.20261030

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