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