@mediapipe/tasks-text 1.0.0-rc.20260707 → 1.0.0-rc.20260708

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.mjs CHANGED
@@ -1,2 +1,2 @@
1
- var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,s=void 0,a="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var c=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,g=t.navigator;function p(t){return p[" "](t),t}d=g&&g.userAgentData||null,p[" "]=function(){};var v={},m=null;function y(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));v[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,_=!(!(c&&d&&d.brands.length>0)&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,E={"-":"+",_:"/",".":"="};function A(t){return E[t]||""}function I(t){if(!_)return y(t);t=S.test(t)?t.replace(S,A):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var T={};function B(){return N||=new x(null,T)}function U(t){O(T);var e=t.g;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.g=e}var N,x=class{i(){return new Uint8Array(U(this)||0)}constructor(t,e){if(O(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function O(t){if(t!==T)throw Error("illegal external caller")}function P(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var L=void 0;function k(){var t=Error("int32");return P(t,"warning"),t}function V(e,r){if(null!=e){var n=L??={},i=n[e]||0;i>=r||(n[e]=i+1,P(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var j="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var G,M=C("jas",void 0,!0),R=C(void 0,"1oa"),D=C(void 0,Symbol()),$=C(void 0,"0ubs"),z=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","R",!0),q={M:{value:0,configurable:!0,writable:!0,enumerable:!1}},K=Object.defineProperties,Y=j?M:"M",X=[];function Q(t,e){j||Y in t||K(t,q),t[Y]|=e}function J(t,e){j||Y in t||K(t,q),t[Y]=e}J(X,7),G=Object.freeze(X);var Z={};function tt(t,e){return void 0===e?t.g!==et&&!!(2&t.l[Y]):!!(2&e)&&t.g!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new x(t,T):B();else if(t.constructor!==x)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new x(new Uint8Array(t),T):B();else{if(!e)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var s=o+(n?-1:0);for(e=128&e?1:0;e<s;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var ot={};function st(t){return 128&t?ot:void 0}function at(t){return t.O=!0,t}var ut=at(t=>"number"==typeof t),lt=at(t=>"string"==typeof t),ct=at(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var e=t;if(lt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ut(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ht?BigInt(t):t=ct(t)?t?"1":"0":lt(t)?t.trim()||"0":String(t)}var dt=at(t=>ht?t>=pt&&t<=mt:"-"===t[0]?yt(t,gt):yt(t,vt)),gt=Number.MIN_SAFE_INTEGER.toString(),pt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,vt=Number.MAX_SAFE_INTEGER.toString(),mt=ht?BigInt(Number.MAX_SAFE_INTEGER):void 0;function yt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var bt,wt="function"==typeof Uint8Array.prototype.slice,_t=0,St=0;function Et(t){var e=t>>>0;_t=e,St=(t-e)/4294967296>>>0}function At(t){if(t<0){Et(-t);let[e,r]=Lt(_t,St);_t=e>>>0,St=r>>>0}else Et(t)}function It(t){var e=bt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),St=0,_t=e.getUint32(0,!0)}function Tt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:Nt(t,e)}function Bt(t,e){return ft(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):Nt(t,e))}function Ut(t,e){return F()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Ot(t,e))}function Nt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+xt(r)+xt(t));return r}function xt(t){return t=String(t),"0000000".slice(t.length)+t}function Ot(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Lt(t,e);t="-"+Nt(r,n)}else t=Nt(t,e);return t}function Pt(t){if(t.length<16)At(Number(t));else if(F())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);St=_t=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));St*=1e6,(_t=1e6*_t+e)>=4294967296&&(St+=Math.trunc(_t/4294967296),St>>>=0,_t>>>=0)}if(e){let[t,e]=Lt(_t,St);_t=t,St=e}}}function Lt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function kt(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,Ft="function"==typeof BigInt?BigInt.asUintN:void 0,jt=Number.isSafeInteger,Ct=Number.isFinite,Gt=Math.trunc;function Mt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Rt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var Dt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $t(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return Dt.test(t);default:return!1}}function zt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Pt(t),Ot(_t,St))}function Ht(t){if(t=Gt(t),!jt(t)){At(t);var e=_t,r=St;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Tt(e,r))?t?-e:e:t?"-"+e:e}return t}function qt(t){var e=Gt(Number(t));return jt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Kt(t){var e=typeof t;return null==t?t:"bigint"===e?ft(Vt(64,t)):$t(t)?("string"===e?(e=Gt(Number(t)),jt(e)?t=ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ft(Vt(64,BigInt(t))):ft(Wt(t)))):jt(t)?t=ft(Ht(t)):(t=Gt(t),jt(t)?t=String(t):(At(t),t=Ot(_t,St)),t=ft(t)),t):void 0}function Yt(t){if("string"!=typeof t)throw Error();return t}function Xt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Qt(t){return null==t||"string"==typeof t?t:void 0}function Jt(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[Y];return(r=n|32&r|2&r)!==n&&J(t,r),new e(t)}}function Zt(t){return t}function te(t){return D?t[D]:void 0}function ee(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var re,ne,ie,oe=class{};function se(t,e){e<100||V($,1)}function ae(t,e,r,n){var i=void 0!==n;n=!!n;var o,s=D;!i&&j&&s&&(o=t[s])&&ee(o,se),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=(re??Zt)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<a;f++){let i=t[f];if(null!=i&&null!=(i=r(i,n)))if(l&&f>=o){let t=f-c;(e??={})[t]=i}else s[f]=i}if(h)for(let t in h){if(null==(a=h[t])||null==(a=r(a,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?s[i]=a:(e??={})[t]=a}return e&&(u?s.push(e):s[o]=e),i&&D&&(t=te(t))&&t instanceof oe&&(s[D]=function(t){var e=new oe;return ee(t,(t,r,n)=>{e[r]=kt(n)}),e.g=t.g,e}(t)),s}function ue(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return dt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[Y];return 0===t.length&&1&e?void 0:ae(t,e,ue)}if(null!=t&&t[H]===Z)return le(t);if(t instanceof x){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(_){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=v[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.g=e}return t}return}return t}function le(t){return ae(t=t.l,0|t[Y],ue)}function ce(t,e){return he(t,e[0],e[1])}function he(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");V(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&J(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 J(t,64|i|n),t}function fe(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[Y];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=pe(t,r,!1,e&&!(16&r)):(Q(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.l)[Y])?t:we(t,e,r)?de(t,e):pe(e,r):t instanceof x?t:void 0}function de(t,e,r){return t=new t.constructor(e),r&&(t.g=et),t.m=et,t}function ge(t){var e=t.l,r=0|e[Y];return we(t,e,r)?de(t,e,!0):new t.constructor(pe(e,r,!1))}function pe(t,e,r,n){return n??=!!(34&e),t=ae(t,e,fe,n),n=32,r&&(n|=2),J(t,e=16769217&e|n),t}function ve(t){var e=t.l,r=0|e[Y];return tt(t,r)?we(t,e,r)?de(t,e,!0):new t.constructor(pe(e,r,!1)):t}function me(t){if(t.g!==et)return!1;var e=t.l;return Q(e=pe(e,0|e[Y]),2048),t.l=e,t.g=void 0,t.m=void 0,!0}function ye(t){if(!me(t)&&tt(t,0|t.l[Y]))throw Error()}function be(t,e){void 0===e&&(e=0|t[Y]),32&e&&!(4096&e)&&J(t,4096|e)}function we(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(J(e,2|r),t.g=et,!0)}var _e=ft(0);function Se(t,e,r,n){if(null!==(t=Ee(t.l,e,r,n)))return t}function Ee(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 Ae(t,e,r,n){ye(t),Ie(t=t.l,0|t[Y],e,r,n)}function Ie(t,e,r,n,i){var o=r+(i?0:-1),s=t.length-1;if(s>=1+(i?0:-1)&&o>=s){let i=t[s];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=s?(t[o]=n,e):(void 0!==n&&(r>=(s=(e??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[s+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Te(t,e,r,n){var i=t.l;return void 0!==Re(i,0|i[Y],e,t=Fe(t,n)===r?r:-1)}function Be(t,e,r,n,i){var o=t.l,s=0|o[Y];n=tt(t,s)?1:n,i=!!i||3===n,2===n&&me(t)&&(s=0|(o=t.l)[Y]);var a=(t=Ne(o,e))===G?7:0|t[Y],u=xe(a,s),l=!(4&u);if(l){4&u&&(t=kt(t),a=0,u=Ke(u,s),s=Ie(o,s,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==a&&(J(t,u),2&u&&Object.freeze(t)),Ue(t,u,o,s,e,n,l,i)}function Ue(t,e,r,n,i,o,s,a){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Oe(e)||((e|=!t.length||s&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&J(t,e),Object.freeze(t)):(2===o&&Oe(e)&&(t=kt(t),u=0,e=Ke(e,n),n=Ie(r,n,i,t)),Oe(e)||(a||(e|=16),e!==u&&J(t,e))),2&e||!(4096&e||16&e)||be(r,n),t}function Ne(t,e,r){return t=Ee(t,e,r),Array.isArray(t)?t:G}function xe(t,e){return 2&e&&(t|=2),1|t}function Oe(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Pe(t){return rt(t,!0)}function Le(t,e,r){ye(t);var n=0|(t=t.l)[Y];if(null==r)Ie(t,n,e);else{var i=r===G?7:0|r[Y],o=i,s=Oe(i),a=s||Object.isFrozen(r);for(s||(i=0),a||(r=kt(r),o=0,i=Ke(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=Yt(t);Object.is(t,e)||(a&&(r=kt(r),o=0,i=Ke(i,n),a=!1),r[s]=e)}i!==o&&(a&&(r=kt(r),i=Ke(i,n)),J(r,i)),Ie(t,n,e,r)}}function ke(t,e){ye(t),Ie(t=t.l,0|t[Y],2,""===e?void 0:e)}function Ve(t,e,r){if(2&e)throw Error();var n=st(e),i=Ne(t,r,n),o=i===G?7:0|i[Y],s=xe(o,e);return(2&s||Oe(s)||16&s)&&(s===o||Oe(s)||J(i,s),i=kt(i),o=0,s=Ke(s,e),Ie(t,e,r,i,n)),(s&=-13)!==o&&J(i,s),i}function Fe(t,e){return Ge(je(t=t.l),t,void 0,e)}function je(t){if(j)return t[R]??(t[R]=new Map);if(R in t)return t[R];var e=new Map;return Object.defineProperty(t,R,{value:e}),e}function Ce(t,e,r,n,i){var o=je(t),s=Ge(o,t,e,r,i);return s!==n&&(s&&(e=Ie(t,e,s,void 0,i)),o.set(r,n)),e}function Ge(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!=Ee(e,s,i)&&(0!==o&&(r=Ie(e,r,o,void 0,i)),o=s)}return t.set(n,o),o}function Me(t,e,r){var n=0|t[Y],i=st(n),o=Ee(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return me(o),o.l;var s=o.l}else Array.isArray(o)&&(s=o);if(s){let t=0|s[Y];2&t&&(s=pe(s,t))}return(s=ce(s,e))!==o&&Ie(t,n,r,s,i),s}function Re(t,e,r,n){var i=!1;if(null!=(n=Ee(t,n,void 0,t=>{var n=Jt(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&be(t,e),n}function De(t,e,r){var n=t.l,i=0|n[Y];if(null==(e=Re(n,i,e,r)))return e;if(!tt(t,i=0|n[Y])){let o=ve(e);o!==e&&(me(t)&&(i=0|(n=t.l)[Y]),be(n,i=Ie(n,i,r,e=o)))}return e}function $e(t,e,r,n,i,o,s){var a=tt(t,r);i=a?1:i,o=!!o||3===i,a=s&&!a,(2===i||a)&&me(t)&&(r=0|(e=t.l)[Y]);var u=(t=Ne(e,1))===G?7:0|t[Y],l=xe(u,r);if(s=!(4&l)){var c=t,h=r;let e=!!(2&l);e&&(h|=2);let i=!e,o=!0,s=0,a=0;for(;s<c.length;s++){let t=Jt(c[s],n,h);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}c[a++]=t}}a<s&&(c.length=a),l|=4,l=o?-4097&l:4096|l,l=i?8|l:-9&l}if(l!==u&&(J(t,l),2&l&&Object.freeze(t)),a&&!(8&l||!t.length&&(1===i||4===i&&(2&l||!(16&l)&&32&r)))){for(Oe(l)&&(t=kt(t),l=Ke(l,r),r=Ie(e,r,1,t)),n=t,a=l,u=0;u<n.length;u++)(c=n[u])!==(l=ve(c))&&(n[u]=l);a|=8,J(t,l=a=n.length?4096|a:-4097&a)}return Ue(t,l,e,r,1,i,s,o)}function ze(t,e){var r=t.l;return $e(t,r,0|r[Y],e,void 0===nt?2:4,!1,!0)}function We(t){return null==t&&(t=void 0),t}function He(t,e,r,n,i){return Ae(t,r,n=We(n),i),n&&!tt(n)&&be(t.l),t}function qe(t,e,r){var n=Ki;t:{var i=r=We(r);ye(t);let o=t.l,s=0|o[Y];if(null==i){let t=je(o);if(Ge(t,o,s,n)!==e)break t;t.set(n,0)}else s=Ce(o,s,n,e);Ie(o,s,e,i)}r&&!tt(r)&&be(t.l)}function Ke(t,e){return-273&(2&e?2|t:-3&t)}function Ye(t,e){var r=Ui;ye(t);var n=t.l;t=$e(t,n,0|n[Y],r,2,!0),e=null!=e?e:new r,t.push(e);var i=r=t===G?7:0|t[Y];(e=tt(e))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==i&&J(t,r),e||be(n)}function Xe(t,e,r){return De(t,e,r=Fe(t,Di)===r?r:-1)}function Qe(t,e,r){ye(t),Be(t,e,Qt,2,!0).push(Yt(r))}var Je=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Ze(t,e){if("string"==typeof t)return new Je(I(t),e);if(Array.isArray(t))return new Je(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Je(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Je(t,!1);if(t.constructor===x)return e=U(t)||new Uint8Array(0),new Je(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Je(t,!1);throw Error()}function tr(t,e){var r=0,n=0,i=0,o=t.i,s=t.g;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(or(t,s),!(128&a))return e(r>>>0,n>>>0);throw Error()}function er(t){for(var e=0,r=t.g,n=r+10,i=t.i;r<n;){let n=i[r++];if(e|=n,!(128&n))return or(t,r),!!(127&e)}throw Error()}function rr(t){var e=t.i,r=t.g,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 or(t,r),i}function nr(t){var e=t.i,r=t.g,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],or(t,t.g+4),t=2*((i=(n|i<<8|o<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function ir(t){return rr(t)}function or(t,e){if(t.g=e,e>t.j)throw Error()}function sr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.j)throw Error();return t.g=e,r}function ar(t,e){if(0==e)return B();var r=sr(t,e);return t.B&&t.v?r=t.i.subarray(r,r+e):(t=t.i,r=r===(e=r+e)?new Uint8Array(0):wt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?B():new x(r,T)}var ur=class{constructor(t,e,r,n){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.init(t,e,r,n)}init(t,e,r,{B:n=!1,D:i=!1}={}){this.B=n,this.D=i,t&&(t=Ze(t,this.D),this.i=t.buffer,this.v=t.g,this.m=e||0,this.j=void 0!==r?this.m+r:this.i.length,this.g=this.m)}clear(){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.B=!1}},lr=[];function cr(t,e,r,n){if(br.length){let i=br.pop();return i.o(n),i.g.init(t,e,r,n),i}return new yr(t,e,r,n)}function hr(t){t.g.clear(),t.j=-1,t.i=-1,br.length<100&&br.push(t)}function fr(t){var e=t.g;if(e.g==e.j)return!1;t.m=t.g.g;var r=rr(t.g)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.j=e,t.i=r,!0}function dr(t){switch(t.i){case 0:0!=t.i?dr(t):er(t.g);break;case 1:or(t=t.g,t.g+8);break;case 2:if(2!=t.i)dr(t);else{var e=rr(t.g)>>>0;or(t=t.g,t.g+e)}break;case 5:or(t=t.g,t.g+4);break;case 3:for(e=t.j;;){if(!fr(t))throw Error();if(4==t.i){if(t.j!=e)throw Error();break}dr(t)}break;default:throw Error()}}function gr(t,e,r){var n=t.g.j,i=rr(t.g)>>>0,o=(i=t.g.g+i)-n;if(o<=0&&(t.g.j=i,r(e,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=n}function pr(t){var e=rr(t.g)>>>0,o=sr(t=t.g,e);if(t=t.i,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 vr(t){var e=rr(t.g)>>>0;return ar(t.g,e)}function mr(t,e,r){var n=rr(t.g)>>>0;for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var yr=class{constructor(t,e,r,n){if(lr.length){let i=lr.pop();i.init(t,e,r,n),t=i}else t=new ur(t,e,r,n);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.o(n)}o({F:t=!1}={}){this.F=t}},br=[];function wr(t){return new Er(4294967295&t,Math.floor(t/4294967296))}function _r(t){return t?/^\d+$/.test(t)?(Pt(t),new Er(_t,St)):null:Sr||=new Er(0,0)}var Sr,Er=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function Ar(t){return new kr(4294967295&t,Math.floor(t/4294967296))}function Ir(t){return t?/^-?\d+$/.test(t)?(Pt(t),new kr(_t,St)):null:Tr||=new kr(0,0)}var Tr,Br,Ur,Nr,xr,Or,Pr,Lr,kr=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function Vr(t,e,r){return"undefined"!=typeof BigInt64Array?(Pr||(Pr=new BigInt64Array(1),Lr=new Uint32Array(Pr.buffer),Pr[0]=BigInt(1),Or=1===Lr[0]),Pr[0]=t,new e(Lr[t=Or?0:1],Lr[1-t])):(xr||(Br=BigInt(Number.MIN_SAFE_INTEGER),Ur=BigInt(Number.MAX_SAFE_INTEGER),Nr=BigInt(4294967295),xr=BigInt(32)),t>=Br&&t<=Ur?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Nr),Number(t>>xr))))}function Fr(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function jr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Cr(t,e){if(e>=0)jr(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Gr(t){var e=_t;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var Mr=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Rr(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Dr(t,e,r){jr(t.g,8*e+r)}function $r(t,e){return Dr(t,e,2),e=t.g.end(),Rr(t,e),e.push(t.i),e}function zr(t,e){var r=e.pop();for(r=t.i+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.i++;e.push(r),t.i++}function Wr(t,e,r){Dr(t,e,2),jr(t.g,r.length),Rr(t,t.g.end()),Rr(t,r)}var Hr=class{constructor(){this.j=[],this.i=0,this.g=new Mr}};function qr(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Kr=qr(),Yr=qr(),Xr=qr(),Qr=qr(),Jr=qr(),Zr=qr(),tn=qr(),en=qr(),rn=qr(),nn=qr();function on(t,e,r){var n=t.l;D&&D in n&&(n=n[D])&&delete n[e.g],e.i?e.m(t,e.i,e.g,r,e.j):e.m(t,e.g,r,e.j)}var sn=class{constructor(t,e){this.l=he(t,e,void 0,2048)}toJSON(){return le(this)}};sn.prototype[H]=Z,sn.prototype.toString=function(){return this.l.toString()};var an=class{constructor(t,e,r){this.g=t,this.i=e,t=Kr,this.j=!!t&&r===t||!1}};function un(t,e){return new an(t,e,Kr)}function ln(t,e,r,n,i){null!=(e=_n(e,n))&&(r=$r(t,r),i(e,t),zr(t,r))}var cn,hn,fn=un(function(t,e,r,n,i){return 2===t.i&&(gr(t,Me(e,n,r),i),!0)},ln),dn=un(function(t,e,r,n,i){return 2===t.i&&(gr(t,Me(e,n,r),i),!0)},ln),gn=Symbol(),pn=Symbol(),vn=Symbol(),mn=Symbol(),yn=Symbol();function bn(t,e,r,n){var i=n[t];if(i)return i;(i={}).I=n,i.A=function(t){switch(typeof t){case"boolean":return ne||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ie||=[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.C=o,"function"==typeof(o=n[++s])&&(i.G=!0,cn??=o,hn??=n[s+1],o=n[s+=2]));for(var a={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)a[o[u]]=o;o=n[++s]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++s]);var l=void 0;if(o instanceof an?t=o:(t=fn,s--),t?.j){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 wn(t){return Array.isArray(t)?t[0]instanceof an?t:[dn,t]:[t,void 0]}function _n(t,e){return t instanceof sn?t.l:Array.isArray(t)?ce(t,e):void 0}function Sn(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function En(t,e,r,n,i){var o,s,a=r.g;t[e]=(t,e,r)=>a(t,e,r,s||=bn(pn,Sn,En,n).A,o||=An(n),i)}function An(t){var e=t[vn];if(null!=e)return e;var r=bn(pn,Sn,En,t);return e=r.G?(t,e)=>cn(t,e,r):(t,e)=>{for(;fr(e)&&4!=e.i;){var n=e.j,i=r[n];if(null==i){var o=r.C;o&&(o=o[n])&&(null!=(o=Tn(o))&&(i=r[n]=o))}if(null==i||!i(e,t,n)){if(i=(o=e).m,dr(o),o.F)var s=void 0;else s=o.g.g-i,o.g.g=i,s=ar(o.g,s);i=void 0,o=t,s&&((i=o[D]??(o[D]=new oe))[n]??(i[n]=[])).push(s)}}return(t=te(t))&&(t.g=r.I[yn]),!0},t[vn]=e,t[yn]=In.bind(t),e}function In(t,e,r,n){var i=this[pn],o=this[vn],s=ce(void 0,i.A),a=te(t);if(a){var u=!1,l=i.C;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=cr(t);try{u=!0,o(s,e)}finally{hr(e)}}else n?.(t,r,i)},null==e)ee(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!r?.T)throw Error();let i=st(n),o=(e,o)=>{if(null!=Ee(t,e,i)){if(1===r?.S)return;throw Error()}null!=o&&(n=Ie(t,n,e,o,i)),delete a[e]};null==e?it(s,0|s[Y],(t,e)=>{o(t,e)}):o(e,Ee(s,e,i))}}}}function Tn(t){var e=(t=wn(t))[0].g;if(t=t[1]){let r=An(t),n=bn(pn,Sn,En,t).A;return(t,i,o)=>e(t,i,o,n,r)}return e}function Bn(t,e,r){t[e]=r.i}function Un(t,e,r,n){var i,o,s=r.i;t[e]=(t,e,r)=>s(t,e,r,o||=bn(gn,Bn,Un,n).A,i||=Nn(n))}function Nn(t){var e=t[mn];if(!e){let r=bn(gn,Bn,Un,t);e=(t,e)=>xn(t,e,r),t[mn]=e}return e}function xn(t,e,r){it(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.C)&&(r=r[e])){var n=(r=wn(r))[0].i;if(r=r[1]){let e=Nn(r),i=bn(gn,Bn,Un,r).A;r=t.G?hn(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||V(z,3)}}),(t=te(t))&&ee(t,(t,r,n)=>{for(Rr(e,e.g.end()),t=0;t<n.length;t++)Rr(e,U(n[t])||new Uint8Array(0))})}var On=ft(0);function Pn(t,e){if(Array.isArray(e)){var r=0|e[Y];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&J(e,t),2&t&&Object.freeze(e),e}}function Ln(t,e,r){return new an(t,e,r)}function kn(t,e,r){return new an(t,e,r)}function Vn(t,e,r){Ie(t,0|t[Y],e,r,st(0|t[Y]))}function Fn(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Vt(64,t));if($t(t)){if("string"===e)return qt(t);if("number"===e)return Ht(t)}}(e),null!=e){if("string"==typeof e)Ir(e);if(null!=e)switch(Dr(t,r,0),typeof e){case"number":t=t.g,At(e),Fr(t,_t,St);break;case"bigint":r=Vr(e,kr,Ar),Fr(t.g,r.i,r.g);break;default:r=Ir(e),Fr(t.g,r.i,r.g)}}}function jn(t,e,r){null!=(e=zt(e))&&null!=e&&(Dr(t,r,0),Cr(t.g,e))}function Cn(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Dr(t,r,0),t.g.g.push(e?1:0))}function Gn(t,e,r){null!=(e=Qt(e))&&Wr(t,r,l(e))}function Mn(t,e,r,n,i){null!=(e=_n(e,n))&&(r=$r(t,r),i(e,t),zr(t,r))}function Rn(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof x?e:void 0)&&Wr(t,r,Ze(e,!0).buffer)}function Dn(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(Dr(t,r,0),jr(t.g,e))}var $n=Ln(function(t,e,r){return 5===t.i&&(Vn(e,r,nr(t.g)),!0)},function(t,e,r){null!=(e=Mt(e))&&(Dr(t,r,5),t=t.g,It(e),Gr(t))},en),zn=kn(function(t,e,r){return(5===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?mr(t,nr,e):e.push(nr(t.g)),!0)},function(t,e,r){if(null!=(e=Pn(Mt,e))&&e.length){Dr(t,r,2),jr(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,It(e[n]),Gr(r)}},en),Wn=Ln(function(t,e,r){return 0!==t.i?t=!1:(Vn(e,r,tr(t.g,Ut)),t=!0),t},Fn,Zr),Hn=Ln(function(t,e,r){return 0!==t.i?e=!1:(Vn(e,r,(t=tr(t.g,Ut))===On?void 0:t),e=!0),e},Fn,Zr),qn=Ln(function(t,e,r){return 0!==t.i?t=!1:(Vn(e,r,tr(t.g,Bt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ft(64,t));if($t(t)){if("string"===e)return e=Gt(Number(t)),jt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(Pt(t),t=Nt(_t,St))),t;if("number"===e)return(t=Gt(t))>=0&&jt(t)||(At(t),t=Tt(_t,St)),t}}(e),null!=e){if("string"==typeof e)_r(e);if(null!=e)switch(Dr(t,r,0),typeof e){case"number":t=t.g,At(e),Fr(t,_t,St);break;case"bigint":r=Vr(e,Er,wr),Fr(t.g,r.i,r.g);break;default:r=_r(e),Fr(t.g,r.i,r.g)}}},tn),Kn=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,rr(t.g)),!0)},jn,Qr),Yn=kn(function(t,e,r){return(0===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?mr(t,rr,e):e.push(rr(t.g)),!0)},function(t,e,r){if(null!=(e=Pn(zt,e))&&e.length){r=$r(t,r);for(let r=0;r<e.length;r++)Cr(t.g,e[r]);zr(t,r)}},Qr),Xn=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,0===(t=rr(t.g))?void 0:t),!0)},jn,Qr),Qn=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,er(t.g)),!0)},Cn,Yr),Jn=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,!1===(t=er(t.g))?void 0:t),!0)},Cn,Yr),Zn=kn(function(t,e,r){return 2===t.i&&(t=pr(t),Ve(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=Pn(Qt,e)))for(let s=0;s<e.length;s++){var n=t,i=r,o=e[s];null!=o&&Wr(n,i,l(o))}},Xr),ti=Ln(function(t,e,r){return 2===t.i&&(Vn(e,r,""===(t=pr(t))?void 0:t),!0)},Gn,Xr),ei=Ln(function(t,e,r){return 2===t.i&&(Vn(e,r,pr(t)),!0)},Gn,Xr),ri=function(t,e,r=Kr){return new an(t,e,r)}(function(t,e,r,n,i){return 2===t.i&&(n=ce(void 0,n),Ve(e,0|e[Y],r).push(n),gr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)Mn(t,e[o],r,n,i);1&(t=0|e[Y])||J(e,1|t)}}),ni=un(function(t,e,r,n,i,o){if(2!==t.i)return!1;var s=0|e[Y];return Ce(e,s,o,r,st(s)),gr(t,e=Me(e,n,r),i),!0},Mn),ii=Ln(function(t,e,r){return 2===t.i&&(Vn(e,r,vr(t)),!0)},Rn,rn),oi=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,0===(t=rr(t.g)>>>0)?void 0:t),!0)},Dn,Jr),si=Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,rr(t.g)),!0)},function(t,e,r){null!=(e=zt(e))&&(e=parseInt(e,10),Dr(t,r,0),Cr(t.g,e))},nn);class ai{constructor(t,e){var r=Ai;this.g=t,this.i=e,this.m=He,this.defaultValue=void 0,this.j=null!=r.P?ot:void 0}register(){p(this)}}function ui(t,e){return(r,n)=>{{let o={D:!0};n&&Object.assign(o,n),r=cr(r,void 0,void 0,o);try{let n=new t,o=n.l;An(e)(o,r);var i=n}finally{hr(r)}}return i}}var li,ci=[0,ti,Ln(function(t,e,r){return 2===t.i&&(Vn(e,r,(t=vr(t))===B()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof sn){let n=e.U;return void(n?(e=n(e),null!=e&&Wr(t,r,Ze(e,!0).buffer)):V(z,3))}if(Array.isArray(e))return void V(z,3)}Rn(t,e,r)},rn)],hi=globalThis.trustedTypes;var fi=class{constructor(t){this.g=t}toString(){return this.g+""}};function di(t){var e;return void 0===li&&(li=function(){var t=null;if(!hi)return t;try{let e=t=>t;t=hi.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=li)?e.createScriptURL(t):t,new fi(t)}function gi(t,...e){if(0===e.length)return di(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return di(r)}var pi=[0,Kn,si,Qn,-1,Yn,si,-1,Qn,-1],vi=[0,si,-1,Qn],mi=class extends sn{constructor(t){super(t)}},yi=[0,Qn,ei,Qn,si,-1,kn(function(t,e,r){return(0===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?mr(t,ir,e):e.push(rr(t.g)),!0)},function(t,e,r){if(null!=(e=Pn(zt,e))&&e.length){r=$r(t,r);for(let r=0;r<e.length;r++)Cr(t.g,e[r]);zr(t,r)}},nn),ei,-1,[0,Qn,-1],si,Qn,-1,vi],bi=[0,3,Qn,-1,2,[0,[2],Kn,ni,[0,Ln(function(t,e,r){return 0===t.i&&(Vn(e,r,rr(t.g)>>>0),!0)},Dn,Jr)]],[0,si,Qn,si,Qn,si,Qn,ei,-1],[0,[3,4],ei,-1,ni,[0,Kn],ni,[0,si]],[0]],wi=[0,ei,-2],_i=class extends sn{constructor(t){super(t)}},Si=[0],Ei=[0,Kn,Qn,1,Qn,-4],Ai=class extends sn{constructor(t){super(t,2)}},Ii={};Ii[336783863]=[0,ei,Qn,-1,Kn,[0,[1,2,3,4,5,6,7,8,9],ni,Si,ni,yi,ni,wi,ni,Ei,ni,pi,ni,[0,ei,-2],ni,[0,ei,si],ni,bi,ni,vi],[0,ei],Qn,[0,[1,3],[2,4],ni,[0,Yn],-1,ni,[0,Zn],-1,ri,[0,ei,-1]],ei];var Ti=[0,Hn,-1,Jn,-3,Hn,Yn,ti,Xn,Hn,-1,Jn,Xn,Jn,-2,ti];function Bi(t){Qe(t,3,"TEXT:text_in")}var Ui=class extends sn{constructor(t){super(t,500)}o(t){return He(this,0,7,t)}},Ni=[-1,{}],xi=[0,ei,1,Ni],Oi=[0,ei,Zn,Ni];function Pi(t){Qe(t,10,"text_in")}var Li,ki=class extends sn{constructor(t){super(t,500)}o(t){return He(this,0,1001,t)}};ki.prototype.i=(Li=[-500,ri,[-500,ti,-1,Zn,-3,[-2,Ii,Qn],ri,ci,Xn,-1,xi,Oi,ri,[0,ti,Jn],ti,Ti,Xn,Zn,987,Zn],4,ri,[-500,ei,-1,[-1,{}],998,ei],ri,[-500,ei,Zn,-1,[-2,{},Qn],997,Zn,-1],Xn,ri,[-500,ei,Zn,Ni,998,Zn],Zn,Xn,xi,Oi,ri,[0,ti,-1,Ni],Zn,-2,Ti,ti,-1,Jn,[0,Jn,oi],978,Ni,ri,ci],function(){var t=new Hr;xn(this.l,t,bn(gn,Bn,Un,Li)),Rr(t,t.g.end());var e=new Uint8Array(t.i),r=t.j,n=r.length,i=0;for(let t=0;t<n;t++){let n=r[t];e.set(n,i),i+=n.length}return t.j=[e],e});var Vi=class extends sn{constructor(t){super(t)}},Fi=class extends sn{constructor(t){super(t)}i(){return ze(this,Vi)}},ji=class extends sn{constructor(t){super(t)}},Ci=ui(class extends sn{constructor(t){super(t)}},[0,ri,[0,1,Kn,ei,[0,ri,[0,Kn,$n,ei,-1]]],Wn]),Gi=class extends sn{constructor(t){super(t)}},Mi=class extends sn{constructor(t){super(t)}i(){var t=Se(this,1,void 0,Pe);return null==t?B():t}},Ri=class extends sn{constructor(t){super(t)}},Di=[1,2],$i=ui(class extends sn{constructor(t){super(t)}},[0,ri,[0,Di,ni,[0,zn],ni,[0,ii],Kn,ei],Wn]),zi=class extends sn{constructor(t){super(t)}},Wi=class extends sn{constructor(t){super(t)}},Hi=[0,Qn,-1],qi=class extends sn{constructor(t){super(t)}i(){Te(this,mi,2,Ki)}},Ki=[1,2,3,4,5,6],Yi=class extends sn{constructor(t){super(t)}i(){return null!=Se(this,1,void 0,Pe)}j(){return null!=Qt(Se(this,2))}},Xi=class extends sn{constructor(t){super(t)}},Qi=[0,ii,ei,[0,Kn,Wn,-1],[0,qn,Wn]],Ji=[0,Qi,Qn,[0,Ki,ni,Ei,ni,yi,ni,pi,ni,Si,ni,wi,ni,bi],si],Zi=class extends sn{constructor(t){super(t)}},to=new ai(462704549,Zi);Ii[462704549]=[0,Ji,[0,ei,Kn,$n,Zn,-1]];var eo=class extends sn{constructor(t){super(t)}},ro=new ai(477589892,eo);function no(t,e){if(e=e?ge(e):new zi,void 0!==t.displayNamesLocale?Ae(e,1,Xt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ae(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw k();if(!Ct(r))throw k();r|=0}Ae(e,2,r)}else"maxResults"in t&&Ae(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}`);Ae(e,3,r)}else"scoreThreshold"in t&&Ae(e,3);return void 0!==t.categoryAllowlist?Le(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ae(e,4),void 0!==t.categoryDenylist?Le(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ae(e,5),e}function io(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function oo(t){var e={classifications:ze(t,ji).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:zt(Se(t,1))??0??-1,score:Se(t,2,void 0,Mt)??0??0,categoryName:Qt(Se(t,3))??""??"",displayName:Qt(Se(t,4))??""??""})),headIndex:e,headName:r}}(De(t,Fi,4)?.i()??[],zt(Se(t,2))??0,Qt(Se(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(dt(t)?t=Number(t):(t=Vt(64,t),t=dt(t)?Number(t):String(t)),t):$t(t)?"number"==typeof t?Ht(t):qt(t):void 0}(Se(t,2,void 0,Kt))&&(e.timestampMs=io(Se(t,2,void 0,Kt)??_e)),e}function so(t){return Array.from(t,t=>t>127?t-256:t)}function ao(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)}Ii[477589892]=[0,Ji,Hi,1,Qi];var uo,lo=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function co(t){if(t)return!0;if(void 0===uo)try{await WebAssembly.instantiate(lo),uo=!0}catch{uo=!1}return uo}async function ho(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await co(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var fo=class{};fo.forVisionTasks=function(t,e=!1){return ho("vision",t??gi``,e)},fo.forTextTasks=function(t,e=!1){return ho("text",t??gi``,e)},fo.forGenAiTasks=function(t,e=!1){return ho("genai",t??gi``,e)},fo.forAudioTasks=function(t,e=!1){return ho("audio",t??gi``,e)},fo.isSimdSupported=function(t=!1){return co(t)};var go=class{close(){}};function po(){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 vo(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 mo(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function yo(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.h.stringToNewUTF8(e[r]);e=t.h._malloc(4*n.length),t.h.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.h._free(e);t.h._free(e)}function bo(t,e,r){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=r}function wo(t,e,r){var n=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var _o=function(t){return class extends t{N(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:po()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){var 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.h._malloc(r);this.h.HEAPU8.set(t,n),e?this.h._changeBinaryGraph(r,n):this.h._changeTextGraph(r,n),this.h._free(n)}configureAudio(t,e,r,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),mo(this,n||"input_audio",n=>{mo(this,i=i||"audio_header",i=>{this.h._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),mo(this,n,t=>{this.h._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){mo(this,e,e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();var n=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);var[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,r)})}addBoolToStream(t,e,r){mo(this,e,e=>{this.h._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){mo(this,e,e=>{this.h._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){mo(this,e,e=>{this.h._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){mo(this,e,e=>{this.h._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){mo(this,e,e=>{this.h._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){mo(this,e,e=>{mo(this,t,t=>{this.h._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){mo(this,e,e=>{yo(this,Object.keys(t),n=>{yo(this,Object.values(t),i=>{this.h._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){mo(this,r,r=>{mo(this,e,e=>{var i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,r,n),this.h._free(i)})})}addEmptyPacketToStream(t,e){mo(this,t,t=>{this.h._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){mo(this,e,e=>{var n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)mo(this,e,t=>{this.h._addStringVectorEntry(n,t)});this.h._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){mo(this,e,e=>{this.h._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){mo(this,e,e=>{this.h._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){mo(this,e,e=>{this.h._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){mo(this,e,e=>{this.h._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){mo(this,e,e=>{this.h._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){mo(this,e,e=>{mo(this,t,t=>{this.h._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){mo(this,r,r=>{mo(this,e,e=>{var n=this.h._malloc(t.length);this.h.HEAPU8.set(t,n),this.h._addProtoToInputSidePacket(n,t.length,e,r),this.h._free(n)})})}addBoolVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){mo(this,e,e=>{var r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)mo(this,e,t=>{this.h._addStringVectorEntry(r,t)});this.h._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachBoolListener(t)})}attachBoolVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachBoolVectorListener(t)})}attachIntListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachIntListener(t)})}attachIntVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachIntVectorListener(t)})}attachUintListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachUintListener(t)})}attachUintVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachUintVectorListener(t)})}attachDoubleListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachDoubleVectorListener(t)})}attachFloatListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachFloatListener(t)})}attachFloatVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachFloatVectorListener(t)})}attachStringListener(t,e){bo(this,t,e),mo(this,t,t=>{this.h._attachStringListener(t)})}attachStringVectorListener(t,e){wo(this,t,e),mo(this,t,t=>{this.h._attachStringVectorListener(t)})}attachProtoListener(t,e,r){bo(this,t,e),mo(this,t,t=>{this.h._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){wo(this,t,e),mo(this,t,t=>{this.h._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),bo(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),mo(this,t,t=>{this.h._attachAudioListener(t,r||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),So=class extends _o{};async function Eo(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await vo(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await vo(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}),t.H=new go,await t.o(r),t}async function Ao(t,e,r){return Eo(t,e,r)}function Io(t,e){var r=De(t.baseOptions,Yi,1)||new Yi;"string"==typeof e?(Ae(r,2,Xt(e)),Ae(r,1)):e instanceof Uint8Array&&(Ae(r,1,rt(e,!1)),Ae(r,2)),He(t.baseOptions,0,1,r)}function To(t,e){var r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(De(t.baseOptions,Yi,1)?.i()||De(t.baseOptions,Yi,1)?.j()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=De(t.baseOptions,qi,3);if(!r){var n=r=new qi;qe(n,4,new _i)}"delegate"in e&&("GPU"===e.delegate?qe(e=r,2,n=new mi):qe(e=r,4,n=new _i)),He(t.baseOptions,0,3,r)}(t,r),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=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Io(t,"/model.dat"),t.v()});if(r.modelAssetBuffer instanceof Uint8Array)Io(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=>{Io(t,e),t.v()});return t.v(),Promise.resolve()}function Bo(t){try{let e=t.m.length;if(1===e)throw Error(t.m[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.m.map(t=>t.message).join(", "))}finally{t.m=[]}}function Uo(t,e){t.H&&void 0!==e&&De(t.baseOptions,qi,3)?.i()}function No(t,e){t.j=Math.max(t.j,e)}var xo=class{constructor(t){this.g=t,this.m=[],this.j=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.m.push(Error(e))}),this.g.N(),this.g.setGraph(t,e),Bo(this)}finishProcessing(){this.g.finishProcessing(),Bo(this)}close(){this.H?.close(),this.g.closeGraph()}};xo.prototype.close=xo.prototype.close;var Oo=class extends xo{constructor(t,e){super(new So(t,e)),this.u={languages:[]},He(t=this.i=new Zi,0,1,e=new Xi)}o(t){return He(this.i,0,2,no(t,De(this.i,zi,2))),To(this,t)}get baseOptions(){return De(this.i,Xi,1)}set baseOptions(t){He(this.i,0,1,t)}K(t){this.u={languages:[]};var e=this.j+1;return Uo(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}v(){var t=new ki;Pi(t),Qe(t,15,"classifications_out");var e=new Ai;on(e,to,this.i);var r=new Ui;ke(r,Xt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Bi(r),Qe(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=oo(Ci(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})),No(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{No(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};Oo.prototype.detect=Oo.prototype.K,Oo.prototype.setOptions=Oo.prototype.o,Oo.createFromModelPath=function(t,e){return Ao(Oo,t,{baseOptions:{modelAssetPath:e}})},Oo.createFromModelBuffer=function(t,e){return Ao(Oo,t,{baseOptions:{modelAssetBuffer:e}})},Oo.createFromOptions=function(t,e){return Ao(Oo,t,e)};var Po=class extends xo{constructor(t,e){super(new So(t,e)),this.u={classifications:[]},He(t=this.i=new Zi,0,1,e=new Xi)}o(t){return He(this.i,0,2,no(t,De(this.i,zi,2))),To(this,t)}get baseOptions(){return De(this.i,Xi,1)}set baseOptions(t){He(this.i,0,1,t)}J(t){this.u={classifications:[]};var e=this.j+1;return Uo(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}v(){var t=new ki;Pi(t),Qe(t,15,"classifications_out");var e=new Ai;on(e,to,this.i);var r=new Ui;ke(r,Xt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Bi(r),Qe(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("classifications_out",(t,e)=>{this.u=oo(Ci(t)),No(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{No(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};function Lo(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"}}Po.prototype.classify=Po.prototype.J,Po.prototype.setOptions=Po.prototype.o,Po.createFromModelPath=function(t,e){return Ao(Po,t,{baseOptions:{modelAssetPath:e}})},Po.createFromModelBuffer=function(t,e){return Ao(Po,t,{baseOptions:{modelAssetBuffer:e}})},Po.createFromOptions=function(t,e){return Ao(Po,t,e)};var ko=class extends xo{constructor(t,e){super(new So(t,e)),this.u={embeddings:[]},He(t=this.i=new eo,0,1,e=new Xi)}o(t){var e=this.i,r=De(this.i,Wi,2);return r=r?ge(r):new Wi,void 0!==t.l2Normalize?Ae(r,1,Rt(t.l2Normalize)):"l2Normalize"in t&&Ae(r,1),void 0!==t.quantize?Ae(r,2,Rt(t.quantize)):"quantize"in t&&Ae(r,2),He(e,0,2,r),To(this,t)}get baseOptions(){return De(this.i,Xi,1)}set baseOptions(t){He(this.i,0,1,t)}L(t,e){var r=this.j+1;if(Uo(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: ${Lo(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Lo(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Lo(r)} | query: ${t}`}}return this.g.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.u}v(){var t=new ki;Pi(t),Qe(t,15,"embeddings_out");var e=new Ai;on(e,ro,this.i);var r=new Ui;ke(r,Xt("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Bi(r),Qe(r,4,"EMBEDDINGS:embeddings_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=$i(t),this.u=function(t){return{embeddings:ze(t,Ri).map(t=>{var e={headIndex:zt(Se(t,3))??0??-1,headName:Qt(Se(t,4))??""??""};if(Te(t,Gi,1,Di))t=Be(t=Xe(t,Gi,1),1,Mt,void 0===nt?2:4),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Xe(t,Mi,2)?.i()?.i()??r}return e}),timestampMs:io(Se(t,2,void 0,Kt)??_e)}}(t),No(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{No(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};ko.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=ao(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=ao(so(t.quantizedEmbedding),so(e.quantizedEmbedding))}return t},ko.prototype.embed=ko.prototype.L,ko.prototype.setOptions=ko.prototype.o,ko.createFromModelPath=function(t,e){return Ao(ko,t,{baseOptions:{modelAssetPath:e}})},ko.createFromModelBuffer=function(t,e){return Ao(ko,t,{baseOptions:{modelAssetBuffer:e}})},ko.createFromOptions=function(t,e){return Ao(ko,t,e)};export{fo as FilesetResolver,Oo as LanguageDetector,xo as TaskRunner,Po as TextClassifier,ko as TextEmbedder};
1
+ var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,o=0;o<n.length;o++)if(null==(i=i[n[o]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(){throw Error("Invalid UTF8")}function n(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var i,o,a=void 0,s="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function l(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let o=t.charCodeAt(++i);if(o>=56320&&o<=57343){e=1024*(e-55296)+o-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}var c=e(610401301,!1),h=e(748402147,!0);function f(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var d,g=t.navigator;function p(t){return p[" "](t),t}d=g&&g.userAgentData||null,p[" "]=function(){};var v={},m=null;function y(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=m[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}b();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),o=r(64);if(64===o&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=o&&e(i<<6&192|o))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function b(){if(!m){m={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));v[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===m[e]&&(m[e]=t)}}}}var w="undefined"!=typeof Uint8Array,_=!(!(c&&d&&d.brands.length>0)&&(-1!=f().indexOf("Trident")||-1!=f().indexOf("MSIE")))&&"function"==typeof btoa,S=/[-_.]/g,E={"-":"+",_:"/",".":"="};function A(t){return E[t]||""}function I(t){if(!_)return y(t);t=S.test(t)?t.replace(S,A):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}var T={};function B(){return x||=new N(null,T)}function U(t){O(T);var e=t.g;return null==(e=null==e||w&&null!=e&&e instanceof Uint8Array?e:"string"==typeof e?I(e):null)?e:t.g=e}var x,N=class{i(){return new Uint8Array(U(this)||0)}constructor(t,e){if(O(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function O(t){if(t!==T)throw Error("illegal external caller")}function P(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var L=void 0;function k(){var t=Error("int32");return P(t,"warning"),t}function V(e,r){if(null!=e){var n=L??={},i=n[e]||0;i>=r||(n[e]=i+1,P(e=Error(),"incident"),function(e){t.setTimeout(()=>{throw e},0)}(e))}}function F(){return"function"==typeof BigInt}var j="function"==typeof Symbol&&"symbol"==typeof Symbol();function C(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var G,M=C("jas",void 0,!0),R=C(void 0,"1oa"),D=C(void 0,Symbol()),$=C(void 0,"0ubs"),z=C(void 0,"0ubsb"),W=C(void 0,"0actk"),H=C("m_m","R",!0),q={M:{value:0,configurable:!0,writable:!0,enumerable:!1}},K=Object.defineProperties,Y=j?M:"M",X=[];function Q(t,e){j||Y in t||K(t,q),t[Y]|=e}function J(t,e){j||Y in t||K(t,q),t[Y]=e}J(X,7),G=Object.freeze(X);var Z={};function tt(t,e){return void 0===e?t.g!==et&&!!(2&t.l[Y]):!!(2&e)&&t.g!==et}var et={};function rt(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,T):B();else if(t.constructor!==N)if(w&&null!=t&&t instanceof Uint8Array)t=t.length?new N(new Uint8Array(t),T):B();else{if(!e)throw Error();t=void 0}return t}var nt=Object.freeze({});function it(t,e,r){var n,i=128&e?0:-1,o=t.length;(n=!!o)&&(n=null!=(n=t[o-1])&&"object"==typeof n&&n.constructor===Object);var a=o+(n?-1:0);for(e=128&e?1:0;e<a;e++)r(e-i,t[e]);if(n){t=t[o-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var ot={};function at(t){return 128&t?ot:void 0}function st(t){return t.O=!0,t}var ut=st(t=>"number"==typeof t),lt=st(t=>"string"==typeof t),ct=st(t=>"boolean"==typeof t),ht="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function ft(t){var e=t;if(lt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(ut(e)&&!Number.isSafeInteger(e))throw Error(String(e));return ht?BigInt(t):t=ct(t)?t?"1":"0":lt(t)?t.trim()||"0":String(t)}var dt=st(t=>ht?t>=pt&&t<=mt:"-"===t[0]?yt(t,gt):yt(t,vt)),gt=Number.MIN_SAFE_INTEGER.toString(),pt=ht?BigInt(Number.MIN_SAFE_INTEGER):void 0,vt=Number.MAX_SAFE_INTEGER.toString(),mt=ht?BigInt(Number.MAX_SAFE_INTEGER):void 0;function yt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var bt,wt="function"==typeof Uint8Array.prototype.slice,_t=0,St=0;function Et(t){var e=t>>>0;_t=e,St=(t-e)/4294967296>>>0}function At(t){if(t<0){Et(-t);let[e,r]=Lt(_t,St);_t=e>>>0,St=r>>>0}else Et(t)}function It(t){var e=bt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),St=0,_t=e.getUint32(0,!0)}function Tt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:xt(t,e)}function Bt(t,e){return ft(F()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):xt(t,e))}function Ut(t,e){return F()?ft(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):ft(Ot(t,e))}function xt(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else F()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Nt(r)+Nt(t));return r}function Nt(t){return t=String(t),"0000000".slice(t.length)+t}function Ot(t,e){if(2147483648&e)if(F())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=Lt(t,e);t="-"+xt(r,n)}else t=xt(t,e);return t}function Pt(t){if(t.length<16)At(Number(t));else if(F())t=BigInt(t),_t=Number(t&BigInt(4294967295))>>>0,St=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);St=_t=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));St*=1e6,(_t=1e6*_t+e)>=4294967296&&(St+=Math.trunc(_t/4294967296),St>>>=0,_t>>>=0)}if(e){let[t,e]=Lt(_t,St);_t=t,St=e}}}function Lt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function kt(t){return Array.prototype.slice.call(t)}var Vt="function"==typeof BigInt?BigInt.asIntN:void 0,Ft="function"==typeof BigInt?BigInt.asUintN:void 0,jt=Number.isSafeInteger,Ct=Number.isFinite,Gt=Math.trunc;function Mt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Rt(t){if(null!=t&&"boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var Dt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function $t(t){switch(typeof t){case"bigint":return!0;case"number":return Ct(t);case"string":return Dt.test(t);default:return!1}}function zt(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?0|t:void 0}function Wt(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Pt(t),Ot(_t,St))}function Ht(t){if(t=Gt(t),!jt(t)){At(t);var e=_t,r=St;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Tt(e,r))?t?-e:e:t?"-"+e:e}return t}function qt(t){var e=Gt(Number(t));return jt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),Wt(t))}function Kt(t){var e=typeof t;return null==t?t:"bigint"===e?ft(Vt(64,t)):$t(t)?("string"===e?(e=Gt(Number(t)),jt(e)?t=ft(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),t=F()?ft(Vt(64,BigInt(t))):ft(Wt(t)))):jt(t)?t=ft(Ht(t)):(t=Gt(t),jt(t)?t=String(t):(At(t),t=Ot(_t,St)),t=ft(t)),t):void 0}function Yt(t){if("string"!=typeof t)throw Error();return t}function Xt(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Qt(t){return null==t||"string"==typeof t?t:void 0}function Jt(t,e,r){if(null!=t&&t[H]===Z)return t;if(Array.isArray(t)){var n=0|t[Y];return(r=n|32&r|2&r)!==n&&J(t,r),new e(t)}}function Zt(t){return t}function te(t){return D?t[D]:void 0}function ee(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}var re,ne,ie,oe=class{};function ae(t,e){e<100||V($,1)}function se(t,e,r,n){var i=void 0!==n;n=!!n;var o,a=D;!i&&j&&a&&(o=t[a])&&ee(o,ae),a=[];var s=t.length;o=4294967295;var u=!1,l=!!(64&e),c=l?128&e?0:-1:void 0;if(!(1&e)){var h=s&&t[s-1];null!=h&&"object"==typeof h&&h.constructor===Object?o=--s:h=void 0,!l||128&e||i||(u=!0,o=(re??Zt)(o-c,c,t,h,void 0)+c)}e=void 0;for(var f=0;f<s;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 a[f]=i}if(h)for(let t in h){if(null==(s=h[t])||null==(s=r(s,n)))continue;let i;f=+t,l&&!Number.isNaN(f)&&(i=f+c)<o?a[i]=s:(e??={})[t]=s}return e&&(u?a.push(e):a[o]=e),i&&D&&(t=te(t))&&t instanceof oe&&(a[D]=function(t){var e=new oe;return ee(t,(t,r,n)=>{e[r]=kt(n)}),e.g=t.g,e}(t)),a}function ue(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return dt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[Y];return 0===t.length&&1&e?void 0:se(t,e,ue)}if(null!=t&&t[H]===Z)return le(t);if(t instanceof N){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(_){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),b(),r=v[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],a=e[t+1],s=e[t+2],u=r[o>>2];o=r[(3&o)<<4|a>>4],a=r[(15&a)<<2|s>>6],s=r[63&s],n[l++]=u+o+a+s}switch(u=0,s=i,e.length-t){case 2:s=r[(15&(u=e[t+1]))<<2]||i;case 1:e=e[t],n[l]=r[e>>2]+r[(3&e)<<4|u>>4]+s+i}e=n.join("")}t=t.g=e}return t}return}return t}function le(t){return se(t=t.l,0|t[Y],ue)}function ce(t,e){return he(t,e[0],e[1])}function he(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Y],h&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(h)throw Error("carr");V(W,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&J(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 a=o-1;let t=r[a];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((a-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var s in t)(o=+s)<a&&(r[o+e]=t[s],delete t[s]);i=-16760833&i|(1023&a)<<14;break t}}if(e){if((s=Math.max(e,o-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&s)<<14}}}return J(t,64|i|n),t}function fe(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[Y];return 0===t.length&&1&r?t=void 0:2&r||(!e||4096&r||16&r?t=pe(t,r,!1,e&&!(16&r)):(Q(t,34),4&r&&Object.freeze(t))),t}return null!=t&&t[H]===Z?tt(t,r=0|(e=t.l)[Y])?t:we(t,e,r)?de(t,e):pe(e,r):t instanceof N?t:void 0}function de(t,e,r){return t=new t.constructor(e),r&&(t.g=et),t.m=et,t}function ge(t){var e=t.l,r=0|e[Y];return we(t,e,r)?de(t,e,!0):new t.constructor(pe(e,r,!1))}function pe(t,e,r,n){return n??=!!(34&e),t=se(t,e,fe,n),n=32,r&&(n|=2),J(t,e=16769217&e|n),t}function ve(t){var e=t.l,r=0|e[Y];return tt(t,r)?we(t,e,r)?de(t,e,!0):new t.constructor(pe(e,r,!1)):t}function me(t){if(t.g!==et)return!1;var e=t.l;return Q(e=pe(e,0|e[Y]),2048),t.l=e,t.g=void 0,t.m=void 0,!0}function ye(t){if(!me(t)&&tt(t,0|t.l[Y]))throw Error()}function be(t,e){void 0===e&&(e=0|t[Y]),32&e&&!(4096&e)&&J(t,4096|e)}function we(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(J(e,2|r),t.g=et,!0)}var _e=ft(0);function Se(t,e,r,n){if(null!==(t=Ee(t.l,e,r,n)))return t}function Ee(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 a=t[o];if(null!=a&&"object"==typeof a&&a.constructor===Object){r=a[e];var s=!0}else{if(i!==o)return;r=a}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return s?a[e]=n:t[i]=n,n}return r}}function Ae(t,e,r,n){ye(t),Ie(t=t.l,0|t[Y],e,r,n)}function Ie(t,e,r,n,i){var o=r+(i?0:-1),a=t.length-1;if(a>=1+(i?0:-1)&&o>=a){let i=t[a];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return o<=a?(t[o]=n,e):(void 0!==n&&(r>=(a=(e??=0|t[Y])>>14&1023||536870912)?null!=n&&(t[a+(i?0:-1)]={[r]:n}):t[o]=n),e)}function Te(t,e,r,n){var i=t.l;return void 0!==Re(i,0|i[Y],e,t=Fe(t,n)===r?r:-1)}function Be(t,e,r,n,i){var o=t.l,a=0|o[Y];n=tt(t,a)?1:n,i=!!i||3===n,2===n&&me(t)&&(a=0|(o=t.l)[Y]);var s=(t=xe(o,e))===G?7:0|t[Y],u=Ne(s,a),l=!(4&u);if(l){4&u&&(t=kt(t),s=0,u=Ke(u,a),a=Ie(o,a,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&u|4,u=r&=-1025,u&=-4097}return u!==s&&(J(t,u),2&u&&Object.freeze(t)),Ue(t,u,o,a,e,n,l,i)}function Ue(t,e,r,n,i,o,a,s){var u=e;return 1===o||4===o&&(2&e||!(16&e)&&32&n)?Oe(e)||((e|=!t.length||a&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==u&&J(t,e),Object.freeze(t)):(2===o&&Oe(e)&&(t=kt(t),u=0,e=Ke(e,n),n=Ie(r,n,i,t)),Oe(e)||(s||(e|=16),e!==u&&J(t,e))),2&e||!(4096&e||16&e)||be(r,n),t}function xe(t,e,r){return t=Ee(t,e,r),Array.isArray(t)?t:G}function Ne(t,e){return 2&e&&(t|=2),1|t}function Oe(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Pe(t){return rt(t,!0)}function Le(t,e,r){ye(t);var n=0|(t=t.l)[Y];if(null==r)Ie(t,n,e);else{var i=r===G?7:0|r[Y],o=i,a=Oe(i),s=a||Object.isFrozen(r);for(a||(i=0),s||(r=kt(r),o=0,i=Ke(i,n),s=!1),i|=5,i|=(4&i?512&i?512:1024&i?1024:0:void 0)??1024,a=0;a<r.length;a++){let t=r[a],e=Yt(t);Object.is(t,e)||(s&&(r=kt(r),o=0,i=Ke(i,n),s=!1),r[a]=e)}i!==o&&(s&&(r=kt(r),i=Ke(i,n)),J(r,i)),Ie(t,n,e,r)}}function ke(t,e){ye(t),Ie(t=t.l,0|t[Y],2,""===e?void 0:e)}function Ve(t,e,r){if(2&e)throw Error();var n=at(e),i=xe(t,r,n),o=i===G?7:0|i[Y],a=Ne(o,e);return(2&a||Oe(a)||16&a)&&(a===o||Oe(a)||J(i,a),i=kt(i),o=0,a=Ke(a,e),Ie(t,e,r,i,n)),(a&=-13)!==o&&J(i,a),i}function Fe(t,e){return Ge(je(t=t.l),t,void 0,e)}function je(t){if(j)return t[R]??(t[R]=new Map);if(R in t)return t[R];var e=new Map;return Object.defineProperty(t,R,{value:e}),e}function Ce(t,e,r,n,i){var o=je(t),a=Ge(o,t,e,r,i);return a!==n&&(a&&(e=Ie(t,e,a,void 0,i)),o.set(r,n)),e}function Ge(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 a=n[t];null!=Ee(e,a,i)&&(0!==o&&(r=Ie(e,r,o,void 0,i)),o=a)}return t.set(n,o),o}function Me(t,e,r){var n=0|t[Y],i=at(n),o=Ee(t,r,i);if(null!=o&&o[H]===Z){if(!tt(o))return me(o),o.l;var a=o.l}else Array.isArray(o)&&(a=o);if(a){let t=0|a[Y];2&t&&(a=pe(a,t))}return(a=ce(a,e))!==o&&Ie(t,n,r,a,i),a}function Re(t,e,r,n){var i=!1;if(null!=(n=Ee(t,n,void 0,t=>{var n=Jt(t,r,e);return i=n!==t&&null!=n,n})))return i&&!tt(n)&&be(t,e),n}function De(t,e,r){var n=t.l,i=0|n[Y];if(null==(e=Re(n,i,e,r)))return e;if(!tt(t,i=0|n[Y])){let o=ve(e);o!==e&&(me(t)&&(i=0|(n=t.l)[Y]),be(n,i=Ie(n,i,r,e=o)))}return e}function $e(t,e,r,n,i,o,a){var s=tt(t,r);i=s?1:i,o=!!o||3===i,s=a&&!s,(2===i||s)&&me(t)&&(r=0|(e=t.l)[Y]);var u=(t=xe(e,1))===G?7:0|t[Y],l=Ne(u,r);if(a=!(4&l)){var c=t,h=r;let e=!!(2&l);e&&(h|=2);let i=!e,o=!0,a=0,s=0;for(;a<c.length;a++){let t=Jt(c[a],n,h);if(t instanceof n){if(!e){let e=tt(t);i&&=!e,o&&=e}c[s++]=t}}s<a&&(c.length=s),l|=4,l=o?-4097&l:4096|l,l=i?8|l:-9&l}if(l!==u&&(J(t,l),2&l&&Object.freeze(t)),s&&!(8&l||!t.length&&(1===i||4===i&&(2&l||!(16&l)&&32&r)))){for(Oe(l)&&(t=kt(t),l=Ke(l,r),r=Ie(e,r,1,t)),n=t,s=l,u=0;u<n.length;u++)(c=n[u])!==(l=ve(c))&&(n[u]=l);s|=8,J(t,l=s=n.length?4096|s:-4097&s)}return Ue(t,l,e,r,1,i,a,o)}function ze(t,e){var r=t.l;return $e(t,r,0|r[Y],e,void 0===nt?2:4,!1,!0)}function We(t){return null==t&&(t=void 0),t}function He(t,e,r,n,i){return Ae(t,r,n=We(n),i),n&&!tt(n)&&be(t.l),t}function qe(t,e,r){var n=Xi;t:{var i=r=We(r);ye(t);let o=t.l,a=0|o[Y];if(null==i){let t=je(o);if(Ge(t,o,a,n)!==e)break t;t.set(n,0)}else a=Ce(o,a,n,e);Ie(o,a,e,i)}r&&!tt(r)&&be(t.l)}function Ke(t,e){return-273&(2&e?2|t:-3&t)}function Ye(t,e){var r=Ni;ye(t);var n=t.l;t=$e(t,n,0|n[Y],r,2,!0),e=null!=e?e:new r,t.push(e);var i=r=t===G?7:0|t[Y];(e=tt(e))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==i&&J(t,r),e||be(n)}function Xe(t,e,r){return De(t,e,r=Fe(t,zi)===r?r:-1)}function Qe(t,e,r){ye(t),Be(t,e,Qt,2,!0).push(Yt(r))}var Je=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Ze(t,e){if("string"==typeof t)return new Je(I(t),e);if(Array.isArray(t))return new Je(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Je(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Je(t,!1);if(t.constructor===N)return e=U(t)||new Uint8Array(0),new Je(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Je(t,!1);throw Error()}function tr(t,e){var r=0,n=0,i=0,o=t.i,a=t.g;do{var s=o[a++];r|=(127&s)<<i,i+=7}while(i<32&&128&s);if(i>32)for(n|=(127&s)>>4,i=3;i<32&&128&s;i+=7)n|=(127&(s=o[a++]))<<i;if(or(t,a),!(128&s))return e(r>>>0,n>>>0);throw Error()}function er(t){for(var e=0,r=t.g,n=r+10,i=t.i;r<n;){let n=i[r++];if(e|=n,!(128&n))return or(t,r),!!(127&e)}throw Error()}function rr(t){var e=t.i,r=t.g,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 or(t,r),i}function nr(t){var e=t.i,r=t.g,n=e[r],i=e[r+1],o=e[r+2];return e=e[r+3],or(t,t.g+4),t=2*((i=(n|i<<8|o<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function ir(t){return rr(t)}function or(t,e){if(t.g=e,e>t.j)throw Error()}function ar(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.j)throw Error();return t.g=e,r}function sr(t,e){if(0==e)return B();var r=ar(t,e);return t.B&&t.v?r=t.i.subarray(r,r+e):(t=t.i,r=r===(e=r+e)?new Uint8Array(0):wt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?B():new N(r,T)}var ur=class{constructor(t,e,r,n){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.init(t,e,r,n)}init(t,e,r,{B:n=!1,D:i=!1}={}){this.B=n,this.D=i,t&&(t=Ze(t,this.D),this.i=t.buffer,this.v=t.g,this.m=e||0,this.j=void 0!==r?this.m+r:this.i.length,this.g=this.m)}clear(){this.i=null,this.v=!1,this.g=this.j=this.m=0,this.B=!1}},lr=[],cr=0;function hr(t,e,r,n){if(_r.length){let i=_r.pop();return i.o(n),i.g.init(t,e,r,n),i}return new wr(t,e,r,n)}function fr(t){t.g.clear(),t.j=-1,t.i=-1,_r.length<100&&_r.push(t)}function dr(t){var e=t.g;if(e.g==e.j)return!1;t.m=t.g.g;var r=rr(t.g)>>>0;if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.j=e,t.i=r,!0}function gr(t){try{switch(t.i){case 0:0!=t.i?gr(t):er(t.g);break;case 1:var e=t.g;or(e,e.g+8);break;case 2:if(2!=t.i)gr(t);else{var r=rr(t.g)>>>0,n=t.g;or(n,n.g+r)}break;case 5:var i=t.g;or(i,i.g+4);break;case 3:pr();let o=t.j;try{for(;;){if(!dr(t))throw Error();if(4==t.i){if(t.j!=o)throw Error();break}gr(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{cr>0&&cr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function pr(){if(cr>=100)throw new SyntaxError;cr++}function vr(t,e,r){var n=t.g.j,i=rr(t.g)>>>0,o=(i=t.g.g+i)-n;if(o<=0&&(t.g.j=i,r(e,t,void 0,void 0,void 0),o=i-t.g.g),o)throw Error();t.g.g=i,t.g.j=n}function mr(t){var e=rr(t.g)>>>0,o=ar(t=t.g,e);if(t=t.i,s){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===a){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(i=void 0),t}}else{e=(c=o)+e,o=[];let i,a=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&&(a=n(a,o),o.length=0)}c=n(a,o)}return c}function yr(t){var e=rr(t.g)>>>0;return sr(t.g,e)}function br(t,e,r){var n=rr(t.g)>>>0;for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var wr=class{constructor(t,e,r,n){if(lr.length){let i=lr.pop();i.init(t,e,r,n),t=i}else t=new ur(t,e,r,n);this.g=t,this.m=this.g.g,this.i=this.j=-1,this.o(n)}o({F:t=!1}={}){this.F=t}},_r=[];function Sr(t){return new Ir(4294967295&t,Math.floor(t/4294967296))}function Er(t){return t?/^\d+$/.test(t)?(Pt(t),new Ir(_t,St)):null:Ar||=new Ir(0,0)}var Ar,Ir=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function Tr(t){return new Fr(4294967295&t,Math.floor(t/4294967296))}function Br(t){return t?/^-?\d+$/.test(t)?(Pt(t),new Fr(_t,St)):null:Ur||=new Fr(0,0)}var Ur,xr,Nr,Or,Pr,Lr,kr,Vr,Fr=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};function jr(t,e,r){return"undefined"!=typeof BigInt64Array?(kr||(kr=new BigInt64Array(1),Vr=new Uint32Array(kr.buffer),kr[0]=BigInt(1),Lr=1===Vr[0]),kr[0]=t,new e(Vr[t=Lr?0:1],Vr[1-t])):(Pr||(xr=BigInt(Number.MIN_SAFE_INTEGER),Nr=BigInt(Number.MAX_SAFE_INTEGER),Or=BigInt(4294967295),Pr=BigInt(32)),t>=xr&&t<=Nr?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&Or),Number(t>>Pr))))}function Cr(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function Gr(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Mr(t,e){if(e>=0)Gr(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Rr(t){var e=_t;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var Dr=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function $r(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function zr(t,e,r){Gr(t.g,8*e+r)}function Wr(t,e){return zr(t,e,2),e=t.g.end(),$r(t,e),e.push(t.i),e}function Hr(t,e){var r=e.pop();for(r=t.i+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.i++;e.push(r),t.i++}function qr(t,e,r){zr(t,e,2),Gr(t.g,r.length),$r(t,t.g.end()),$r(t,r)}var Kr=class{constructor(){this.j=[],this.i=0,this.g=new Dr}};function Yr(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Xr=Yr(),Qr=Yr(),Jr=Yr(),Zr=Yr(),tn=Yr(),en=Yr(),rn=Yr(),nn=Yr(),on=Yr(),an=Yr();function sn(t,e,r){var n=t.l;D&&D in n&&(n=n[D])&&delete n[e.g],e.i?e.m(t,e.i,e.g,r,e.j):e.m(t,e.g,r,e.j)}var un=class{constructor(t,e){this.l=he(t,e,void 0,2048)}toJSON(){return le(this)}};un.prototype[H]=Z,un.prototype.toString=function(){return this.l.toString()};var ln=class{constructor(t,e,r){this.g=t,this.i=e,t=Xr,this.j=!!t&&r===t||!1}};function cn(t,e){return new ln(t,e,Xr)}function hn(t,e,r,n,i){null!=(e=En(e,n))&&(r=Wr(t,r),i(e,t),Hr(t,r))}var fn,dn,gn=cn(function(t,e,r,n,i){return 2===t.i&&(vr(t,Me(e,n,r),i),!0)},hn),pn=cn(function(t,e,r,n,i){return 2===t.i&&(vr(t,Me(e,n,r),i),!0)},hn),vn=Symbol(),mn=Symbol(),yn=Symbol(),bn=Symbol(),wn=Symbol();function _n(t,e,r,n){var i=n[t];if(i)return i;(i={}).I=n,i.A=function(t){switch(typeof t){case"boolean":return ne||=[0,void 0,!0];case"number":return t>0?void 0:0===t?ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var o=n[1],a=1;o&&o.constructor===Object&&(i.C=o,"function"==typeof(o=n[++a])&&(i.G=!0,fn??=o,dn??=n[a+1],o=n[a+=2]));for(var s={};o&&Array.isArray(o)&&o.length&&"number"==typeof o[0]&&o[0]>0;){for(var u=0;u<o.length;u++)s[o[u]]=o;o=n[++a]}for(u=1;void 0!==o;){let t;"number"==typeof o&&(u+=o,o=n[++a]);var l=void 0;if(o instanceof ln?t=o:(t=gn,a--),t?.j){o=n[++a],l=n;var c=a;"function"==typeof o&&(o=o(),l[c]=o),l=o}for(c=u+1,"number"==typeof(o=n[++a])&&o<0&&(c-=o,o=n[++a]);u<c;u++){let n=s[u];l?r(i,u,t,l,n):e(i,u,t,n)}}return n[t]=i}function Sn(t){return Array.isArray(t)?t[0]instanceof ln?t:[pn,t]:[t,void 0]}function En(t,e){return t instanceof un?t.l:Array.isArray(t)?ce(t,e):void 0}function An(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function In(t,e,r,n,i){var o,a,s=r.g;t[e]=(t,e,r)=>s(t,e,r,a||=_n(mn,An,In,n).A,o||=Tn(n),i)}function Tn(t){var e=t[yn];if(null!=e)return e;var r=_n(mn,An,In,t);return e=r.G?(t,e)=>fn(t,e,r):(t,e)=>{t:{pr();try{for(;dr(e)&&4!=e.i;){let u=e.j,l=r[u];if(null==l){let t=r.C;if(t){let e=t[u];if(e){let t=Un(e);null!=t&&(l=r[u]=t)}}}if(null==l||!l(e,t,u)){var n=e;let r=n.m;if(gr(n),n.F)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=sr(n.g,t)}n=void 0;var o=t,a=u,s=i;s&&((n=o[D]??(o[D]=new oe))[a]??(n[a]=[])).push(s)}}let l=te(t);l&&(l.g=r.I[wn]);var u=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{cr>0&&cr--}u=void 0}return u},t[yn]=e,t[wn]=Bn.bind(t),e}function Bn(t,e,r,n){var i=this[mn],o=this[yn],a=ce(void 0,i.A),s=te(t);if(s){var u=!1,l=i.C;if(l){if(i=(e,r,i)=>{if(0!==i.length)if(l[r])for(let t of i){e=hr(t);try{u=!0,o(a,e)}finally{fr(e)}}else n?.(t,r,i)},null==e)ee(s,i);else if(null!=s){let t=s[e];t&&i(s,e,t)}if(u){let n=0|t[Y];if(2&n&&2048&n&&!r?.T)throw Error();let i=at(n),o=(e,o)=>{if(null!=Ee(t,e,i)){if(1===r?.S)return;throw Error()}null!=o&&(n=Ie(t,n,e,o,i)),delete s[e]};null==e?it(a,0|a[Y],(t,e)=>{o(t,e)}):o(e,Ee(a,e,i))}}}}function Un(t){var e=(t=Sn(t))[0].g;if(t=t[1]){let r=Tn(t),n=_n(mn,An,In,t).A;return(t,i,o)=>e(t,i,o,n,r)}return e}function xn(t,e,r){t[e]=r.i}function Nn(t,e,r,n){var i,o,a=r.i;t[e]=(t,e,r)=>a(t,e,r,o||=_n(vn,xn,Nn,n).A,i||=On(n))}function On(t){var e=t[bn];if(!e){let r=_n(vn,xn,Nn,t);e=(t,e)=>Pn(t,e,r),t[bn]=e}return e}function Pn(t,e,r){it(t,0|t[Y],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.C)&&(r=r[e])){var n=(r=Sn(r))[0].i;if(r=r[1]){let e=On(r),i=_n(vn,xn,Nn,r).A;r=t.G?dn(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||V(z,3)}}),(t=te(t))&&ee(t,(t,r,n)=>{for($r(e,e.g.end()),t=0;t<n.length;t++)$r(e,U(n[t])||new Uint8Array(0))})}var Ln=ft(0);function kn(t,e){if(Array.isArray(e)){var r=0|e[Y];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&J(e,t),2&t&&Object.freeze(e),e}}function Vn(t,e,r){return new ln(t,e,r)}function Fn(t,e,r){return new ln(t,e,r)}function jn(t,e,r){Ie(t,0|t[Y],e,r,at(0|t[Y]))}function Cn(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Vt(64,t));if($t(t)){if("string"===e)return qt(t);if("number"===e)return Ht(t)}}(e),null!=e){if("string"==typeof e)Br(e);if(null!=e)switch(zr(t,r,0),typeof e){case"number":t=t.g,At(e),Cr(t,_t,St);break;case"bigint":r=jr(e,Fr,Tr),Cr(t.g,r.i,r.g);break;default:r=Br(e),Cr(t.g,r.i,r.g)}}}function Gn(t,e,r){null!=(e=zt(e))&&null!=e&&(zr(t,r,0),Mr(t.g,e))}function Mn(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(zr(t,r,0),t.g.g.push(e?1:0))}function Rn(t,e,r){null!=(e=Qt(e))&&qr(t,r,l(e))}function Dn(t,e,r,n,i){null!=(e=En(e,n))&&(r=Wr(t,r),i(e,t),Hr(t,r))}function $n(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof N?e:void 0)&&qr(t,r,Ze(e,!0).buffer)}function zn(t,e,r){e=function(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Ct(t)?t>>>0:void 0}(e),null!=e&&null!=e&&(zr(t,r,0),Gr(t.g,e))}var Wn=Vn(function(t,e,r){return 5===t.i&&(jn(e,r,nr(t.g)),!0)},function(t,e,r){null!=(e=Mt(e))&&(zr(t,r,5),t=t.g,It(e),Rr(t))},nn),Hn=Fn(function(t,e,r){return(5===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?br(t,nr,e):e.push(nr(t.g)),!0)},function(t,e,r){if(null!=(e=kn(Mt,e))&&e.length){zr(t,r,2),Gr(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,It(e[n]),Rr(r)}},nn),qn=Vn(function(t,e,r){return 0!==t.i?t=!1:(jn(e,r,tr(t.g,Ut)),t=!0),t},Cn,en),Kn=Vn(function(t,e,r){return 0!==t.i?e=!1:(jn(e,r,(t=tr(t.g,Ut))===Ln?void 0:t),e=!0),e},Cn,en),Yn=Vn(function(t,e,r){return 0!==t.i?t=!1:(jn(e,r,tr(t.g,Bt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ft(64,t));if($t(t)){if("string"===e)return e=Gt(Number(t)),jt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(Pt(t),t=xt(_t,St))),t;if("number"===e)return(t=Gt(t))>=0&&jt(t)||(At(t),t=Tt(_t,St)),t}}(e),null!=e){if("string"==typeof e)Er(e);if(null!=e)switch(zr(t,r,0),typeof e){case"number":t=t.g,At(e),Cr(t,_t,St);break;case"bigint":r=jr(e,Ir,Sr),Cr(t.g,r.i,r.g);break;default:r=Er(e),Cr(t.g,r.i,r.g)}}},rn),Xn=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,rr(t.g)),!0)},Gn,Zr),Qn=Fn(function(t,e,r){return(0===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?br(t,rr,e):e.push(rr(t.g)),!0)},function(t,e,r){if(null!=(e=kn(zt,e))&&e.length){r=Wr(t,r);for(let r=0;r<e.length;r++)Mr(t.g,e[r]);Hr(t,r)}},Zr),Jn=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,0===(t=rr(t.g))?void 0:t),!0)},Gn,Zr),Zn=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,er(t.g)),!0)},Mn,Qr),ti=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,!1===(t=er(t.g))?void 0:t),!0)},Mn,Qr),ei=Fn(function(t,e,r){return 2===t.i&&(t=mr(t),Ve(e,0|e[Y],r).push(t),!0)},function(t,e,r){if(null!=(e=kn(Qt,e)))for(let a=0;a<e.length;a++){var n=t,i=r,o=e[a];null!=o&&qr(n,i,l(o))}},Jr),ri=Vn(function(t,e,r){return 2===t.i&&(jn(e,r,""===(t=mr(t))?void 0:t),!0)},Rn,Jr),ni=Vn(function(t,e,r){return 2===t.i&&(jn(e,r,mr(t)),!0)},Rn,Jr),ii=function(t,e,r=Xr){return new ln(t,e,r)}(function(t,e,r,n,i){return 2===t.i&&(n=ce(void 0,n),Ve(e,0|e[Y],r).push(n),vr(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let o=0;o<e.length;o++)Dn(t,e[o],r,n,i);1&(t=0|e[Y])||J(e,1|t)}}),oi=cn(function(t,e,r,n,i,o){if(2!==t.i)return!1;var a=0|e[Y];return Ce(e,a,o,r,at(a)),vr(t,e=Me(e,n,r),i),!0},Dn),ai=Vn(function(t,e,r){return 2===t.i&&(jn(e,r,yr(t)),!0)},$n,on),si=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,0===(t=rr(t.g)>>>0)?void 0:t),!0)},zn,tn),ui=Vn(function(t,e,r){return 0===t.i&&(jn(e,r,rr(t.g)),!0)},function(t,e,r){null!=(e=zt(e))&&(e=parseInt(e,10),zr(t,r,0),Mr(t.g,e))},an);class li{constructor(t,e){var r=Ti;this.g=t,this.i=e,this.m=He,this.defaultValue=void 0,this.j=null!=r.P?ot:void 0}register(){p(this)}}function ci(t,e){return(r,n)=>{t:{let o={D:!0};n&&Object.assign(o,n),r=hr(r,void 0,void 0,o);try{let n=new t,o=n.l;Tn(e)(o,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{fr(r)}i=void 0}return i}}var hi,fi=[0,ri,Vn(function(t,e,r){return 2===t.i&&(jn(e,r,(t=yr(t))===B()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof un){let n=e.U;return void(n?(e=n(e),null!=e&&qr(t,r,Ze(e,!0).buffer)):V(z,3))}if(Array.isArray(e))return void V(z,3)}$n(t,e,r)},on)],di=globalThis.trustedTypes;var gi=class{constructor(t){this.g=t}toString(){return this.g+""}};function pi(t){var e;return void 0===hi&&(hi=function(){var t=null;if(!di)return t;try{let e=t=>t;t=di.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=hi)?e.createScriptURL(t):t,new gi(t)}function vi(t,...e){if(0===e.length)return pi(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return pi(r)}var mi=[0,Xn,ui,Zn,-1,Qn,ui,-1,Zn,-1],yi=[0,ui,-1,Zn],bi=class extends un{constructor(t){super(t)}},wi=[0,Zn,ni,Zn,ui,-1,Fn(function(t,e,r){return(0===t.i||2===t.i)&&(e=Ve(e,0|e[Y],r),2==t.i?br(t,ir,e):e.push(rr(t.g)),!0)},function(t,e,r){if(null!=(e=kn(zt,e))&&e.length){r=Wr(t,r);for(let r=0;r<e.length;r++)Mr(t.g,e[r]);Hr(t,r)}},an),ni,-1,[0,Zn,-1],ui,Zn,-1,yi],_i=[0,3,Zn,-1,2,[0,[2],Xn,oi,[0,Vn(function(t,e,r){return 0===t.i&&(jn(e,r,rr(t.g)>>>0),!0)},zn,tn)]],[0,ui,Zn,ui,Zn,ui,Zn,ni,-1],[0,[3,4],ni,-1,oi,[0,Xn],oi,[0,ui]],[0]],Si=[0,ni,-2],Ei=class extends un{constructor(t){super(t)}},Ai=[0],Ii=[0,Xn,Zn,1,Zn,-4],Ti=class extends un{constructor(t){super(t,2)}},Bi={};Bi[336783863]=[0,ni,Zn,-1,Xn,[0,[1,2,3,4,5,6,7,8,9],oi,Ai,oi,wi,oi,Si,oi,Ii,oi,mi,oi,[0,ni,-2],oi,[0,ni,ui],oi,_i,oi,yi],[0,ni],Zn,[0,[1,3],[2,4],oi,[0,Qn],-1,oi,[0,ei],-1,ii,[0,ni,-1]],ni];var Ui=[0,Kn,-1,ti,-3,Kn,Qn,ri,Jn,Kn,-1,ti,Jn,ti,-2,ri];function xi(t){Qe(t,3,"TEXT:text_in")}var Ni=class extends un{constructor(t){super(t,500)}o(t){return He(this,0,7,t)}},Oi=[-1,{}],Pi=[0,ni,1,Oi],Li=[0,ni,ei,Oi];function ki(t){Qe(t,10,"text_in")}var Vi,Fi=class extends un{constructor(t){super(t,500)}o(t){return He(this,0,1001,t)}};Fi.prototype.i=(Vi=[-500,ii,[-500,ri,-1,ei,-3,[-2,Bi,Zn],ii,fi,Jn,-1,Pi,Li,ii,[0,ri,ti],ri,Ui,Jn,ei,987,ei],4,ii,[-500,ni,-1,[-1,{}],998,ni],ii,[-500,ni,ei,-1,[-2,{},Zn],997,ei,-1],Jn,ii,[-500,ni,ei,Oi,998,ei],ei,Jn,Pi,Li,ii,[0,ri,-1,Oi],ei,-2,Ui,ri,-1,ti,[0,ti,si],978,Oi,ii,fi],function(){var t=new Kr;Pn(this.l,t,_n(vn,xn,Nn,Vi)),$r(t,t.g.end());var e=new Uint8Array(t.i),r=t.j,n=r.length,i=0;for(let t=0;t<n;t++){let n=r[t];e.set(n,i),i+=n.length}return t.j=[e],e});var ji=class extends un{constructor(t){super(t)}},Ci=class extends un{constructor(t){super(t)}i(){return ze(this,ji)}},Gi=class extends un{constructor(t){super(t)}},Mi=ci(class extends un{constructor(t){super(t)}},[0,ii,[0,1,Xn,ni,[0,ii,[0,Xn,Wn,ni,-1]]],qn]),Ri=class extends un{constructor(t){super(t)}},Di=class extends un{constructor(t){super(t)}i(){var t=Se(this,1,void 0,Pe);return null==t?B():t}},$i=class extends un{constructor(t){super(t)}},zi=[1,2],Wi=ci(class extends un{constructor(t){super(t)}},[0,ii,[0,zi,oi,[0,Hn],oi,[0,ai],Xn,ni],qn]),Hi=class extends un{constructor(t){super(t)}},qi=class extends un{constructor(t){super(t)}},Ki=[0,Zn,-1],Yi=class extends un{constructor(t){super(t)}i(){Te(this,bi,2,Xi)}},Xi=[1,2,3,4,5,6],Qi=class extends un{constructor(t){super(t)}i(){return null!=Se(this,1,void 0,Pe)}j(){return null!=Qt(Se(this,2))}},Ji=class extends un{constructor(t){super(t)}},Zi=[0,ai,ni,[0,Xn,qn,-1],[0,Yn,qn]],to=[0,Zi,Zn,[0,Xi,oi,Ii,oi,wi,oi,mi,oi,Ai,oi,Si,oi,_i],ui],eo=class extends un{constructor(t){super(t)}},ro=new li(462704549,eo);Bi[462704549]=[0,to,[0,ni,Xn,Wn,ei,-1]];var no=class extends un{constructor(t){super(t)}},io=new li(477589892,no);function oo(t,e){if(e=e?ge(e):new Hi,void 0!==t.displayNamesLocale?Ae(e,1,Xt(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ae(e,1),void 0!==t.maxResults){var r=t.maxResults;if(null!=r){if("number"!=typeof r)throw k();if(!Ct(r))throw k();r|=0}Ae(e,2,r)}else"maxResults"in t&&Ae(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}`);Ae(e,3,r)}else"scoreThreshold"in t&&Ae(e,3);return void 0!==t.categoryAllowlist?Le(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ae(e,4),void 0!==t.categoryDenylist?Le(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ae(e,5),e}function ao(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function so(t){var e={classifications:ze(t,Gi).map(t=>function(t,e=-1,r=""){return{categories:t.map(t=>({index:zt(Se(t,1))??0??-1,score:Se(t,2,void 0,Mt)??0??0,categoryName:Qt(Se(t,3))??""??"",displayName:Qt(Se(t,4))??""??""})),headIndex:e,headName:r}}(De(t,Ci,4)?.i()??[],zt(Se(t,2))??0,Qt(Se(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(dt(t)?t=Number(t):(t=Vt(64,t),t=dt(t)?Number(t):String(t)),t):$t(t)?"number"==typeof t?Ht(t):qt(t):void 0}(Se(t,2,void 0,Kt))&&(e.timestampMs=ao(Se(t,2,void 0,Kt)??_e)),e}function uo(t){return Array.from(t,t=>t>127?t-256:t)}function lo(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)}Bi[477589892]=[0,to,Ki,1,Zi];var co,ho=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function fo(t){if(t)return!0;if(void 0===co)try{await WebAssembly.instantiate(ho),co=!0}catch{co=!1}return co}async function go(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await fo(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var po=class{};po.forVisionTasks=function(t,e=!1){return go("vision",t??vi``,e)},po.forTextTasks=function(t,e=!1){return go("text",t??vi``,e)},po.forGenAiTasks=function(t,e=!1){return go("genai",t??vi``,e)},po.forAudioTasks=function(t,e=!1){return go("audio",t??vi``,e)},po.isSimdSupported=function(t=!1){return fo(t)};var vo=class{close(){}};function mo(){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 yo(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 bo(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function wo(t,e,r){t.m||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.h.stringToNewUTF8(e[r]);e=t.h._malloc(4*n.length),t.h.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.h._free(e);t.h._free(e)}function _o(t,e,r){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=r}function So(t,e,r){var n=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Eo=function(t){return class extends t{N(){this.h._registerModelResourcesGraphService()}}}(class{constructor(t,e){this.j=!0,this.h=t,this.g=null,this.i=0,this.m="function"==typeof this.h._addIntToInputStream,void 0!==e?this.h.canvas=e:mo()?this.h.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas"))}async initializeGraph(t){var 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.h._malloc(r);this.h.HEAPU8.set(t,n),e?this.h._changeBinaryGraph(r,n):this.h._changeTextGraph(r,n),this.h._free(n)}configureAudio(t,e,r,n,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),bo(this,n||"input_audio",n=>{bo(this,i=i||"audio_header",i=>{this.h._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.j=t}setAutoRenderToScreen(t){this.h._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.h.gpuOriginForWebTexturesIsBottomLeft=t}attachErrorListener(t){this.h.errorListener=t}attachEmptyPacketListener(t,e){this.h.emptyPacketListeners=this.h.emptyPacketListeners||{},this.h.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var o=4*t.length;this.i!==o&&(this.g&&this.h._free(this.g),this.g=this.h._malloc(o),this.i=o),this.h.HEAPF32.set(t,this.g/4),bo(this,n,t=>{this.h._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){bo(this,e,e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();var n=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!n)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);var[i,o]=void 0!==t.videoWidth?[t.videoWidth,t.videoHeight]:void 0!==t.naturalWidth?[t.naturalWidth,t.naturalHeight]:void 0!==t.displayWidth?[t.displayWidth,t.displayHeight]:[t.width,t.height];!this.j||i===this.h.canvas.width&&o===this.h.canvas.height||(this.h.canvas.width=i,this.h.canvas.height=o);var[a,s]=[i,o];this.h._addBoundTextureToStream(e,a,s,r)})}addBoolToStream(t,e,r){bo(this,e,e=>{this.h._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){bo(this,e,e=>{this.h._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){bo(this,e,e=>{this.h._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){bo(this,e,e=>{this.h._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){bo(this,e,e=>{this.h._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){bo(this,e,e=>{bo(this,t,t=>{this.h._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){bo(this,e,e=>{wo(this,Object.keys(t),n=>{wo(this,Object.values(t),i=>{this.h._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){bo(this,r,r=>{bo(this,e,e=>{var i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,r,n),this.h._free(i)})})}addEmptyPacketToStream(t,e){bo(this,t,t=>{this.h._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(n,e);this.h._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){bo(this,e,e=>{var n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)bo(this,e,t=>{this.h._addStringVectorEntry(n,t)});this.h._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){bo(this,e,e=>{this.h._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){bo(this,e,e=>{this.h._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){bo(this,e,e=>{this.h._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){bo(this,e,e=>{this.h._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){bo(this,e,e=>{this.h._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){bo(this,e,e=>{bo(this,t,t=>{this.h._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){bo(this,r,r=>{bo(this,e,e=>{var n=this.h._malloc(t.length);this.h.HEAPU8.set(t,n),this.h._addProtoToInputSidePacket(n,t.length,e,r),this.h._free(n)})})}addBoolVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.h._addUintVectorEntry(r,e);this.h._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){bo(this,e,e=>{var r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)bo(this,e,t=>{this.h._addStringVectorEntry(r,t)});this.h._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachBoolListener(t)})}attachBoolVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachBoolVectorListener(t)})}attachIntListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachIntListener(t)})}attachIntVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachIntVectorListener(t)})}attachUintListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachUintListener(t)})}attachUintVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachUintVectorListener(t)})}attachDoubleListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachDoubleVectorListener(t)})}attachFloatListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachFloatListener(t)})}attachFloatVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachFloatVectorListener(t)})}attachStringListener(t,e){_o(this,t,e),bo(this,t,t=>{this.h._attachStringListener(t)})}attachStringVectorListener(t,e){So(this,t,e),bo(this,t,t=>{this.h._attachStringVectorListener(t)})}attachProtoListener(t,e,r){_o(this,t,e),bo(this,t,t=>{this.h._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){So(this,t,e),bo(this,t,t=>{this.h._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),_o(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),bo(this,t,t=>{this.h._attachAudioListener(t,r||!1)})}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}}),Ao=class extends Eo{};async function Io(t,e,r){return t=await(async(t,e,r,n)=>{if(e&&await yo(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await yo(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}),t.H=new vo,await t.o(r),t}async function To(t,e,r){return Io(t,e,r)}function Bo(t,e){var r=De(t.baseOptions,Qi,1)||new Qi;"string"==typeof e?(Ae(r,2,Xt(e)),Ae(r,1)):e instanceof Uint8Array&&(Ae(r,1,rt(e,!1)),Ae(r,2)),He(t.baseOptions,0,1,r)}function Uo(t,e){var r=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(De(t.baseOptions,Qi,1)?.i()||De(t.baseOptions,Qi,1)?.j()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=De(t.baseOptions,Yi,3);if(!r){var n=r=new Yi;qe(n,4,new Ei)}"delegate"in e&&("GPU"===e.delegate?qe(e=r,2,n=new bi):qe(e=r,4,n=new Ei)),He(t.baseOptions,0,3,r)}(t,r),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=>{try{t.g.h.FS_unlink("/model.dat")}catch{}t.g.h.FS_createDataFile("/","model.dat",new Uint8Array(e),!0,!1,!1),Bo(t,"/model.dat"),t.v()});if(r.modelAssetBuffer instanceof Uint8Array)Bo(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=>{Bo(t,e),t.v()});return t.v(),Promise.resolve()}function xo(t){try{let e=t.m.length;if(1===e)throw Error(t.m[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.m.map(t=>t.message).join(", "))}finally{t.m=[]}}function No(t,e){t.H&&void 0!==e&&De(t.baseOptions,Yi,3)?.i()}function Oo(t,e){t.j=Math.max(t.j,e)}var Po=class{constructor(t){this.g=t,this.m=[],this.j=0,this.g.setAutoRenderToScreen(!1)}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.m.push(Error(e))}),this.g.N(),this.g.setGraph(t,e),xo(this)}finishProcessing(){this.g.finishProcessing(),xo(this)}close(){this.H?.close(),this.g.closeGraph()}};Po.prototype.close=Po.prototype.close;var Lo=class extends Po{constructor(t,e){super(new Ao(t,e)),this.u={languages:[]},He(t=this.i=new eo,0,1,e=new Ji)}o(t){return He(this.i,0,2,oo(t,De(this.i,Hi,2))),Uo(this,t)}get baseOptions(){return De(this.i,Ji,1)}set baseOptions(t){He(this.i,0,1,t)}K(t){this.u={languages:[]};var e=this.j+1;return No(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}v(){var t=new Fi;ki(t),Qe(t,15,"classifications_out");var e=new Ti;sn(e,ro,this.i);var r=new Ni;ke(r,Xt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),xi(r),Qe(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("classifications_out",(t,e)=>{if(({classifications:t}=so(Mi(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})),Oo(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{Oo(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};Lo.prototype.detect=Lo.prototype.K,Lo.prototype.setOptions=Lo.prototype.o,Lo.createFromModelPath=function(t,e){return To(Lo,t,{baseOptions:{modelAssetPath:e}})},Lo.createFromModelBuffer=function(t,e){return To(Lo,t,{baseOptions:{modelAssetBuffer:e}})},Lo.createFromOptions=function(t,e){return To(Lo,t,e)};var ko=class extends Po{constructor(t,e){super(new Ao(t,e)),this.u={classifications:[]},He(t=this.i=new eo,0,1,e=new Ji)}o(t){return He(this.i,0,2,oo(t,De(this.i,Hi,2))),Uo(this,t)}get baseOptions(){return De(this.i,Ji,1)}set baseOptions(t){He(this.i,0,1,t)}J(t){this.u={classifications:[]};var e=this.j+1;return No(this,e),this.g.addStringToStream(t,"text_in",e),this.finishProcessing(e),this.u}v(){var t=new Fi;ki(t),Qe(t,15,"classifications_out");var e=new Ti;sn(e,ro,this.i);var r=new Ni;ke(r,Xt("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),xi(r),Qe(r,4,"CLASSIFICATIONS:classifications_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("classifications_out",(t,e)=>{this.u=so(Mi(t)),Oo(this,e)}),this.g.attachEmptyPacketListener("classifications_out",t=>{Oo(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};function Vo(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"}}ko.prototype.classify=ko.prototype.J,ko.prototype.setOptions=ko.prototype.o,ko.createFromModelPath=function(t,e){return To(ko,t,{baseOptions:{modelAssetPath:e}})},ko.createFromModelBuffer=function(t,e){return To(ko,t,{baseOptions:{modelAssetBuffer:e}})},ko.createFromOptions=function(t,e){return To(ko,t,e)};var Fo=class extends Po{constructor(t,e){super(new Ao(t,e)),this.u={embeddings:[]},He(t=this.i=new no,0,1,e=new Ji)}o(t){var e=this.i,r=De(this.i,qi,2);return r=r?ge(r):new qi,void 0!==t.l2Normalize?Ae(r,1,Rt(t.l2Normalize)):"l2Normalize"in t&&Ae(r,1),void 0!==t.quantize?Ae(r,2,Rt(t.quantize)):"quantize"in t&&Ae(r,2),He(e,0,2,r),Uo(this,t)}get baseOptions(){return De(this.i,Ji,1)}set baseOptions(t){He(this.i,0,1,t)}L(t,e){var r=this.j+1;if(No(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: ${Vo(r)} | query: ${t}`;break t;case"QUESTION_ANSWERING":case"FACT_CHECKING":case"CODE_RETRIEVAL":t=e?`task: ${Vo(r)} | query: ${t}`:`title: ${n} | text: ${t}`;break t;default:t=`task: ${Vo(r)} | query: ${t}`}}return this.g.addStringToStream(t,"text_in",r),this.finishProcessing(r),this.u}v(){var t=new Fi;ki(t),Qe(t,15,"embeddings_out");var e=new Ti;sn(e,io,this.i);var r=new Ni;ke(r,Xt("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),xi(r),Qe(r,4,"EMBEDDINGS:embeddings_out"),r.o(e),Ye(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=Wi(t),this.u=function(t){return{embeddings:ze(t,$i).map(t=>{var e={headIndex:zt(Se(t,3))??0??-1,headName:Qt(Se(t,4))??""??""};if(Te(t,Ri,1,zi))t=Be(t=Xe(t,Ri,1),1,Mt,void 0===nt?2:4),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Xe(t,Di,2)?.i()?.i()??r}return e}),timestampMs:ao(Se(t,2,void 0,Kt)??_e)}}(t),Oo(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{Oo(this,t)}),t=t.i(),this.setGraph(new Uint8Array(t),!0)}};Fo.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=lo(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=lo(uo(t.quantizedEmbedding),uo(e.quantizedEmbedding))}return t},Fo.prototype.embed=Fo.prototype.L,Fo.prototype.setOptions=Fo.prototype.o,Fo.createFromModelPath=function(t,e){return To(Fo,t,{baseOptions:{modelAssetPath:e}})},Fo.createFromModelBuffer=function(t,e){return To(Fo,t,{baseOptions:{modelAssetBuffer:e}})},Fo.createFromOptions=function(t,e){return To(Fo,t,e)};export{po as FilesetResolver,Lo as LanguageDetector,Po as TaskRunner,ko as TextClassifier,Fo as TextEmbedder};
2
2
  //# sourceMappingURL=text_bundle_mjs.js.map