@mediapipe/tasks-text 1.1.0 → 1.1.1-rc.20261008
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/LICENSE +218 -0
- package/NOTICE +32152 -0
- package/README.md +0 -0
- package/package.json +1 -1
- package/text_bundle.cjs +1 -1
- package/text_bundle.cjs.map +1 -1
- package/text_bundle.js +1 -1
- package/text_bundle.js.map +1 -0
- package/text_bundle.mjs +1 -1
- package/text_bundle.mjs.map +1 -1
- package/wasm/text_wasm_internal.js +41 -39
- package/wasm/text_wasm_internal.wasm +0 -0
- package/wasm/text_wasm_module_internal.js +41 -39
- package/wasm/text_wasm_module_internal.wasm +0 -0
- package/wasm/text_wasm_nosimd_internal.js +41 -39
- package/wasm/text_wasm_nosimd_internal.wasm +0 -0
package/README.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/text_bundle.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,s=void 0,a="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var c=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,p=t.navigator;function v(t){return v[" "](t),t}d=p&&p.userAgentData||null,v[" "]=function(){};var g={},m=null;function y(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 n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));g[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,S=!(!(!!c&&(!!d&&d.brands.length>0))&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,_=/[-_.]/g,E={"-":"+",_:"/",".":"="};function A(t){return E[t]||""}function I(t){if(!S)return y(t);t=_.test(t)?t.replace(_,A):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 T={};function j(){return B||=new N(null,T)}function x(t){L(T);var e=t.h;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.h=e}var B,N=class{j(){return new Uint8Array(x(this)||0)}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!==T)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 U=void 0;function P(t){return O(t=Error(t),"warning"),t}function k(e,r){if(null!=e){var n=U??={},i=n[e]||0;i>=r||(n[e]=i+1,O(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var V="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(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 M,R=C("jas",void 0,!0),G=C(void 0,"1oa"),D=C(void 0,Symbol()),z=C(void 0,"0ubs"),$=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","ka",!0),K={ba:{value:0,configurable:!0,writable:!0,enumerable:!1}},q=Object.defineProperties,Y=V?R:"ba",J=[];function X(t,e){V||Y in t||q(t,K),t[Y]|=e}function Q(t,e){V||Y in t||q(t,K),t[Y]=e}Q(J,7),M=Object.freeze(J);var Z={};function tt(t,e){return void 0===e?t.h!==et&&!!(2&t.m[Y]):!!(2&e)&&t.h!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,T):j();else if(t.constructor!==N)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new N(new Uint8Array(t),T):j();else{if(!e)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var ot={};function st(t){return 128&t?ot:void 0}function at(t){return t.ia=!0,t}var ut=at(t=>"number"==typeof t),lt=at(t=>"string"==typeof t),ct=at(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var e=t;if(lt(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 ht?BigInt(t):t=ct(t)?t?"1":"0":lt(t)?t.trim()||"0":String(t)}var dt=at(t=>ht?t>=vt&&t<=mt:"-"===t[0]?yt(t,pt):yt(t,gt)),pt=Number.MIN_SAFE_INTEGER.toString(),vt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,gt=Number.MAX_SAFE_INTEGER.toString(),mt=ht?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 n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var bt,wt="function"==typeof Uint8Array.prototype.slice,St=0,_t=0;function Et(t){var e=t>>>0;St=e,_t=(t-e)/4294967296>>>0}function At(t){if(t<0){Et(-t);let[e,r]=Ut(St,_t);St=e>>>0,_t=r>>>0}else Et(t)}function It(t){var e=bt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),_t=0,St=e.getUint32(0,!0)}function Tt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Bt(t,e)}function jt(t,e){return ft(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Bt(t,e))}function xt(t,e){return F()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Lt(t,e))}function Bt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?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+Nt(r)+Nt(t));return r}function Nt(t){return t=String(t),"0000000".slice(t.length)+t}function Lt(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Ut(t,e);t="-"+Bt(r,n)}else t=Bt(t,e);return t}function Ot(t){if(t.length<16)At(Number(t));else if(F())t=BigInt(t),St=Number(t&BigInt(4294967295))>>>0,_t=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);_t=St=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));_t*=1e6,(St=1e6*St+e)>=4294967296&&(_t+=Math.trunc(St/4294967296),_t>>>=0,St>>>=0)}if(e){let[t,e]=Ut(St,_t);St=t,_t=e}}}function Ut(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Pt(t){return Array.prototype.slice.call(t)}var kt="function"==typeof BigInt?BigInt.asIntN:void 0,Ft="function"==typeof BigInt?BigInt.asUintN:void 0,Vt=Number.isSafeInteger,Ct=Number.isFinite,Mt=Math.trunc;function Rt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Gt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var Dt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zt(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return Dt.test(t);default:return!1}}function $t(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(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:(Ot(t),Lt(St,_t))}function Ht(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Ot(t),Bt(St,_t))}function Kt(t){if(t=Mt(t),!Vt(t)){At(t);var e=St,r=_t;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Tt(e,r))?t?-e:e:t?"-"+e:e}return t}function qt(t){return(t=Mt(t))>=0&&Vt(t)||(At(t),t=Tt(St,_t)),t}function Yt(t){var e=Mt(Number(t));return Vt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Jt(t){var e=Mt(Number(t));return Vt(e)?ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),F()?ft(kt(64,BigInt(t))):ft(Wt(t)))}function Xt(t){return Vt(t)?t=ft(Kt(t)):(t=Mt(t),Vt(t)?t=String(t):(At(t),t=Lt(St,_t)),t=ft(t)),t}function Qt(t){var e=typeof t;return null==t?t:"bigint"===e?ft(kt(64,t)):zt(t)?"string"===e?Jt(t):Xt(t):void 0}function Zt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(kt(64,t));if(zt(t)){if("string"===e)return Yt(t);if("number"===e)return Kt(t)}}function te(t){if(null==t||"string"==typeof t||t instanceof N)return t}function ee(t){if("string"!=typeof t)throw Error();return t}function re(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function ne(t){return null==t||"string"==typeof t?t:void 0}function ie(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[Y];return(r=n|32&r|2&r)!==n&&Q(t,r),new e(t)}}function oe(t){return t}function se(t){return D?t[D]:void 0}function ae(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ue,le,ce,he=class{};function fe(t,e){e<100||k(z,1)}function de(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=D;!i&&V&&s&&(o=t[s])&&ae(o,fe),s=[];var a=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!l||128&e||i||(u=!0,o=(ue??oe)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&D&&(t=se(t))&&t instanceof he&&(s[D]=function(t){var e=new he;return ae(t,(t,r,n)=>{e[r]=Pt(n)}),e.h=t.h,e}(t)),s}function pe(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:de(t,e,pe)}if(null!=t&&t[H]===Z)return ve(t);if(t instanceof N){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(S){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=g[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,l=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[l++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.h=e}return t}return}return t}function ve(t){return de(t=t.m,0|t[Y],pe)}function ge(t,e){return me(t,e[0],e[1])}function me(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");k(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var o=(r=t).length;if(o){var s=o-1;let t=r[s];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((s-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(o=+a)<s&&(r[o+e]=t[a],delete t[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return Q(t,64|i|n),t}function ye(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=Se(t,r,!1,e&&!(16&r)):(X(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.m)[Y])?t:Te(t,e,r)?be(t,e):Se(e,r):t instanceof N?t:void 0}function be(t,e,r){return t=new t.constructor(e),r&&(t.h=et),t.o=et,t}function we(t){var e=t.m,r=0|e[Y];return Te(t,e,r)?be(t,e,!0):new t.constructor(Se(e,r,!1))}function Se(t,e,r,n){return n??=!!(34&e),t=de(t,e,ye,n),n=32,r&&(n|=2),Q(t,e=16769217&e|n),t}function _e(t){var e=t.m,r=0|e[Y];return tt(t,r)?Te(t,e,r)?be(t,e,!0):new t.constructor(Se(e,r,!1)):t}function Ee(t){if(t.h!==et)return!1;var e=t.m;return X(e=Se(e,0|e[Y]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ae(t){if(!Ee(t)&&tt(t,0|t.m[Y]))throw Error()}function Ie(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=et,!0)}var je=ft(0);function xe(t,e,r,n){if(null!==(t=Be(t.m,e,r,n)))return t}function Be(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Ne(t,e,r,n){Ae(t);var i=t.m;return Le(i,0|i[Y],e,r,n),t}function Le(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Oe(t,e,r,n){var i=t.m;return void 0!==Ke(i,0|i[Y],e,t=De(t,n)===r?r:-1)}function Ue(t,e,r,n,i){var o=t.m,s=0|o[Y];n=tt(t,s)?1:n,i=!!i||3===n,2===n&&Ee(t)&&(s=0|(o=t.m)[Y]);var a=(t=ke(o,e))===M?7:0|t[Y],u=Fe(a,s),l=!(4&u);if(l){4&u&&(t=Pt(t),a=0,u=tr(u,s),s=Le(o,s,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Q(t,u),2&u&&Object.freeze(t)),Pe(t,u,o,s,e,n,l,i)}function Pe(t,e,r,n,i,o,s,a){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Ve(e)||((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Q(t,e),Object.freeze(t)):(2===o&&Ve(e)&&(t=Pt(t),u=0,e=tr(e,n),n=Le(r,n,i,t)),Ve(e)||(a||(e|=16),e!==u&&Q(t,e))),2&e||!(4096&e||16&e)||Ie(r,n),t}function ke(t,e,r){return t=Be(t,e,r),Array.isArray(t)?t:M}function Fe(t,e){return 2&e&&(t|=2),1|t}function Ve(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Ce(t){return rt(t,!0)}function Me(t,e,r){Ae(t);var n=0|(t=t.m)[Y];if(null==r)Le(t,n,e);else{var i=r===M?7:0|r[Y],o=i,s=Ve(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Pt(r),o=0,i=tr(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=ee(t);Object.is(t,e)||(a&&(r=Pt(r),o=0,i=tr(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Pt(r),i=tr(i,n)),Q(r,i)),Le(t,n,e,r)}}function Re(t,e){Ae(t),Le(t=t.m,0|t[Y],2,""===e?void 0:e)}function Ge(t,e,r){if(2&e)throw Error();var n=st(e),i=ke(t,r,n),o=i===M?7:0|i[Y],s=Fe(o,e);return(2&s||Ve(s)||16&s)&&(s===o||Ve(s)||Q(i,s),i=Pt(i),o=0,s=tr(s,e),Le(t,e,r,i,n)),(s&=-13)!==o&&Q(i,s),i}function De(t,e){return We(ze(t=t.m),t,void 0,e)}function ze(t){if(V)return t[G]??(t[G]=new Map);if(G in t)return t[G];var e=new Map;return Object.defineProperty(t,G,{value:e}),e}function $e(t,e,r,n,i){var o=ze(t),s=We(o,t,e,r,i);return s!==n&&(s&&(e=Le(t,e,s,void 0,i)),o.set(r,n)),e}function We(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=Be(e,s,i)&&(0!==o&&(r=Le(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function He(t,e,r){var n=0|t[Y],i=st(n),o=Be(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return Ee(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o);if(s){let t=0|s[Y];2&t&&(s=Se(s,t))}return(s=ge(s,e))!==o&&Le(t,n,r,s,i),s}function Ke(t,e,r,n){var i=!1;if(null!=(n=Be(t,n,void 0,t=>{var n=ie(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&Ie(t,e),n}function qe(t,e,r){var n=t.m,i=0|n[Y];if(null==(e=Ke(n,i,e,r)))return e;if(!tt(t,i=0|n[Y])){let o=_e(e);o!==e&&(Ee(t)&&(i=0|(n=t.m)[Y]),Ie(n,i=Le(n,i,r,e=o)))}return e}function Ye(t,e,r,n,i,o,s,a){var u=tt(t,r);o=u?1:o,s=!!s||3===o,u=a&&!u,(2===o||u)&&Ee(t)&&(r=0|(e=t.m)[Y]);var l=(t=ke(e,i))===M?7:0|t[Y],c=Fe(l,r);if(a=!(4&c)){var h=t,f=r;let e=!!(2&c);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=ie(h[s],n,f);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Q(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Ve(c)&&(t=Pt(t),c=tr(c,r),r=Le(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=_e(h))&&(n[l]=c);u|=8,Q(t,c=u=n.length?4096|u:-4097&u)}return Pe(t,c,e,r,i,o,a,s)}function Je(t,e){var r=t.m;return Ye(t,r,0|r[Y],e,1,void 0===nt?2:4,!1,!0)}function Xe(t){return null==t&&(t=void 0),t}function Qe(t,e,r,n,i){return Ne(t,r,n=Xe(n),i),n&&!tt(n)&&Ie(t.m),t}function Ze(t,e,r,n){t:{var i=n=Xe(n);Ae(t);let o=t.m,s=0|o[Y];if(null==i){let t=ze(o);if(We(t,o,s,r)!==e)break t;t.set(r,0)}else s=$e(o,s,r,e);Le(o,s,e,i)}return n&&!tt(n)&&Ie(t.m),t}function tr(t,e){return-273&(2&e?2|t:-3&t)}function er(t,e,r,n){Ae(t);var i=t.m;t=Ye(t,i,0|i[Y],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===M?7:0|t[Y],(n=tt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Q(t,r),n||Ie(i)}function rr(t,e,r,n){return qe(t,e,r=De(t,n)===r?r:-1)}function nr(t,e,r){if(null!=r)t:{if(!zt(r))throw P("int64");switch(typeof r){case"string":r=Jt(r);break t;case"bigint":r=ft(kt(64,r));break t;default:r=Xt(r)}}return Ne(t,e,r)}function ir(t,e,r){return Ne(t,e,null==r?r:function(t){if(!zt(t))throw P("uint64");switch(typeof t){case"string":var e=Mt(Number(t));return Vt(e)&&e>=0?t=ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ft(Ft(64,BigInt(t))):ft(Ht(t))),t;case"bigint":return ft(Ft(64,t));default:return Vt(t)?t=ft(qt(t)):((t=Mt(t))>=0&&Vt(t)?t=String(t):(At(t),t=Bt(St,_t)),t=ft(t)),t}}(r))}function or(t,e,r){if(null!=r){if(!Ct(r))throw P("enum");r|=0}return Ne(t,e,r)}function sr(t,e,r){Ae(t),Ue(t,e,ne,2,!0).push(ee(r))}var ar=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function ur(t,e){if("string"==typeof t)return new ar(I(t),e);if(Array.isArray(t))return new ar(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ar(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ar(t,!1);if(t.constructor===N)return e=x(t)||new Uint8Array(0),new ar(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ar(t,!1);throw Error()}function lr(t,e){var r=0,n=0,i=0,o=t.j,s=t.h;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(gr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function cr(t){for(var e=0,r=t.h,n=r+10,i=t.j;r<n;){let n=i[r++];if(e|=n,!(128&n))return gr(t,r),!!(127&e)}throw Error()}function hr(t){var e=t.j,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return gr(t,r),i}function fr(t){return lr(t,xt)}function dr(t){var e=t.j,r=t.h,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],gr(t,t.h+4),(n|i<<8|o<<16|e<<24)>>>0}function pr(t){var e=dr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function vr(t){return hr(t)}function gr(t,e){if(t.h=e,e>t.l)throw Error()}function mr(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 yr(t,e){if(0==e)return j();var r=mr(t,e);return t.M&&t.v?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?j():new N(r,T)}var br=class{constructor(t,e,r,n){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,P:i=!1}={}){this.M=n,this.P=i,t&&(t=ur(t,this.P),this.j=t.buffer,this.v=t.h,this.o=e||0,this.l=void 0!==r?this.o+r:this.j.length,this.h=this.o)}clear(){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.M=!1}},wr=[],Sr=0;function _r(t,e,r,n){if(Or.length){let i=Or.pop();return i.u(n),i.h.init(t,e,r,n),i}return new Lr(t,e,r,n)}function Er(t){t.h.clear(),t.l=-1,t.j=-1,Or.length<100&&Or.push(t)}function Ar(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=hr(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 Ir(t){try{switch(t.j){case 0:0!=t.j?Ir(t):cr(t.h);break;case 1:var e=t.h;gr(e,e.h+8);break;case 2:if(2!=t.j)Ir(t);else{var r=hr(t.h)>>>0,n=t.h;gr(n,n.h+r)}break;case 5:var i=t.h;gr(i,i.h+4);break;case 3:Tr();let o=t.l;try{for(;;){if(!Ar(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}Ir(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Sr>0&&Sr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function Tr(){if(Sr>=100)throw new SyntaxError;Sr++}function jr(t,e,r){var n=t.h.l,i=hr(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,r(e,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function xr(t){var e=hr(t.h)>>>0,o=mr(t=t.h,e);if(t=t.j,a){var u,l=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=o+e,l=0===o&&e===l.length?l:l.subarray(o,e);try{var c=u.decode(l)}catch(t){if(void 0===s){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(i=void 0),t}}else{e=(c=o)+e,o=[];let i,s=null;for(;c<e;){var h=t[c++];h<128?o.push(h):h<224?c>=e?r():(i=t[c++],h<194||128!=(192&i)?(c--,r()):o.push((31&h)<<6|63&i)):h<240?c>=e-1?r():(i=t[c++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[c++]))?(c--,r()):o.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?c>=e-2?r():(i=t[c++],128!=(192&i)||i-144+(h<<28)>>30||128!=(192&(u=t[c++]))||128!=(192&(l=t[c++]))?(c--,r()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&l,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):r(),o.length>=8192&&(s=n(s,o),o.length=0)}c=n(s,o)}return c}function Br(t){var e=hr(t.h)>>>0;return yr(t.h,e)}function Nr(t,e,r){var n=hr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Lr=class{constructor(t,e,r,n){if(wr.length){let i=wr.pop();i.init(t,e,r,n),t=i}else t=new br(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.u(n)}u({T:t=!1}={}){this.T=t}},Or=[];function Ur(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}function Pr(t){return t?/^\d+$/.test(t)?(Ot(t),new Fr(St,_t)):null:kr||=new Fr(0,0)}var kr,Fr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Vr(t){return new Kr(4294967295&t,Math.floor(t/4294967296))}function Cr(t){return t?/^-?\d+$/.test(t)?(Ot(t),new Kr(St,_t)):null:Mr||=new Kr(0,0)}var Mr,Rr,Gr,Dr,zr,$r,Wr,Hr,Kr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function qr(t,e,r){return"undefined"!=typeof BigInt64Array?(Wr||(Wr=new BigInt64Array(1),Hr=new Uint32Array(Wr.buffer),Wr[0]=BigInt(1),$r=1===Hr[0]),Wr[0]=t,new e(Hr[t=$r?0:1],Hr[1-t])):(zr||(Rr=BigInt(Number.MIN_SAFE_INTEGER),Gr=BigInt(Number.MAX_SAFE_INTEGER),Dr=BigInt(4294967295),zr=BigInt(32)),t>=Rr&&t<=Gr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Dr),Number(t>>zr))))}function Yr(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 Jr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Xr(t,e){if(e>=0)Jr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Qr(t,e){Ot(e),function(t){var e=_t>>31;t(St<<1^e,(_t<<1|St>>>31)^e)}((e,r)=>{Yr(t,e>>>0,r>>>0)})}function Zr(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 tn=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function en(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function rn(t,e,r){Jr(t.h,8*e+r)}function nn(t,e){return rn(t,e,2),e=t.h.end(),en(t,e),e.push(t.j),e}function on(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 sn(t,e,r){if(null!=r)switch(rn(t,e,0),typeof r){case"number":t=t.h,At(r),Yr(t,St,_t);break;case"bigint":r=qr(r,Kr,Vr),Yr(t.h,r.j,r.h);break;default:r=Cr(r),Yr(t.h,r.j,r.h)}}function an(t,e,r){rn(t,e,2),Jr(t.h,r.length),en(t,t.h.end()),en(t,r)}var un=class{constructor(){this.l=[],this.j=0,this.h=new tn}};function ln(t){if("string"==typeof t)Cr(t)}function cn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var hn=cn(),fn=cn(),dn=cn(),pn=cn(),vn=cn(),gn=cn(),mn=cn(),yn=cn(),bn=cn(),wn=cn(),Sn=cn(),_n=cn();function En(t,e,r){var n=t.m;D&&D in n&&(n=n[D])&&delete n[e.h],e.j?e.o(t,e.j,e.h,r,e.l):e.o(t,e.h,r,e.l)}var An=class{constructor(t,e){this.m=me(t,e,void 0,2048)}toJSON(){return ve(this)}};An.prototype[H]=Z,An.prototype.toString=function(){return this.m.toString()};var In=class{constructor(t,e,r){this.h=t,this.j=e,t=hn,this.l=!!t&&r===t||!1}};function Tn(t,e){return new In(t,e,hn)}function jn(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}var xn,Bn,Nn=Tn(function(t,e,r,n,i){return 2===t.j&&(jr(t,He(e,n,r),i),!0)},jn),Ln=Tn(function(t,e,r,n,i){return 2===t.j&&(jr(t,He(e,n,r),i),!0)},jn),On=Symbol(),Un=Symbol(),Pn=Symbol(),kn=Symbol(),Fn=Symbol();function Vn(t,e,r,n){var i=n[t];if(i)return i;(i={}).W=n,i.L=function(t){switch(typeof t){case"boolean":return le||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ce||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.N=o,"function"==typeof(o=n[++s])&&(i.U=!0,xn??=o,Bn??=n[s+1],o=n[s+=2]));for(var a={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof In?t=o:(t=Nn,s--),t?.l){o=n[++s],l=n;var c=s;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++s])&&o<0&&(c-=o,o=n[++s]);u<c;u++){let n=a[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Cn(t){return Array.isArray(t)?t[0]instanceof In?t:[Ln,t]:[t,void 0]}function Mn(t,e){return t instanceof An?t.m:Array.isArray(t)?ge(t,e):void 0}function Rn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Gn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Vn(Un,Rn,Gn,n).L,o||=Dn(n),i)}function Dn(t){var e=t[Pn];if(null!=e)return e;var r=Vn(Un,Rn,Gn,t);return e=r.U?(t,e)=>xn(t,e,r):(t,e)=>{t:{Tr();try{for(;Ar(e)&&4!=e.j;){let u=e.l,l=r[u];if(null==l){let t=r.N;if(t){let e=t[u];if(e){let t=$n(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.o;if(Ir(n),n.T)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=yr(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[D]??(o[D]=new he))[s]??(n[s]=[])).push(a)}}let l=se(t);l&&(l.h=r.W[Fn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Sr>0&&Sr--}u=void 0}return u},t[Pn]=e,t[Fn]=zn.bind(t),e}function zn(t,e,r,n){var i=this[Un],o=this[Pn],s=ge(void 0,i.L),a=se(t);if(a){var u=!1,l=i.N;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=_r(t);try{u=!0,o(s,e)}finally{Er(e)}}else n?.(t,r,i)},null==e)ae(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!r?.ma)throw Error();let i=st(n),o=(e,o)=>{if(null!=Be(t,e,i)){if(1===r?.la)return;throw Error()}null!=o&&(n=Le(t,n,e,o,i)),delete a[e]};null==e?it(s,0|s[Y],(t,e)=>{o(t,e)}):o(e,Be(s,e,i))}}}}function $n(t){var e=(t=Cn(t))[0].h;if(t=t[1]){let r=Dn(t),n=Vn(Un,Rn,Gn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function Wn(t,e,r){t[e]=r.j}function Hn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Vn(On,Wn,Hn,n).L,i||=Kn(n))}function Kn(t){var e=t[kn];if(!e){let r=Vn(On,Wn,Hn,t);e=(t,e)=>qn(t,e,r),t[kn]=e}return e}function qn(t,e,r){it(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.N)&&(r=r[e])){var n=(r=Cn(r))[0].j;if(r=r[1]){let e=Kn(r),i=Vn(On,Wn,Hn,r).L;r=t.U?Bn(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||k($,3)}}),(t=se(t))&&ae(t,(t,r,n)=>{for(en(e,e.h.end()),t=0;t<n.length;t++)en(e,x(n[t])||new Uint8Array(0))})}var Yn=ft(0);function Jn(t,e,r){if(Array.isArray(e)){var n=0|e[Y];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Q(e,t),r&&2&t&&Object.freeze(e),e}}var Xn=(t,e)=>{var r=new un;qn(t.m,r,Vn(On,Wn,Hn,e)),en(r,r.h.end()),t=new Uint8Array(r.j);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Qn(t,e,r){return new In(t,e,r)}function Zn(t,e,r){return new In(t,e,r)}function ti(t,e,r){Le(t,0|t[Y],e,r,st(0|t[Y]))}function ei(t,e,r){null!=(e=Zt(e))&&(ln(e),sn(t,r,e))}function ri(t,e,r){null!=(e=$t(e))&&null!=e&&(rn(t,r,0),Xr(t.h,e))}function ni(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(rn(t,r,0),t.h.h.push(e?1:0))}function ii(t,e,r){null!=(e=ne(e))&&an(t,r,l(e))}function oi(t,e,r,n,i){null!=(e=Mn(e,n))&&(r=nn(t,r),i(e,t),on(t,r))}function si(t,e,r){null!=(e=te(e))&&an(t,r,ur(e,!0).buffer)}function ai(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 Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(rn(t,r,0),Jr(t.h,e))}function ui(t,e,r){null!=(e=$t(e))&&(e=parseInt(e,10),rn(t,r,0),Xr(t.h,e))}function li(t,e,r){return 0===t.j&&(ti(e,r,fr(t.h)),!0)}function ci(t,e,r){return(0===t.j||2===t.j)&&(e=Ge(e,0|e[Y],r),2==t.j?Nr(t,hr,e):e.push(hr(t.h)),!0)}function hi(t,e,r){return 2===t.j&&(ti(e,r,(t=Br(t))===j()?void 0:t),!0)}var fi=Qn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=dr(n);var i=dr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ti(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Rt(e))&&(rn(t,r,1),t=t.h,(r=bt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),St=r.getUint32(0,!0),_t=r.getUint32(4,!0),Zr(t,St),Zr(t,_t))},wn),di=Qn(function(t,e,r){return 5===t.j&&(ti(e,r,pr(t.h)),!0)},function(t,e,r){null!=(e=Rt(e))&&(rn(t,r,5),t=t.h,It(e),Zr(t,St))},bn),pi=Zn(function(t,e,r){return(5===t.j||2===t.j)&&(e=Ge(e,0|e[Y],r),2==t.j?Nr(t,pr,e):e.push(pr(t.h)),!0)},function(t,e,r){if(null!=(e=Jn(Rt,e,!0))&&e.length){rn(t,r,2),Jr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,It(e[n]),Zr(r,St)}},bn),vi=Qn(function(t,e,r){return li(t,e,r)},ei,gn),gi=Qn(function(t,e,r){return li(t,e,r)},ei,gn),mi=Zn(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=Ge(e,0|e[Y],r),2==t.j?Nr(t,fr,e):e.push(fr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Jn(Zt,e,!1)))for(let n=0;n<e.length;n++)sn(t,r,e[n])},gn),yi=Qn(function(t,e,r){return 0!==t.j?e=!1:(ti(e,r,(t=fr(t.h))===Yn?void 0:t),e=!0),e},ei,gn),bi=Qn(function(t,e,r){return 0!==t.j?t=!1:(ti(e,r,lr(t.h,jt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ft(64,t));if(zt(t)){if("string"===e)return e=Mt(Number(t)),Vt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=Ht(t)),t;if("number"===e)return qt(t)}}(e),null!=e){if("string"==typeof e)Pr(e);if(null!=e)switch(rn(t,r,0),typeof e){case"number":t=t.h,At(e),Yr(t,St,_t);break;case"bigint":r=qr(e,Fr,Ur),Yr(t.h,r.j,r.h);break;default:r=Pr(e),Yr(t.h,r.j,r.h)}}},mn),wi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)),!0)},ri,pn),Si=Zn(ci,function(t,e,r){if(null!=(e=Jn($t,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(rn(n,i,0),Xr(n.h,o))}},pn),_i=Zn(ci,function(t,e,r){if(null!=(e=Jn($t,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.h,e[r]);on(t,r)}},pn),Ei=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h))?void 0:t),!0)},ri,pn),Ai=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,cr(t.h)),!0)},ni,fn),Ii=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,!1===(t=cr(t.h))?void 0:t),!0)},ni,fn),Ti=Zn(function(t,e,r){return 2===t.j&&(t=xr(t),Ge(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Jn(ne,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,l(o))}},dn),ji=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,""===(t=xr(t))?void 0:t),!0)},ii,dn),xi=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,xr(t)),!0)},ii,dn),Bi=function(t,e,r=hn){return new In(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ge(void 0,n),Ge(e,0|e[Y],r).push(n),jr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)oi(t,e[o],r,n,i);1&(t=0|e[Y])||Q(e,1|t)}}),Ni=Tn(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[Y];return $e(e,s,o,r,st(s)),jr(t,e=He(e,n,r),i),!0},oi),Li=Qn(function(t,e,r){return 2===t.j&&(ti(e,r,Br(t)),!0)},si,Sn),Oi=Zn(function(t,e,r){return 2===t.j&&(t=Br(t),Ge(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Jn(te,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&an(n,i,ur(o,!0).buffer)}},Sn),Ui=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)>>>0),!0)},ai,vn),Pi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h)>>>0)?void 0:t),!0)},ai,vn),ki=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,hr(t.h)),!0)},ui,_n),Fi=Qn(function(t,e,r){return 0===t.j&&(ti(e,r,0===(t=hr(t.h))?void 0:t),!0)},ui,_n),Vi=Qn(function(t,e,r){return 0!==t.j?t=!1:(ti(e,r,function(t){return lr(t,(t,e)=>{var r=-(1&t);return xt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Zt(e))&&(ln(e),null!=e))switch(rn(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,Et(r=2*Math.abs(r)),r=St;let n=_t;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Yr(t,St=r,_t=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),St=Number(BigInt.asUintN(32,e)),_t=Number(BigInt.asUintN(32,e>>BigInt(32))),Yr(t,St,_t);break;default:Qr(t.h,e)}},yn);class Ci{constructor(t,e){var r=ao;this.h=t,this.j=e,this.o=Qe,this.defaultValue=void 0,this.l=null!=r.ja?ot:void 0}register(){v(this)}}function Mi(t,e){return(r,n)=>{t:{let o={P:!0};n&&Object.assign(o,n),r=_r(r,void 0,void 0,o);try{let n=new t,o=n.m;Dn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Er(r)}i=void 0}return i}}function Ri(t){return function(){return Xn(this,t)}}var Gi,Di=[0,Li,Oi,Ai,xi],zi=[0,ji,[0,Fi,[0,yi,Ei],Fi,-1,[0,ki],Fi,-1],Qn(hi,si,Sn)],$i=[0,ji,Qn(hi,function(t,e,r){if(null!=e){if(e instanceof An){let n=e.oa;return void(n?(e=n(e),null!=e&&an(t,r,ur(e,!0).buffer)):k($,3))}if(Array.isArray(e))return void k($,3)}si(t,e,r)},Sn)],Wi=[0,1,[0,12,wi,10,Ai],[0,7,[0,wi,-1]]],Hi=globalThis.trustedTypes;var Ki=class{constructor(t){this.h=t}toString(){return this.h+""}};function qi(t){var e;return void 0===Gi&&(Gi=function(){var t=null;if(!Hi)return t;try{let e=t=>t;t=Hi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Gi)?e.createScriptURL(t):t,new Ki(t)}function Yi(t,...e){if(0===e.length)return qi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return qi(r)}var Ji=[0,wi,ki,Ai,-1,_i,ki,-1,Ai,-1],Xi=[0,ki,-1,Ai],Qi=class extends An{constructor(t){super(t)}},Zi=[0,Ai,xi,Ai,ki,-1,Zn(function(t,e,r){return(0===t.j||2===t.j)&&(e=Ge(e,0|e[Y],r),2==t.j?Nr(t,vr,e):e.push(hr(t.h)),!0)},function(t,e,r){if(null!=(e=Jn($t,e,!0))&&e.length){r=nn(t,r);for(let r=0;r<e.length;r++)Xr(t.h,e[r]);on(t,r)}},_n),xi,-1,[0,Ai,-1],ki,Ai,-1,Xi],to=class extends An{constructor(t){super(t)}},eo=class extends An{constructor(t){super(t)}j(){var t=this.m;return void 0!==Ke(t,0|t[Y],to,9)}},ro=[0,3,Ai,-1,2,[0,[2],wi,Ni,[0,Ui]],[0,ki,Ai,ki,Ai,ki,4,[0,Ai,xi,-1,Ai]],[0,[3,4],xi,-1,Ni,[0,wi],Ni,[0,ki,-1]],[0],xi],no=[0,xi,-2],io=class extends An{constructor(t){super(t)}},oo=[0],so=[0,wi,Ai,1,Ai,-4],ao=class extends An{constructor(t){super(t,2)}},uo={};uo[336783863]=[0,xi,Ai,-1,wi,[0,[1,2,3,4,5,6,7,8,9],Ni,oo,Ni,Zi,Ni,no,Ni,so,Ni,Ji,Ni,[0,xi,-2],Ni,[0,xi,ki],Ni,ro,Ni,Xi],[0,xi],Ai,[0,[1,3],[2,4],Ni,[0,_i],-1,Ni,[0,Ti],-1,Bi,[0,xi,-1]],xi];var lo=[0,yi,-1,Ii,-3,yi,_i,ji,Ei,yi,-1,Ii,Ei,Ii,-2,ji];function co(t){sr(t,3,"TEXT:text_in")}var ho=class extends An{constructor(t){super(t,500)}u(t){return Qe(this,0,7,t)}},fo=[-1,{}],po=[0,xi,1,fo],vo=[0,xi,Ti,fo];function go(t){sr(t,10,"text_in")}var mo=class extends An{constructor(t){super(t,500)}u(t){return Qe(this,0,1001,t)}};mo.prototype.j=Ri([-500,Bi,[-500,ji,-1,Ti,-3,[-2,uo,Ai],Bi,$i,Ei,-1,po,vo,Bi,[0,ji,Ii],ji,lo,Ei,Ti,987,Ti],4,Bi,[-500,xi,-1,[-1,{}],998,xi],Bi,[-500,xi,Ti,-1,[-2,{},Ai],997,Ti,-1],Ei,Bi,[-500,xi,Ti,fo,998,Ti],Ti,Ei,po,vo,Bi,[0,ji,-1,fo],Ti,-2,lo,ji,-1,Ii,[0,Ii,Pi],978,fo,Bi,$i]);var yo=class extends An{constructor(t){super(t)}},bo=class extends An{constructor(t){super(t)}j(){return Je(this,yo)}},wo=class extends An{constructor(t){super(t)}},So=Mi(class extends An{constructor(t){super(t)}},[0,Bi,[0,1,wi,xi,[0,Bi,[0,wi,di,xi,-1]]],gi]),_o=class extends An{constructor(t){super(t)}},Eo=class extends An{constructor(t){super(t)}j(){var t=xe(this,1,void 0,Ce);return null==t?j():t}},Ao=class extends An{constructor(t){super(t)}},Io=[1,2],To=Mi(class extends An{constructor(t){super(t)}},[0,Bi,[0,Io,Ni,[0,pi],Ni,[0,Li],wi,xi],gi]),jo=class extends An{constructor(t){super(t)}},xo=class extends An{constructor(t){super(t)}},Bo=[0,Ai,-1],No=class extends An{constructor(t){super(t)}j(){return Oe(this,Qi,2,Lo)}l(){return rr(this,eo,6,Lo)}},Lo=[1,2,3,4,5,6],Oo=class extends An{constructor(t){super(t)}j(){return null!=xe(this,1,void 0,Ce)}l(){return null!=ne(xe(this,2))}},Uo=class extends An{constructor(t){super(t)}},Po=[0,Li,xi,[0,wi,gi,-1],[0,bi,gi]],ko=[0,Po,Ai,[0,Lo,Ni,so,Ni,Zi,Ni,Ji,Ni,oo,Ni,no,Ni,ro],ki],Fo=class extends An{constructor(t){super(t)}},Vo=new Ci(462704549,Fo);uo[462704549]=[0,ko,[0,xi,wi,di,Ti,-1]];var Co=class extends An{constructor(t){super(t)}},Mo=new Ci(477589892,Co);function Ro(t,e){if(e=e?we(e):new jo,void 0!==t.displayNamesLocale?Ne(e,1,re(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ne(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw P("int32");if(!Ct(r))throw P("int32");r|=0}Ne(e,2,r)}else"maxResults"in t&&Ne(e,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Ne(e,3,r)}else"scoreThreshold"in t&&Ne(e,3);return void 0!==t.categoryAllowlist?Me(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ne(e,4),void 0!==t.categoryDenylist?Me(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ne(e,5),e}function Go(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Do(t){var e={classifications:Je(t,wo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:$t(xe(t,1))??0??-1,score:xe(t,2,void 0,Rt)??0??0,categoryName:ne(xe(t,3))??""??"",displayName:ne(xe(t,4))??""??""})),headIndex:e,headName:r}}(qe(t,bo,4)?.j()??[],$t(xe(t,2))??0,ne(xe(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):zt(t)?"number"==typeof t?Kt(t):Yt(t):void 0}(xe(t,2,void 0,Qt))&&(e.timestampMs=Go(xe(t,2,void 0,Qt)??je)),e}function zo(t){return Array.from(t,t=>t>127?t-256:t)}function $o(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}uo[477589892]=[0,ko,Bo,1,Po];var Wo,Ho=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function Ko(t){if(t)return!0;if(void 0===Wo)try{await WebAssembly.instantiate(Ho),Wo=!0}catch{Wo=!1}return Wo}async function qo(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Ko(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var Yo=class{};function Jo(t){return or(new Xo,1,t)}Yo.forVisionTasks=function(t,e=!1){return qo("vision",t??Yi``,e)},Yo.forLiteRtLmTextTasks=function(t,e=!1){return qo("litertlm_text",t??Yi``,e)},Yo.forTextTasks=function(t,e=!1){return qo("text",t??Yi``,e)},Yo.forRetrievalTasks=function(t,e=!1){return qo("retrieval",t??Yi``,e)},Yo.forGenAiTasks=function(t,e=!1){return qo("genai",t??Yi``,e)},Yo.forDecisionTasks=function(t,e=!1){return qo("decision",t??Yi``,e)},Yo.forAudioTasks=function(t,e=!1){return qo("audio",t??Yi``,e)},Yo.isSimdSupported=function(t=!1){return Ko(t)};var Xo=class extends An{constructor(t){super(t)}},Qo=class extends An{constructor(t){super(t)}},Zo=[0,ki,2,bi,-2,gi,Bi,[0,ki,gi]],ts=class extends An{constructor(t){super(t)}},es=class extends An{constructor(t){super(t)}};function rs(t,e){return or(t,1,e)}function ns(t,e){return or(t,2,e)}var is=class extends An{constructor(t){super(t)}},os=[3,4,5,6,7],ss=class extends An{constructor(t){super(t)}},as=class extends An{constructor(t){super(t)}};as.prototype.j=Ri([0,[0,ki,xi,-3,ki],[0,os,ki,-1,Ni,[0,ki,xi,bi],Ni,Zo,Ni,[0,1,Zo],Ni,[0,ki],Ni,[0,ki,xi,bi]]]);var us=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=this.h?new AbortController:void 0,i=n&&t.O>0?setTimeout(()=>{n.abort()},t.O):void 0;try{let i=await fetch(t.url,{method:t.ga,headers:{...t.fa},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.O&&n?n.signal:null});200===i.status?e?.(await i.text()):r?.(i.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(400)}finally{clearTimeout(i)}}},ls=class extends An{constructor(t){super(t,37)}},cs=[-4,{},Wi,ki,zi],hs=[0,xi,ki,1,xi,-1,ki,1,ki,1,gi],fs=[0,ki,xi,-2],ds=[0,xi,ki],ps=[0,xi,ki],vs=[0,Ai,-3],gs=[0,ki,xi,-1,gi,wi,-1,xi,-5,Bi,[0,xi,-4],-1,Ai,[0,Ai,-3],ki];var ms,ys=class extends An{constructor(t){super(t,19)}},bs=(ms=[-19,{},[0,ki,1,[0,xi,-6,gi,wi,xi,-1,gi],1,[0,xi,1,xi,-5],xi,-1,[0,ki,xi,-8],[0,xi,-3],[0,xi,ki,xi,-2],[0,xi,-1,ki,xi,-1,ki,xi,-1,[0,Bi,[0,xi,-1],Ai,xi,-5],[0,ki,Ai,wi,-2]],gi,[0,xi,-3,gi,wi,xi,-1],[0,ki,xi,-1],[0,xi,-9],[0,xi,-6,ki,xi,1,xi,Ai,ki,-1,Ai,xi,-2,ki,xi,ki,xi,wi,-1],1,[0,ki],1,[0,xi,-4],1,hs,[0,[1,2,3,4,5,6],Ni,hs,Ni,ds,Ni,ps,Ni,[0,ki],Ni,gs,Ni,fs],ds,ps,gs,[0,[0,ki,xi,-1,gi,wi,-1,xi,-4,Bi,[0,xi,-4],-1,1,vs],[0,ki,xi,-1,gi,wi,-1,xi,-4,vs]],fs,[0,xi,[0,wi,-3,ki],ki,-2,[0,wi,-1],Ai],4,[0,xi,ki,xi,-1,gi,ki,xi,-1,ki,wi,-1]],ki,Bi,[-37,{},vi,xi,Bi,[0,xi,-1],Li,1,Li,[0,Ti,-1,Si,mi,-1],xi,[0,wi,xi,-1],Ai,wi,gi,xi,-1,Vi,Di,vi,Li,ki,Si,gi,-1,[0,ki,-1],xi,Ai,xi,_i,xi,-1,fi,1,fi,cs,Ai,[0,ki,[0,di,wi,-2],[0,di]],[0,ki,gi]],vi,Oi,xi,-1,vi,ki,-1,[0,Ai,-1,ki,Ai],[0,gi,-1,xi],[0,vi,Ai,gi],gi,1,Ui,1,cs],t=>Xn(t,ms)),ws=class{constructor(t){this.j=[],this.o=new us,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 ys;{Ae(e=or(e,2,1786));let l=e.m,c=0|l[Y];if(null==t)Le(l,c,3);else{var r=t===M?7:0|t[Y],n=r,i=Ve(r),o=i||Object.isFrozen(t),s=!0,a=!0;for(let e=0;e<t.length;e++){var u=t[e];i||(u=tt(u),s&&=!u,a&&=u)}i||(r=s?13:5,r=a?-4097&r:4096|r),o&&r===n||(t=Pt(t),n=0,r=tr(r,c)),r!==n&&Q(t,r),c=Le(l,c,3,t),2&r||!(4096&r||16&r)||Ie(l,c)}}return e}(r),r=bs(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",ga:"POST",O:1e4,body:r,ha:2,fa:{"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 Ss{constructor(){this.K=this.D=this.J=this.C=this.H=this.I=this.G=0}}function _s(t,e){var r=new as;r=Qe(r,0,1,t.V),r=Qe(r,0,2,e),e=Ne(e=new ls,6,rt(r=r.j(),!1)),(t=t.F).error||t.j.push(e)}function Es(t,e){var r={G:e.G-t.l.G,I:e.I-t.l.I,H:e.H-t.l.H,C:e.C-t.l.C,J:e.J-t.l.J,D:e.D,K:e.K},n=ns(rs(new is,t.B),1);r=As(t,r),_s(t,n=Ze(n,4,os,r)),t.l=e}function As(t,e){var r=new Qo;return t=ir(t=nr(t=or(r,1,t.A),7,e.C),5,e.D),t=ir(t,6,e.K),e.H>0&&ir(t,4,e.J/e.H),0!==e.G&&(r=nr(r=Jo(3),2,e.G),er(t,8,Xo,r)),0!==e.I&&(e=nr(r=Jo(4),2,e.I),er(t,8,Xo,e)),t}var Is=class{constructor(t,e,r){this.S=performance.now(),this.o=performance.now(),this.j=new Map,this.v=0,this.h=new Ss,this.l=new Ss,this.F=new ws(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;default:return 0}}(t),this.A=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 ss,"undefined"==typeof window?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=Ne(t=or(t,1,e),2,re("")),t=Ne(t,3,re("")),t=Ne(t,4,re("1.1.0")),t=Ne(t,5,re("")),this.V=or(t,6,4)}da(){var t=new es;t=ir(t=or(t,1,this.A),3,performance.now()-this.S),_s(this,t=Ze(ns(rs(new is,this.B),0),3,os,t)),this.o=performance.now()}ca(){var t={...this.h,C:this.h.C+this.j.size,D:this.v,K:performance.now()-this.S};Es(this,t);var e=new ts;e=Qe(e,0,2,t=As(this,t)),_s(this,e=Ze(t=ns(rs(new is,this.B),2),5,os,e))}close(){var t=this.F;"function"==typeof t.close?t.close():t.flush()}};function Ts(){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 js(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 xs(t,e,r){t.o||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 Bs(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Ns(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Ls(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Os=function(t){return class extends t{get R(){return this.i}aa(){if("function"==typeof this.R._mediapipeLoggerGetEncodedApiKey){let t=this.R._mediapipeLoggerGetEncodedApiKey();return this.R._decodeBase64(t)}}}}(function(t){return class extends t{ea(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Ts()?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,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),xs(this,n||"input_audio",n=>{xs(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,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,n,i){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),xs(this,n,t=>{this.i._addAudioToInputStream(this.h,e,r,t,i)})}addGpuBufferToStream(t,e,r){xs(this,e,e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[s,a]=[i,o];this.i._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){xs(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){xs(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){xs(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){xs(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){xs(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){xs(this,e,e=>{xs(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){xs(this,e,e=>{Bs(this,Object.keys(t),n=>{Bs(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){xs(this,r,r=>{xs(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){xs(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){xs(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)xs(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){xs(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){xs(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){xs(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){xs(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){xs(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){xs(this,e,e=>{xs(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){xs(this,r,r=>{xs(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){xs(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){xs(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){xs(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){xs(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){xs(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){xs(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)xs(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ns(this,t,e),xs(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Ls(this,t,e),xs(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ns(this,t,e),xs(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ls(this,t,e),xs(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?'),Ns(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),xs(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}})),Us=class extends Os{};async function Ps(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await js(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await js(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.na??"";var r=t.h.aa();t.j=new Is(t.F(),e,r)}(t,r),await t.u(r),t}async function ks(t,e,r){return Ps(t,e,r)}function Fs(t,e,r){try{t.h.i.FS_unlink(`/${r}`)}catch{}t.h.i.FS_createDataFile("/",r,e,!0,!1,!1),Vs(t,`/${r}`)}function Vs(t,e){var r=qe(t.baseOptions,Oo,1)||new Oo;"string"==typeof e?(Ne(r,2,re(e)),Ne(r,1)):e instanceof Uint8Array&&(Ne(r,1,rt(e,!1)),Ne(r,2)),Qe(t.baseOptions,0,1,r)}function Cs(t,e,r=!0,n=!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(!(qe(t.baseOptions,Oo,1)?.j()||qe(t.baseOptions,Oo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");!function(t,e){var r=qe(t.baseOptions,No,3);if(!r){var n=r=new No,i=new io;Ze(n,4,Lo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Qi,Ze(e,2,Lo,n)):(e=r,n=new io,Ze(e,4,Lo,n))),Qe(t.baseOptions,0,3,r)}(t,r);let i=n?"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=>{Fs(t,new Uint8Array(e),i),t.o()});if(r.modelAssetBuffer instanceof Uint8Array)n?Fs(t,r.modelAssetBuffer,i):Vs(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{n?Fs(t,e,i):Vs(t,e),t.o()})}return t.o(),Promise.resolve()}function Ms(t){try{let e=t.B.length;if(1===e)throw Error(t.B[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.B.map(t=>t.message).join(", "))}finally{t.B=[]}}function Rs(t,e){if(t.j&&void 0!==e){let r=qe(t.baseOptions,No,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.I,t.j.set(e,performance.now())):(++(t=t.j).h.G,t.j.set(e,performance.now()))}}function Gs(t,e){t.v=Math.max(t.v,e)}var Ds=class{constructor(t){this.h=t,this.B=[],this.v=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.B.push(Error(e))}),this.h.ea(),this.h.setGraph(t,e),this.j?.da(),Ms(this)}finishProcessing(t){if(this.h.finishProcessing(),Ms(this),this.j&&void 0!==t){var e=this.j,r=e.j.get(t);if(void 0!==r&&(e.j.delete(t),t=performance.now()-r,++e.h.H,e.h.J+=t,e.h.D=Math.max(e.h.D,t),e.v=Math.max(e.v,t),performance.now()>e.o+3e4)){for(let[n,i]of e.j.entries())t=n,i<r&&(e.h.C++,e.j.delete(t));r={...e.h,K:performance.now()-e.o},e.h.D=0,e.o=performance.now(),Es(e,r)}}}close(){this.j?.ca(),this.j?.close(),this.h.closeGraph()}};Ds.prototype.close=Ds.prototype.close;var zs=class extends Ds{constructor(t,e){super(new Us(t,e)),this.A={languages:[]},Qe(t=this.l=new Fo,0,1,e=new Uo)}F(){return"LanguageDetector"}u(t){return Qe(this.l,0,2,Ro(t,qe(this.l,jo,2))),Cs(this,t)}get baseOptions(){return qe(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}Y(t){this.A={languages:[]};var e=this.v+1;return Rs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}o(){var t=new mo;go(t),sr(t,15,"classifications_out");var e=new ao;En(e,Vo,this.l);var r=new ho;Re(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),er(t,1,ho,r),this.h.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Do(So(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.A.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Gs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Gs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};zs.prototype.detect=zs.prototype.Y,zs.prototype.setOptions=zs.prototype.u,zs.createFromModelPath=function(t,e){return ks(zs,t,{baseOptions:{modelAssetPath:e}})},zs.createFromModelBuffer=function(t,e){return ks(zs,t,{baseOptions:{modelAssetBuffer:e}})},zs.createFromOptions=function(t,e){return ks(zs,t,e)};var $s=class extends Ds{constructor(t,e){super(new Us(t,e)),this.A={classifications:[]},Qe(t=this.l=new Fo,0,1,e=new Uo)}F(){return"TextClassifier"}u(t){return Qe(this.l,0,2,Ro(t,qe(this.l,jo,2))),Cs(this,t)}get baseOptions(){return qe(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}X(t){this.A={classifications:[]};var e=this.v+1;return Rs(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}o(){var t=new mo;go(t),sr(t,15,"classifications_out");var e=new ao;En(e,Vo,this.l);var r=new ho;Re(r,re("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),sr(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),er(t,1,ho,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.A=Do(So(t)),Gs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Gs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Ws(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}$s.prototype.classify=$s.prototype.X,$s.prototype.setOptions=$s.prototype.u,$s.createFromModelPath=function(t,e){return ks($s,t,{baseOptions:{modelAssetPath:e}})},$s.createFromModelBuffer=function(t,e){return ks($s,t,{baseOptions:{modelAssetBuffer:e}})},$s.createFromOptions=function(t,e){return ks($s,t,e)};var Hs=class extends Ds{constructor(t,e){super(new Us(t,e)),this.A={embeddings:[]},Qe(t=this.l=new Co,0,1,e=new Uo)}F(){return"TextEmbedder"}u(t){var e=this.l,r=qe(this.l,xo,2);return r=r?we(r):new xo,void 0!==t.l2Normalize?Ne(r,1,Gt(t.l2Normalize)):"l2Normalize"in t&&Ne(r,1),void 0!==t.quantize?Ne(r,2,Gt(t.quantize)):"quantize"in t&&Ne(r,2),Qe(e,0,2,r),Cs(this,t)}get baseOptions(){return qe(this.l,Uo,1)}set baseOptions(t){Qe(this.l,0,1,t)}Z(t,e){var r=this.v+1;if(Rs(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${Ws(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Ws(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Ws(r)} | query: ${t}`}}return this.h.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.A}o(){var t=new mo;go(t),sr(t,15,"embeddings_out");var e=new ao;En(e,Mo,this.l);var r=new ho;Re(r,re("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),co(r),sr(r,4,"EMBEDDINGS:embeddings_out"),r.u(e),er(t,1,ho,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=To(t),this.A=function(t){return{embeddings:Je(t,Ao).map(t=>{var e={headIndex:$t(xe(t,3))??0??-1,headName:ne(xe(t,4))??""??""};if(Oe(t,_o,1,Io))t=Ue(t=rr(t,_o,1,Io),1,Rt,void 0===nt?2:4),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=rr(t,Eo,2,Io)?.j()?.j()??r}return e}),timestampMs:Go(xe(t,2,void 0,Qt)??je)}}(t),Gs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Gs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Ks(t,e){return ks(qs,t,e)}Hs.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=$o(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=$o(zo(t.quantizedEmbedding),zo(e.quantizedEmbedding))}return t},Hs.prototype.embed=Hs.prototype.Z,Hs.prototype.setOptions=Hs.prototype.u,Hs.createFromModelPath=function(t,e){return ks(Hs,t,{baseOptions:{modelAssetPath:e}})},Hs.createFromModelBuffer=function(t,e){return ks(Hs,t,{baseOptions:{modelAssetBuffer:e}})},Hs.createFromOptions=function(t,e){return ks(Hs,t,e)};var qs=class extends Ds{constructor(t,e){super(new Us(t,e)),this.baseOptions=new Uo,this.maxNumTokens=0,this.mode="KEYPOINTS",this.l=0}F(){return"TextSummarizer"}async u(t){if(0!==this.l)throw Error("LiteRT LM Tasks do not support updating options after initialization.");return void 0!==t.maxNumTokens&&(this.maxNumTokens=t.maxNumTokens),void 0!==t.mode&&(this.mode=t.mode),Cs(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextSummarizer("/model.litertlm",this.maxNumTokens,this.mode)}summarize(t){var e=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");return e.summarize(this.l,t)}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextSummarizer(this.l)}catch{}this.l=0}super.close()}};qs.createFromModelBuffer=function(t,e,r=0,n="KEYPOINTS"){return Ks(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r,mode:n})},qs.createFromModelPath=function(t,e,r=0,n="KEYPOINTS"){return Ks(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r,mode:n})},qs.createFromOptions=Ks,exports.FilesetResolver=Yo,exports.LanguageDetector=zs,exports.TaskRunner=Ds,exports.TextClassifier=$s,exports.TextEmbedder=Hs,exports.TextSummarizer=qs;
|
|
1
|
+
"use strict";var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,s=void 0,a="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var c=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,p=t.navigator;function v(t){return v[" "](t),t}d=p&&p.userAgentData||null,v[" "]=function(){};var g={},m=null;function y(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 n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));g[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,S=!(!(!!c&&(!!d&&d.brands.length>0))&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,_=/[-_.]/g,E={"-":"+",_:"/",".":"="};function A(t){return E[t]||""}function I(t){if(!S)return y(t);t=_.test(t)?t.replace(_,A):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 T={};function j(){return B||=new N(null,T)}function x(t){L(T);var e=t.h;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.h=e}var B,N=class{j(){return new Uint8Array(x(this)||0)}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!==T)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 U=void 0;function P(t){return O(t=Error(t),"warning"),t}function k(e,r){if(null!=e){var n=U??={},i=n[e]||0;i>=r||(n[e]=i+1,O(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var V="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(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 M,R=C("jas",void 0,!0),G=C(void 0,"1oa"),D=C(void 0,Symbol()),z=C(void 0,"0ubs"),$=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","ka",!0),K={ba:{value:0,configurable:!0,writable:!0,enumerable:!1}},q=Object.defineProperties,Y=V?R:"ba",J=[];function X(t,e){V||Y in t||q(t,K),t[Y]|=e}function Q(t,e){V||Y in t||q(t,K),t[Y]=e}Q(J,7),M=Object.freeze(J);var Z={};function tt(t,e){return void 0===e?t.h!==et&&!!(2&t.m[Y]):!!(2&e)&&t.h!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,T):j();else if(t.constructor!==N)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new N(new Uint8Array(t),T):j();else{if(!e)throw Error();t=void 0}return t}function nt(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}Object.freeze({});var it={};function ot(t){return 128&t?it:void 0}function st(t){return t.ia=!0,t}var at=st(t=>"number"==typeof t),ut=st(t=>"string"==typeof t),lt=st(t=>"boolean"==typeof t),ct="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ht(t){var e=t;if(ut(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(at(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ct?BigInt(t):t=lt(t)?t?"1":"0":ut(t)?t.trim()||"0":String(t)}var ft=st(t=>ct?t>=pt&&t<=gt:"-"===t[0]?mt(t,dt):mt(t,vt)),dt=Number.MIN_SAFE_INTEGER.toString(),pt=ct?BigInt(Number.MIN_SAFE_INTEGER):void 0,vt=Number.MAX_SAFE_INTEGER.toString(),gt=ct?BigInt(Number.MAX_SAFE_INTEGER):void 0;function mt(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 n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var yt,bt="function"==typeof Uint8Array.prototype.slice,wt=0,St=0;function _t(t){var e=t>>>0;wt=e,St=(t-e)/4294967296>>>0}function Et(t){if(t<0){_t(-t);let[e,r]=Ot(wt,St);wt=e>>>0,St=r>>>0}else _t(t)}function At(t){var e=yt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),St=0,wt=e.getUint32(0,!0)}function It(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:xt(t,e)}function Tt(t,e){return ht(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):xt(t,e))}function jt(t,e){return F()?ht(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ht(Nt(t,e))}function xt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?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+Bt(r)+Bt(t));return r}function Bt(t){return t=String(t),"0000000".slice(t.length)+t}function Nt(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Ot(t,e);t="-"+xt(r,n)}else t=xt(t,e);return t}function Lt(t){if(t.length<16)Et(Number(t));else if(F())t=BigInt(t),wt=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);St=wt=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));St*=1e6,(wt=1e6*wt+e)>=4294967296&&(St+=Math.trunc(wt/4294967296),St>>>=0,wt>>>=0)}if(e){let[t,e]=Ot(wt,St);wt=t,St=e}}}function Ot(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ut(t){return Array.prototype.slice.call(t)}var Pt="function"==typeof BigInt?BigInt.asIntN:void 0,kt="function"==typeof BigInt?BigInt.asUintN:void 0,Ft=Number.isSafeInteger,Vt=Number.isFinite,Ct=Math.trunc;function Mt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Rt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var Gt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Dt(t){switch(typeof t){case"bigint":return!0;case"number":return Vt(t);case"string":return Gt.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 $t(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Lt(t),Nt(wt,St))}function Wt(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Lt(t),xt(wt,St))}function Ht(t){if(t=Ct(t),!Ft(t)){Et(t);var e=wt,r=St;(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 Kt(t){return(t=Ct(t))>=0&&Ft(t)||(Et(t),t=It(wt,St)),t}function qt(t){var e=Ct(Number(t));return Ft(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),$t(t))}function Yt(t){var e=Ct(Number(t));return Ft(e)?ht(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),F()?ht(Pt(64,BigInt(t))):ht($t(t)))}function Jt(t){return Ft(t)?t=ht(Ht(t)):(t=Ct(t),Ft(t)?t=String(t):(Et(t),t=Nt(wt,St)),t=ht(t)),t}function Xt(t){var e=typeof t;return null==t?t:"bigint"===e?ht(Pt(64,t)):Dt(t)?"string"===e?Yt(t):Jt(t):void 0}function Qt(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Pt(64,t));if(Dt(t)){if("string"===e)return qt(t);if("number"===e)return Ht(t)}}function Zt(t){if(null==t||"string"==typeof t||t instanceof N)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 ne(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[Y];return(r=n|32&r|2&r)!==n&&Q(t,r),new e(t)}}function ie(t){return t}function oe(t){return D?t[D]:void 0}function se(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ae,ue,le,ce=class{};function he(t,e){e<100||k(z,1)}function fe(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=D;!i&&V&&s&&(o=t[s])&&se(o,he),s=[];var a=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=a&&t[a-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--a:h=void 0,!l||128&e||i||(u=!0,o=(ae??ie)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&D&&(t=oe(t))&&t instanceof ce&&(s[D]=function(t){var e=new ce;return se(t,(t,r,n)=>{e[r]=Ut(n)}),e.h=t.h,e}(t)),s}function de(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return ft(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[H]===Z)return pe(t);if(t instanceof N){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(S){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=g[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,l=0;for(;t<e.length-2;t+=3){var o=e[t],s=e[t+1],a=e[t+2],u=r[o>>2];o=r[(3&o)<<4|s>>4],s=r[(15&s)<<2|a>>6],a=r[63&a],n[l++]=u+o+s+a}switch(u=0,a=i,e.length-t){case 2:a=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+a+i}e=n.join("")}t=t.h=e}return t}return}return t}function pe(t){return fe(t=t.m,0|t[Y],de)}function ve(t,e){return ge(t,e[0],e[1])}function ge(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");k(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&Q(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var o=(r=t).length;if(o){var s=o-1;let t=r[s];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((s-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(o=+a)<s&&(r[o+e]=t[a],delete t[a]);i=-16760833&i|(1023&s)<<14;break t}}if(e){if((a=Math.max(e,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return Q(t,64|i|n),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=we(t,r,!1,e&&!(16&r)):(X(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.m)[Y])?t:Ie(t,e,r)?ye(t,e):we(e,r):t instanceof N?t:void 0}function ye(t,e,r){return t=new t.constructor(e),r&&(t.h=et),t.o=et,t}function be(t){var e=t.m,r=0|e[Y];return Ie(t,e,r)?ye(t,e,!0):new t.constructor(we(e,r,!1))}function we(t,e,r,n){return n??=!!(34&e),t=fe(t,e,me,n),n=32,r&&(n|=2),Q(t,e=16769217&e|n),t}function Se(t){var e=t.m,r=0|e[Y];return tt(t,r)?Ie(t,e,r)?ye(t,e,!0):new t.constructor(we(e,r,!1)):t}function _e(t){if(t.h!==et)return!1;var e=t.m;return X(e=we(e,0|e[Y]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ee(t){if(!_e(t)&&tt(t,0|t.m[Y]))throw Error()}function Ae(t,e){void 0===e&&(e=0|t[Y]),32&e&&!(4096&e)&&Q(t,4096|e)}function Ie(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(Q(e,2|r),t.h=et,!0)}var Te=ht(0);function je(t,e,r,n){if(null!==(t=xe(t.m,e,r,n)))return t}function xe(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),o=t.length-1;if(!(o<1+(r?0:-1))){if(i>=o){var s=t[o];if(null!=s&&"object"==typeof s&&s.constructor===Object){r=s[e];var a=!0}else{if(i!==o)return;r=s}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?s[e]=n:t[i]=n,n}return r}}function Be(t,e,r,n){Ee(t);var i=t.m;return Ne(i,0|i[Y],e,r,n),t}function Ne(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Le(t,e,r,n){var i=t.m;return void 0!==He(i,0|i[Y],e,t=Ge(t,n)===r?r:-1)}function Oe(t,e,r,n,i){var o=t.m,s=0|o[Y];n=tt(t,s)?1:n||4,i=!!i||3===n,2===n&&_e(t)&&(s=0|(o=t.m)[Y]);var a=(t=Pe(o,e))===M?7:0|t[Y],u=ke(a,s),l=!(4&u);if(l){4&u&&(t=Ut(t),a=0,u=Ze(u,s),s=Ne(o,s,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(Q(t,u),2&u&&Object.freeze(t)),Ue(t,u,o,s,e,n,l,i)}function Ue(t,e,r,n,i,o,s,a){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Fe(e)||((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&Q(t,e),Object.freeze(t)):(2===o&&Fe(e)&&(t=Ut(t),u=0,e=Ze(e,n),n=Ne(r,n,i,t)),Fe(e)||(a||(e|=16),e!==u&&Q(t,e))),2&e||!(4096&e||16&e)||Ae(r,n),t}function Pe(t,e,r){return t=xe(t,e,r),Array.isArray(t)?t:M}function ke(t,e){return 2&e&&(t|=2),1|t}function Fe(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Ve(t){return rt(t,!0)}function Ce(t,e,r){Ee(t);var n=0|(t=t.m)[Y];if(null==r)Ne(t,n,e);else{var i=r===M?7:0|r[Y],o=i,s=Fe(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Ut(r),o=0,i=Ze(i,n),a=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,s=0;s<r.length;s++){let t=r[s],e=te(t);Object.is(t,e)||(a&&(r=Ut(r),o=0,i=Ze(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Ut(r),i=Ze(i,n)),Q(r,i)),Ne(t,n,e,r)}}function Me(t,e){Ee(t),Ne(t=t.m,0|t[Y],2,""===e?void 0:e)}function Re(t,e,r){if(2&e)throw Error();var n=ot(e),i=Pe(t,r,n),o=i===M?7:0|i[Y],s=ke(o,e);return(2&s||Fe(s)||16&s)&&(s===o||Fe(s)||Q(i,s),i=Ut(i),o=0,s=Ze(s,e),Ne(t,e,r,i,n)),(s&=-13)!==o&&Q(i,s),i}function Ge(t,e){return $e(De(t=t.m),t,void 0,e)}function De(t){if(V)return t[G]??(t[G]=new Map);if(G in t)return t[G];var e=new Map;return Object.defineProperty(t,G,{value:e}),e}function ze(t,e,r,n,i){var o=De(t),s=$e(o,t,e,r,i);return s!==n&&(s&&(e=Ne(t,e,s,void 0,i)),o.set(r,n)),e}function $e(t,e,r,n,i){var o=t.get(n);if(null!=o)return o;o=0;for(let t=0;t<n.length;t++){let s=n[t];null!=xe(e,s,i)&&(0!==o&&(r=Ne(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function We(t,e,r){var n=0|t[Y],i=ot(n),o=xe(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return _e(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o);if(s){let t=0|s[Y];2&t&&(s=we(s,t))}return(s=ve(s,e))!==o&&Ne(t,n,r,s,i),s}function He(t,e,r,n){var i=!1;if(null!=(n=xe(t,n,void 0,t=>{var n=ne(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&Ae(t,e),n}function Ke(t,e,r){var n=t.m,i=0|n[Y];if(null==(e=He(n,i,e,r)))return e;if(!tt(t,i=0|n[Y])){let o=Se(e);o!==e&&(_e(t)&&(i=0|(n=t.m)[Y]),Ae(n,i=Ne(n,i,r,e=o)))}return e}function qe(t,e,r,n,i,o,s,a){var u=tt(t,r);o=u?1:o||4,s=!!s||3===o,u=a&&!u,(2===o||u)&&_e(t)&&(r=0|(e=t.m)[Y]);var l=(t=Pe(e,i))===M?7:0|t[Y],c=ke(l,r);if(a=!(4&c)){var h=t,f=r;let e=!!(2&c);e&&(f|=2);let i=!e,o=!0,s=0,a=0;for(;s<h.length;s++){let t=ne(h[s],n,f);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}h[a++]=t}}a<s&&(h.length=a),c|=4,c=o?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==l&&(Q(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Fe(c)&&(t=Ut(t),c=Ze(c,r),r=Ne(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Se(h))&&(n[l]=c);u|=8,Q(t,c=u=n.length?4096|u:-4097&u)}return Ue(t,c,e,r,i,o,a,s)}function Ye(t,e){var r=t.m;return qe(t,r,0|r[Y],e,1,void 0,!1,!0)}function Je(t){return null==t&&(t=void 0),t}function Xe(t,e,r,n,i){return Be(t,r,n=Je(n),i),n&&!tt(n)&&Ae(t.m),t}function Qe(t,e,r,n){t:{var i=n=Je(n);Ee(t);let o=t.m,s=0|o[Y];if(null==i){let t=De(o);if($e(t,o,s,r)!==e)break t;t.set(r,0)}else s=ze(o,s,r,e);Ne(o,s,e,i)}return n&&!tt(n)&&Ae(t.m),t}function Ze(t,e){return-273&(2&e?2|t:-3&t)}function tr(t,e,r,n){Ee(t);var i=t.m;t=qe(t,i,0|i[Y],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===M?7:0|t[Y],(n=tt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&Q(t,r),n||Ae(i)}function er(t,e,r,n){return Ke(t,e,r=Ge(t,n)===r?r:-1)}function rr(t,e,r){if(null!=r)t:{if(!Dt(r))throw P("int64");switch(typeof r){case"string":r=Yt(r);break t;case"bigint":r=ht(Pt(64,r));break t;default:r=Jt(r)}}return Be(t,e,r)}function nr(t,e,r){return Be(t,e,null==r?r:function(t){if(!Dt(t))throw P("uint64");switch(typeof t){case"string":var e=Ct(Number(t));return Ft(e)&&e>=0?t=ht(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ht(kt(64,BigInt(t))):ht(Wt(t))),t;case"bigint":return ht(kt(64,t));default:return Ft(t)?t=ht(Kt(t)):((t=Ct(t))>=0&&Ft(t)?t=String(t):(Et(t),t=xt(wt,St)),t=ht(t)),t}}(r))}function ir(t,e,r){if(null!=r){if(!Vt(r))throw P("enum");r|=0}return Be(t,e,r)}function or(t,e,r){Ee(t),Oe(t,e,re,2,!0).push(te(r))}var sr=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function ar(t,e){if("string"==typeof t)return new sr(I(t),e);if(Array.isArray(t))return new sr(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new sr(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new sr(t,!1);if(t.constructor===N)return e=x(t)||new Uint8Array(0),new sr(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new sr(t,!1);throw Error()}function ur(t,e){var r=0,n=0,i=0,o=t.j,s=t.h;do{var a=o[s++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=o[s++]))<<i;if(vr(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function lr(t){for(var e=0,r=t.h,n=r+10,i=t.j;r<n;){let n=i[r++];if(e|=n,!(128&n))return vr(t,r),!!(127&e)}throw Error()}function cr(t){var e=t.j,r=t.h,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return vr(t,r),i}function hr(t){return ur(t,jt)}function fr(t){var e=t.j,r=t.h,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],vr(t,t.h+4),(n|i<<8|o<<16|e<<24)>>>0}function dr(t){var e=fr(t);t=2*(e>>31)+1;var r=e>>>23&255;return e&=8388607,255==r?e?NaN:t*(1/0):0==r?1401298464324817e-60*t*e:t*Math.pow(2,r-150)*(e+8388608)}function pr(t){return cr(t)}function vr(t,e){if(t.h=e,e>t.l)throw Error()}function gr(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 mr(t,e){if(0==e)return j();var r=gr(t,e);return t.M&&t.v?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):bt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?j():new N(r,T)}var yr=class{constructor(t,e,r,n){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,P:i=!1}={}){this.M=n,this.P=i,t&&(t=ar(t,this.P),this.j=t.buffer,this.v=t.h,this.o=e||0,this.l=void 0!==r?this.o+r:this.j.length,this.h=this.o)}clear(){this.j=null,this.v=!1,this.h=this.l=this.o=0,this.M=!1}},br=[],wr=0;function Sr(t,e,r,n){if(Lr.length){let i=Lr.pop();return i.u(n),i.h.init(t,e,r,n),i}return new Nr(t,e,r,n)}function _r(t){t.h.clear(),t.l=-1,t.j=-1,Lr.length<100&&Lr.push(t)}function Er(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=cr(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 Ar(t){try{switch(t.j){case 0:0!=t.j?Ar(t):lr(t.h);break;case 1:var e=t.h;vr(e,e.h+8);break;case 2:if(2!=t.j)Ar(t);else{var r=cr(t.h)>>>0,n=t.h;vr(n,n.h+r)}break;case 5:var i=t.h;vr(i,i.h+4);break;case 3:Ir();let o=t.l;try{for(;;){if(!Er(t))throw Error();if(4==t.j){if(t.l!=o)throw Error();break}Ar(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{wr>0&&wr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function Ir(){if(wr>=100)throw new SyntaxError;wr++}function Tr(t,e,r){var n=t.h.l,i=cr(t.h)>>>0,o=(i=t.h.h+i)-n;if(o<=0&&(t.h.l=i,r(e,t,void 0,void 0,void 0),o=i-t.h.h),o)throw Error();t.h.h=i,t.h.l=n}function jr(t){var e=cr(t.h)>>>0,o=gr(t=t.h,e);if(t=t.j,a){var u,l=t;(u=i)||(u=i=new TextDecoder("utf-8",{fatal:!0})),e=o+e,l=0===o&&e===l.length?l:l.subarray(o,e);try{var c=u.decode(l)}catch(t){if(void 0===s){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),s=!0}catch(t){s=!1}}throw!s&&(i=void 0),t}}else{e=(c=o)+e,o=[];let i,s=null;for(;c<e;){var h=t[c++];h<128?o.push(h):h<224?c>=e?r():(i=t[c++],h<194||128!=(192&i)?(c--,r()):o.push((31&h)<<6|63&i)):h<240?c>=e-1?r():(i=t[c++],128!=(192&i)||224===h&&i<160||237===h&&i>=160||128!=(192&(u=t[c++]))?(c--,r()):o.push((15&h)<<12|(63&i)<<6|63&u)):h<=244?c>=e-2?r():(i=t[c++],128!=(192&i)||i-144+(h<<28)>>30||128!=(192&(u=t[c++]))||128!=(192&(l=t[c++]))?(c--,r()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&l,h-=65536,o.push(55296+(h>>10&1023),56320+(1023&h)))):r(),o.length>=8192&&(s=n(s,o),o.length=0)}c=n(s,o)}return c}function xr(t){var e=cr(t.h)>>>0;return mr(t.h,e)}function Br(t,e,r){var n=cr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Nr=class{constructor(t,e,r,n){if(br.length){let i=br.pop();i.init(t,e,r,n),t=i}else t=new yr(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.u(n)}u({T:t=!1}={}){this.T=t}},Lr=[];function Or(t){return new kr(4294967295&t,Math.floor(t/4294967296))}function Ur(t){return t?/^\d+$/.test(t)?(Lt(t),new kr(wt,St)):null:Pr||=new kr(0,0)}var Pr,kr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Fr(t){return new Hr(4294967295&t,Math.floor(t/4294967296))}function Vr(t){return t?/^-?\d+$/.test(t)?(Lt(t),new Hr(wt,St)):null:Cr||=new Hr(0,0)}var Cr,Mr,Rr,Gr,Dr,zr,$r,Wr,Hr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Kr(t,e,r){return"undefined"!=typeof BigInt64Array?($r||($r=new BigInt64Array(1),Wr=new Uint32Array($r.buffer),$r[0]=BigInt(1),zr=1===Wr[0]),$r[0]=t,new e(Wr[t=zr?0:1],Wr[1-t])):(Dr||(Mr=BigInt(Number.MIN_SAFE_INTEGER),Rr=BigInt(Number.MAX_SAFE_INTEGER),Gr=BigInt(4294967295),Dr=BigInt(32)),t>=Mr&&t<=Rr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Gr),Number(t>>Dr))))}function qr(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 Yr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Jr(t,e){if(e>=0)Yr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Xr(t,e){Lt(e),function(t){var e=St>>31;t(wt<<1^e,(St<<1|wt>>>31)^e)}((e,r)=>{qr(t,e>>>0,r>>>0)})}function Qr(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 Zr=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function tn(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function en(t,e,r){Yr(t.h,8*e+r)}function rn(t,e){return en(t,e,2),e=t.h.end(),tn(t,e),e.push(t.j),e}function nn(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 on(t,e,r){if(null!=r)switch(en(t,e,0),typeof r){case"number":t=t.h,Et(r),qr(t,wt,St);break;case"bigint":r=Kr(r,Hr,Fr),qr(t.h,r.j,r.h);break;default:r=Vr(r),qr(t.h,r.j,r.h)}}function sn(t,e,r){en(t,e,2),Yr(t.h,r.length),tn(t,t.h.end()),tn(t,r)}var an=class{constructor(){this.l=[],this.j=0,this.h=new Zr}};function un(t){if("string"==typeof t)Vr(t)}function ln(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var cn=ln(),hn=ln(),fn=ln(),dn=ln(),pn=ln(),vn=ln(),gn=ln(),mn=ln(),yn=ln(),bn=ln(),wn=ln(),Sn=ln();function _n(t,e,r){var n=t.m;D&&D in n&&(n=n[D])&&delete n[e.h],e.j?e.o(t,e.j,e.h,r,e.l):e.o(t,e.h,r,e.l)}var En=class{constructor(t,e){this.m=ge(t,e,void 0,2048)}toJSON(){return pe(this)}};En.prototype[H]=Z,En.prototype.toString=function(){return this.m.toString()};var An=class{constructor(t,e,r){this.h=t,this.j=e,t=cn,this.l=!!t&&r===t||!1}};function In(t,e){return new An(t,e,cn)}function Tn(t,e,r,n,i){null!=(e=Cn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}var jn,xn,Bn=In(function(t,e,r,n,i){return 2===t.j&&(Tr(t,We(e,n,r),i),!0)},Tn),Nn=In(function(t,e,r,n,i){return 2===t.j&&(Tr(t,We(e,n,r),i),!0)},Tn),Ln=Symbol(),On=Symbol(),Un=Symbol(),Pn=Symbol(),kn=Symbol();function Fn(t,e,r,n){var i=n[t];if(i)return i;(i={}).W=n,i.L=function(t){switch(typeof t){case"boolean":return ue||=[0,void 0,!0];case"number":return t>0?void 0:0===t?le||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],s=1;o&&o.constructor===Object&&(i.N=o,"function"==typeof(o=n[++s])&&(i.U=!0,jn??=o,xn??=n[s+1],o=n[s+=2]));for(var a={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof An?t=o:(t=Bn,s--),t?.l){o=n[++s],l=n;var c=s;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++s])&&o<0&&(c-=o,o=n[++s]);u<c;u++){let n=a[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Vn(t){return Array.isArray(t)?t[0]instanceof An?t:[Nn,t]:[t,void 0]}function Cn(t,e){return t instanceof En?t.m:Array.isArray(t)?ve(t,e):void 0}function Mn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Rn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Fn(On,Mn,Rn,n).L,o||=Gn(n),i)}function Gn(t){var e=t[Un];if(null!=e)return e;var r=Fn(On,Mn,Rn,t);return e=r.U?(t,e)=>jn(t,e,r):(t,e)=>{t:{Ir();try{for(;Er(e)&&4!=e.j;){let u=e.l,l=r[u];if(null==l){let t=r.N;if(t){let e=t[u];if(e){let t=zn(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.o;if(Ar(n),n.T)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=mr(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[D]??(o[D]=new ce))[s]??(n[s]=[])).push(a)}}let l=oe(t);l&&(l.h=r.W[kn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{wr>0&&wr--}u=void 0}return u},t[Un]=e,t[kn]=Dn.bind(t),e}function Dn(t,e,r,n){var i=this[On],o=this[Un],s=ve(void 0,i.L),a=oe(t);if(a){var u=!1,l=i.N;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=Sr(t);try{u=!0,o(s,e)}finally{_r(e)}}else n?.(t,r,i)},null==e)se(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!r?.ma)throw Error();let i=ot(n),o=(e,o)=>{if(null!=xe(t,e,i)){if(1===r?.la)return;throw Error()}null!=o&&(n=Ne(t,n,e,o,i)),delete a[e]};null==e?nt(s,0|s[Y],(t,e)=>{o(t,e)}):o(e,xe(s,e,i))}}}}function zn(t){var e=(t=Vn(t))[0].h;if(t=t[1]){let r=Gn(t),n=Fn(On,Mn,Rn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function $n(t,e,r){t[e]=r.j}function Wn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Fn(Ln,$n,Wn,n).L,i||=Hn(n))}function Hn(t){var e=t[Pn];if(!e){let r=Fn(Ln,$n,Wn,t);e=(t,e)=>Kn(t,e,r),t[Pn]=e}return e}function Kn(t,e,r){nt(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.N)&&(r=r[e])){var n=(r=Vn(r))[0].j;if(r=r[1]){let e=Hn(r),i=Fn(Ln,$n,Wn,r).L;r=t.U?xn(i,e):(t,r,o)=>n(t,r,o,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||k($,3)}}),(t=oe(t))&&se(t,(t,r,n)=>{for(tn(e,e.h.end()),t=0;t<n.length;t++)tn(e,x(n[t])||new Uint8Array(0))})}var qn=ht(0);function Yn(t,e,r){if(Array.isArray(e)){var n=0|e[Y];if(4&n)return e;for(var i=0,o=0;i<e.length;i++){let r=t(e[i]);null!=r&&(e[o++]=r)}return o<i&&(e.length=o),t=1|n,r&&(t=-1537&t|4),t!==n&&Q(e,t),r&&2&t&&Object.freeze(e),e}}var Jn=(t,e)=>{var r=new an;Kn(t.m,r,Fn(Ln,$n,Wn,e)),tn(r,r.h.end()),t=new Uint8Array(r.j);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function Xn(t,e,r){return new An(t,e,r)}function Qn(t,e,r){return new An(t,e,r)}function Zn(t,e,r){Ne(t,0|t[Y],e,r,ot(0|t[Y]))}function ti(t,e,r){null!=(e=Qt(e))&&(un(e),on(t,r,e))}function ei(t,e,r){null!=(e=zt(e))&&null!=e&&(en(t,r,0),Jr(t.h,e))}function ri(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(en(t,r,0),t.h.h.push(e?1:0))}function ni(t,e,r){null!=(e=re(e))&&sn(t,r,l(e))}function ii(t,e,r,n,i){null!=(e=Cn(e,n))&&(r=rn(t,r),i(e,t),nn(t,r))}function oi(t,e,r){null!=(e=Zt(e))&&sn(t,r,ar(e,!0).buffer)}function si(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&&(en(t,r,0),Yr(t.h,e))}function ai(t,e,r){null!=(e=zt(e))&&(e=parseInt(e,10),en(t,r,0),Jr(t.h,e))}function ui(t,e,r){return 0===t.j&&(Zn(e,r,hr(t.h)),!0)}function li(t,e,r){return(0===t.j||2===t.j)&&(e=Re(e,0|e[Y],r),2==t.j?Br(t,cr,e):e.push(cr(t.h)),!0)}function ci(t,e,r){return 2===t.j&&(Zn(e,r,(t=xr(t))===j()?void 0:t),!0)}var hi=Xn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=fr(n);var i=fr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,Zn(e,r,2047==o?t?NaN:n*(1/0):0==o?5e-324*n*t:n*Math.pow(2,o-1075)*(t+4503599627370496)),!0},function(t,e,r){null!=(e=Mt(e))&&(en(t,r,1),t=t.h,(r=yt||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),wt=r.getUint32(0,!0),St=r.getUint32(4,!0),Qr(t,wt),Qr(t,St))},bn),fi=Xn(function(t,e,r){return 5===t.j&&(Zn(e,r,dr(t.h)),!0)},function(t,e,r){null!=(e=Mt(e))&&(en(t,r,5),t=t.h,At(e),Qr(t,wt))},yn),di=Qn(function(t,e,r){return(5===t.j||2===t.j)&&(e=Re(e,0|e[Y],r),2==t.j?Br(t,dr,e):e.push(dr(t.h)),!0)},function(t,e,r){if(null!=(e=Yn(Mt,e,!0))&&e.length){en(t,r,2),Yr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,At(e[n]),Qr(r,wt)}},yn),pi=Xn(function(t,e,r){return ui(t,e,r)},ti,vn),vi=Xn(function(t,e,r){return ui(t,e,r)},ti,vn),gi=Qn(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=Re(e,0|e[Y],r),2==t.j?Br(t,hr,e):e.push(hr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Yn(Qt,e,!1)))for(let n=0;n<e.length;n++)on(t,r,e[n])},vn),mi=Xn(function(t,e,r){return 0!==t.j?e=!1:(Zn(e,r,(t=hr(t.h))===qn?void 0:t),e=!0),e},ti,vn),yi=Xn(function(t,e,r){return 0!==t.j?t=!1:(Zn(e,r,ur(t.h,Tt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(kt(64,t));if(Dt(t)){if("string"===e)return e=Ct(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 Kt(t)}}(e),null!=e){if("string"==typeof e)Ur(e);if(null!=e)switch(en(t,r,0),typeof e){case"number":t=t.h,Et(e),qr(t,wt,St);break;case"bigint":r=Kr(e,kr,Or),qr(t.h,r.j,r.h);break;default:r=Ur(e),qr(t.h,r.j,r.h)}}},gn),bi=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,cr(t.h)),!0)},ei,dn),wi=Qn(li,function(t,e,r){if(null!=(e=Yn(zt,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(en(n,i,0),Jr(n.h,o))}},dn),Si=Qn(li,function(t,e,r){if(null!=(e=Yn(zt,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},dn),_i=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,0===(t=cr(t.h))?void 0:t),!0)},ei,dn),Ei=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,lr(t.h)),!0)},ri,hn),Ai=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,!1===(t=lr(t.h))?void 0:t),!0)},ri,hn),Ii=Qn(function(t,e,r){return 2===t.j&&(t=jr(t),Re(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Yn(re,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,l(o))}},fn),Ti=Xn(function(t,e,r){return 2===t.j&&(Zn(e,r,""===(t=jr(t))?void 0:t),!0)},ni,fn),ji=Xn(function(t,e,r){return 2===t.j&&(Zn(e,r,jr(t)),!0)},ni,fn),xi=function(t,e,r=cn){return new An(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ve(void 0,n),Re(e,0|e[Y],r).push(n),Tr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)ii(t,e[o],r,n,i);1&(t=0|e[Y])||Q(e,1|t)}}),Bi=In(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[Y];return ze(e,s,o,r,ot(s)),Tr(t,e=We(e,n,r),i),!0},ii),Ni=Xn(function(t,e,r){return 2===t.j&&(Zn(e,r,xr(t)),!0)},oi,wn),Li=Qn(function(t,e,r){return 2===t.j&&(t=xr(t),Re(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Yn(Zt,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&sn(n,i,ar(o,!0).buffer)}},wn),Oi=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,cr(t.h)>>>0),!0)},si,pn),Ui=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,0===(t=cr(t.h)>>>0)?void 0:t),!0)},si,pn),Pi=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,cr(t.h)),!0)},ai,Sn),ki=Xn(function(t,e,r){return 0===t.j&&(Zn(e,r,0===(t=cr(t.h))?void 0:t),!0)},ai,Sn),Fi=Xn(function(t,e,r){return 0!==t.j?t=!1:(Zn(e,r,function(t){return ur(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=Qt(e))&&(un(e),null!=e))switch(en(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,_t(r=2*Math.abs(r)),r=wt;let n=St;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),qr(t,wt=r,St=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),wt=Number(BigInt.asUintN(32,e)),St=Number(BigInt.asUintN(32,e>>BigInt(32))),qr(t,wt,St);break;default:Xr(t.h,e)}},mn);class Vi{constructor(t,e){var r=so;this.h=t,this.j=e,this.o=Xe,this.defaultValue=void 0,this.l=null!=r.ja?it:void 0}register(){v(this)}}function Ci(t,e){return(r,n)=>{t:{let o={P:!0};n&&Object.assign(o,n),r=Sr(r,void 0,void 0,o);try{let n=new t,o=n.m;Gn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r(r)}i=void 0}return i}}function Mi(t){return function(){return Jn(this,t)}}var Ri,Gi=[0,Ni,Li,Ei,ji],Di=[0,Ti,[0,ki,[0,mi,_i],ki,-1,[0,Pi],ki,-1],Xn(ci,oi,wn)],zi=[0,Ti,Xn(ci,function(t,e,r){if(null!=e){if(e instanceof En){let n=e.oa;return void(n?(e=n(e),null!=e&&sn(t,r,ar(e,!0).buffer)):k($,3))}if(Array.isArray(e))return void k($,3)}oi(t,e,r)},wn)],$i=[0,1,[0,12,bi,10,Ei],[0,7,[0,bi,-1]]],Wi=globalThis.trustedTypes;var Hi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Ki(t){var e;return void 0===Ri&&(Ri=function(){var t=null;if(!Wi)return t;try{let e=t=>t;t=Wi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Ri)?e.createScriptURL(t):t,new Hi(t)}function qi(t,...e){if(0===e.length)return Ki(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Ki(r)}var Yi=[0,bi,Pi,Ei,-1,Si,Pi,-1,Ei,-1],Ji=[0,Pi,-1,Ei],Xi=class extends En{constructor(t){super(t)}},Qi=[0,Ei,ji,Ei,Pi,-1,Qn(function(t,e,r){return(0===t.j||2===t.j)&&(e=Re(e,0|e[Y],r),2==t.j?Br(t,pr,e):e.push(cr(t.h)),!0)},function(t,e,r){if(null!=(e=Yn(zt,e,!0))&&e.length){r=rn(t,r);for(let r=0;r<e.length;r++)Jr(t.h,e[r]);nn(t,r)}},Sn),ji,-1,[0,Ei,-1],Pi,Ei,-1,Ji],Zi=class extends En{constructor(t){super(t)}},to=class extends En{constructor(t){super(t)}j(){var t=this.m;return void 0!==He(t,0|t[Y],Zi,9)}},eo=[0,3,Ei,-1,2,[0,[2],bi,Bi,[0,Oi]],[0,Pi,Ei,Pi,Ei,Pi,4,[0,Ei,ji,-1,Ei]],[0,[3,4],ji,-1,Bi,[0,bi],Bi,[0,Pi,-1]],[0],ji],ro=[0,ji,-2],no=class extends En{constructor(t){super(t)}},io=[0],oo=[0,bi,Ei,1,Ei,-4],so=class extends En{constructor(t){super(t,2)}},ao={};ao[336783863]=[0,ji,Ei,-1,bi,[0,[1,2,3,4,5,6,7,8,9],Bi,io,Bi,Qi,Bi,ro,Bi,oo,Bi,Yi,Bi,[0,ji,-2],Bi,[0,ji,Pi],Bi,eo,Bi,Ji],[0,ji],Ei,[0,[1,3],[2,4],Bi,[0,Si],-1,Bi,[0,Ii],-1,xi,[0,ji,-1]],ji];var uo=[0,mi,-1,Ai,-3,mi,Si,Ti,_i,mi,-1,Ai,_i,Ai,-2,Ti];function lo(t){or(t,3,"TEXT:text_in")}var co=class extends En{constructor(t){super(t,500)}u(t){return Xe(this,0,7,t)}},ho=[-1,{}],fo=[0,ji,1,ho],po=[0,ji,Ii,ho];function vo(t){or(t,10,"text_in")}var go=class extends En{constructor(t){super(t,500)}u(t){return Xe(this,0,1001,t)}};go.prototype.j=Mi([-500,xi,[-500,Ti,-1,Ii,-3,[-2,ao,Ei],xi,zi,_i,-1,fo,po,xi,[0,Ti,Ai],Ti,uo,_i,Ii,987,Ii],4,xi,[-500,ji,-1,[-1,{}],998,ji],xi,[-500,ji,Ii,-1,[-2,{},Ei],997,Ii,-1],_i,xi,[-500,ji,Ii,ho,998,Ii],Ii,_i,fo,po,xi,[0,Ti,-1,ho],Ii,-2,uo,Ti,-1,Ai,[0,Ai,Ui],978,ho,xi,zi]);var mo=class extends En{constructor(t){super(t)}},yo=class extends En{constructor(t){super(t)}j(){return Ye(this,mo)}},bo=class extends En{constructor(t){super(t)}},wo=Ci(class extends En{constructor(t){super(t)}},[0,xi,[0,1,bi,ji,[0,xi,[0,bi,fi,ji,-1]]],vi]),So=class extends En{constructor(t){super(t)}},_o=class extends En{constructor(t){super(t)}j(){var t=je(this,1,void 0,Ve);return null==t?j():t}},Eo=class extends En{constructor(t){super(t)}},Ao=[1,2],Io=Ci(class extends En{constructor(t){super(t)}},[0,xi,[0,Ao,Bi,[0,di],Bi,[0,Ni],bi,ji],vi]),To=class extends En{constructor(t){super(t)}},jo=class extends En{constructor(t){super(t)}},xo=[0,Ei,-1],Bo=class extends En{constructor(t){super(t)}j(){return Le(this,Xi,2,No)}l(){return er(this,to,6,No)}},No=[1,2,3,4,5,6],Lo=class extends En{constructor(t){super(t)}j(){return null!=je(this,1,void 0,Ve)}l(){return null!=re(je(this,2))}},Oo=class extends En{constructor(t){super(t)}},Uo=[0,Ni,ji,[0,bi,vi,-1],[0,yi,vi]],Po=[0,Uo,Ei,[0,No,Bi,oo,Bi,Qi,Bi,Yi,Bi,io,Bi,ro,Bi,eo],Pi],ko=class extends En{constructor(t){super(t)}},Fo=new Vi(462704549,ko);ao[462704549]=[0,Po,[0,ji,bi,fi,Ii,-1]];var Vo=class extends En{constructor(t){super(t)}},Co=new Vi(477589892,Vo);function Mo(t,e){if(e=e?be(e):new To,void 0!==t.displayNamesLocale?Be(e,1,ee(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Be(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw P("int32");if(!Vt(r))throw P("int32");r|=0}Be(e,2,r)}else"maxResults"in t&&Be(e,2);if(void 0!==t.scoreThreshold){if(null!=(r=t.scoreThreshold)&&"number"!=typeof r)throw Error(`Value of float/double field must be a number, found ${typeof r}: ${r}`);Be(e,3,r)}else"scoreThreshold"in t&&Be(e,3);return void 0!==t.categoryAllowlist?Ce(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Be(e,4),void 0!==t.categoryDenylist?Ce(e,5,t.categoryDenylist):"categoryDenylist"in t&&Be(e,5),e}function Ro(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Go(t){var e={classifications:Ye(t,bo).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,Mt)??0??0,categoryName:re(je(t,3))??""??"",displayName:re(je(t,4))??""??""})),headIndex:e,headName:r}}(Ke(t,yo,4)?.j()??[],zt(je(t,2))??0,re(je(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(ft(t)?t=Number(t):(t=Pt(64,t),t=ft(t)?Number(t):String(t)),t):Dt(t)?"number"==typeof t?Ht(t):qt(t):void 0}(je(t,2,void 0,Xt))&&(e.timestampMs=Ro(je(t,2,void 0,Xt)??Te)),e}function Do(t){return Array.from(t,t=>t>127?t-256:t)}function zo(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let o=0;o<t.length;o++)r+=t[o]*e[o],n+=t[o]*t[o],i+=e[o]*e[o];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}ao[477589892]=[0,Po,xo,1,Uo];var $o,Wo=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 Ho(t){if(t)return!0;if(void 0===$o)try{await WebAssembly.instantiate(Wo),$o=!0}catch{$o=!1}return $o}async function Ko(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Ho(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var qo=class{};function Yo(t){return ir(new Jo,1,t)}qo.forVisionTasks=function(t,e=!1){return Ko("vision",t??qi``,e)},qo.forLiteRtLmTextTasks=function(t,e=!1){return Ko("litertlm_text",t??qi``,e)},qo.forTextTasks=function(t,e=!1){return Ko("text",t??qi``,e)},qo.forRetrievalTasks=function(t,e=!1){return Ko("retrieval",t??qi``,e)},qo.forGenAiTasks=function(t,e=!1){return Ko("genai",t??qi``,e)},qo.forDecisionTasks=function(t,e=!1){return Ko("decision",t??qi``,e)},qo.forAudioTasks=function(t,e=!1){return Ko("audio",t??qi``,e)},qo.isSimdSupported=function(t=!1){return Ho(t)};var Jo=class extends En{constructor(t){super(t)}},Xo=class extends En{constructor(t){super(t)}},Qo=[0,Pi,2,yi,-2,vi,xi,[0,Pi,vi]],Zo=class extends En{constructor(t){super(t)}},ts=class extends En{constructor(t){super(t)}};function es(t,e){return ir(t,1,e)}function rs(t,e){return ir(t,2,e)}var ns=class extends En{constructor(t){super(t)}},is=[3,4,5,6,7],os=class extends En{constructor(t){super(t)}},ss=class extends En{constructor(t){super(t)}};ss.prototype.j=Mi([0,[0,Pi,ji,-3,Pi],[0,is,Pi,-1,Bi,[0,Pi,ji,yi],Bi,Qo,Bi,[0,1,Qo],Bi,[0,Pi],Bi,[0,Pi,ji,yi]]]);var as=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=this.h?new AbortController:void 0,i=n&&t.O>0?setTimeout(()=>{n.abort()},t.O):void 0;try{let i=await fetch(t.url,{method:t.ga,headers:{...t.fa},...t.body&&{body:t.body},...t.withCredentials&&{credentials:"include"},signal:t.O&&n?n.signal:null});200===i.status?e?.(await i.text()):r?.(i.status)}catch(t){if("AbortError"===t?.name)r?.(408);else r?.(400)}finally{clearTimeout(i)}}},us=class extends En{constructor(t){super(t,37)}},ls=[-4,{},$i,Pi,Di],cs=[0,ji,Pi],hs=[0,ji,Pi],fs=[0,Pi,ji,-1,vi,bi,-1,ji,-5,xi,[0,ji,-4],-1,Ei,[0,Ei,-3],Pi],ds=[0,ji,Pi,1,ji,-1,Pi,1,Pi,1,vi],ps=[0,Pi,ji,-2],vs=[0,Ei,-3];var gs,ms=class extends En{constructor(t){super(t,19)}},ys=(gs=[-19,{},[0,Pi,1,[0,ji,-6,vi,bi,ji,-1,vi],1,[0,ji,1,ji,-5],ji,-1,[0,Pi,ji,-8],[0,ji,-3],[0,ji,Pi,ji,-2],[0,ji,-1,Pi,ji,-1,Pi,ji,-1,[0,xi,[0,ji,-1],Ei,ji,-5],[0,Pi,Ei,bi,-2]],vi,[0,ji,-3,vi,bi,ji,-1],[0,Pi,ji,-1],[0,ji,-9],[0,ji,-6,Pi,ji,1,ji,Ei,Pi,-1,Ei,ji,-2,Pi,ji,Pi,ji,bi,-1],1,[0,Pi],1,[0,ji,-4],1,ds,[0,[1,2,3,4,5,6],Bi,ds,Bi,cs,Bi,hs,Bi,[0,Pi],Bi,fs,Bi,ps],cs,hs,fs,[0,[0,Pi,ji,-1,vi,bi,-1,ji,-4,xi,[0,ji,-4],-1,1,vs],[0,Pi,ji,-1,vi,bi,-1,ji,-4,vs]],ps,[0,ji,[0,bi,-3,Pi],Pi,-2,[0,bi,-1],Ei],4,[0,ji,Pi,ji,-1,vi,Pi,ji,-1,Pi,bi,-1]],Pi,xi,[-37,{},pi,ji,xi,[0,ji,-1],Ni,1,Ni,[0,Ii,-1,wi,gi,-1],ji,[0,bi,ji,-1],Ei,bi,vi,ji,-1,Fi,Gi,pi,Ni,Pi,wi,vi,-1,[0,Pi,-1],ji,Ei,ji,Si,ji,-1,hi,1,hi,ls,Ei,[0,Pi,[0,fi,bi,-2],[0,fi]],[0,Pi,vi]],pi,Li,ji,-1,pi,Pi,-1,[0,Ei,-1,Pi,Ei],[0,vi,-1,ji],[0,pi,Ei,vi],vi,1,Oi,1,ls],t=>Jn(t,gs)),bs=class{constructor(t){this.j=[],this.o=new as,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 ms;{Ee(e=ir(e,2,1786));let l=e.m,c=0|l[Y];if(null==t)Ne(l,c,3);else{var r=t===M?7:0|t[Y],n=r,i=Fe(r),o=i||Object.isFrozen(t),s=!0,a=!0;for(let e=0;e<t.length;e++){var u=t[e];i||(u=tt(u),s&&=!u,a&&=u)}i||(r=s?13:5,r=a?-4097&r:4096|r),o&&r===n||(t=Ut(t),n=0,r=Ze(r,c)),r!==n&&Q(t,r),c=Ne(l,c,3,t),2&r||!(4096&r||16&r)||Ae(l,c)}}return e}(r),r=ys(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",ga:"POST",O:1e4,body:r,ha:2,fa:{"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 ws{constructor(){this.K=this.D=this.J=this.C=this.H=this.I=this.G=0}}function Ss(t,e){var r=new ss;r=Xe(r,0,1,t.V),r=Xe(r,0,2,e),e=Be(e=new us,6,rt(r=r.j(),!1)),(t=t.F).error||t.j.push(e)}function _s(t,e){var r={G:e.G-t.l.G,I:e.I-t.l.I,H:e.H-t.l.H,C:e.C-t.l.C,J:e.J-t.l.J,D:e.D,K:e.K},n=rs(es(new ns,t.B),1);r=Es(t,r),Ss(t,n=Qe(n,4,is,r)),t.l=e}function Es(t,e){var r=new Xo;return t=nr(t=rr(t=ir(r,1,t.A),7,e.C),5,e.D),t=nr(t,6,e.K),e.H>0&&nr(t,4,e.J/e.H),0!==e.G&&(r=rr(r=Yo(3),2,e.G),tr(t,8,Jo,r)),0!==e.I&&(e=rr(r=Yo(4),2,e.I),tr(t,8,Jo,e)),t}var As=class{constructor(t,e,r){this.S=performance.now(),this.o=performance.now(),this.j=new Map,this.v=0,this.h=new ws,this.l=new ws,this.F=new bs(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;default:return 0}}(t),this.A=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 os,"undefined"==typeof window?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=ir(t,1,e),2,ee("")),t=Be(t,3,ee("")),t=Be(t,4,ee("1.1.1")),t=Be(t,5,ee("")),this.V=ir(t,6,4)}da(){var t=new ts;t=nr(t=ir(t,1,this.A),3,performance.now()-this.S),Ss(this,t=Qe(rs(es(new ns,this.B),0),3,is,t)),this.o=performance.now()}ca(){var t={...this.h,C:this.h.C+this.j.size,D:this.v,K:performance.now()-this.S};_s(this,t);var e=new Zo;e=Xe(e,0,2,t=Es(this,t)),Ss(this,e=Qe(t=rs(es(new ns,this.B),2),5,is,e))}close(){var t=this.F;"function"==typeof t.close?t.close():t.flush()}};function Is(){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 Ts(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 js(t,e,r){t.o||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 xs(t,e,r){t.o||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Bs(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Ns(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Ls=function(t){return class extends t{get R(){return this.i}aa(){if("function"==typeof this.R._mediapipeLoggerGetEncodedApiKey){let t=this.R._mediapipeLoggerGetEncodedApiKey();return this.R._decodeBase64(t)}}}}(function(t){return class extends t{ea(){this.i._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.l=!0,this.i=t,this.h=null,this.j=0,this.o="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Is()?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,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),js(this,n||"input_audio",n=>{js(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,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,n,i){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),js(this,n,t=>{this.i._addAudioToInputStream(this.h,e,r,t,i)})}addGpuBufferToStream(t,e,r){js(this,e,e=>{if(!this.i.canvas)throw Error("No OpenGL canvas configured.");e?this.i._bindTextureToStream(e):this.i._bindTextureToCanvas();var n=this.i.canvas.getContext("webgl2")||this.i.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.l||i===this.i.canvas.width&&o===this.i.canvas.height||(this.i.canvas.width=i,this.i.canvas.height=o);var[s,a]=[i,o];this.i._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){js(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){js(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){js(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){js(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){js(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){js(this,e,e=>{js(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){js(this,e,e=>{xs(this,Object.keys(t),n=>{xs(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){js(this,r,r=>{js(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){js(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){js(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)js(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){js(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){js(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){js(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){js(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){js(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){js(this,e,e=>{js(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){js(this,r,r=>{js(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){js(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){js(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){js(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){js(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){js(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){js(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)js(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Bs(this,t,e),js(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Bs(this,t,e),js(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ns(this,t,e),js(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?'),Bs(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),js(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}})),Os=class extends Ls{};async function Us(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await Ts(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Ts(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&n&&((e=self.Module).locateFile=n.locateFile,n.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=n.mainScriptUrlOrBlob)),n=await self.ModuleFactory(self.Module||n),self.ModuleFactory=self.Module=void 0,new t(n,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),function(t,e){e=e.na??"";var r=t.h.aa();t.j=new As(t.F(),e,r)}(t,r),await t.u(r),t}async function Ps(t,e,r){return Us(t,e,r)}function ks(t,e,r){try{t.h.i.FS_unlink(`/${r}`)}catch{}t.h.i.FS_createDataFile("/",r,e,!0,!1,!1),Fs(t,`/${r}`)}function Fs(t,e){var r=Ke(t.baseOptions,Lo,1)||new Lo;"string"==typeof e?(Be(r,2,ee(e)),Be(r,1)):e instanceof Uint8Array&&(Be(r,1,rt(e,!1)),Be(r,2)),Xe(t.baseOptions,0,1,r)}function Vs(t,e,r=!0,n=!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(!(Ke(t.baseOptions,Lo,1)?.j()||Ke(t.baseOptions,Lo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");!function(t,e){var r=Ke(t.baseOptions,Bo,3);if(!r){var n=r=new Bo,i=new no;Qe(n,4,No,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Xi,Qe(e,2,No,n)):(e=r,n=new no,Qe(e,4,No,n))),Xe(t.baseOptions,0,3,r)}(t,r);let i=n?"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=>{ks(t,new Uint8Array(e),i),t.o()});if(r.modelAssetBuffer instanceof Uint8Array)n?ks(t,r.modelAssetBuffer,i):Fs(t,r.modelAssetBuffer);else if(r.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(r.modelAssetBuffer).then(e=>{n?ks(t,e,i):Fs(t,e),t.o()})}return t.o(),Promise.resolve()}function Cs(t){try{let e=t.B.length;if(1===e)throw Error(t.B[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.B.map(t=>t.message).join(", "))}finally{t.B=[]}}function Ms(t,e){if(t.j&&void 0!==e){let r=Ke(t.baseOptions,Bo,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.I,t.j.set(e,performance.now())):(++(t=t.j).h.G,t.j.set(e,performance.now()))}}function Rs(t,e){t.v=Math.max(t.v,e)}var Gs=class{constructor(t){this.h=t,this.B=[],this.v=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.B.push(Error(e))}),this.h.ea(),this.h.setGraph(t,e),this.j?.da(),Cs(this)}finishProcessing(t){if(this.h.finishProcessing(),Cs(this),this.j&&void 0!==t){var e=this.j,r=e.j.get(t);if(void 0!==r&&(e.j.delete(t),t=performance.now()-r,++e.h.H,e.h.J+=t,e.h.D=Math.max(e.h.D,t),e.v=Math.max(e.v,t),performance.now()>e.o+3e4)){for(let[n,i]of e.j.entries())t=n,i<r&&(e.h.C++,e.j.delete(t));r={...e.h,K:performance.now()-e.o},e.h.D=0,e.o=performance.now(),_s(e,r)}}}close(){this.j?.ca(),this.j?.close(),this.h.closeGraph()}};Gs.prototype.close=Gs.prototype.close;var Ds=class extends Gs{constructor(t,e){super(new Os(t,e)),this.A={languages:[]},Xe(t=this.l=new ko,0,1,e=new Oo)}F(){return"LanguageDetector"}u(t){return Xe(this.l,0,2,Mo(t,Ke(this.l,To,2))),Vs(this,t)}get baseOptions(){return Ke(this.l,Oo,1)}set baseOptions(t){Xe(this.l,0,1,t)}Y(t){this.A={languages:[]};var e=this.v+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}o(){var t=new go;vo(t),or(t,15,"classifications_out");var e=new so;_n(e,Fo,this.l);var r=new co;Me(r,ee("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),lo(r),or(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),tr(t,1,co,r),this.h.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=Go(wo(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.A.languages=t[0].categories.map(t=>({languageCode:t.categoryName,probability:t.score})),Rs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Rs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};Ds.prototype.detect=Ds.prototype.Y,Ds.prototype.setOptions=Ds.prototype.u,Ds.createFromModelPath=function(t,e){return Ps(Ds,t,{baseOptions:{modelAssetPath:e}})},Ds.createFromModelBuffer=function(t,e){return Ps(Ds,t,{baseOptions:{modelAssetBuffer:e}})},Ds.createFromOptions=function(t,e){return Ps(Ds,t,e)};var zs=class extends Gs{constructor(t,e){super(new Os(t,e)),this.A={classifications:[]},Xe(t=this.l=new ko,0,1,e=new Oo)}F(){return"TextClassifier"}u(t){return Xe(this.l,0,2,Mo(t,Ke(this.l,To,2))),Vs(this,t)}get baseOptions(){return Ke(this.l,Oo,1)}set baseOptions(t){Xe(this.l,0,1,t)}X(t){this.A={classifications:[]};var e=this.v+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.A}o(){var t=new go;vo(t),or(t,15,"classifications_out");var e=new so;_n(e,Fo,this.l);var r=new co;Me(r,ee("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),lo(r),or(r,4,"CLASSIFICATIONS:classifications_out"),r.u(e),tr(t,1,co,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.A=Go(wo(t)),Rs(this,e)}),this.h.attachEmptyPacketListener("classifications_out",t=>{Rs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function $s(t){switch(t){case"RETRIEVAL_QUERY":default:return"search result";case"SEMANTIC_SIMILARITY":return"sentence similarity";case"CLASSIFICATION":return"classification";case"CLUSTERING":return"clustering";case"QUESTION_ANSWERING":return"question answering";case"FACT_CHECKING":return"fact checking";case"CODE_RETRIEVAL":return"code retrieval"}}zs.prototype.classify=zs.prototype.X,zs.prototype.setOptions=zs.prototype.u,zs.createFromModelPath=function(t,e){return Ps(zs,t,{baseOptions:{modelAssetPath:e}})},zs.createFromModelBuffer=function(t,e){return Ps(zs,t,{baseOptions:{modelAssetBuffer:e}})},zs.createFromOptions=function(t,e){return Ps(zs,t,e)};var Ws=class extends Gs{constructor(t,e){super(new Os(t,e)),this.A={embeddings:[]},Xe(t=this.l=new Vo,0,1,e=new Oo)}F(){return"TextEmbedder"}u(t){var e=this.l,r=Ke(this.l,jo,2);return r=r?be(r):new jo,void 0!==t.l2Normalize?Be(r,1,Rt(t.l2Normalize)):"l2Normalize"in t&&Be(r,1),void 0!==t.quantize?Be(r,2,Rt(t.quantize)):"quantize"in t&&Be(r,2),Xe(e,0,2,r),Vs(this,t)}get baseOptions(){return Ke(this.l,Oo,1)}set baseOptions(t){Xe(this.l,0,1,t)}Z(t,e){var r=this.v+1;if(Ms(this,r),e)t:{let r=e.type,n=e.title&&e.title.length>0?e.title:"none";switch(e="DOCUMENT"!==e.textRole,r){case"RETRIEVAL_DOCUMENT":t=`title: ${n} | text: ${t}`;break t;case"RETRIEVAL_QUERY":t=`task: ${$s(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${$s(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${$s(r)} | query: ${t}`}}return this.h.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.A}o(){var t=new go;vo(t),or(t,15,"embeddings_out");var e=new so;_n(e,Co,this.l);var r=new co;Me(r,ee("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),lo(r),or(r,4,"EMBEDDINGS:embeddings_out"),r.u(e),tr(t,1,co,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Io(t),this.A=function(t){return{embeddings:Ye(t,Eo).map(t=>{var e={headIndex:zt(je(t,3))??0??-1,headName:re(je(t,4))??""??""};if(Le(t,So,1,Ao))t=Oe(t=er(t,So,1,Ao),1,Mt),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=er(t,_o,2,Ao)?.j()?.j()??r}return e}),timestampMs:Ro(je(t,2,void 0,Xt)??Te)}}(t),Rs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Rs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Hs(t,e){return Ps(Ks,t,e)}Ws.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=zo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=zo(Do(t.quantizedEmbedding),Do(e.quantizedEmbedding))}return t},Ws.prototype.embed=Ws.prototype.Z,Ws.prototype.setOptions=Ws.prototype.u,Ws.createFromModelPath=function(t,e){return Ps(Ws,t,{baseOptions:{modelAssetPath:e}})},Ws.createFromModelBuffer=function(t,e){return Ps(Ws,t,{baseOptions:{modelAssetBuffer:e}})},Ws.createFromOptions=function(t,e){return Ps(Ws,t,e)};var Ks=class extends Gs{constructor(t,e){super(new Os(t,e)),this.baseOptions=new Oo,this.maxNumTokens=0,this.mode="KEYPOINTS",this.l=0}F(){return"TextSummarizer"}async u(t){if(0!==this.l)throw Error("LiteRT LM Tasks do not support updating options after initialization.");return void 0!==t.maxNumTokens&&(this.maxNumTokens=t.maxNumTokens),void 0!==t.mode&&(this.mode=t.mode),Vs(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextSummarizer("/model.litertlm",this.maxNumTokens,this.mode)}summarize(t){var e=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");return e.summarize(this.l,t)}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextSummarizer(this.l)}catch{}this.l=0}super.close()}};Ks.createFromModelBuffer=function(t,e,r=0,n="KEYPOINTS"){return Hs(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r,mode:n})},Ks.createFromModelPath=function(t,e,r=0,n="KEYPOINTS"){return Hs(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r,mode:n})},Ks.createFromOptions=Hs,exports.FilesetResolver=qo,exports.LanguageDetector=Ds,exports.TaskRunner=Gs,exports.TextClassifier=zs,exports.TextEmbedder=Ws,exports.TextSummarizer=Ks;
|
|
2
2
|
//# sourceMappingURL=text_bundle_cjs.js.map
|