@mediapipe/tasks-text 1.2.1-rc.20261102 → 1.2.2

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/text_bundle.js CHANGED
@@ -1,2 +1,2 @@
1
- var Text=function(t){"use strict";var e="undefined"!=typeof self?self:{};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}function c(){var t=e.navigator;return t&&(t=t.userAgent)?t:""}function h(t){return h[" "](t),t}h[" "]=function(){};var f={},d=null;function p(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=d[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}v();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 v(){if(!d){d={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));f[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===d[e]&&(d[e]=t)}}}}var m="undefined"!=typeof Uint8Array,g=!(-1!=c().indexOf("Trident")||-1!=c().indexOf("MSIE"))&&"function"==typeof btoa,y=/[-_.]/g,b={"-":"+",_:"/",".":"="};function w(t){return b[t]||""}function S(t){if(!g)return p(t);t=y.test(t)?t.replace(y,w):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 _={};function E(){return A||=new I(null,_)}function T(t){j(_);var e=t.h;return null==(e=null==e||m&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?S(e):null)?e:t.h=e}var A,I=class{j(){return new Uint8Array(T(this)||0)}constructor(t,e){if(j(e),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function j(t){if(t!==_)throw Error("illegal external caller")}function x(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var N,P,O=void 0;function B(t){return x(t=Error(t),"warning"),t}function L(t,r){if(null!=t){var n=O??={},i=n[t]||0;i>=r||(n[t]=i+1,x(t=Error(),"incident"),function(t){e.setTimeout(()=>{throw t},0)}(t))}}t:{for(var U=["CLOSURE_FLAGS"],k=e,F=0;F<U.length;F++)if(null==(k=k[U[F]])){P=null;break t}P=k}var V=P&&P[748402147];function C(){return"function"==typeof BigInt}N=null==V||V;var M="function"==typeof Symbol&&"symbol"==typeof Symbol();function R(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var G,D=R("jas",void 0,!0),z=R(void 0,"1oa"),$=R(void 0,Symbol()),H=R(void 0,"0ubs"),W=R(void 0,"0ubsb"),K=R(void 0,"0actk"),q=R("m_m","ka",!0),Y={ca:{value:0,configurable:!0,writable:!0,enumerable:!1}},J=Object.defineProperties,X=M?D:"ca",Q=[];function Z(t,e){M||X in t||J(t,Y),t[X]|=e}function tt(t,e){M||X in t||J(t,Y),t[X]=e}function et(t,e){return 2&e&&(t|=2),1|t}tt(Q,7),G=Object.freeze(Q);var rt={};function nt(t,e){return void 0===e?t.h!==it&&!!(2&t.m[X]):!!(2&e)&&t.h!==it}var it={};function ot(t,e){if(null!=t)if("string"==typeof t)t=t?new I(t,_):E();else if(!(t instanceof I))if(m&&null!=t&&t instanceof Uint8Array)t=t.length?new I(new Uint8Array(t),_):E();else{if(!e)throw Error();t=void 0}return t}function st(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 at={};function ut(t){return 128&t?at:void 0}function lt(t){return t.ia=!0,t}var ct=lt(t=>"number"==typeof t),ht=lt(t=>"string"==typeof t),ft=lt(t=>"boolean"==typeof t),dt="function"==typeof e.BigInt&&"bigint"==typeof e.BigInt(0);function pt(t){var e=t;if(ht(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ct(e)&&!Number.isSafeInteger(e))throw Error(String(e));return dt?BigInt(t):t=ft(t)?t?"1":"0":ht(t)?t.trim()||"0":String(t)}var vt=lt(t=>dt?t>=gt&&t<=bt:"-"===t[0]?wt(t,mt):wt(t,yt)),mt=Number.MIN_SAFE_INTEGER.toString(),gt=dt?BigInt(Number.MIN_SAFE_INTEGER):void 0,yt=Number.MAX_SAFE_INTEGER.toString(),bt=dt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function wt(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 St,_t="function"==typeof Uint8Array.prototype.slice,Et=0,Tt=0;function At(t){var e=t>>>0;Et=e,Tt=(t-e)/4294967296>>>0}function It(t){if(t<0){At(-t);let[e,r]=kt(Et,Tt);Et=e>>>0,Tt=r>>>0}else At(t)}function jt(t){var e=St||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function xt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Ot(t,e)}function Nt(t,e){return pt(C()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Ot(t,e))}function Pt(t,e){return C()?pt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):pt(Lt(t,e))}function Ot(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else C()?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 Lt(t,e){if(2147483648&e)if(C())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=kt(t,e);t="-"+Ot(r,n)}else t=Ot(t,e);return t}function Ut(t){if(t.length<16)It(Number(t));else if(C())t=BigInt(t),Et=Number(t&BigInt(4294967295))>>>0,Tt=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Tt=Et=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));Tt*=1e6,(Et=1e6*Et+e)>=4294967296&&(Tt+=Math.trunc(Et/4294967296),Tt>>>=0,Et>>>=0)}if(e){let[t,e]=kt(Et,Tt);Et=t,Tt=e}}}function kt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ft(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,Ct="function"==typeof BigInt?BigInt.asUintN:void 0,Mt=Number.isSafeInteger,Rt=Number.isFinite,Gt=Math.trunc;function Dt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function zt(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 $t=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ht(t){switch(typeof t){case"bigint":return!0;case"number":return Rt(t);case"string":return $t.test(t);default:return!1}}function Wt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Rt(t)?0|t:void 0}function Kt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Ut(t),Lt(Et,Tt))}function qt(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Ut(t),Ot(Et,Tt))}function Yt(t){if(t=Gt(t),!Mt(t)){It(t);var e=Et,r=Tt;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=xt(e,r))?t?-e:e:t?"-"+e:e}return t}function Jt(t){return t=Gt(t),Mt(t)?t=String(t):(It(t),t=Lt(Et,Tt)),t}function Xt(t){var e=Gt(Number(t));return Mt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Kt(t))}function Qt(t){var e=Gt(Number(t));return Mt(e)?pt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),C()?pt(Vt(64,BigInt(t))):pt(Kt(t)))}function Zt(t){var e=typeof t;return null==t?t:"bigint"===e?pt(Vt(64,t)):Ht(t)?"string"===e?Qt(t):pt(Mt(t)?t:Jt(t)):void 0}function te(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Vt(64,t));if(Ht(t)){if("string"===e)return Xt(t);if("number"===e)return Yt(t)}}function ee(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ct(64,t));if(Ht(t)){if("string"===e)return function(t){var e=Gt(Number(t));return Mt(e)&&e>=0?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),qt(t))}(t);if("number"===e)return function(t){return(t=Gt(t))>=0&&Mt(t)||(It(t),t=xt(Et,Tt)),t}(t)}}function re(t){if(null==t||"string"==typeof t||t instanceof I)return t}function ne(t){if("string"!=typeof t)throw Error();return t}function ie(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function oe(t){return null==t||"string"==typeof t?t:void 0}function se(t,e,r){if(null!=t&&t[q]===rt)return t;if(Array.isArray(t)){var n=0|t[X];return(r=n|32&r|2&r)!==n&&tt(t,r),new e(t)}}function ae(t){return t}function ue(t){return $?t[$]:void 0}function le(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ce,he,fe,de=class{};function pe(t,e){e<100||L(H,1)}function ve(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=$;!i&&M&&s&&(o=t[s])&&le(o,pe),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=(ce??ae)(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&&$&&(t=ue(t))&&t instanceof de&&(s[$]=function(t){var e=new de;return le(t,(t,r,n)=>{e[r]=Ft(n)}),e.h=t.h,e}(t)),s}function me(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return vt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[X];return 0===t.length&&1&e?void 0:ve(t,e,me)}if(null!=t&&t[q]===rt)return ge(t);if(t instanceof I){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(g){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),v(),r=f[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 ge(t){return ve(t=t.m,0|t[X],me)}function ye(t,e){return be(t,e[0],e[1])}function be(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[X],N&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(N)throw Error("carr");L(K,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&tt(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 tt(t,64|i|n),t}function we(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[X];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=Ee(t,r,!1,e&&!(16&r)):(Z(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[q]===rt?nt(t,r=0|(e=t.m)[X])?t:xe(t,e,r)?Se(t,e):Ee(e,r):t instanceof I?t:void 0}function Se(t,e,r){return t=new t.constructor(e),r&&(t.h=it),t.o=it,t}function _e(t){var e=t.m,r=0|e[X];return xe(t,e,r)?Se(t,e,!0):new t.constructor(Ee(e,r,!1))}function Ee(t,e,r,n){return n??=!!(34&e),t=ve(t,e,we,n),n=32,r&&(n|=2),tt(t,e=16769217&e|n),t}function Te(t){var e=t.m,r=0|e[X];return nt(t,r)?xe(t,e,r)?Se(t,e,!0):new t.constructor(Ee(e,r,!1)):t}function Ae(t){if(t.h!==it)return!1;var e=t.m;return Z(e=Ee(e,0|e[X]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ie(t){if(!Ae(t)&&nt(t,0|t.m[X]))throw Error()}function je(t,e){void 0===e&&(e=0|t[X]),32&e&&!(4096&e)&&tt(t,4096|e)}function xe(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(tt(e,2|r),t.h=it,!0)}var Ne=pt(0);function Pe(t,e,r,n){if(null!==(t=Oe(t.m,e,r,n)))return t}function Oe(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){Ie(t);var i=t.m;return Le(i,0|i[X],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[X])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Ue(t,e){return null!=(t=Oe(t.m,e))&&t[q]===rt||Array.isArray(t)}function ke(t,e,r){return Ue(t,e=$e(t,r)===e?e:-1)}function Fe(t,e,r,n,i){var o=t.m,s=0|o[X];n=n&&4!==n?1!==n&&(t?nt(t,s):2&s)?1:n:4,i=!!i||3===n,2===n&&Ae(t)&&(s=0|(o=t.m)[X]);var a=(t=Ce(o,e))===G?7:0|t[X],u=et(a,s),l=!(4&u);if(l){let e=0,n=0;for(;e<t.length;e++){let i=r(t[e]);null!=i&&(t[n++]=i)}n<e&&(t.length=n),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(tt(t,u),2&u&&Object.freeze(t)),Ve(t,u,o,s,e,n,l,i)}function Ve(t,e,r,n,i,o,s,a){var u=e,l=Me(e);return l&&2===o&&(t=Ft(t),u=0,e=er(e,n),n=Le(r,n,i,t),l=!1),l||(1===o||4===o&&(2&e||!(16&e)&&32&n)?((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&tt(t,e),Object.freeze(t)):(a||(e|=16),e!==u&&tt(t,e))),2&e||!(4096&e||16&e)||je(r,n),t}function Ce(t,e,r){return t=Oe(t,e,r),Array.isArray(t)?t:G}function Me(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Re(t){return ot(t,!0)}function Ge(t,e,r){Ie(t);var n=0|(t=t.m)[X];if(null==r)Le(t,n,e);else{var i=r===G?7:0|r[X],o=i,s=Me(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Ft(r),o=0,i=er(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=ne(t);Object.is(t,e)||(a&&(r=Ft(r),o=0,i=er(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Ft(r),i=er(i,n)),tt(r,i)),Le(t,n,e,r)}}function De(t,e){Ie(t),Le(t=t.m,0|t[X],2,""===e?void 0:e)}function ze(t,e,r){if(2&e)throw Error();var n=ut(e),i=Ce(t,r,n),o=i===G?7:0|i[X],s=et(o,e);return(2&s||Me(s)||16&s)&&(s===o||Me(s)||tt(i,s),i=Ft(i),o=0,s=er(s,e),Le(t,e,r,i,n)),(s&=-13)!==o&&tt(i,s),i}function $e(t,e){return Ke(He(t=t.m),t,void 0,e)}function He(t){if(M)return t[z]??(t[z]=new Map);if(z in t)return t[z];var e=new Map;return Object.defineProperty(t,z,{value:e}),e}function We(t,e,r,n,i){var o=He(t),s=Ke(o,t,e,r,i);return s!==n&&(s&&(e=Le(t,e,s,void 0,i)),o.set(r,n)),e}function Ke(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!=Oe(e,s,i)&&(0!==o&&(r=Le(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function qe(t,e,r){var n=0|t[X],i=ut(n),o=Oe(t,r,i);if(null!=o&&o[q]===rt){if(!nt(o))return Ae(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o,2&n&&Z(s,34));if(s){let t=0|s[X];2&t&&(s=Ee(s,t))}return(s=ye(s,e))!==o&&Le(t,n,r,s,i),s}function Ye(t,e,r){var n=t.m,i=0|n[X];if(e=function(t,e,r,n){var i=!1;if(null!=(n=Oe(t,n,void 0,t=>{var n=se(t,r,e);return i=n!==t&&null!=n,n})))return i&&!nt(n)&&je(t,e),n}(n,i,e,r),null==e)return e;if(!nt(t,i=0|n[X])){let o=Te(e);o!==e&&(Ae(t)&&(i=0|(n=t.m)[X]),je(n,i=Le(n,i,r,e=o)))}return e}function Je(t,e,r,n,i,o,s,a){o=o&&4!==o?1!==o&&(t?nt(t,r):2&r)?1:o:4,s=!!s||3===o;var u=!!a&&!(t?nt(t,r):2&r);(2===o||u)&&t&&Ae(t)&&(r=0|(e=t.m)[X]);var l=(t=Ce(e,i))===G?7:0|t[X],c=et(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=se(h[s],n,f);if(t instanceof n){if(!e){let e=nt(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&&(tt(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Me(c)&&(t=Ft(t),c=er(c,r),r=Le(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Te(h))&&(n[l]=c);u|=8,tt(t,c=u=n.length?4096|u:-4097&u)}return Ve(t,c,e,r,i,o,a,s)}function Xe(t,e){var r=t.m;return Je(t,r,0|r[X],e,1,void 0,!1,!0)}function Qe(t){return null==t&&(t=void 0),t}function Ze(t,e,r,n,i){return Be(t,r,n=Qe(n),i),n&&!nt(n)&&je(t.m),t}function tr(t,e,r,n){t:{var i=n=Qe(n);Ie(t);let o=t.m,s=0|o[X];if(null==i){let t=He(o);if(Ke(t,o,s,r)!==e)break t;t.set(r,0)}else s=We(o,s,r,e);Le(o,s,e,i)}return n&&!nt(n)&&je(t.m),t}function er(t,e){return-273&(2&e?2|t:-3&t)}function rr(t,e,r,n){Ie(t);var i=t.m;t=Je(t,i,0|i[X],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===G?7:0|t[X],(n=nt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&tt(t,r),n||je(i)}function nr(t,e,r,n){return Ye(t,e,r=$e(t,n)===r?r:-1)}function ir(t,e,r){if(null!=r)t:{if(!Ht(r))throw B("int64");switch(typeof r){case"string":r=Qt(r);break t;case"bigint":r=pt(Vt(64,r));break t;default:r=pt(Mt(r)?r:Jt(r))}}return Be(t,e,r)}function or(t,e,r){return Be(t,e,null==r?r:function(t){if(!Ht(t))throw B("uint64");var e=typeof t;switch(e){case"string":return e=Gt(Number(t)),Mt(e)&&e>=0?t=pt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=C()?pt(Ct(64,BigInt(t))):pt(qt(t))),t;case"bigint":return pt(Ct(64,t));default:return t>=0&&Mt(t)||((t=Gt(t))>=0&&Mt(t)?t=String(t):(It(t),t=Ot(Et,Tt))),pt(t)}}(r))}function sr(t,e,r){if(null!=r){if(!Rt(r))throw B("enum");r|=0}return Be(t,e,r)}function ar(t,e,r){Ie(t),Fe(t,e,oe,2,!0).push(ne(r))}var ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function lr(t,e){if("string"==typeof t)return new ur(S(t),e);if(Array.isArray(t))return new ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ur(t,!1);if(t.constructor===I)return e=T(t)||new Uint8Array(0),new ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ur(t,!1);throw Error()}function cr(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 hr(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 fr(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 dr(t){return cr(t,Pt)}function pr(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 vr(t){var e=pr(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 mr(t){return fr(t)}function gr(t,e){if(t.h=e,e>t.l)throw Error()}function yr(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 br(t,e){if(0==e)return E();var r=yr(t,e);return t.M&&t.A?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):_t?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?E():new I(r,_)}var wr=class{constructor(t,e,r,n){this.j=null,this.A=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,R:i=!1}={}){this.M=n,this.R=i,t&&(t=lr(t,this.R),this.j=t.buffer,this.A=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.A=!1,this.h=this.l=this.o=0,this.M=!1}},Sr=[],_r=0;function Er(t,e,r,n){if(Lr.length){let i=Lr.pop();return i.v(n),i.h.init(t,e,r,n),i}return new Br(t,e,r,n)}function Tr(t){t.h.clear(),t.l=-1,t.j=-1,Lr.length<100&&Lr.push(t)}function Ar(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=fr(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):hr(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=fr(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:jr();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{_r>0&&_r--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function jr(){if(_r>=100)throw new SyntaxError;_r++}function xr(t,e,r){var n=t.h.l,i=fr(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 Nr(t){var e=fr(t.h)>>>0,o=yr(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 Pr(t){var e=fr(t.h)>>>0;return br(t.h,e)}function Or(t,e,r){var n=fr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Br=class{constructor(t,e,r,n){if(Sr.length){let i=Sr.pop();i.init(t,e,r,n),t=i}else t=new wr(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.v(n)}v({U:t=!1}={}){this.U=t}},Lr=[];function Ur(t){return new Vr(4294967295&t,Math.floor(t/4294967296))}function kr(t){return t?/^\d+$/.test(t)?(Ut(t),new Vr(Et,Tt)):null:Fr||=new Vr(0,0)}var Fr,Vr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Cr(t){return new qr(4294967295&t,Math.floor(t/4294967296))}function Mr(t){return t?/^-?\d+$/.test(t)?(Ut(t),new qr(Et,Tt)):null:Rr||=new qr(0,0)}var Rr,Gr,Dr,zr,$r,Hr,Wr,Kr,qr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Yr(t,e,r){return"undefined"!=typeof BigInt64Array?(Wr||(Wr=new BigInt64Array(1),Kr=new Uint32Array(Wr.buffer),Wr[0]=BigInt(1),Hr=1===Kr[0]),Wr[0]=t,new e(Kr[t=Hr?0:1],Kr[1-t])):($r||(Gr=BigInt(Number.MIN_SAFE_INTEGER),Dr=BigInt(Number.MAX_SAFE_INTEGER),zr=BigInt(4294967295),$r=BigInt(32)),t>=Gr&&t<=Dr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&zr),Number(t>>$r))))}function Jr(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 Xr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Qr(t,e){if(e>=0)Xr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Zr(t,e){Ut(e),function(t){var e=Tt>>31;t(Et<<1^e,(Tt<<1|Et>>>31)^e)}((e,r)=>{Jr(t,e>>>0,r>>>0)})}function tn(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 en=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function rn(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function nn(t,e,r){Xr(t.h,8*e+r)}function on(t,e){return nn(t,e,2),e=t.h.end(),rn(t,e),e.push(t.j),e}function sn(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 an(t,e,r){if(null!=r)switch(nn(t,e,0),typeof r){case"number":t=t.h,It(r),Jr(t,Et,Tt);break;case"bigint":r=Yr(r,qr,Cr),Jr(t.h,r.j,r.h);break;default:r=Mr(r),Jr(t.h,r.j,r.h)}}function un(t,e,r){nn(t,e,2),Xr(t.h,r.length),rn(t,t.h.end()),rn(t,r)}var ln=class{constructor(){this.l=[],this.j=0,this.h=new en}};function cn(t){if("string"==typeof t)Mr(t)}function hn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var fn=hn(),dn=hn(),pn=hn(),vn=hn(),mn=hn(),gn=hn(),yn=hn(),bn=hn(),wn=hn(),Sn=hn(),_n=hn(),En=hn();function Tn(t,e,r){var n=t.m;$&&$ in n&&(n=n[$])&&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=be(t,e,void 0,2048)}toJSON(){return ge(this)}};An.prototype[q]=rt,An.prototype.toString=function(){return this.m.toString()};var In=class{constructor(t,e,r){this.h=t,this.j=e,t=fn,this.l=!!t&&r===t||!1}};function jn(t,e){return new In(t,e,fn)}function xn(t,e,r,n,i){null!=(e=Rn(e,n))&&(r=on(t,r),i(e,t),sn(t,r))}var Nn,Pn,On=jn(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},xn),Bn=jn(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},xn),Ln=Symbol(),Un=Symbol(),kn=Symbol(),Fn=Symbol(),Vn=Symbol();function Cn(t,e,r,n){var i=n[t];if(i)return i;(i={}).X=n,i.L=function(t){switch(typeof t){case"boolean":return he||=[0,void 0,!0];case"number":return t>0?void 0:0===t?fe||=[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.V=!0,Nn??=o,Pn??=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=On,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 Mn(t){return Array.isArray(t)?t[0]instanceof In?t:[Bn,t]:[t,void 0]}function Rn(t,e){return t instanceof An?t.m:Array.isArray(t)?ye(t,e):void 0}function Gn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Dn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Cn(Un,Gn,Dn,n).L,o||=zn(n),i)}function zn(t){var e=t[kn];if(null!=e)return e;var r=Cn(Un,Gn,Dn,t);return e=r.V?(t,e)=>Nn(t,e,r):(t,e)=>{t:{jr();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=Hn(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.U)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=br(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[$]??(o[$]=new de))[s]??(n[s]=[])).push(a)}}let l=ue(t);l&&(l.h=r.X[Vn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}u=void 0}return u},t[kn]=e,t[Vn]=$n.bind(t),e}function $n(t,e,r,n){var i=this[Un],o=this[kn],s=ye(void 0,i.L),a=ue(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=Er(t);try{u=!0,o(s,e)}finally{Tr(e)}}else n?.(t,r,i)},null==e)le(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[X];if(2&n&&2048&n&&!r?.ma)throw Error();let i=ut(n),o=(e,o)=>{if(null!=Oe(t,e,i)){if(1===r?.la)return;throw Error()}null!=o&&(n=Le(t,n,e,o,i)),delete a[e]};null==e?st(s,0|s[X],(t,e)=>{o(t,e)}):o(e,Oe(s,e,i))}}}}function Hn(t){var e=(t=Mn(t))[0].h;if(t=t[1]){let r=zn(t),n=Cn(Un,Gn,Dn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function Wn(t,e,r){t[e]=r.j}function Kn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Cn(Ln,Wn,Kn,n).L,i||=qn(n))}function qn(t){var e=t[Fn];if(!e){let r=Cn(Ln,Wn,Kn,t);e=(t,e)=>Yn(t,e,r),t[Fn]=e}return e}function Yn(t,e,r){st(t,0|t[X],(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=Mn(r))[0].j;if(r=r[1]){let e=qn(r),i=Cn(Ln,Wn,Kn,r).L;r=t.V?Pn(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||L(W,3)}}),(t=ue(t))&&le(t,(t,r,n)=>{for(rn(e,e.h.end()),t=0;t<n.length;t++)rn(e,T(n[t])||new Uint8Array(0))})}var Jn=pt(0);function Xn(t,e,r){if(Array.isArray(e)){var n=0|e[X];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&&tt(e,t),r&&2&t&&Object.freeze(e),e}}var Qn=(t,e)=>{var r=new ln;Yn(t.m,r,Cn(Ln,Wn,Kn,e)),rn(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 Zn(t,e,r){return new In(t,e,r)}function ti(t,e,r){return new In(t,e,r)}function ei(t,e,r){Le(t,0|t[X],e,r,ut(0|t[X]))}function ri(t,e,r){null!=(e=te(e))&&(cn(e),an(t,r,e))}function ni(t,e,r){null!=(e=Wt(e))&&null!=e&&(nn(t,r,0),Qr(t.h,e))}function ii(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(nn(t,r,0),t.h.h.push(e?1:0))}function oi(t,e,r){null!=(e=oe(e))&&un(t,r,l(e))}function si(t,e,r,n,i){null!=(e=Rn(e,n))&&(r=on(t,r),i(e,t),sn(t,r))}function ai(t,e,r){null!=(e=re(e))&&un(t,r,lr(e,!0).buffer)}function ui(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 Rt(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(nn(t,r,0),Xr(t.h,e))}function li(t,e,r){null!=(e=Wt(e))&&(e=parseInt(e,10),nn(t,r,0),Qr(t.h,e))}function ci(t,e,r){return 0===t.j&&(ei(e,r,dr(t.h)),!0)}function hi(t,e,r){return(0===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,fr,e):e.push(fr(t.h)),!0)}function fi(t,e,r){return 2===t.j&&(ei(e,r,(t=Pr(t))===E()?void 0:t),!0)}var di=Zn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=pr(n);var i=pr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ei(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=Dt(e))&&(nn(t,r,1),t=t.h,(r=St||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Et=r.getUint32(0,!0),Tt=r.getUint32(4,!0),tn(t,Et),tn(t,Tt))},Sn),pi=Zn(function(t,e,r){return 5===t.j&&(ei(e,r,vr(t.h)),!0)},function(t,e,r){null!=(e=Dt(e))&&(nn(t,r,5),t=t.h,jt(e),tn(t,Et))},wn),vi=ti(function(t,e,r){return(5===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,vr,e):e.push(vr(t.h)),!0)},function(t,e,r){if(null!=(e=Xn(Dt,e,!0))&&e.length){nn(t,r,2),Xr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,jt(e[n]),tn(r,Et)}},wn),mi=Zn(function(t,e,r){return ci(t,e,r)},ri,gn),gi=Zn(function(t,e,r){return ci(t,e,r)},ri,gn),yi=ti(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=ze(e,0|e[X],r),2==t.j?Or(t,dr,e):e.push(dr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Xn(te,e,!1)))for(let n=0;n<e.length;n++)an(t,r,e[n])},gn),bi=Zn(function(t,e,r){return 0!==t.j?e=!1:(ei(e,r,(t=dr(t.h))===Jn?void 0:t),e=!0),e},ri,gn),wi=Zn(function(t,e,r){return 0!==t.j?t=!1:(ei(e,r,cr(t.h,Nt)),t=!0),t},function(t,e,r){if(null!=(e=ee(e))){if("string"==typeof e)kr(e);if(null!=e)switch(nn(t,r,0),typeof e){case"number":t=t.h,It(e),Jr(t,Et,Tt);break;case"bigint":r=Yr(e,Vr,Ur),Jr(t.h,r.j,r.h);break;default:r=kr(e),Jr(t.h,r.j,r.h)}}},yn),Si=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)),!0)},ni,vn),_i=ti(hi,function(t,e,r){if(null!=(e=Xn(Wt,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(nn(n,i,0),Qr(n.h,o))}},vn),Ei=ti(hi,function(t,e,r){if(null!=(e=Xn(Wt,e,!0))&&e.length){r=on(t,r);for(let r=0;r<e.length;r++)Qr(t.h,e[r]);sn(t,r)}},vn),Ti=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h))?void 0:t),!0)},ni,vn),Ai=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,hr(t.h)),!0)},ii,dn),Ii=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,!1===(t=hr(t.h))?void 0:t),!0)},ii,dn),ji=ti(function(t,e,r){return 2===t.j&&(t=Nr(t),ze(e,0|e[X],r).push(t),!0)},function(t,e,r){if(null!=(e=Xn(oe,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&un(n,i,l(o))}},pn),xi=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,""===(t=Nr(t))?void 0:t),!0)},oi,pn),Ni=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,Nr(t)),!0)},oi,pn),Pi=function(t,e,r=fn){return new In(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ye(void 0,n),ze(e,0|e[X],r).push(n),xr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)si(t,e[o],r,n,i);1&(t=0|e[X])||tt(e,1|t)}}),Oi=jn(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[X];return We(e,s,o,r,ut(s)),xr(t,e=qe(e,n,r),i),!0},si),Bi=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,Pr(t)),!0)},ai,_n),Li=ti(function(t,e,r){return 2===t.j&&(t=Pr(t),ze(e,0|e[X],r).push(t),!0)},function(t,e,r){if(null!=(e=Xn(re,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&un(n,i,lr(o,!0).buffer)}},_n),Ui=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)>>>0),!0)},ui,mn),ki=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h)>>>0)?void 0:t),!0)},ui,mn),Fi=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)),!0)},li,En),Vi=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h))?void 0:t),!0)},li,En),Ci=Zn(function(t,e,r){return 0!==t.j?t=!1:(ei(e,r,function(t){return cr(t,(t,e)=>{var r=-(1&t);return Pt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=te(e))&&(cn(e),null!=e))switch(nn(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,At(r=2*Math.abs(r)),r=Et;let n=Tt;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Jr(t,Et=r,Tt=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),Et=Number(BigInt.asUintN(32,e)),Tt=Number(BigInt.asUintN(32,e>>BigInt(32))),Jr(t,Et,Tt);break;default:Zr(t.h,e)}},bn);class Mi{constructor(t,e){var r=ao;this.h=t,this.j=e,this.o=Ze,this.defaultValue=void 0,this.l=null!=r.ja?at:void 0}register(){h(this)}}function Ri(t,e){return(r,n)=>{t:{let o={R:!0};n&&Object.assign(o,n),r=Er(r,void 0,void 0,o);try{let n=new t,o=n.m;zn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Tr(r)}i=void 0}return i}}function Gi(t){return function(){return Qn(this,t)}}var Di,zi=[0,Bi,Li,Ai,Ni],$i=[0,xi,[0,Vi,[0,bi,Ti],Vi,-1,[0,Fi],Vi,-1],Zn(fi,ai,_n)],Hi=[0,xi,Zn(fi,function(t,e,r){if(null!=e){if(e instanceof An){let n=e.oa;return void(n?(e=n(e),null!=e&&un(t,r,lr(e,!0).buffer)):L(W,3))}if(Array.isArray(e))return void L(W,3)}ai(t,e,r)},_n)],Wi=[0,1,[0,12,Si,10,Ai],[0,7,[0,Si,-1]]],Ki=globalThis.trustedTypes;var qi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Yi(t){var e;return void 0===Di&&(Di=function(){var t=null;if(!Ki)return t;try{let e=t=>t;t=Ki.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Di)?e.createScriptURL(t):t,new qi(t)}function Ji(t,...e){if(0===e.length)return Yi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Yi(r)}var Xi=[0,Si,Fi,Ai,-1,Ei,Fi,-1,Ai,-1],Qi=[0,Fi,-1,Ai],Zi=class extends An{constructor(t){super(t)}},to=[0,Ai,Ni,Ai,Fi,-1,ti(function(t,e,r){return(0===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,mr,e):e.push(fr(t.h)),!0)},function(t,e,r){if(null!=(e=Xn(Wt,e,!0))&&e.length){r=on(t,r);for(let r=0;r<e.length;r++)Qr(t.h,e[r]);sn(t,r)}},En),Ni,-1,[0,Ai,-1],Fi,Ai,-1,Qi],eo=class extends An{constructor(t){super(t)}j(){return Ue(this,9)}},ro=[0,3,Ai,-1,2,[0,[2],Si,Oi,[0,Ui]],[0,Fi,Ai,Fi,Ai,Fi,4,[0,Ai,Ni,-1,Ai,Si,-1,Ai],Fi,Ai,-4,Fi,ji,Ai,ji,Ai,-1,Si,Ai,-3,[0,Ai,Si],[0,Ni,Si,-1],[0,Ai],[0,Ai,-1],[0,Ai,Si,-1]],[0,[3,4],Ni,-1,Oi,[0,Si],Oi,[0,Fi,-2]],[0],Ni,Ai],no=[0,Ni,-2],io=class extends An{constructor(t){super(t)}},oo=[0],so=[0,Si,Ai,1,Ai,-4],ao=class extends An{constructor(t){super(t,2)}},uo={};uo[336783863]=[0,Ni,Ai,-1,Si,[0,[1,2,3,4,5,6,7,8,9],Oi,oo,Oi,to,Oi,no,Oi,so,Oi,Xi,Oi,[0,Ni,-2],Oi,[0,Ni,Fi],Oi,ro,Oi,Qi],[0,Ni],Ai,[0,[1,3],[2,4],Oi,[0,Ei],-1,Oi,[0,ji],-1,Pi,[0,Ni,-1]],Ni];var lo=[0,bi,-1,Ii,-3,bi,Ei,xi,Ti,bi,-1,Ii,Ti,Ii,-2,xi];function co(t){ar(t,3,"TEXT:text_in")}var ho=class extends An{constructor(t){super(t,500)}v(t){return Ze(this,0,7,t)}},fo=[-1,{}],po=[0,Ni,1,fo],vo=[0,Ni,ji,fo];function mo(t){ar(t,10,"text_in")}var go=class extends An{constructor(t){super(t,500)}v(t){return Ze(this,0,1001,t)}};go.prototype.j=Gi([-500,Pi,[-500,xi,-1,ji,-3,[-2,uo,Ai],Pi,Hi,Ti,-1,po,vo,Pi,[0,xi,Ii],xi,lo,Ti,ji,987,ji],4,Pi,[-500,Ni,-1,[-1,{}],998,Ni],Pi,[-500,Ni,ji,-1,[-2,{},Ai],997,ji,-1],Ti,Pi,[-500,Ni,ji,fo,998,ji],ji,Ti,po,vo,Pi,[0,xi,-1,fo],ji,-2,lo,xi,-1,Ii,[0,Ii,ki],978,fo,Pi,Hi]);var yo=class extends An{constructor(t){super(t)}},bo=class extends An{constructor(t){super(t)}j(){return Xe(this,yo)}},wo=class extends An{constructor(t){super(t)}},So=Ri(class extends An{constructor(t){super(t)}},[0,Pi,[0,1,Si,Ni,[0,Pi,[0,Si,pi,Ni,-1]]],gi]),_o=class extends An{constructor(t){super(t)}},Eo=class extends An{constructor(t){super(t)}j(){var t=Pe(this,1,void 0,Re);return null==t?E():t}},To=class extends An{constructor(t){super(t)}},Ao=[1,2],Io=Ri(class extends An{constructor(t){super(t)}},[0,Pi,[0,Ao,Oi,[0,vi],Oi,[0,Bi],Si,Ni],gi]),jo=class extends An{constructor(t){super(t)}},xo=class extends An{constructor(t){super(t)}},No=[0,Ai,-1],Po=class extends An{constructor(t){super(t)}j(){return ke(this,2,Oo)}l(){return nr(this,eo,6,Oo)}},Oo=[1,2,3,4,5,6],Bo=class extends An{constructor(t){super(t)}j(){return null!=Pe(this,1,void 0,Re)}l(){return null!=oe(Pe(this,2))}},Lo=class extends An{constructor(t){super(t)}},Uo=[0,Bi,Ni,[0,Si,gi,-1],[0,wi,gi]],ko=[0,Uo,Ai,[0,Oo,Oi,so,Oi,to,Oi,Xi,Oi,oo,Oi,no,Oi,ro],Fi],Fo=class extends An{constructor(t){super(t)}},Vo=new Mi(462704549,Fo);uo[462704549]=[0,ko,[0,Ni,Si,pi,ji,-1]];var Co=class extends An{constructor(t){super(t)}},Mo=new Mi(477589892,Co);function Ro(t,e){if(e=e?_e(e):new jo,void 0!==t.displayNamesLocale?Be(e,1,ie(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 B("int32");if(!Rt(r))throw B("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?Ge(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Be(e,4),void 0!==t.categoryDenylist?Ge(e,5,t.categoryDenylist):"categoryDenylist"in t&&Be(e,5),e}function Go(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Do(t){var e={classifications:Xe(t,wo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:Wt(Pe(t,1))??0??-1,score:Pe(t,2,void 0,Dt)??0??0,categoryName:oe(Pe(t,3))??""??"",displayName:oe(Pe(t,4))??""??""})),headIndex:e,headName:r}}(Ye(t,bo,4)?.j()??[],Wt(Pe(t,2))??0,oe(Pe(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(vt(t)?t=Number(t):(t=Vt(64,t),t=vt(t)?Number(t):String(t)),t):Ht(t)?"number"==typeof t?Yt(t):Xt(t):void 0}(Pe(t,2,void 0,Zt))&&(e.timestampMs=Go(Pe(t,2,void 0,Zt)??Ne)),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)}function Ho(t,e,r){return r=`wasm${r?"_module":""}_internal`,Promise.resolve({wasmLoaderPath:`${e}/${t}_${r}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`})}uo[477589892]=[0,ko,No,1,Uo];var Wo=class{};function Ko(t){return sr(new qo,1,t)}Wo.forVisionTasks=function(t,e=!1){return Ho("vision",t??Ji``,e)},Wo.forLiteRtLmTextTasks=function(t,e=!1){return Ho("litertlm_text",t??Ji``,e)},Wo.forTextTasks=function(t,e=!1){return Ho("text",t??Ji``,e)},Wo.forRetrievalTasks=function(t,e=!1){return Ho("retrieval",t??Ji``,e)},Wo.forGenAiTasks=function(t,e=!1){return Ho("genai",t??Ji``,e)},Wo.forDecisionTasks=function(t,e=!1){return Ho("decision",t??Ji``,e)},Wo.forAudioTasks=function(t,e=!1){return Ho("audio",t??Ji``,e)};var qo=class extends An{constructor(t){super(t)}},Yo=class extends An{constructor(t){super(t)}},Jo=[0,Fi,2,wi,-2,gi,Pi,[0,Fi,gi]],Xo=class extends An{constructor(t){super(t)}},Qo=class extends An{constructor(t){super(t)}};function Zo(t,e){return sr(t,1,e)}function ts(t,e){return sr(t,2,e)}var es=class extends An{constructor(t){super(t)}},rs=[3,4,5,6,7],ns=class extends An{constructor(t){super(t)}},is=class extends An{constructor(t){super(t)}};is.prototype.j=Gi([0,[0,Fi,Ni,-3,Fi],[0,rs,Fi,-1,Oi,[0,Fi,Ni,wi],Oi,Jo,Oi,[0,1,Jo],Oi,[0,Fi],Oi,[0,Fi,Ni,wi]]]);var os=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=this.h?new AbortController:void 0,i=n&&t.P>0?setTimeout(()=>{n.abort()},t.P):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.P&&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)}}},ss=class extends An{constructor(t){super(t,37)}},as=[-4,{},Wi,Fi,$i],us=[0,Ni,Fi,1,Ni,-1,Fi,1,Fi,1,gi],ls=[0,Fi,Ni,-2],cs=[0,Ni,Fi],hs=[0,Ni,Fi],fs=[0,Ai,-3],ds=[0,Fi,Ni,-1,gi,Si,-1,Ni,-5,Pi,[0,Ni,-4],-1,Ai,[0,Ai,-3],Fi];var ps,vs=class extends An{constructor(t){super(t,19)}},ms=(ps=[-19,{},[0,Fi,1,[0,Ni,-6,gi,Si,Ni,-1,gi],1,[0,Ni,1,Ni,-5],Ni,-1,[0,Fi,Ni,-8],[0,Ni,-3],[0,Ni,Fi,Ni,-2],[0,Ni,-1,Fi,Ni,-1,Fi,Ni,-1,[0,Pi,[0,Ni,-1],Ai,Ni,-5],[0,Fi,Ai,Si,-2]],gi,[0,Ni,-3,gi,Si,Ni,-1],[0,Fi,Ni,-1],[0,Ni,-9],[0,Ni,-6,Fi,Ni,1,Ni,Ai,Fi,-1,Ai,Ni,-2,Fi,Ni,Fi,Ni,Si,-1],1,[0,Fi],1,[0,Ni,-4],1,us,[0,[1,2,3,4,5,6],Oi,us,Oi,cs,Oi,hs,Oi,[0,Fi],Oi,ds,Oi,ls],cs,hs,ds,[0,[0,Fi,Ni,-1,gi,Si,-1,Ni,-4,Pi,[0,Ni,-4],-1,1,fs],[0,Fi,Ni,-1,gi,Si,-1,Ni,-4,fs]],ls,[0,Ni,[0,Si,-3,Fi],Fi,-2,[0,Si,-1],Ai],4,[0,Ni,Fi,Ni,-1,gi,Fi,Ni,-1,Fi,Si,-1]],Fi,Pi,[-37,{},mi,Ni,Pi,[0,Ni,-1],Bi,1,Bi,[0,ji,-1,_i,yi,-1],Ni,[0,Si,Ni,-1],Ai,Si,gi,Ni,-1,Ci,zi,mi,Bi,Fi,_i,gi,-1,[0,Fi,-1],Ni,Ai,Ni,Ei,Ni,-1,di,1,di,as,Ai,[0,Fi,[0,pi,Si,-2],[0,pi]],[0,Fi,gi]],mi,Li,Ni,-1,mi,Fi,-1,[0,Ai,-1,Fi,Ai],[0,gi,-1,Ni],[0,mi,Ai,gi],gi,1,Ui,1,as],t=>Qn(t,ps)),gs=class{constructor(t){this.j=[],this.o=new os,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 vs;Ie(e=sr(e,2,1786));var r=e.m,n=0|r[X];if(null==t)Le(r,n,3);else{var i=t===G?7:0|t[X],o=i,s=Me(i),a=s||Object.isFrozen(t),u=!0,l=!0;for(let e=0;e<t.length;e++){var c=t[e];s||(c=nt(c),u&&=!c,l&&=c)}s||(i=u?13:5,i=l?-4097&i:4096|i),a&&i===o||(t=Ft(t),o=0,i=er(i,n)),i!==o&&tt(t,i),n=Le(r,n,3,t),2&i||!(4096&i||16&i)||je(r,n)}return e}(r),r=ms(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",ga:"POST",P: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 ys{constructor(){this.K=this.F=this.J=this.D=this.H=this.I=this.G=0}}function bs(t,e){var r=new is;r=Ze(r,0,1,t.W),r=Ze(r,0,2,e),e=Be(e=new ss,6,ot(r=r.j(),!1)),(t=t.C).error||t.j.push(e)}function ws(t,e){++t.h.G,t.j.set(e,performance.now())}function Ss(t,e){var r={G:e.G-t.l.G,I:e.I-t.l.I,H:e.H-t.l.H,D:e.D-t.l.D,J:e.J-t.l.J,F:e.F,K:e.K},n=ts(Zo(new es,t.B),1);r=Es(t,r),bs(t,n=tr(n,4,rs,r)),t.l=e}function _s(t,e){var r=t.j.get(e);if(void 0!==r&&(t.j.delete(e),e=performance.now()-r,++t.h.H,t.h.J+=e,t.h.F=Math.max(t.h.F,e),t.A=Math.max(t.A,e),performance.now()>t.o+3e4)){for(let[n,i]of t.j.entries())e=n,i<r&&(t.h.D++,t.j.delete(e));r={...t.h,K:performance.now()-t.o},t.h.F=0,t.o=performance.now(),Ss(t,r)}}function Es(t,e){var r=new Yo;return t=or(t=ir(t=sr(r,1,t.u),7,e.D),5,e.F),t=or(t,6,e.K),e.H>0&&or(t,4,e.J/e.H),0!==e.G&&(r=ir(r=Ko(3),2,e.G),rr(t,8,qo,r)),0!==e.I&&(e=ir(r=Ko(4),2,e.I),rr(t,8,qo,e)),t}var Ts=class{constructor(t,e,r){this.T=performance.now(),this.o=performance.now(),this.j=new Map,this.A=0,this.h=new ys,this.l=new ys,this.C=new gs(r),this.B=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;case"UniversalEmbedder":return 28;case"SemanticRetriever":return 29;case"DecisionMaker":return 30;case"TextSummarizer":return 26;case"TextProofreader":return 27;case"AudioTranscriber":return 31;case"TextToSpeech":return 32;default:return 0}}(t),this.u=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 ns,"undefined"==typeof navigator?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Be(t=sr(t,1,e),2,ie("")),t=Be(t,3,ie("")),t=Be(t,4,ie("1.2.1")),t=Be(t,5,ie("")),this.W=sr(t,6,function(){var t=globalThis.__HOST_ENVIRONMENT__;if("string"==typeof t)switch(t){case"ANDROID":return 1;case"IOS":return 2;case"PYTHON":return 3;case"WEB":break;case"FLUTTER":return 5;case"FLUTTER_WEB":return 6;default:return 0}return 4}())}O(){var t=new Qo;t=or(t=sr(t,1,this.u),3,performance.now()-this.T),bs(this,t=tr(ts(Zo(new es,this.B),0),3,rs,t)),this.o=performance.now()}da(){var t={...this.h,D:this.h.D+this.j.size,F:this.A,K:performance.now()-this.T};Ss(this,t);var e=new Xo;e=Ze(e,0,2,t=Es(this,t)),bs(this,e=tr(t=ts(Zo(new es,this.B),2),5,rs,e))}close(){var t=this.C;"function"==typeof t.close?t.close():t.flush()}};function As(){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 Is(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 Ns(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Ps(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 S(){return this.i}ba(){if("function"==typeof this.S._mediapipeLoggerGetEncodedApiKey){let t=this.S._mediapipeLoggerGetEncodedApiKey();return this.S._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:As()?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){Ns(this,t,e),js(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ns(this,t,e),js(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ps(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?'),Ns(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}})),Bs=class extends Os{};async function Ls(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await Is(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Is(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.ba();t.j=new Ts(t.A(),e,r)}(t,r),await t.v(r),t}async function Us(t,e,r){return Ls(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=Ye(t.baseOptions,Bo,1)||new Bo;"string"==typeof e?(Be(r,2,ie(e)),Be(r,1)):e instanceof Uint8Array&&(Be(r,1,ot(e,!1)),Be(r,2)),Ze(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(!(Ye(t.baseOptions,Bo,1)?.j()||Ye(t.baseOptions,Bo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");!function(t,e){var r=Ye(t.baseOptions,Po,3);if(!r){var n=r=new Po,i=new io;tr(n,4,Oo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Zi,tr(e,2,Oo,n)):(e=r,n=new io,tr(e,4,Oo,n))),Ze(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.C.length;if(1===e)throw Error(t.C[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.C.map(t=>t.message).join(", "))}finally{t.C=[]}}function Ms(t,e){if(t.j&&void 0!==e){let r=Ye(t.baseOptions,Po,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.I,t.j.set(e,performance.now())):ws(t.j,e)}}function Rs(t,e){t.B=Math.max(t.B,e)}var Gs=class{constructor(t){this.h=t,this.C=[],this.B=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.C.push(Error(e))}),this.h.ea(),this.h.setGraph(t,e),this.j?.O(),Cs(this)}finishProcessing(t){this.h.finishProcessing(),Cs(this),this.j&&void 0!==t&&_s(this.j,t)}close(){this.j?.da(),this.j?.close(),this.h.closeGraph()}};Gs.prototype.close=Gs.prototype.close;var Ds=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={languages:[]},Ze(t=this.l=new Fo,0,1,e=new Lo)}A(){return"LanguageDetector"}v(t){return Ze(this.l,0,2,Ro(t,Ye(this.l,jo,2))),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}Z(t){this.u={languages:[]};var e=this.B+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new go;mo(t),ar(t,15,"classifications_out");var e=new ao;Tn(e,Vo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(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.u.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.Z,Ds.prototype.setOptions=Ds.prototype.v,Ds.createFromModelPath=function(t,e){return Us(Ds,t,{baseOptions:{modelAssetPath:e}})},Ds.createFromModelBuffer=function(t,e){return Us(Ds,t,{baseOptions:{modelAssetBuffer:e}})},Ds.createFromOptions=function(t,e){return Us(Ds,t,e)};var zs=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={classifications:[]},Ze(t=this.l=new Fo,0,1,e=new Lo)}A(){return"TextClassifier"}v(t){return Ze(this.l,0,2,Ro(t,Ye(this.l,jo,2))),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}Y(t){this.u={classifications:[]};var e=this.B+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new go;mo(t),ar(t,15,"classifications_out");var e=new ao;Tn(e,Vo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(t,1,ho,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.u=Do(So(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.Y,zs.prototype.setOptions=zs.prototype.v,zs.createFromModelPath=function(t,e){return Us(zs,t,{baseOptions:{modelAssetPath:e}})},zs.createFromModelBuffer=function(t,e){return Us(zs,t,{baseOptions:{modelAssetBuffer:e}})},zs.createFromOptions=function(t,e){return Us(zs,t,e)};var Hs=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={embeddings:[]},Ze(t=this.l=new Co,0,1,e=new Lo)}A(){return"TextEmbedder"}v(t){var e=this.l,r=Ye(this.l,xo,2);return r=r?_e(r):new xo,void 0!==t.l2Normalize?Be(r,1,zt(t.l2Normalize)):"l2Normalize"in t&&Be(r,1),void 0!==t.quantize?Be(r,2,zt(t.quantize)):"quantize"in t&&Be(r,2),Ze(e,0,2,r),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}aa(t,e){var r=this.B+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.u}o(){var t=new go;mo(t),ar(t,15,"embeddings_out");var e=new ao;Tn(e,Mo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),co(r),ar(r,4,"EMBEDDINGS:embeddings_out"),r.v(e),rr(t,1,ho,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Io(t),this.u=function(t){return{embeddings:Xe(t,To).map(t=>{var e={headIndex:Wt(Pe(t,3))??0??-1,headName:oe(Pe(t,4))??""??""};if(ke(t,1,Ao))t=Fe(t=nr(t,_o,1,Ao),1,Dt),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=nr(t,Eo,2,Ao)?.j()?.j()??r}return e}),timestampMs:Go(Pe(t,2,void 0,Zt)??Ne)}}(t),Rs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Rs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Ws(t,e){return Us(Ks,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.aa,Hs.prototype.setOptions=Hs.prototype.v,Hs.createFromModelPath=function(t,e){return Us(Hs,t,{baseOptions:{modelAssetPath:e}})},Hs.createFromModelBuffer=function(t,e){return Us(Hs,t,{baseOptions:{modelAssetBuffer:e}})},Hs.createFromOptions=function(t,e){return Us(Hs,t,e)};var Ks=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.baseOptions=new Lo,this.u=this.l=this.maxNumTokens=0}A(){return"TextProofreader"}async v(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),Vs(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextProofreader("/model.litertlm",this.maxNumTokens),this.j.O()}proofread(t){var e=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");var r=this.u++;ws(this.j,r);try{return e.proofread(this.l,t)}finally{_s(this.j,r)}}proofreadStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");if(r._userProofreaderListener)throw Error("Another proofread is already in progress.");var n=this.u++;ws(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userProofreaderListener=void 0,_s(this.j,n)},u="";r._userProofreaderListener=(t,r,n,s)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i({proofreadText:u,corrections:s??[]}))}};try{r.proofreadStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextProofreader(this.l)}catch{}this.l=0}super.close()}};function qs(t,e){return Us(Ys,t,e)}Ks.prototype.proofreadStreaming=Ks.prototype.proofreadStreaming,Ks.createFromModelBuffer=function(t,e,r=0){return Ws(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r})},Ks.createFromModelPath=function(t,e,r=0){return Ws(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r})},Ks.createFromOptions=Ws;var Ys=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.baseOptions=new Lo,this.maxNumTokens=0,this.mode="KEYPOINTS",this.u=this.l=0}A(){return"TextSummarizer"}async v(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),this.j.O()}summarize(t){var e=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");var r=this.u++;ws(this.j,r);try{return e.summarize(this.l,t)}finally{_s(this.j,r)}}summarizeStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");if(r._userSummarizerListener)throw Error("Another summarization is already in progress.");var n=this.u++;ws(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userSummarizerListener=void 0,_s(this.j,n)},u="";r._userSummarizerListener=(t,r,n)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i(u))}};try{r.summarizeStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextSummarizer(this.l)}catch{}this.l=0}super.close()}};return Ys.prototype.summarizeStreaming=Ys.prototype.summarizeStreaming,Ys.createFromModelBuffer=function(t,e,r=0,n="KEYPOINTS"){return qs(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r,mode:n})},Ys.createFromModelPath=function(t,e,r=0,n="KEYPOINTS"){return qs(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r,mode:n})},Ys.createFromOptions=qs,t.FilesetResolver=Wo,t.LanguageDetector=Ds,t.TaskRunner=Gs,t.TextClassifier=zs,t.TextEmbedder=Hs,t.TextProofreader=Ks,t.TextSummarizer=Ys,t}({});
1
+ var Text=function(t){"use strict";var e="undefined"!=typeof self?self:{};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}function c(){var t=e.navigator;return t&&(t=t.userAgent)?t:""}function h(t){return h[" "](t),t}h[" "]=function(){};var f={},d=null;function p(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=d[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}v();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 v(){if(!d){d={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));f[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===d[e]&&(d[e]=t)}}}}var m="undefined"!=typeof Uint8Array,g=!(-1!=c().indexOf("Trident")||-1!=c().indexOf("MSIE"))&&"function"==typeof btoa,y=/[-_.]/g,b={"-":"+",_:"/",".":"="};function w(t){return b[t]||""}function S(t){if(!g)return p(t);t=y.test(t)?t.replace(y,w):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 _={};function E(){return A||=new I(null,_)}function T(t){j(_);var e=t.h;return null==(e=null==e||m&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?S(e):null)?e:t.h=e}var A,I=class{j(){return new Uint8Array(T(this)||0)}constructor(t,e){if(j(e),this.h=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function j(t){if(t!==_)throw Error("illegal external caller")}function x(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var N,P,O=void 0;function B(t){return x(t=Error(t),"warning"),t}function L(t,r){if(null!=t){var n=O??={},i=n[t]||0;i>=r||(n[t]=i+1,x(t=Error(),"incident"),function(t){e.setTimeout(()=>{throw t},0)}(t))}}t:{for(var U=["CLOSURE_FLAGS"],k=e,F=0;F<U.length;F++)if(null==(k=k[U[F]])){P=null;break t}P=k}var V=P&&P[748402147];function C(){return"function"==typeof BigInt}N=null==V||V;var M="function"==typeof Symbol&&"symbol"==typeof Symbol();function R(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var G,D=R("jas",void 0,!0),z=R(void 0,"1oa"),$=R(void 0,Symbol()),H=R(void 0,"0ubs"),W=R(void 0,"0ubsb"),K=R(void 0,"0actk"),q=R("m_m","ka",!0),Y={ca:{value:0,configurable:!0,writable:!0,enumerable:!1}},J=Object.defineProperties,X=M?D:"ca",Q=[];function Z(t,e){M||X in t||J(t,Y),t[X]|=e}function tt(t,e){M||X in t||J(t,Y),t[X]=e}function et(t,e){return 2&e&&(t|=2),1|t}tt(Q,7),G=Object.freeze(Q);var rt={};function nt(t,e){return void 0===e?t.h!==it&&!!(2&t.m[X]):!!(2&e)&&t.h!==it}var it={};function ot(t,e){if(null!=t)if("string"==typeof t)t=t?new I(t,_):E();else if(!(t instanceof I))if(m&&null!=t&&t instanceof Uint8Array)t=t.length?new I(new Uint8Array(t),_):E();else{if(!e)throw Error();t=void 0}return t}function st(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 at={};function ut(t){return 128&t?at:void 0}function lt(t){return t.ia=!0,t}var ct=lt(t=>"number"==typeof t),ht=lt(t=>"string"==typeof t),ft=lt(t=>"boolean"==typeof t),dt="function"==typeof e.BigInt&&"bigint"==typeof e.BigInt(0);function pt(t){var e=t;if(ht(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ct(e)&&!Number.isSafeInteger(e))throw Error(String(e));return dt?BigInt(t):t=ft(t)?t?"1":"0":ht(t)?t.trim()||"0":String(t)}var vt=lt(t=>dt?t>=gt&&t<=bt:"-"===t[0]?wt(t,mt):wt(t,yt)),mt=Number.MIN_SAFE_INTEGER.toString(),gt=dt?BigInt(Number.MIN_SAFE_INTEGER):void 0,yt=Number.MAX_SAFE_INTEGER.toString(),bt=dt?BigInt(Number.MAX_SAFE_INTEGER):void 0;function wt(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 St,_t="function"==typeof Uint8Array.prototype.slice,Et=0,Tt=0;function At(t){var e=t>>>0;Et=e,Tt=(t-e)/4294967296>>>0}function It(t){if(t<0){At(-t);let[e,r]=kt(Et,Tt);Et=e>>>0,Tt=r>>>0}else At(t)}function jt(t){var e=St||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Tt=0,Et=e.getUint32(0,!0)}function xt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Ot(t,e)}function Nt(t,e){return pt(C()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Ot(t,e))}function Pt(t,e){return C()?pt(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):pt(Lt(t,e))}function Ot(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else C()?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 Lt(t,e){if(2147483648&e)if(C())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=kt(t,e);t="-"+Ot(r,n)}else t=Ot(t,e);return t}function Ut(t){if(t.length<16)It(Number(t));else if(C())t=BigInt(t),Et=Number(t&BigInt(4294967295))>>>0,Tt=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);Tt=Et=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));Tt*=1e6,(Et=1e6*Et+e)>=4294967296&&(Tt+=Math.trunc(Et/4294967296),Tt>>>=0,Et>>>=0)}if(e){let[t,e]=kt(Et,Tt);Et=t,Tt=e}}}function kt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Ft(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,Ct="function"==typeof BigInt?BigInt.asUintN:void 0,Mt=Number.isSafeInteger,Rt=Number.isFinite,Gt=Math.trunc;function Dt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function zt(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 $t=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Ht(t){switch(typeof t){case"bigint":return!0;case"number":return Rt(t);case"string":return $t.test(t);default:return!1}}function Wt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Rt(t)?0|t:void 0}function Kt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Ut(t),Lt(Et,Tt))}function qt(t){if("-"===t[0])var e=!1;else e=(e=t.length)<20||20===e&&t<="18446744073709551615";return e?t:(Ut(t),Ot(Et,Tt))}function Yt(t){if(t=Gt(t),!Mt(t)){It(t);var e=Et,r=Tt;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=xt(e,r))?t?-e:e:t?"-"+e:e}return t}function Jt(t){return t=Gt(t),Mt(t)?t=String(t):(It(t),t=Lt(Et,Tt)),t}function Xt(t){var e=Gt(Number(t));return Mt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Kt(t))}function Qt(t){var e=Gt(Number(t));return Mt(e)?pt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),C()?pt(Vt(64,BigInt(t))):pt(Kt(t)))}function Zt(t){var e=typeof t;return null==t?t:"bigint"===e?pt(Vt(64,t)):Ht(t)?"string"===e?Qt(t):pt(Mt(t)?t:Jt(t)):void 0}function te(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Vt(64,t));if(Ht(t)){if("string"===e)return Xt(t);if("number"===e)return Yt(t)}}function ee(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ct(64,t));if(Ht(t)){if("string"===e)return function(t){var e=Gt(Number(t));return Mt(e)&&e>=0?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),qt(t))}(t);if("number"===e)return function(t){return(t=Gt(t))>=0&&Mt(t)||(It(t),t=xt(Et,Tt)),t}(t)}}function re(t){if(null==t||"string"==typeof t||t instanceof I)return t}function ne(t){if("string"!=typeof t)throw Error();return t}function ie(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function oe(t){return null==t||"string"==typeof t?t:void 0}function se(t,e,r){if(null!=t&&t[q]===rt)return t;if(Array.isArray(t)){var n=0|t[X];return(r=n|32&r|2&r)!==n&&tt(t,r),new e(t)}}function ae(t){return t}function ue(t){return $?t[$]:void 0}function le(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var ce,he,fe,de=class{};function pe(t,e){e<100||L(H,1)}function ve(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=$;!i&&M&&s&&(o=t[s])&&le(o,pe),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=(ce??ae)(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&&$&&(t=ue(t))&&t instanceof de&&(s[$]=function(t){var e=new de;return le(t,(t,r,n)=>{e[r]=Ft(n)}),e.h=t.h,e}(t)),s}function me(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return vt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[X];return 0===t.length&&1&e?void 0:ve(t,e,me)}if(null!=t&&t[q]===rt)return ge(t);if(t instanceof I){if(null==(e=t.h))t="";else if("string"==typeof e)t=e;else{if(g){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),v(),r=f[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 ge(t){return ve(t=t.m,0|t[X],me)}function ye(t,e){return be(t,e[0],e[1])}function be(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[X],N&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(N)throw Error("carr");L(K,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&tt(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 tt(t,64|i|n),t}function we(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[X];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=Ee(t,r,!1,e&&!(16&r)):(Z(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[q]===rt?nt(t,r=0|(e=t.m)[X])?t:xe(t,e,r)?Se(t,e):Ee(e,r):t instanceof I?t:void 0}function Se(t,e,r){return t=new t.constructor(e),r&&(t.h=it),t.o=it,t}function _e(t){var e=t.m,r=0|e[X];return xe(t,e,r)?Se(t,e,!0):new t.constructor(Ee(e,r,!1))}function Ee(t,e,r,n){return n??=!!(34&e),t=ve(t,e,we,n),n=32,r&&(n|=2),tt(t,e=16769217&e|n),t}function Te(t){var e=t.m,r=0|e[X];return nt(t,r)?xe(t,e,r)?Se(t,e,!0):new t.constructor(Ee(e,r,!1)):t}function Ae(t){if(t.h!==it)return!1;var e=t.m;return Z(e=Ee(e,0|e[X]),2048),t.m=e,t.h=void 0,t.o=void 0,!0}function Ie(t){if(!Ae(t)&&nt(t,0|t.m[X]))throw Error()}function je(t,e){void 0===e&&(e=0|t[X]),32&e&&!(4096&e)&&tt(t,4096|e)}function xe(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(tt(e,2|r),t.h=it,!0)}var Ne=pt(0);function Pe(t,e,r,n){if(null!==(t=Oe(t.m,e,r,n)))return t}function Oe(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){Ie(t);var i=t.m;return Le(i,0|i[X],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[X])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Ue(t,e){return null!=(t=Oe(t.m,e))&&t[q]===rt||Array.isArray(t)}function ke(t,e,r){return Ue(t,e=$e(t,r)===e?e:-1)}function Fe(t,e,r,n,i){var o=t.m,s=0|o[X];n=n&&4!==n?1!==n&&(t?nt(t,s):2&s)?1:n:4,i=!!i||3===n,2===n&&Ae(t)&&(s=0|(o=t.m)[X]);var a=(t=Ce(o,e))===G?7:0|t[X],u=et(a,s),l=!(4&u);if(l){let e=0,n=0;for(;e<t.length;e++){let i=r(t[e]);null!=i&&(t[n++]=i)}n<e&&(t.length=n),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(tt(t,u),2&u&&Object.freeze(t)),Ve(t,u,o,s,e,n,l,i)}function Ve(t,e,r,n,i,o,s,a){var u=e,l=Me(e);return l&&2===o&&(t=Ft(t),u=0,e=er(e,n),n=Le(r,n,i,t),l=!1),l||(1===o||4===o&&(2&e||!(16&e)&&32&n)?((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&tt(t,e),Object.freeze(t)):(a||(e|=16),e!==u&&tt(t,e))),2&e||!(4096&e||16&e)||je(r,n),t}function Ce(t,e,r){return t=Oe(t,e,r),Array.isArray(t)?t:G}function Me(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Re(t){return ot(t,!0)}function Ge(t,e,r){Ie(t);var n=0|(t=t.m)[X];if(null==r)Le(t,n,e);else{var i=r===G?7:0|r[X],o=i,s=Me(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=Ft(r),o=0,i=er(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=ne(t);Object.is(t,e)||(a&&(r=Ft(r),o=0,i=er(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=Ft(r),i=er(i,n)),tt(r,i)),Le(t,n,e,r)}}function De(t,e){Ie(t),Le(t=t.m,0|t[X],2,""===e?void 0:e)}function ze(t,e,r){if(2&e)throw Error();var n=ut(e),i=Ce(t,r,n),o=i===G?7:0|i[X],s=et(o,e);return(2&s||Me(s)||16&s)&&(s===o||Me(s)||tt(i,s),i=Ft(i),o=0,s=er(s,e),Le(t,e,r,i,n)),(s&=-13)!==o&&tt(i,s),i}function $e(t,e){return Ke(He(t=t.m),t,void 0,e)}function He(t){if(M)return t[z]??(t[z]=new Map);if(z in t)return t[z];var e=new Map;return Object.defineProperty(t,z,{value:e}),e}function We(t,e,r,n,i){var o=He(t),s=Ke(o,t,e,r,i);return s!==n&&(s&&(e=Le(t,e,s,void 0,i)),o.set(r,n)),e}function Ke(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!=Oe(e,s,i)&&(0!==o&&(r=Le(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function qe(t,e,r){var n=0|t[X],i=ut(n),o=Oe(t,r,i);if(null!=o&&o[q]===rt){if(!nt(o))return Ae(o),o.m;var s=o.m}else Array.isArray(o)&&(s=o,2&n&&Z(s,34));if(s){let t=0|s[X];2&t&&(s=Ee(s,t))}return(s=ye(s,e))!==o&&Le(t,n,r,s,i),s}function Ye(t,e,r){var n=t.m,i=0|n[X];if(e=function(t,e,r,n){var i=!1;if(null!=(n=Oe(t,n,void 0,t=>{var n=se(t,r,e);return i=n!==t&&null!=n,n})))return i&&!nt(n)&&je(t,e),n}(n,i,e,r),null==e)return e;if(!nt(t,i=0|n[X])){let o=Te(e);o!==e&&(Ae(t)&&(i=0|(n=t.m)[X]),je(n,i=Le(n,i,r,e=o)))}return e}function Je(t,e,r,n,i,o,s,a){o=o&&4!==o?1!==o&&(t?nt(t,r):2&r)?1:o:4,s=!!s||3===o;var u=!!a&&!(t?nt(t,r):2&r);(2===o||u)&&t&&Ae(t)&&(r=0|(e=t.m)[X]);var l=(t=Ce(e,i))===G?7:0|t[X],c=et(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=se(h[s],n,f);if(t instanceof n){if(!e){let e=nt(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&&(tt(t,c),2&c&&Object.freeze(t)),u&&!(8&c||!t.length&&(1===o||4===o&&(2&c||!(16&c)&&32&r)))){for(Me(c)&&(t=Ft(t),c=er(c,r),r=Le(e,r,i,t)),n=t,u=c,l=0;l<n.length;l++)(h=n[l])!==(c=Te(h))&&(n[l]=c);u|=8,tt(t,c=u=n.length?4096|u:-4097&u)}return Ve(t,c,e,r,i,o,a,s)}function Xe(t,e){var r=t.m;return Je(t,r,0|r[X],e,1,void 0,!1,!0)}function Qe(t){return null==t&&(t=void 0),t}function Ze(t,e,r,n,i){return Be(t,r,n=Qe(n),i),n&&!nt(n)&&je(t.m),t}function tr(t,e,r,n){t:{var i=n=Qe(n);Ie(t);let o=t.m,s=0|o[X];if(null==i){let t=He(o);if(Ke(t,o,s,r)!==e)break t;t.set(r,0)}else s=We(o,s,r,e);Le(o,s,e,i)}return n&&!nt(n)&&je(t.m),t}function er(t,e){return-273&(2&e?2|t:-3&t)}function rr(t,e,r,n){Ie(t);var i=t.m;t=Je(t,i,0|i[X],r,e,2,!0),n=null!=n?n:new r,t.push(n),e=r=t===G?7:0|t[X],(n=nt(n))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&tt(t,r),n||je(i)}function nr(t,e,r,n){return Ye(t,e,r=$e(t,n)===r?r:-1)}function ir(t,e,r){if(null!=r)t:{if(!Ht(r))throw B("int64");switch(typeof r){case"string":r=Qt(r);break t;case"bigint":r=pt(Vt(64,r));break t;default:r=pt(Mt(r)?r:Jt(r))}}return Be(t,e,r)}function or(t,e,r){return Be(t,e,null==r?r:function(t){if(!Ht(t))throw B("uint64");var e=typeof t;switch(e){case"string":return e=Gt(Number(t)),Mt(e)&&e>=0?t=pt(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=C()?pt(Ct(64,BigInt(t))):pt(qt(t))),t;case"bigint":return pt(Ct(64,t));default:return t>=0&&Mt(t)||((t=Gt(t))>=0&&Mt(t)?t=String(t):(It(t),t=Ot(Et,Tt))),pt(t)}}(r))}function sr(t,e,r){if(null!=r){if(!Rt(r))throw B("enum");r|=0}return Be(t,e,r)}function ar(t,e,r){Ie(t),Fe(t,e,oe,2,!0).push(ne(r))}var ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.h=e}};function lr(t,e){if("string"==typeof t)return new ur(S(t),e);if(Array.isArray(t))return new ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new ur(t,!1);if(t.constructor===I)return e=T(t)||new Uint8Array(0),new ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new ur(t,!1);throw Error()}function cr(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 hr(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 fr(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 dr(t){return cr(t,Pt)}function pr(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 vr(t){var e=pr(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 mr(t){return fr(t)}function gr(t,e){if(t.h=e,e>t.l)throw Error()}function yr(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 br(t,e){if(0==e)return E();var r=yr(t,e);return t.M&&t.A?r=t.j.subarray(r,r+e):(t=t.j,r=r===(e=r+e)?new Uint8Array(0):_t?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?E():new I(r,_)}var wr=class{constructor(t,e,r,n){this.j=null,this.A=!1,this.h=this.l=this.o=0,this.init(t,e,r,n)}init(t,e,r,{M:n=!1,R:i=!1}={}){this.M=n,this.R=i,t&&(t=lr(t,this.R),this.j=t.buffer,this.A=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.A=!1,this.h=this.l=this.o=0,this.M=!1}},Sr=[],_r=0;function Er(t,e,r,n){if(Lr.length){let i=Lr.pop();return i.v(n),i.h.init(t,e,r,n),i}return new Br(t,e,r,n)}function Tr(t){t.h.clear(),t.l=-1,t.j=-1,Lr.length<100&&Lr.push(t)}function Ar(t){var e=t.h;if(e.h==e.l)return!1;t.o=t.h.h;var r=fr(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):hr(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=fr(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:jr();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{_r>0&&_r--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function jr(){if(_r>=100)throw new SyntaxError;_r++}function xr(t,e,r){var n=t.h.l,i=fr(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 Nr(t){var e=fr(t.h)>>>0,o=yr(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 Pr(t){var e=fr(t.h)>>>0;return br(t.h,e)}function Or(t,e,r){var n=fr(t.h)>>>0;for(n=t.h.h+n;t.h.h<n;)r.push(e(t.h))}var Br=class{constructor(t,e,r,n){if(Sr.length){let i=Sr.pop();i.init(t,e,r,n),t=i}else t=new wr(t,e,r,n);this.h=t,this.o=this.h.h,this.j=this.l=-1,this.v(n)}v({U:t=!1}={}){this.U=t}},Lr=[];function Ur(t){return new Vr(4294967295&t,Math.floor(t/4294967296))}function kr(t){return t?/^\d+$/.test(t)?(Ut(t),new Vr(Et,Tt)):null:Fr||=new Vr(0,0)}var Fr,Vr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Cr(t){return new qr(4294967295&t,Math.floor(t/4294967296))}function Mr(t){return t?/^-?\d+$/.test(t)?(Ut(t),new qr(Et,Tt)):null:Rr||=new qr(0,0)}var Rr,Gr,Dr,zr,$r,Hr,Wr,Kr,qr=class{constructor(t,e){this.j=t>>>0,this.h=e>>>0}};function Yr(t,e,r){return"undefined"!=typeof BigInt64Array?(Wr||(Wr=new BigInt64Array(1),Kr=new Uint32Array(Wr.buffer),Wr[0]=BigInt(1),Hr=1===Kr[0]),Wr[0]=t,new e(Kr[t=Hr?0:1],Kr[1-t])):($r||(Gr=BigInt(Number.MIN_SAFE_INTEGER),Dr=BigInt(Number.MAX_SAFE_INTEGER),zr=BigInt(4294967295),$r=BigInt(32)),t>=Gr&&t<=Dr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&zr),Number(t>>$r))))}function Jr(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 Xr(t,e){for(;e>127;)t.h.push(127&e|128),e>>>=7;t.h.push(e)}function Qr(t,e){if(e>=0)Xr(t,e);else{for(let r=0;r<9;r++)t.h.push(127&e|128),e>>=7;t.h.push(1)}}function Zr(t,e){Ut(e),function(t){var e=Tt>>31;t(Et<<1^e,(Tt<<1|Et>>>31)^e)}((e,r)=>{Jr(t,e>>>0,r>>>0)})}function tn(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 en=class{constructor(){this.h=[]}length(){return this.h.length}end(){var t=this.h;return this.h=[],t}};function rn(t,e){0!==e.length&&(t.l.push(e),t.j+=e.length)}function nn(t,e,r){Xr(t.h,8*e+r)}function on(t,e){return nn(t,e,2),e=t.h.end(),rn(t,e),e.push(t.j),e}function sn(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 an(t,e,r){if(null!=r)switch(nn(t,e,0),typeof r){case"number":t=t.h,It(r),Jr(t,Et,Tt);break;case"bigint":r=Yr(r,qr,Cr),Jr(t.h,r.j,r.h);break;default:r=Mr(r),Jr(t.h,r.j,r.h)}}function un(t,e,r){nn(t,e,2),Xr(t.h,r.length),rn(t,t.h.end()),rn(t,r)}var ln=class{constructor(){this.l=[],this.j=0,this.h=new en}};function cn(t){if("string"==typeof t)Mr(t)}function hn(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var fn=hn(),dn=hn(),pn=hn(),vn=hn(),mn=hn(),gn=hn(),yn=hn(),bn=hn(),wn=hn(),Sn=hn(),_n=hn(),En=hn();function Tn(t,e,r){var n=t.m;$&&$ in n&&(n=n[$])&&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=be(t,e,void 0,2048)}toJSON(){return ge(this)}};An.prototype[q]=rt,An.prototype.toString=function(){return this.m.toString()};var In=class{constructor(t,e,r){this.h=t,this.j=e,t=fn,this.l=!!t&&r===t||!1}};function jn(t,e){return new In(t,e,fn)}function xn(t,e,r,n,i){null!=(e=Rn(e,n))&&(r=on(t,r),i(e,t),sn(t,r))}var Nn,Pn,On=jn(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},xn),Bn=jn(function(t,e,r,n,i){return 2===t.j&&(xr(t,qe(e,n,r),i),!0)},xn),Ln=Symbol(),Un=Symbol(),kn=Symbol(),Fn=Symbol(),Vn=Symbol();function Cn(t,e,r,n){var i=n[t];if(i)return i;(i={}).X=n,i.L=function(t){switch(typeof t){case"boolean":return he||=[0,void 0,!0];case"number":return t>0?void 0:0===t?fe||=[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.V=!0,Nn??=o,Pn??=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=On,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 Mn(t){return Array.isArray(t)?t[0]instanceof In?t:[Bn,t]:[t,void 0]}function Rn(t,e){return t instanceof An?t.m:Array.isArray(t)?ye(t,e):void 0}function Gn(t,e,r,n){var i=r.h;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function Dn(t,e,r,n,i){var o,s,a=r.h;t[e]=(t,e,r)=>a(t,e,r,s||=Cn(Un,Gn,Dn,n).L,o||=zn(n),i)}function zn(t){var e=t[kn];if(null!=e)return e;var r=Cn(Un,Gn,Dn,t);return e=r.V?(t,e)=>Nn(t,e,r):(t,e)=>{t:{jr();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=Hn(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.U)var i=void 0;else{let t=n.h.h-r;n.h.h=r,i=br(n.h,t)}n=void 0;var o=t,s=u,a=i;a&&((n=o[$]??(o[$]=new de))[s]??(n[s]=[])).push(a)}}let l=ue(t);l&&(l.h=r.X[Vn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{_r>0&&_r--}u=void 0}return u},t[kn]=e,t[Vn]=$n.bind(t),e}function $n(t,e,r,n){var i=this[Un],o=this[kn],s=ye(void 0,i.L),a=ue(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=Er(t);try{u=!0,o(s,e)}finally{Tr(e)}}else n?.(t,r,i)},null==e)le(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[X];if(2&n&&2048&n&&!r?.ma)throw Error();let i=ut(n),o=(e,o)=>{if(null!=Oe(t,e,i)){if(1===r?.la)return;throw Error()}null!=o&&(n=Le(t,n,e,o,i)),delete a[e]};null==e?st(s,0|s[X],(t,e)=>{o(t,e)}):o(e,Oe(s,e,i))}}}}function Hn(t){var e=(t=Mn(t))[0].h;if(t=t[1]){let r=zn(t),n=Cn(Un,Gn,Dn,t).L;return(t,i,o)=>e(t,i,o,n,r)}return e}function Wn(t,e,r){t[e]=r.j}function Kn(t,e,r,n){var i,o,s=r.j;t[e]=(t,e,r)=>s(t,e,r,o||=Cn(Ln,Wn,Kn,n).L,i||=qn(n))}function qn(t){var e=t[Fn];if(!e){let r=Cn(Ln,Wn,Kn,t);e=(t,e)=>Yn(t,e,r),t[Fn]=e}return e}function Yn(t,e,r){st(t,0|t[X],(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=Mn(r))[0].j;if(r=r[1]){let e=qn(r),i=Cn(Ln,Wn,Kn,r).L;r=t.V?Pn(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||L(W,3)}}),(t=ue(t))&&le(t,(t,r,n)=>{for(rn(e,e.h.end()),t=0;t<n.length;t++)rn(e,T(n[t])||new Uint8Array(0))})}var Jn=pt(0);function Xn(t,e,r){if(Array.isArray(e)){var n=0|e[X];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&&tt(e,t),r&&2&t&&Object.freeze(e),e}}var Qn=(t,e)=>{var r=new ln;Yn(t.m,r,Cn(Ln,Wn,Kn,e)),rn(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 Zn(t,e,r){return new In(t,e,r)}function ti(t,e,r){return new In(t,e,r)}function ei(t,e,r){Le(t,0|t[X],e,r,ut(0|t[X]))}function ri(t,e,r){null!=(e=te(e))&&(cn(e),an(t,r,e))}function ni(t,e,r){null!=(e=Wt(e))&&null!=e&&(nn(t,r,0),Qr(t.h,e))}function ii(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(nn(t,r,0),t.h.h.push(e?1:0))}function oi(t,e,r){null!=(e=oe(e))&&un(t,r,l(e))}function si(t,e,r,n,i){null!=(e=Rn(e,n))&&(r=on(t,r),i(e,t),sn(t,r))}function ai(t,e,r){null!=(e=re(e))&&un(t,r,lr(e,!0).buffer)}function ui(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 Rt(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(nn(t,r,0),Xr(t.h,e))}function li(t,e,r){null!=(e=Wt(e))&&(e=parseInt(e,10),nn(t,r,0),Qr(t.h,e))}function ci(t,e,r){return 0===t.j&&(ei(e,r,dr(t.h)),!0)}function hi(t,e,r){return(0===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,fr,e):e.push(fr(t.h)),!0)}function fi(t,e,r){return 2===t.j&&(ei(e,r,(t=Pr(t))===E()?void 0:t),!0)}var di=Zn(function(t,e,r){if(1!==t.j)return!1;var n=t.h;t=pr(n);var i=pr(n);n=2*(i>>31)+1;var o=i>>>20&2047;return t=4294967296*(1048575&i)+t,ei(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=Dt(e))&&(nn(t,r,1),t=t.h,(r=St||=new DataView(new ArrayBuffer(8))).setFloat64(0,+e,!0),Et=r.getUint32(0,!0),Tt=r.getUint32(4,!0),tn(t,Et),tn(t,Tt))},Sn),pi=Zn(function(t,e,r){return 5===t.j&&(ei(e,r,vr(t.h)),!0)},function(t,e,r){null!=(e=Dt(e))&&(nn(t,r,5),t=t.h,jt(e),tn(t,Et))},wn),vi=ti(function(t,e,r){return(5===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,vr,e):e.push(vr(t.h)),!0)},function(t,e,r){if(null!=(e=Xn(Dt,e,!0))&&e.length){nn(t,r,2),Xr(t.h,4*e.length);for(let n=0;n<e.length;n++)r=t.h,jt(e[n]),tn(r,Et)}},wn),mi=Zn(function(t,e,r){return ci(t,e,r)},ri,gn),gi=Zn(function(t,e,r){return ci(t,e,r)},ri,gn),yi=ti(function(t,e,r){return 0!==t.j&&2!==t.j?t=!1:(e=ze(e,0|e[X],r),2==t.j?Or(t,dr,e):e.push(dr(t.h)),t=!0),t},function(t,e,r){if(null!=(e=Xn(te,e,!1)))for(let n=0;n<e.length;n++)an(t,r,e[n])},gn),bi=Zn(function(t,e,r){return 0!==t.j?e=!1:(ei(e,r,(t=dr(t.h))===Jn?void 0:t),e=!0),e},ri,gn),wi=Zn(function(t,e,r){return 0!==t.j?t=!1:(ei(e,r,cr(t.h,Nt)),t=!0),t},function(t,e,r){if(null!=(e=ee(e))){if("string"==typeof e)kr(e);if(null!=e)switch(nn(t,r,0),typeof e){case"number":t=t.h,It(e),Jr(t,Et,Tt);break;case"bigint":r=Yr(e,Vr,Ur),Jr(t.h,r.j,r.h);break;default:r=kr(e),Jr(t.h,r.j,r.h)}}},yn),Si=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)),!0)},ni,vn),_i=ti(hi,function(t,e,r){if(null!=(e=Xn(Wt,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&(nn(n,i,0),Qr(n.h,o))}},vn),Ei=ti(hi,function(t,e,r){if(null!=(e=Xn(Wt,e,!0))&&e.length){r=on(t,r);for(let r=0;r<e.length;r++)Qr(t.h,e[r]);sn(t,r)}},vn),Ti=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h))?void 0:t),!0)},ni,vn),Ai=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,hr(t.h)),!0)},ii,dn),Ii=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,!1===(t=hr(t.h))?void 0:t),!0)},ii,dn),ji=ti(function(t,e,r){return 2===t.j&&(t=Nr(t),ze(e,0|e[X],r).push(t),!0)},function(t,e,r){if(null!=(e=Xn(oe,e,!0)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&un(n,i,l(o))}},pn),xi=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,""===(t=Nr(t))?void 0:t),!0)},oi,pn),Ni=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,Nr(t)),!0)},oi,pn),Pi=function(t,e,r=fn){return new In(t,e,r)}(function(t,e,r,n,i){return 2===t.j&&(n=ye(void 0,n),ze(e,0|e[X],r).push(n),xr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)si(t,e[o],r,n,i);1&(t=0|e[X])||tt(e,1|t)}}),Oi=jn(function(t,e,r,n,i,o){if(2!==t.j)return!1;var s=0|e[X];return We(e,s,o,r,ut(s)),xr(t,e=qe(e,n,r),i),!0},si),Bi=Zn(function(t,e,r){return 2===t.j&&(ei(e,r,Pr(t)),!0)},ai,_n),Li=ti(function(t,e,r){return 2===t.j&&(t=Pr(t),ze(e,0|e[X],r).push(t),!0)},function(t,e,r){if(null!=(e=Xn(re,e,!1)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&un(n,i,lr(o,!0).buffer)}},_n),Ui=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)>>>0),!0)},ui,mn),ki=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h)>>>0)?void 0:t),!0)},ui,mn),Fi=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,fr(t.h)),!0)},li,En),Vi=Zn(function(t,e,r){return 0===t.j&&(ei(e,r,0===(t=fr(t.h))?void 0:t),!0)},li,En),Ci=Zn(function(t,e,r){return 0!==t.j?t=!1:(ei(e,r,function(t){return cr(t,(t,e)=>{var r=-(1&t);return Pt(t=(t>>>1|e<<31)^r,e>>>1^r)})}(t.h)),t=!0),t},function(t,e,r){if(null!=(e=te(e))&&(cn(e),null!=e))switch(nn(t,r,0),typeof e){case"number":t=t.h,e=(r=e)<0,At(r=2*Math.abs(r)),r=Et;let n=Tt;e&&(0==r?0==n?n=r=4294967295:(n--,r=4294967295):r--),Jr(t,Et=r,Tt=n);break;case"bigint":t=t.h,e=e<<BigInt(1)^e>>BigInt(63),Et=Number(BigInt.asUintN(32,e)),Tt=Number(BigInt.asUintN(32,e>>BigInt(32))),Jr(t,Et,Tt);break;default:Zr(t.h,e)}},bn);class Mi{constructor(t,e){var r=ao;this.h=t,this.j=e,this.o=Ze,this.defaultValue=void 0,this.l=null!=r.ja?at:void 0}register(){h(this)}}function Ri(t,e){return(r,n)=>{t:{let o={R:!0};n&&Object.assign(o,n),r=Er(r,void 0,void 0,o);try{let n=new t,o=n.m;zn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Tr(r)}i=void 0}return i}}function Gi(t){return function(){return Qn(this,t)}}var Di,zi=[0,Bi,Li,Ai,Ni],$i=[0,xi,[0,Vi,[0,bi,Ti],Vi,-1,[0,Fi],Vi,-1],Zn(fi,ai,_n)],Hi=[0,xi,Zn(fi,function(t,e,r){if(null!=e){if(e instanceof An){let n=e.oa;return void(n?(e=n(e),null!=e&&un(t,r,lr(e,!0).buffer)):L(W,3))}if(Array.isArray(e))return void L(W,3)}ai(t,e,r)},_n)],Wi=[0,1,[0,12,Si,10,Ai],[0,7,[0,Si,-1]]],Ki=globalThis.trustedTypes;var qi=class{constructor(t){this.h=t}toString(){return this.h+""}};function Yi(t){var e;return void 0===Di&&(Di=function(){var t=null;if(!Ki)return t;try{let e=t=>t;t=Ki.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=Di)?e.createScriptURL(t):t,new qi(t)}function Ji(t,...e){if(0===e.length)return Yi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return Yi(r)}var Xi=[0,Si,Fi,Ai,-1,Ei,Fi,-1,Ai,-1],Qi=[0,Fi,-1,Ai],Zi=class extends An{constructor(t){super(t)}},to=[0,Ai,Ni,Ai,Fi,-1,ti(function(t,e,r){return(0===t.j||2===t.j)&&(e=ze(e,0|e[X],r),2==t.j?Or(t,mr,e):e.push(fr(t.h)),!0)},function(t,e,r){if(null!=(e=Xn(Wt,e,!0))&&e.length){r=on(t,r);for(let r=0;r<e.length;r++)Qr(t.h,e[r]);sn(t,r)}},En),Ni,-1,[0,Ai,-1],Fi,Ai,-1,Qi],eo=class extends An{constructor(t){super(t)}j(){return Ue(this,9)}},ro=[0,3,Ai,-1,2,[0,[2],Si,Oi,[0,Ui]],[0,Fi,Ai,Fi,Ai,Fi,4,[0,Ai,Ni,-1,Ai,Si,-1,Ai],Fi,Ai,-4,Fi,ji,Ai,ji,Ai,-1,Si,Ai,-3,[0,Ai,Si],[0,Ni,Si,-1],[0,Ai],[0,Ai,-1],[0,Ai,Si,-1]],[0,[3,4],Ni,-1,Oi,[0,Si],Oi,[0,Fi,-2]],[0],Ni,Ai],no=[0,Ni,-2],io=class extends An{constructor(t){super(t)}},oo=[0],so=[0,Si,Ai,1,Ai,-4],ao=class extends An{constructor(t){super(t,2)}},uo={};uo[336783863]=[0,Ni,Ai,-1,Si,[0,[1,2,3,4,5,6,7,8,9],Oi,oo,Oi,to,Oi,no,Oi,so,Oi,Xi,Oi,[0,Ni,-2],Oi,[0,Ni,Fi],Oi,ro,Oi,Qi],[0,Ni],Ai,[0,[1,3],[2,4],Oi,[0,Ei],-1,Oi,[0,ji],-1,Pi,[0,Ni,-1]],Ni];var lo=[0,bi,-1,Ii,-3,bi,Ei,xi,Ti,bi,-1,Ii,Ti,Ii,-2,xi];function co(t){ar(t,3,"TEXT:text_in")}var ho=class extends An{constructor(t){super(t,500)}v(t){return Ze(this,0,7,t)}},fo=[-1,{}],po=[0,Ni,1,fo],vo=[0,Ni,ji,fo];function mo(t){ar(t,10,"text_in")}var go=class extends An{constructor(t){super(t,500)}v(t){return Ze(this,0,1001,t)}};go.prototype.j=Gi([-500,Pi,[-500,xi,-1,ji,-3,[-2,uo,Ai],Pi,Hi,Ti,-1,po,vo,Pi,[0,xi,Ii],xi,lo,Ti,ji,987,ji],4,Pi,[-500,Ni,-1,[-1,{}],998,Ni],Pi,[-500,Ni,ji,-1,[-2,{},Ai],997,ji,-1],Ti,Pi,[-500,Ni,ji,fo,998,ji],ji,Ti,po,vo,Pi,[0,xi,-1,fo],ji,-2,lo,xi,-1,Ii,[0,Ii,ki],978,fo,Pi,Hi]);var yo=class extends An{constructor(t){super(t)}},bo=class extends An{constructor(t){super(t)}j(){return Xe(this,yo)}},wo=class extends An{constructor(t){super(t)}},So=Ri(class extends An{constructor(t){super(t)}},[0,Pi,[0,1,Si,Ni,[0,Pi,[0,Si,pi,Ni,-1]]],gi]),_o=class extends An{constructor(t){super(t)}},Eo=class extends An{constructor(t){super(t)}j(){var t=Pe(this,1,void 0,Re);return null==t?E():t}},To=class extends An{constructor(t){super(t)}},Ao=[1,2],Io=Ri(class extends An{constructor(t){super(t)}},[0,Pi,[0,Ao,Oi,[0,vi],Oi,[0,Bi],Si,Ni],gi]),jo=class extends An{constructor(t){super(t)}},xo=class extends An{constructor(t){super(t)}},No=[0,Ai,-1],Po=class extends An{constructor(t){super(t)}j(){return ke(this,2,Oo)}l(){return nr(this,eo,6,Oo)}},Oo=[1,2,3,4,5,6],Bo=class extends An{constructor(t){super(t)}j(){return null!=Pe(this,1,void 0,Re)}l(){return null!=oe(Pe(this,2))}},Lo=class extends An{constructor(t){super(t)}},Uo=[0,Bi,Ni,[0,Si,gi,-1],[0,wi,gi]],ko=[0,Uo,Ai,[0,Oo,Oi,so,Oi,to,Oi,Xi,Oi,oo,Oi,no,Oi,ro],Fi],Fo=class extends An{constructor(t){super(t)}},Vo=new Mi(462704549,Fo);uo[462704549]=[0,ko,[0,Ni,Si,pi,ji,-1]];var Co=class extends An{constructor(t){super(t)}},Mo=new Mi(477589892,Co);function Ro(t,e){if(e=e?_e(e):new jo,void 0!==t.displayNamesLocale?Be(e,1,ie(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 B("int32");if(!Rt(r))throw B("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?Ge(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Be(e,4),void 0!==t.categoryDenylist?Ge(e,5,t.categoryDenylist):"categoryDenylist"in t&&Be(e,5),e}function Go(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Do(t){var e={classifications:Xe(t,wo).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:Wt(Pe(t,1))??0??-1,score:Pe(t,2,void 0,Dt)??0??0,categoryName:oe(Pe(t,3))??""??"",displayName:oe(Pe(t,4))??""??""})),headIndex:e,headName:r}}(Ye(t,bo,4)?.j()??[],Wt(Pe(t,2))??0,oe(Pe(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(vt(t)?t=Number(t):(t=Vt(64,t),t=vt(t)?Number(t):String(t)),t):Ht(t)?"number"==typeof t?Yt(t):Xt(t):void 0}(Pe(t,2,void 0,Zt))&&(e.timestampMs=Go(Pe(t,2,void 0,Zt)??Ne)),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)}function Ho(t,e,r){return r=`wasm${r?"_module":""}_internal`,Promise.resolve({wasmLoaderPath:`${e}/${t}_${r}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`})}uo[477589892]=[0,ko,No,1,Uo];var Wo=class{};function Ko(t){return sr(new qo,1,t)}Wo.forVisionTasks=function(t,e=!1){return Ho("vision",t??Ji``,e)},Wo.forLiteRtLmTextTasks=function(t,e=!1){return Ho("litertlm_text",t??Ji``,e)},Wo.forTextTasks=function(t,e=!1){return Ho("text",t??Ji``,e)},Wo.forRetrievalTasks=function(t,e=!1){return Ho("retrieval",t??Ji``,e)},Wo.forGenAiTasks=function(t,e=!1){return Ho("genai",t??Ji``,e)},Wo.forDecisionTasks=function(t,e=!1){return Ho("decision",t??Ji``,e)},Wo.forAudioTasks=function(t,e=!1){return Ho("audio",t??Ji``,e)};var qo=class extends An{constructor(t){super(t)}},Yo=class extends An{constructor(t){super(t)}},Jo=[0,Fi,2,wi,-2,gi,Pi,[0,Fi,gi]],Xo=class extends An{constructor(t){super(t)}},Qo=class extends An{constructor(t){super(t)}};function Zo(t,e){return sr(t,1,e)}function ts(t,e){return sr(t,2,e)}var es=class extends An{constructor(t){super(t)}},rs=[3,4,5,6,7],ns=class extends An{constructor(t){super(t)}},is=class extends An{constructor(t){super(t)}};is.prototype.j=Gi([0,[0,Fi,Ni,-3,Fi],[0,rs,Fi,-1,Oi,[0,Fi,Ni,wi],Oi,Jo,Oi,[0,1,Jo],Oi,[0,Fi],Oi,[0,Fi,Ni,wi]]]);var os=class{constructor(){this.h="undefined"!=typeof AbortController}async send(t,e,r){var n=this.h?new AbortController:void 0,i=n&&t.P>0?setTimeout(()=>{n.abort()},t.P):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.P&&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)}}},ss=class extends An{constructor(t){super(t,37)}},as=[-4,{},Wi,Fi,$i],us=[0,Ni,Fi,1,Ni,-1,Fi,1,Fi,1,gi],ls=[0,Fi,Ni,-2],cs=[0,Ni,Fi],hs=[0,Ni,Fi],fs=[0,Ai,-3],ds=[0,Fi,Ni,-1,gi,Si,-1,Ni,-5,Pi,[0,Ni,-4],-1,Ai,[0,Ai,-3],Fi];var ps,vs=class extends An{constructor(t){super(t,19)}},ms=(ps=[-19,{},[0,Fi,1,[0,Ni,-6,gi,Si,Ni,-1,gi],1,[0,Ni,1,Ni,-5],Ni,-1,[0,Fi,Ni,-8],[0,Ni,-3],[0,Ni,Fi,Ni,-2],[0,Ni,-1,Fi,Ni,-1,Fi,Ni,-1,[0,Pi,[0,Ni,-1],Ai,Ni,-5],[0,Fi,Ai,Si,-2]],gi,[0,Ni,-3,gi,Si,Ni,-1],[0,Fi,Ni,-1],[0,Ni,-9],[0,Ni,-6,Fi,Ni,1,Ni,Ai,Fi,-1,Ai,Ni,-2,Fi,Ni,Fi,Ni,Si,-1],1,[0,Fi],1,[0,Ni,-4],1,us,[0,[1,2,3,4,5,6],Oi,us,Oi,cs,Oi,hs,Oi,[0,Fi],Oi,ds,Oi,ls],cs,hs,ds,[0,[0,Fi,Ni,-1,gi,Si,-1,Ni,-4,Pi,[0,Ni,-4],-1,1,fs],[0,Fi,Ni,-1,gi,Si,-1,Ni,-4,fs]],ls,[0,Ni,[0,Si,-3,Fi],Fi,-2,[0,Si,-1],Ai],4,[0,Ni,Fi,Ni,-1,gi,Fi,Ni,-1,Fi,Si,-1]],Fi,Pi,[-37,{},mi,Ni,Pi,[0,Ni,-1],Bi,1,Bi,[0,ji,-1,_i,yi,-1],Ni,[0,Si,Ni,-1],Ai,Si,gi,Ni,-1,Ci,zi,mi,Bi,Fi,_i,gi,-1,[0,Fi,-1],Ni,Ai,Ni,Ei,Ni,-1,di,1,di,as,Ai,[0,Fi,[0,pi,Si,-2],[0,pi]],[0,Fi,gi]],mi,Li,Ni,-1,mi,Fi,-1,[0,Ai,-1,Fi,Ai],[0,gi,-1,Ni],[0,mi,Ai,gi],gi,1,Ui,1,as],t=>Qn(t,ps)),gs=class{constructor(t){this.j=[],this.o=new os,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 vs;Ie(e=sr(e,2,1786));var r=e.m,n=0|r[X];if(null==t)Le(r,n,3);else{var i=t===G?7:0|t[X],o=i,s=Me(i),a=s||Object.isFrozen(t),u=!0,l=!0;for(let e=0;e<t.length;e++){var c=t[e];s||(c=nt(c),u&&=!c,l&&=c)}s||(i=u?13:5,i=l?-4097&i:4096|i),a&&i===o||(t=Ft(t),o=0,i=er(i,n)),i!==o&&tt(t,i),n=Le(r,n,3,t),2&i||!(4096&i||16&i)||je(r,n)}return e}(r),r=ms(r),this.o.send({url:"https://odml.pa.googleapis.com/v1/log",ga:"POST",P: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 ys{constructor(){this.K=this.F=this.J=this.D=this.H=this.I=this.G=0}}function bs(t,e){var r=new is;r=Ze(r,0,1,t.W),r=Ze(r,0,2,e),e=Be(e=new ss,6,ot(r=r.j(),!1)),(t=t.C).error||t.j.push(e)}function ws(t,e){++t.h.G,t.j.set(e,performance.now())}function Ss(t,e){var r={G:e.G-t.l.G,I:e.I-t.l.I,H:e.H-t.l.H,D:e.D-t.l.D,J:e.J-t.l.J,F:e.F,K:e.K},n=ts(Zo(new es,t.B),1);r=Es(t,r),bs(t,n=tr(n,4,rs,r)),t.l=e}function _s(t,e){var r=t.j.get(e);if(void 0!==r&&(t.j.delete(e),e=performance.now()-r,++t.h.H,t.h.J+=e,t.h.F=Math.max(t.h.F,e),t.A=Math.max(t.A,e),performance.now()>t.o+3e4)){for(let[n,i]of t.j.entries())e=n,i<r&&(t.h.D++,t.j.delete(e));r={...t.h,K:performance.now()-t.o},t.h.F=0,t.o=performance.now(),Ss(t,r)}}function Es(t,e){var r=new Yo;return t=or(t=ir(t=sr(r,1,t.u),7,e.D),5,e.F),t=or(t,6,e.K),e.H>0&&or(t,4,e.J/e.H),0!==e.G&&(r=ir(r=Ko(3),2,e.G),rr(t,8,qo,r)),0!==e.I&&(e=ir(r=Ko(4),2,e.I),rr(t,8,qo,e)),t}var Ts=class{constructor(t,e,r){this.T=performance.now(),this.o=performance.now(),this.j=new Map,this.A=0,this.h=new ys,this.l=new ys,this.C=new gs(r),this.B=function(t){switch(t){case"AudioClassifier":return 4;case"AudioEmbedder":return 5;case"TextClassifier":return 6;case"TextEmbedder":return 7;case"GestureRecognizer":return 8;case"HandDetector":return 9;case"HandLandmarker":return 10;case"ImageClassifier":return 11;case"ImageEmbedder":return 12;case"ImageSegmenter":return 13;case"ObjectDetector":return 14;case"FaceDetector":return 15;case"FaceLandmarker":return 16;case"InteractiveSegmenter":case"InteractiveSegmenterLegacy":return 18;case"HolisticLandmarker":return 20;case"LlmInference":return 21;case"LanguageDetector":return 22;case"PoseLandmarker":return 23;case"UniversalEmbedder":return 28;case"SemanticRetriever":return 29;case"DecisionMaker":return 30;case"TextSummarizer":return 26;case"TextProofreader":return 27;case"AudioTranscriber":return 31;case"TextToSpeech":return 32;default:return 0}}(t),this.u=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 ns,"undefined"==typeof navigator?e=0:(e=navigator.userAgent,e=/Android/i.test(e)?1:/iPhone|iPad|iPod/i.test(e)?2:/Windows/i.test(e)?5:/Macintosh/i.test(e)?4:/Linux/i.test(e)?3:0),t=Be(t=sr(t,1,e),2,ie("")),t=Be(t,3,ie("")),t=Be(t,4,ie("1.2.2")),t=Be(t,5,ie("")),this.W=sr(t,6,function(){var t=globalThis.__HOST_ENVIRONMENT__;if("string"==typeof t)switch(t){case"ANDROID":return 1;case"IOS":return 2;case"PYTHON":return 3;case"WEB":break;case"FLUTTER":return 5;case"FLUTTER_WEB":return 6;default:return 0}return 4}())}O(){var t=new Qo;t=or(t=sr(t,1,this.u),3,performance.now()-this.T),bs(this,t=tr(ts(Zo(new es,this.B),0),3,rs,t)),this.o=performance.now()}da(){var t={...this.h,D:this.h.D+this.j.size,F:this.A,K:performance.now()-this.T};Ss(this,t);var e=new Xo;e=Ze(e,0,2,t=Es(this,t)),bs(this,e=tr(t=ts(Zo(new es,this.B),2),5,rs,e))}close(){var t=this.C;"function"==typeof t.close?t.close():t.flush()}};function As(){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 Is(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 Ns(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Ps(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 S(){return this.i}ba(){if("function"==typeof this.S._mediapipeLoggerGetEncodedApiKey){let t=this.S._mediapipeLoggerGetEncodedApiKey();return this.S._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:As()?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){Ns(this,t,e),js(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ns(this,t,e),js(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Ps(this,t,e),js(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ns(this,t,e),js(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ps(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?'),Ns(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}})),Bs=class extends Os{};async function Ls(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await Is(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Is(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.ba();t.j=new Ts(t.A(),e,r)}(t,r),await t.v(r),t}async function Us(t,e,r){return Ls(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=Ye(t.baseOptions,Bo,1)||new Bo;"string"==typeof e?(Be(r,2,ie(e)),Be(r,1)):e instanceof Uint8Array&&(Be(r,1,ot(e,!1)),Be(r,2)),Ze(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(!(Ye(t.baseOptions,Bo,1)?.j()||Ye(t.baseOptions,Bo,1)?.l()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");!function(t,e){var r=Ye(t.baseOptions,Po,3);if(!r){var n=r=new Po,i=new io;tr(n,4,Oo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Zi,tr(e,2,Oo,n)):(e=r,n=new io,tr(e,4,Oo,n))),Ze(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.C.length;if(1===e)throw Error(t.C[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.C.map(t=>t.message).join(", "))}finally{t.C=[]}}function Ms(t,e){if(t.j&&void 0!==e){let r=Ye(t.baseOptions,Po,3);r?.j()||r?.l()?.j()?(++(t=t.j).h.I,t.j.set(e,performance.now())):ws(t.j,e)}}function Rs(t,e){t.B=Math.max(t.B,e)}var Gs=class{constructor(t){this.h=t,this.C=[],this.B=0,this.h.setAutoRenderToScreen(!1)}setGraph(t,e){this.h.attachErrorListener((t,e)=>{this.C.push(Error(e))}),this.h.ea(),this.h.setGraph(t,e),this.j?.O(),Cs(this)}finishProcessing(t){this.h.finishProcessing(),Cs(this),this.j&&void 0!==t&&_s(this.j,t)}close(){this.j?.da(),this.j?.close(),this.h.closeGraph()}};Gs.prototype.close=Gs.prototype.close;var Ds=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={languages:[]},Ze(t=this.l=new Fo,0,1,e=new Lo)}A(){return"LanguageDetector"}v(t){return Ze(this.l,0,2,Ro(t,Ye(this.l,jo,2))),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}Z(t){this.u={languages:[]};var e=this.B+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new go;mo(t),ar(t,15,"classifications_out");var e=new ao;Tn(e,Vo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(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.u.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.Z,Ds.prototype.setOptions=Ds.prototype.v,Ds.createFromModelPath=function(t,e){return Us(Ds,t,{baseOptions:{modelAssetPath:e}})},Ds.createFromModelBuffer=function(t,e){return Us(Ds,t,{baseOptions:{modelAssetBuffer:e}})},Ds.createFromOptions=function(t,e){return Us(Ds,t,e)};var zs=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={classifications:[]},Ze(t=this.l=new Fo,0,1,e=new Lo)}A(){return"TextClassifier"}v(t){return Ze(this.l,0,2,Ro(t,Ye(this.l,jo,2))),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}Y(t){this.u={classifications:[]};var e=this.B+1;return Ms(this,e),this.h.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}o(){var t=new go;mo(t),ar(t,15,"classifications_out");var e=new ao;Tn(e,Vo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),co(r),ar(r,4,"CLASSIFICATIONS:classifications_out"),r.v(e),rr(t,1,ho,r),this.h.attachProtoListener("classifications_out",(t,e)=>{this.u=Do(So(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.Y,zs.prototype.setOptions=zs.prototype.v,zs.createFromModelPath=function(t,e){return Us(zs,t,{baseOptions:{modelAssetPath:e}})},zs.createFromModelBuffer=function(t,e){return Us(zs,t,{baseOptions:{modelAssetBuffer:e}})},zs.createFromOptions=function(t,e){return Us(zs,t,e)};var Hs=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.u={embeddings:[]},Ze(t=this.l=new Co,0,1,e=new Lo)}A(){return"TextEmbedder"}v(t){var e=this.l,r=Ye(this.l,xo,2);return r=r?_e(r):new xo,void 0!==t.l2Normalize?Be(r,1,zt(t.l2Normalize)):"l2Normalize"in t&&Be(r,1),void 0!==t.quantize?Be(r,2,zt(t.quantize)):"quantize"in t&&Be(r,2),Ze(e,0,2,r),Vs(this,t)}get baseOptions(){return Ye(this.l,Lo,1)}set baseOptions(t){Ze(this.l,0,1,t)}aa(t,e){var r=this.B+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.u}o(){var t=new go;mo(t),ar(t,15,"embeddings_out");var e=new ao;Tn(e,Mo,this.l);var r=new ho;De(r,ie("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),co(r),ar(r,4,"EMBEDDINGS:embeddings_out"),r.v(e),rr(t,1,ho,r),this.h.attachProtoListener("embeddings_out",(t,e)=>{t=Io(t),this.u=function(t){return{embeddings:Xe(t,To).map(t=>{var e={headIndex:Wt(Pe(t,3))??0??-1,headName:oe(Pe(t,4))??""??""};if(ke(t,1,Ao))t=Fe(t=nr(t,_o,1,Ao),1,Dt),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=nr(t,Eo,2,Ao)?.j()?.j()??r}return e}),timestampMs:Go(Pe(t,2,void 0,Zt)??Ne)}}(t),Rs(this,e)}),this.h.attachEmptyPacketListener("embeddings_out",t=>{Rs(this,t)}),t=t.j(),this.setGraph(new Uint8Array(t),!0)}};function Ws(t,e){return Us(Ks,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.aa,Hs.prototype.setOptions=Hs.prototype.v,Hs.createFromModelPath=function(t,e){return Us(Hs,t,{baseOptions:{modelAssetPath:e}})},Hs.createFromModelBuffer=function(t,e){return Us(Hs,t,{baseOptions:{modelAssetBuffer:e}})},Hs.createFromOptions=function(t,e){return Us(Hs,t,e)};var Ks=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.baseOptions=new Lo,this.u=this.l=this.maxNumTokens=0}A(){return"TextProofreader"}async v(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),Vs(this,t,!(!t.baseOptions||!t.baseOptions.modelAssetPath&&!t.baseOptions.modelAssetBuffer),!0)}o(){this.l=this.h.i.createTextProofreader("/model.litertlm",this.maxNumTokens),this.j.O()}proofread(t){var e=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");var r=this.u++;ws(this.j,r);try{return e.proofread(this.l,t)}finally{_s(this.j,r)}}proofreadStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextProofreader is already closed.");if(r._userProofreaderListener)throw Error("Another proofread is already in progress.");var n=this.u++;ws(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userProofreaderListener=void 0,_s(this.j,n)},u="";r._userProofreaderListener=(t,r,n,s)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i({proofreadText:u,corrections:s??[]}))}};try{r.proofreadStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextProofreader(this.l)}catch{}this.l=0}super.close()}};function qs(t,e){return Us(Ys,t,e)}Ks.prototype.proofreadStreaming=Ks.prototype.proofreadStreaming,Ks.createFromModelBuffer=function(t,e,r=0){return Ws(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r})},Ks.createFromModelPath=function(t,e,r=0){return Ws(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r})},Ks.createFromOptions=Ws;var Ys=class extends Gs{constructor(t,e){super(new Bs(t,e)),this.baseOptions=new Lo,this.maxNumTokens=0,this.mode="KEYPOINTS",this.u=this.l=0}A(){return"TextSummarizer"}async v(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),this.j.O()}summarize(t){var e=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");var r=this.u++;ws(this.j,r);try{return e.summarize(this.l,t)}finally{_s(this.j,r)}}summarizeStreaming(t,e){var r=this.h.i;if(0===this.l)throw Error("TextSummarizer is already closed.");if(r._userSummarizerListener)throw Error("Another summarization is already in progress.");var n=this.u++;ws(this.j,n);var i,o,s=new Promise((t,e)=>{i=t,o=e}),a=()=>{r._userSummarizerListener=void 0,_s(this.j,n)},u="";r._userSummarizerListener=(t,r,n)=>{if(n)a(),o(Error(n));else{if(u+=t,e)try{e(t,r)}catch(t){return a(),void o(t)}r&&(a(),i(u))}};try{r.summarizeStreaming(this.l,t)}catch(t){a(),o(t)}return s}close(){var t=this.h.i;if(0!==this.l){try{t.deleteTextSummarizer(this.l)}catch{}this.l=0}super.close()}};return Ys.prototype.summarizeStreaming=Ys.prototype.summarizeStreaming,Ys.createFromModelBuffer=function(t,e,r=0,n="KEYPOINTS"){return qs(t,{baseOptions:{modelAssetBuffer:e},maxNumTokens:r,mode:n})},Ys.createFromModelPath=function(t,e,r=0,n="KEYPOINTS"){return qs(t,{baseOptions:{modelAssetPath:e},maxNumTokens:r,mode:n})},Ys.createFromOptions=qs,t.FilesetResolver=Wo,t.LanguageDetector=Ds,t.TaskRunner=Gs,t.TextClassifier=zs,t.TextEmbedder=Hs,t.TextProofreader=Ks,t.TextSummarizer=Ys,t}({});
2
2
  //# sourceMappingURL=text_bundle_iife.js.map