@mediapipe/tasks-text 0.10.10-rc.20240121 → 0.10.10-rc.20240123

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mediapipe/tasks-text",
3
- "version": "0.10.10-rc.20240121",
3
+ "version": "0.10.10-rc.20240123",
4
4
  "description": "MediaPipe Text Tasks",
5
5
  "main": "text_bundle.cjs",
6
6
  "browser": "text_bundle.mjs",
package/text_bundle.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,o=0;o<r.length;o++)if(null==(i=i[r[o]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const o=t.charCodeAt(++i);if(56320<=o&&57343>=o){e=1024*(e-55296)+o-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var l,h=e(610401301,!1),f=e(572417392,!0);const d=t.navigator;function g(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function p(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function y(){return!!h&&(!!l&&0<l.brands.length)}function m(){return y()?g("Chromium"):(p("Chrome")||p("CriOS"))&&!(!y()&&p("Edge"))||p("Silk")}l=d&&d.userAgentData||null;var v=!y()&&(p("Trident")||p("MSIE"));!p("Android")||m(),m(),p("Safari")&&(m()||!y()&&p("Coast")||!y()&&p("Opera")||!y()&&p("Edge")||(y()?g("Microsoft Edge"):p("Edg/"))||y()&&g("Opera"));var b={},w=null;function A(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=w[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}_();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function _(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));b[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===w[o]&&(w[o]=i)}}}}var S="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),_(),e=b[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,x={"-":"+",_:"/",".":"="};function P(t){return x[t]||""}function O(t){if(!E)return A(t);I.test(t)&&(t=t.replace(I,P)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function L(t){return S&&null!=t&&t instanceof Uint8Array}let B;function F(){return B||=new Uint8Array(0)}var j={};let k;function U(t){if(t!==j)throw Error("illegal external caller")}function N(){return k||=new C(null,j)}function V(t){U(j);var e=t.I;return null==(e=null==e||L(e)?e:"string"==typeof e?O(e):null)?e:t.I=e}var C=class{constructor(t,e){if(U(e),this.I=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}P(){const t=V(this);return t?new Uint8Array(t):F()}};function M(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function G(){return Error("Failed to read varint, encoding is invalid.")}function D(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function z(t){return 0==t.length?N():new C(t,j)}function $(t){if("string"==typeof t)return{buffer:O(t),C:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),C:!1};if(t.constructor===Uint8Array)return{buffer:t,C:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),C:!1};if(t.constructor===C)return{buffer:V(t)||F(),C:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),C:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function W(){return"function"==typeof BigInt}var R=!f;let H=!f;const q="function"==typeof Uint8Array.prototype.slice;let J,K=0,Y=0;function X(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=it(n,t);t=r,n=e}K=n>>>0,Y=t>>>0}function Q(t){const e=J||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Y=0,K=e.getUint32(0,!0)}function Z(t,e){return 4294967296*e+(t>>>0)}function tt(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Z(t,e),n?-t:t}function et(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else W()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+nt(n)+nt(t));return n}function nt(t){return t=String(t),"0000000".slice(t.length)+t}function rt(t){if(16>t.length)X(Number(t));else if(W())t=BigInt(t),K=Number(t&BigInt(4294967295))>>>0,Y=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);Y=K=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));Y*=1e6,K=1e6*K+e,4294967296<=K&&(Y+=Math.trunc(K/4294967296),Y>>>=0,K>>>=0)}if(e){const[t,e]=it(K,Y);K=t,Y=e}}}function it(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function ot(t,e){let n,r=0,i=0,o=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(32>o&&128&n);for(32<o&&(i|=(127&n)>>4),o=3;32>o&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(ht(t,a),128>n)return e(r>>>0,i>>>0);throw G()}function st(t){let e=0,n=t.g;const r=n+10,i=t.i;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return ht(t,n),!!(127&e)}throw G()}function at(t){const e=t.i;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw G();return ht(t,n),i}function ut(t){var e=t.i;const n=t.g;var r=e[n],i=e[n+1];const o=e[n+2];return e=e[n+3],ht(t,t.g+4),t=2*((i=(r<<0|i<<8|o<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,255==r?i?NaN:1/0*t:0==r?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))}function ct(t){return at(t)}function lt(t,e,{J:n=!1}={}){t.J=n,e&&(e=$(e),t.i=e.buffer,t.m=e.C,t.v=0,t.j=t.i.length,t.g=t.v)}function ht(t,e){if(t.g=e,e>t.j)throw D(t.j,e)}function ft(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw D(e,t.j-n);return t.g=r,n}function dt(t,e){if(0==e)return N();var n=ft(t,e);return t.J&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?F():q?t.slice(n,e):new Uint8Array(t.subarray(n,e))),z(n)}var gt=[];function pt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=at(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw M(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function yt(t){switch(t.i){case 0:0!=t.i?yt(t):st(t.g);break;case 1:ht(t=t.g,t.g+8);break;case 2:if(2!=t.i)yt(t);else{var e=at(t.g)>>>0;ht(t=t.g,t.g+e)}break;case 5:ht(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!pt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}yt(t)}break;default:throw M(t.i,t.j)}}function mt(t,e,n){const r=t.g.j,i=at(t.g)>>>0,o=t.g.g+i;let s=o-r;if(0>=s&&(t.g.j=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.j=r}function vt(t){var e=at(t.g)>>>0,a=ft(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(i=t[l++],194>h||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):240>h?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&160>i||237===h&&160<=i||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):244>=h?l>=e-2?n():(i=t[l++],128!=(192&i)||0!=i-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function bt(t){const e=at(t.g)>>>0;return dt(t.g,e)}function wt(t,e,n){var r=at(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var At=[];function _t(t){return t?/^\d+$/.test(t)?(rt(t),new St(K,Y)):null:Et||=new St(0,0)}var St=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let Et;function Tt(t){return t?/^-?\d+$/.test(t)?(rt(t),new It(K,Y)):null:xt||=new It(0,0)}var It=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let xt;function Pt(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Ot(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Lt(t,e){if(0<=e)Ot(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Bt(t){var e=K;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Ft(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function jt(t,e,n){Ot(t.g,8*e+n)}function kt(t,e){return jt(t,e,2),e=t.g.end(),Ft(t,e),e.push(t.i),e}function Ut(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function Nt(t,e,n){jt(t,e,2),Ot(t.g,n.length),Ft(t,t.g.end()),Ft(t,n)}var Vt;class Ct{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.N=r}}function Mt(t){return Array.prototype.slice.call(t)}var Gt=(Vt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0)?(t,e)=>{t[Vt]|=e}:(t,e)=>{void 0!==t.s?t.s|=e:Object.defineProperties(t,{s:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Dt(t){const e=Wt(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Mt(t)),Ht(t,1|e))}var zt=Vt?(t,e)=>{t[Vt]&=~e}:(t,e)=>{void 0!==t.s&&(t.s&=~e)};function $t(t,e,n){return n?t|e:t&~e}var Wt=Vt?t=>0|t[Vt]:t=>0|t.s,Rt=Vt?t=>t[Vt]:t=>t.s,Ht=Vt?(t,e)=>{t[Vt]=e}:(t,e)=>{void 0!==t.s?t.s=e:Object.defineProperties(t,{s:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function qt(){var t=[];return Gt(t,1),t}function Jt(t,e){Ht(e,-14591&(0|t))}function Kt(t,e){Ht(e,-14557&(34|t))}function Yt(t){return 0===(t=t>>14&1023)?536870912:t}function Xt(t){return+!!(512&t)-1}var Qt={},Zt={};function te(t){return!(!t||"object"!=typeof t||t.V!==Zt)}function ee(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let ne=!f;function re(t,e,n){if(null!=t)if("string"==typeof t)t=t?new C(t,j):N();else if(t.constructor!==C)if(L(t))t=n?z(t):t.length?new C(new Uint8Array(t),j):N();else{if(!e)throw Error();t=void 0}return t}function ie(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=Wt(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Ht(t,1|r),!0)}var oe;const se=[];function ae(t){if(2&t)throw Error()}let ue,ce,le;function he(t,e){(e=ue?e[ue]:void 0)&&(t[ue]=Mt(e))}Ht(se,55),oe=Object.freeze(se);function fe(){const t=Error("int32");return t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity="warning",t}function de(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function ge(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}Object.freeze(new class{}),Object.freeze(new class{});const pe=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ye(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&pe.test(t)}function me(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function ve(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function be(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(X(t),t=tt(K,Y)),t}function we(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))))if(rt(t),t=K,2147483648&(e=Y))if(W())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=it(t,e);t="-"+et(n,r)}else t=et(t,e);return t}function Ae(t){if("string"!=typeof t)throw Error();return t}function _e(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function Se(t){return null==t||"string"==typeof t?t:void 0}function Ee(t,e,n){if(null!=t&&"object"==typeof t&&t.G===Qt)return t;if(Array.isArray(t)){var r=Wt(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&Ht(t,i),new e(t)}}let Te,Ie,xe;function Pe(t){switch(typeof t){case"boolean":return Ie||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?xe||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Oe(t,e,n){if(null==t&&(t=Te),Te=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error();if(64&(r=Wt(t)))return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{const i=(n=t).length;if(i){const t=i-1;if(ee(n[t])){if(1024<=(e=t-Xt(r|=256)))throw Error();r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,i-Xt(r))))throw Error();r=-16760833&r|(1023&e)<<14}}}return Ht(t,r),t}function Le(t,e,n,r,i,o){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&Wt(t)?void 0:o&&2&Wt(t)?t:Be(t,e,n,void 0!==r,i,o);else if(ee(t)){const s={};for(let a in t)s[a]=Le(t[a],e,n,r,i,o);t=s}else t=e(t,r);return t}}function Be(t,e,n,r,i,o){const s=r||n?Wt(t):0;r=r?!!(32&s):void 0;const a=Mt(t);for(let t=0;t<a.length;t++)a[t]=Le(a[t],e,n,r,i,o);return n&&(he(a,t),n(s,a)),a}function Fe(t){return t.G===Qt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t){if(Array.isArray(t))return ne||!ie(t,void 0,9999)?t:void 0;if(L(t))return T(t);if(t instanceof C){const e=t.I;return null==e?"":"string"==typeof e?e:t.I=T(e)}}}return t}(t)}function je(t,e,n=Kt){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=Wt(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?(Ht(t,-12293&(34|r)),t):Be(t,je,4&r?Kt:n,!0,!1,!0))}return t.G===Qt&&(n=t.l,t=2&(r=Rt(n))?t:Ue(t,n,r,!0)),t}}function ke(t){const e=t.l;return Ue(t,e,Rt(e),!1)}function Ue(t,e,n,r){return t=t.constructor,Te=e=Ne(e,n,r),e=new t(e),Te=void 0,e}function Ne(t,e,n){const r=n||2&e?Kt:Jt,i=!!(32&e);return t=function(t,e,n){const r=Mt(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return he(r,t),r}(t,e,(t=>je(t,i,r))),Gt(t,32|(n?2:0)),t}function Ve(t){const e=t.l,n=Rt(e);return 2&n?Ue(t,e,n,!1):t}function Ce(t,e){return Me(t=t.l,Rt(t),e)}function Me(t,e,n,r){if(-1===n)return null;if(n>=Yt(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+Xt(e))<i)return t[e]}}function Ge(t,e,n,r){const i=t.l;let o=Rt(i);return ae(o),De(i,o,e,n,r),t}function De(t,e,n,r,i){const o=Yt(e);if(n>=o||i){let s=e;if(256&e)i=t[t.length-1];else{if(null==r)return s;i=t[o+Xt(e)]={},s|=256}return i[n]=r,n<o&&(t[n+Xt(e)]=void 0),s!==e&&Ht(t,s),s}return t[n+Xt(e)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function ze(t,e,n,r,i){var o=2&e;let s=Me(t,e,n,i);Array.isArray(s)||(s=oe);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=Wt(s);return 0!==c||!u||o||a?1&c||(c|=1,Ht(s,c)):(c|=33,Ht(s,c)),o?(t=!1,2&c||(Gt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(o=!!(2&c)||!!(2048&c),r&&o?(s=Mt(s),r=1,u&&!a&&(r|=32),Ht(s,r),De(t,e,n,s,i)):a&&32&c&&!o&&zt(s,32)),s}function $e(t){t=t.l;let e=Rt(t);const n=Me(t,e,1),r=re(n,!0,!!(34&e));return null!=r&&r!==n&&De(t,e,1,r),r}function We(t,e){return t=Me(t,e,1),Array.isArray(t)?t:oe}function Re(t,e,n){return 0===t&&(t=an(t,e,n)),$t(t,1,!0)}function He(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function qe(t,e,n){{const s=t.l;let a=Rt(s);if(ae(a),null==n)De(s,a,e);else{var r,i=t=Wt(n),o=!!(2&t)||Object.isFrozen(n);if((r=!o)&&(r=!1),!(4&t))for(t=21,o&&(n=Mt(n),i=0,t=an(t,a,!0)),o=0;o<n.length;o++)n[o]=Ae(n[o]);r&&(n=Mt(n),i=0,t=an(t,a,!0)),t!==i&&Ht(n,t),De(s,a,e,n)}}}function Je(t,e){t=t.l;let n=Rt(t);ae(n),De(t,n,2,""===e?void 0:e)}function Ke(t,e,n,r){const i=Rt(t);ae(i),t=ze(t,i,e,2),r=n(r,!!(4&(e=Wt(t)))&&!!(4096&e)),t.push(r)}function Ye(t){return t}function Xe(t,e){return Qe(t=t.l,Rt(t),ai)===e?e:-1}function Qe(t,e,n){let r=0;for(let i=0;i<n.length;i++){const o=n[i];null!=Me(t,e,o)&&(0!==r&&(e=De(t,e,r)),r=o)}return r}function Ze(t,e,n,r){let i=Rt(t);ae(i);const o=Me(t,i,n,r);let s;if(null!=o&&o.G===Qt)return(e=Ve(o))!==o&&De(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=Wt(o);s=2&t?Ne(o,t,!1):o,s=Oe(s,e[0],e[1])}else s=Oe(void 0,e[0],e[1]);return s!==o&&De(t,i,n,s,r),s}function tn(t,e,n,r){t=t.l;let i=Rt(t);const o=Me(t,i,n,r);return(e=Ee(o,e,i))!==o&&null!=e&&De(t,i,n,e,r),e}function en(t,e,n){if(null==(e=tn(t,e,n,!1)))return e;t=t.l;let r=Rt(t);if(!(2&r)){const i=Ve(e);i!==e&&De(t,r,n,e=i,!1)}return e}function nn(t,e,n,r,i){var o=!!(2&e),s=o?1:2;const a=1===s;s=2===s,r=!!r,i&&=!o,o=We(t,e);var u=Wt(o);const c=!!(4&u);if(!c){var l,h=o,f=e;(l=!!(2&(u=Re(u,e,r))))&&(f=$t(f,2,!0));let t=!l,i=!0,s=0,a=0;for(;s<h.length;s++){const e=Ee(h[s],n,f);if(e instanceof n){if(!l){const n=!!(2&Wt(e.l));t&&=!n,i&&=n}h[a++]=e}}a<s&&(h.length=a),u=$t(u,4,!0),u=$t(u,16,i),u=$t(u,8,t),Ht(h,u),l&&Object.freeze(h)}if(n=!!(8&u)||a&&!o.length,i&&!n){for(He(u)&&(o=Mt(o),u=an(u,e,r),e=De(t,e,1,o)),i=o,n=u,h=0;h<i.length;h++)(u=i[h])!==(f=Ve(u))&&(i[h]=f);n=$t(n,8,!0),n=$t(n,16,!i.length),Ht(i,n),u=n}return He(u)||(i=u,a?u=$t(u,!o.length||16&u&&(!c||32&u)?2:2048,!0):r||(u=$t(u,32,!1)),u!==i&&Ht(o,u),a&&Object.freeze(o)),s&&He(u)&&(o=Mt(o),u=an(u,e,r),Ht(o,u),De(t,e,1,o)),o}function rn(t,e){t=t.l;const n=Rt(t);return nn(t,n,e,!1,!(2&n))}function on(t,e,n,r,i){return null==r&&(r=void 0),Ge(t,n,r,i)}function sn(t,e,n){var r=pi;null==n&&(n=void 0),t=t.l;let i=Rt(t);ae(i),(r=Qe(t,i,r))&&r!==e&&null!=n&&(i=De(t,i,r)),De(t,i,e,n)}function an(t,e,n){return t=$t(t,2,!!(2&e)),t=$t(t,32,!!(32&e)&&n),$t(t,2048,!1)}function un(t,e){var n=zr;t=t.l;const r=Rt(t);ae(r),t=nn(t,r,n,!0),e=null!=e?e:new n,t.push(e),2&Wt(e.l)?zt(t,8):zt(t,16)}function cn(t){return null==(t=Ce(t,2))?t:ye(t)?"number"==typeof t?be(t):we(t):void 0}function ln(t){return t??0}function hn(t,e,n){Ke(t.l,e,Ae,n)}function fn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var dn=class{constructor(t,e){this.l=Oe(t,e)}toJSON(){return gn(this,Be(this.l,Fe,void 0,void 0,!1,!1),!0)}C(){return!!(2&Wt(this.l))}};function gn(t,e,n){const r=t.constructor.B;var i=Rt(n?t.l:e),o=Yt(i),s=!1;if(r&&ne){if(!n){var a;if((e=Mt(e)).length&&ee(a=e[e.length-1]))for(s=0;s<r.length;s++)if(r[s]>=o){Object.assign(e[e.length-1]={},a);break}s=!0}var u;o=e,n=!n,t=Yt(a=Rt(t.l)),a=Xt(a);for(let e=0;e<r.length;e++){var c=r[e];if(c<t){var l=o[c+=a];null==l?o[c]=n?oe:qt():n&&l!==oe&&Dt(l)}else{if(!u){var h=void 0;o.length&&ee(h=o[o.length-1])?u=h:o.push(u={})}l=u[c],null==u[c]?u[c]=n?oe:qt():n&&l!==oe&&Dt(l)}}}if(!(u=e.length))return e;let f,d;if(ee(h=e[u-1])){t:{var g=h;for(var p in o={},n=!1,g)t=g[p],Array.isArray(t)&&(a=t,(!H&&ie(t,r,+p)||!R&&te(t)&&0===t.size)&&(t=null),t!=a&&(n=!0)),null!=t?o[p]=t:n=!0;if(n){for(let t in o){g=o;break t}g=null}}g!=h&&(f=!0),u--}for(i=Xt(i);0<u&&(null==(h=e[p=u-1])||!H&&ie(h,r,p-i)||!R&&te(h)&&0===h.size);u--)d=!0;return f||d?(e=s?e:Array.prototype.slice.call(e,0,u),s&&(e.length=u),g&&e.push(g),e):e}function pn(t){return Array.isArray(t)?t[0]instanceof Ct?t:[pr,t]:[t,void 0]}function yn(t,e){if(Array.isArray(e)){var n=Wt(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Ht(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}dn.prototype.G=Qt,dn.prototype.toString=function(){return gn(this,this.l,!1).toString()};const mn=Symbol();function vn(t){let e=t[mn];if(!e){const n=On(t),r=$n(t),i=r.g;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;pt(e)&&4!=e.i;){var i=e.m,o=r[i];if(!o){var s=r.D;s&&(s=s[i])&&(o=r[i]=bn(s))}o&&o(e,t,i)||(i=(o=e).j,yt(o),o.L?o=void 0:(s=o.g.g-i,o.g.g=i,o=dt(o.g,s)),i=t,o&&(ue||=Symbol(),(s=i[ue])?s.push(o):i[ue]=[o]))}n===wn||n===An||n.M||(t[le||=Symbol()]=n)},t[mn]=e}return e}function bn(t){const e=(t=pn(t))[0].g;if(t=t[1]){const n=vn(t),r=$n(t).A;return(t,i,o)=>e(t,i,o,r,n)}return e}let wn,An;function _n(){}function Sn(t,e){Tn(this,t),Tn(this,e)}function En(t,e,n,r){t in n&&!(t in r)&&(xn(r,t,Pn((n=pn(n[t]))[0],n[1])),r[t]?Ln(t,r,e):r[t]=null)}function Tn(t,e){const n=t.D,r=t.A[1]?0:-1,i=e.length;for(let s=0;s<i;s++){var o=e[s];if(o&&"object"==typeof o)if(s===i-1&&ee(o))for(const e in o){const r=+e;if(Number.isNaN(r))continue;const i=o[e];i&&"object"==typeof i&&En(r,i,n,t)}else En(s-r,o,n,t)}}const In=Symbol();function xn(t,e,n){const r=n[1];let i;if(r){const n=r[In];i=n?n.A:Pe(r[0]),t[e]=n??r}i&&i===Ie?(t=t.F||(t.F=[]),Array.isArray(t)?t.push(e):t.add(e)):n[0]&&(t=t.H||(t.H=[]),Array.isArray(t)?t.push(e):t.add(e))}function Pn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function On(t){var e=t[In];if(e)return e;if((e=jn(t,t[In]={},Pn,Pn,xn)).D)e.K=Sn;else if(e.K=_n,!e.H&&!e.F){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=Pe(t[0])===Ie,e=t[In]=e?An||={K:_n,A:Pe(!0)}:wn||={K:_n}):e.M=!0}return e}function Ln(t,e,n){var r;if((r=e[t])?Array.isArray(r)&&(e[t]=r=On(r)):r=void 0,r){var i=e.H;if((i=(i?Array.isArray(i)?e.H=new Set(i):i:ce||=new Set).has(t))||(i=((i=e.F)?Array.isArray(i)?e.F=new Set(i):i:ce||=new Set).has(t)),i){if(Array.isArray(n))for(t=0;t<n.length;t++){if((e=n[t])instanceof dn)e=e.l;else if(!Array.isArray(e))throw Error();Bn(e,r)}}else{if(n instanceof dn)n=n.l;else if(!Array.isArray(n))throw Error();Bn(n,r)}}}function Bn(t,e){if(e!==wn&&e!==An){e.M||(t[le||=Symbol()]=e);var n=t.length,r=e.A[1]?0:-1;for(let o=0;o<t.length;o++){var i=t[o];if(i&&"object"==typeof i)if(o===n-1&&ee(i))for(const t in i){const n=+t;if(Number.isNaN(n))continue;const r=i[t];r&&"object"==typeof r&&Ln(n,e,r)}else Ln(o-r,e,i)}}}function Fn(t,e,n){t[e]=n}function jn(t,e,n,r,i=Fn){e.A=Pe(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.D=s,"function"==typeof(s=t[++o])&&(e.g=s,e.i=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&0<s[0];){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof Ct?h=s:(h=yr,o--),h.N){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&0>s&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const kn=Symbol();function Un(t){let e=t[kn];if(!e){const n=Mn(t);e=(t,e)=>Rn(t,e,n),t[kn]=e}return e}const Nn=Symbol();function Vn(t){return t.i}function Cn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=Mn(e).A,n||=Un(e))}function Mn(t){let e=t[Nn];return e||(e=jn(t,t[Nn]={},Vn,Cn),Gn in t&&Nn in t&&(t.length=0),e)}const Gn=Symbol();function Dn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function zn(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=$n(e).A,i||=vn(e),n)}function $n(t){let e=t[Gn];return e||(On(t),e=jn(t,t[Gn]={},Dn,zn),Gn in t&&Nn in t&&(t.length=0),e)}function Wn(t,e){var n=t[e];if(n)return n;if((n=t.D)&&(n=n[e])){var r=(n=pn(n))[0].i;if(n=n[1]){const e=Un(n),i=Mn(n).A;n=(n=t.i)?n(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function Rn(t,e,n){for(var r=Rt(t),i=Xt(r),o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=Wn(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=Wn(n,i))&&a(e,o,i)}if(t=ue?t[ue]:void 0)for(Ft(e,e.g.end()),n=0;n<t.length;n++)Ft(e,V(t[n])||F())}function Hn(t,e){return new Ct(t,e,!1,!1)}function qn(t,e){return new Ct(t,e,!0,!1)}function Jn(t,e,n){De(t,Rt(t),e,n)}function Kn(t,e,n){t:if(null!=e){if(ye(e)){if("string"==typeof e){e=we(e);break t}if("number"==typeof e){e=be(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Tt(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,X(e),Pt(t,K,Y)):(n=Tt(e),Pt(t.g,n.i,n.g))))}function Yn(t,e,n){null!=(e=me(e))&&null!=e&&(jt(t,n,0),Lt(t.g,e))}function Xn(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(jt(t,n,0),t.g.g.push(e?1:0))}function Qn(t,e,n){null!=(e=Se(e))&&Nt(t,n,c(e))}function Zn(t,e,n,r,i){null!=(e=e instanceof dn?e.l:Array.isArray(e)?Oe(e,r[0],r[1]):void 0)&&(n=kt(t,n),i(e,t),Ut(t,n))}function tr(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof C?e:void 0)&&Nt(t,n,$(e).buffer)}var er,nr=Hn((function(t,e,n){return 5===t.i&&(Jn(e,n,ut(t.g)),!0)}),(function(t,e,n){null!=(e=de(e))&&(jt(t,n,5),t=t.g,Q(e),Bt(t))})),rr=qn((function(t,e,n){return(5===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?wt(t,ut,e):e.push(ut(t.g)),!0)}),(function(t,e,n){if(null!=(e=yn(de,e))&&e.length){jt(t,n,2),Ot(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,Q(e[r]),Bt(n)}})),ir=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,ot(t.g,tt)),!0)}),Kn),or=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,0===(t=ot(t.g,tt))?void 0:t),!0)}),Kn),sr=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,ot(t.g,Z)),!0)}),(function(t,e,n){t:if(null!=e){if(ye(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),ve(e)||(rt(e),e=et(K,Y)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){X(t);const e=et(K,Y);return t=Number(e),Number.isSafeInteger(t)?t:e}return ve(String(t))?t:(X(t),Z(K,Y))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&_t(e),null!=e&&(jt(t,n,0),"number"==typeof e?(t=t.g,X(e),Pt(t,K,Y)):(n=_t(e),Pt(t.g,n.i,n.g))))})),ar=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,at(t.g)),!0)}),Yn),ur=qn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?wt(t,at,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=yn(me,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Lt(t.g,e[n]);Ut(t,n)}})),cr=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,0===(t=at(t.g))?void 0:t),!0)}),Yn),lr=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,st(t.g)),!0)}),Xn),hr=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,!1===(t=st(t.g))?void 0:t),!0)}),Xn),fr=qn((function(t,e,n){return 2===t.i&&(Ke(e,n,Ye,t=vt(t)),!0)}),(function(t,e,n){if(null!=(e=yn(Se,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&Nt(r,i,c(o))}})),dr=Hn((function(t,e,n){return 2===t.i&&(Jn(e,n,""===(t=vt(t))?void 0:t),!0)}),Qn),gr=Hn((function(t,e,n){return 2===t.i&&(Jn(e,n,vt(t)),!0)}),Qn),pr=new Ct((function(t,e,n,r,i){return 2===t.i&&(mt(t,Ze(e,r,n,!0),i),!0)}),Zn,!1,!0),yr=new Ct((function(t,e,n,r,i){return 2===t.i&&(mt(t,Ze(e,r,n),i),!0)}),Zn,!1,!0);er=new Ct((function(t,e,n,r,i){if(2!==t.i)return!1;r=Oe(void 0,r[0],r[1]);let o=Rt(e);ae(o);let s=ze(e,o,n,3);return o=Rt(e),4&Wt(s)&&(s=Mt(s),Ht(s,-2079&(1|Wt(s))),De(e,o,n,s)),s.push(r),mt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)Zn(t,e[o],n,r,i)}),!0,!0);var mr=new Ct((function(t,e,n,r,i,o){if(2!==t.i)return!1;let s=Rt(e);return ae(s),(o=Qe(e,s,o))&&n!==o&&De(e,s,o),mt(t,e=Ze(e,r,n),i),!0}),Zn,!1,!0),vr=Hn((function(t,e,n){return 2===t.i&&(Jn(e,n,bt(t)),!0)}),tr),br=Hn((function(t,e,n){return 0===t.i&&(Jn(e,n,at(t.g)),!0)}),(function(t,e,n){null!=(e=me(e))&&(e=parseInt(e,10),jt(t,n,0),Lt(t.g,e))})),wr=qn((function(t,e,n){return(0===t.i||2===t.i)&&(e=ze(e,Rt(e),n,2,!1),2==t.i?wt(t,ct,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=yn(me,e))&&e.length){n=kt(t,n);for(let n=0;n<e.length;n++)Lt(t.g,e[n]);Ut(t,n)}}));class Ar{constructor(t,e){this.i=t,this.g=e,this.j=on,this.defaultValue=void 0}}function _r(t,e){return(n,r)=>{t:{if(At.length){const t=At.pop();t.o(r),lt(t.g,n,r),n=t}else n=new class{constructor(t,e){if(gt.length){const n=gt.pop();lt(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.v=0,lt(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.v=0,this.J=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({L:t=!1}={}){this.L=t}}(n,r);try{const r=new t,o=r.l;vn(e)(o,n);var i=r;break t}finally{n.g.clear(),n.m=-1,n.i=-1,100>At.length&&At.push(n)}i=void 0}return i}}var Sr=[0,dr,Hn((function(t,e,n){return 2===t.i&&(Jn(e,n,(t=bt(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof dn){const r=e.W;return void(r&&(e=r(e),null!=e&&Nt(t,n,$(e).buffer)))}if(Array.isArray(e))return}tr(t,e,n)}))],Er=[0,gr],Tr=[0,ar,br,lr,-1,ur,br,-1],Ir=[0,lr,-1],xr=class extends dn{constructor(){super()}};xr.B=[6];var Pr=[0,lr,gr,lr,br,-1,wr,gr,-1,Ir,br],Or=[0,gr,-2],Lr=class extends dn{constructor(){super()}},Br=[0],Fr=[0,ar,lr,-2],jr=class extends dn{constructor(t){super(t,2)}},kr={},Ur=[-2,kr,lr];kr[336783863]=[0,gr,lr,-1,ar,[0,[1,2,3,4,5],mr,Br,mr,Pr,mr,Or,mr,Fr,mr,Tr],Er];var Nr=[0,dr,hr],Vr=[0,or,-1,hr,-3,or,ur,dr,cr,or,-1,hr,cr,hr,-2,dr],Cr=[-1,{}],Mr=[0,gr,1,Cr],Gr=[0,gr,fr,Cr];function Dr(t){hn(t,3,"TEXT:text_in")}var zr=class extends dn{constructor(t){super(t,500)}o(t){return on(this,0,7,t)}};zr.B=[3,4,5,6,8,13,17,1005];var $r=[-500,dr,-1,fr,-3,Ur,er,Sr,cr,-1,Mr,Gr,er,Nr,dr,Vr,cr,fr,987,fr],Wr=[0,dr,-1,Cr],Rr=[-500,gr,-1,[-1,{}],998,gr],Hr=[-500,gr,fr,-1,[-2,{},lr],997,fr,-1],qr=[-500,gr,fr,Cr,998,fr];function Jr(t){hn(t,10,"text_in")}var Kr,Yr=class extends dn{constructor(){super(void 0,500)}o(t){return on(this,0,1001,t)}};Yr.B=[1,6,7,9,10,15,16,17,14,1002],Yr.prototype.g=(Kr=[-500,er,$r,4,er,Rr,er,Hr,cr,er,qr,fr,cr,Mr,Gr,er,Wr,fr,-2,Vr,dr,-1,hr,979,Cr,er,Sr],function(){const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Rn(this.l,t,Mn(Kr)),Ft(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var Xr=class extends dn{constructor(t){super(t)}},Qr=[0,ar,nr,gr,-1],Zr=class extends dn{constructor(t){super(t)}g(){return rn(this,Xr)}};Zr.B=[1];var ti=class extends dn{constructor(t){super(t)}},ei=[0,1,ar,gr,[0,er,Qr]],ni=class extends dn{constructor(t){super(t)}};ni.B=[1];var ri=_r(ni,[0,er,ei,ir]),ii=class extends dn{constructor(t){super(t)}};ii.B=[1];var oi=class extends dn{constructor(t){super(t)}O(){const t=$e(this);return null==t?N():t}},si=class extends dn{constructor(t){super(t)}},ai=[1,2],ui=[0,ai,mr,[0,rr],mr,[0,vr],ar,gr],ci=class extends dn{constructor(t){super(t)}};ci.B=[1];var li=_r(ci,[0,er,ui,ir]),hi=class extends dn{constructor(t){super(t)}};hi.B=[4,5];var fi=class extends dn{constructor(t){super(t)}},di=[0,lr,-1],gi=class extends dn{constructor(t){super(t)}},pi=[1,2,3,4,5],yi=class extends dn{constructor(t){super(t)}g(){return null!=$e(this)}i(){return null!=Se(Ce(this,2))}},mi=class extends dn{constructor(t){super(t)}},vi=[0,[0,vr,gr,[0,ar,ir,-1],[0,sr,ir]],lr,[0,pi,mr,Fr,mr,Pr,mr,Tr,mr,Br,mr,Or],br],bi=class extends dn{constructor(t){super(t)}},wi=new Ar(462704549,bi);kr[462704549]=[0,vi,[0,gr,ar,nr,fr,-1]];var Ai=class extends dn{constructor(t){super(t)}},_i=new Ar(477589892,Ai);function Si(t,e){if(e=e?ke(e):new hi,void 0!==t.displayNamesLocale?Ge(e,1,_e(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Ge(e,1),void 0!==t.maxResults){var n=t.maxResults;if(null!=n){if("number"!=typeof n)throw fe();if(!Number.isFinite(n))throw fe();n|=0}Ge(e,2,n)}else"maxResults"in t&&Ge(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Ge(e,3,n)}else"scoreThreshold"in t&&Ge(e,3);return void 0!==t.categoryAllowlist?qe(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Ge(e,4),void 0!==t.categoryDenylist?qe(e,5,t.categoryDenylist):"categoryDenylist"in t&&Ge(e,5),e}function Ei(t){const e={classifications:rn(t,ti).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=me(Ce(t,1))??0??-1;const n=t.l;let r=Rt(n);const i=Me(n,r,2),o=de(i);return null!=o&&o!==i&&De(n,r,2,o),{index:e,score:o??0??0,categoryName:Se(Ce(t,3))??""??"",displayName:Se(Ce(t,4))??""??""}})),headIndex:e,headName:n}}(en(t,Zr,4)?.g()??[],me(Ce(t,2))??0,Se(Ce(t,3))??"")))};return null!=cn(t)&&(e.timestampMs=ln(cn(t))),e}function Ti(t){return Array.from(t,(t=>127<t?t-256:t))}function Ii(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let o=0;o<t.length;o++)n+=t[o]*e[o],r+=t[o]*t[o],i+=e[o]*e[o];if(0>=r||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let xi;kr[477589892]=[0,vi,di];const Pi=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 Oi(){if(void 0===xi)try{await WebAssembly.instantiate(Pi),xi=!0}catch{xi=!1}return xi}async function Li(t,e=""){const n=await Oi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Bi=class{};async function Fi(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}Bi.forVisionTasks=function(t){return Li("vision",t)},Bi.forTextTasks=function(t){return Li("text",t)},Bi.forAudioTasks=function(t){return Li("audio",t)},Bi.isSimdSupported=function(){return Oi()};function ji(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function ki(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function Ui(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Ni(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}const Vi=function(t){return class extends t{U(){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:((t="undefined"==typeof OffscreenCanvas)||(t=(t=navigator.userAgent).includes("Safari")&&!t.includes("Chrome")),t?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas")):this.h.canvas=new OffscreenCanvas(1,1))}async initializeGraph(t){const 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){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),ji(this,r||"input_audio",(r=>{ji(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}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,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const 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),ji(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){ji(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[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);const[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){ji(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){ji(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){ji(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){ji(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){ji(this,e,(e=>{ji(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){ji(this,e,(e=>{ki(this,Object.keys(t),(r=>{ki(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){ji(this,n,(n=>{ji(this,e,(e=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,n,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,e){ji(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){ji(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)ji(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){ji(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){ji(this,e,(e=>{ji(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){ji(this,n,(n=>{ji(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){ji(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)ji(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){Ui(this,t,e),ji(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Ni(this,t,e),ji(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){Ui(this,t,e),ji(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Ni(this,t,e),ji(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachDoubleListener(t,e){Ui(this,t,e),ji(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Ni(this,t,e),ji(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){Ui(this,t,e),ji(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Ni(this,t,e),ji(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){Ui(this,t,e),ji(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Ni(this,t,e),ji(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){Ui(this,t,e),ji(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Ni(this,t,e),ji(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ui(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),ji(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Ci=class extends Vi{};async function Mi(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await Fi(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await Fi(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.o(n),t}async function Gi(t,e,n){return Mi(t,e,n)}function Di(t,e){const n=en(t.baseOptions,yi,1)||new yi;"string"==typeof e?(Ge(n,2,_e(e)),Ge(n,1)):e instanceof Uint8Array&&(Ge(n,1,re(e,!1,!1)),Ge(n,2)),on(t.baseOptions,0,1,n)}function zi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(en(t.baseOptions,yi,1)?.g()||en(t.baseOptions,yi,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(t,e){let n=en(t.baseOptions,gi,3);if(!n){var r=n=new gi;sn(r,4,new Lr)}"delegate"in e&&("GPU"===e.delegate?sn(e=n,2,r=new xr):sn(e=n,4,r=new Lr)),on(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath?fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.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),Di(t,"/model.dat"),t.v()})):(Di(t,n.modelAssetBuffer),t.v(),Promise.resolve())}function $i(t){try{const e=t.m.length;if(1===e)throw Error(t.m[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.m.map((t=>t.message)).join(", "))}finally{t.m=[]}}function Wi(t,e){t.j=Math.max(t.j,e)}var Ri=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.U(),this.g.setGraph(t,e),$i(this)}finishProcessing(){this.g.finishProcessing(),$i(this)}close(){this.g.closeGraph()}};Ri.prototype.close=Ri.prototype.close;var Hi=class extends Ri{constructor(t,e){super(new Ci(t,e)),this.u={languages:[]},on(t=this.i=new bi,0,1,e=new mi)}o(t){return on(this.i,0,2,Si(t,en(this.i,hi,2))),zi(this,t)}get baseOptions(){return en(this.i,mi,1)}set baseOptions(t){on(this.i,0,1,t)}S(t){return this.u={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new Yr;Jr(t),hn(t,15,"classifications_out");const e=new jr;fn(e,wi,this.i);const n=new zr;Je(n,_e("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Dr(n),hn(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),un(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{if(({classifications:t}=Ei(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}))),Wi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Hi.prototype.detect=Hi.prototype.S,Hi.prototype.setOptions=Hi.prototype.o,Hi.createFromModelPath=function(t,e){return Gi(Hi,t,{baseOptions:{modelAssetPath:e}})},Hi.createFromModelBuffer=function(t,e){return Gi(Hi,t,{baseOptions:{modelAssetBuffer:e}})},Hi.createFromOptions=function(t,e){return Gi(Hi,t,e)};var qi=class extends Ri{constructor(t,e){super(new Ci(t,e)),this.u={classifications:[]},on(t=this.i=new bi,0,1,e=new mi)}o(t){return on(this.i,0,2,Si(t,en(this.i,hi,2))),zi(this,t)}get baseOptions(){return en(this.i,mi,1)}set baseOptions(t){on(this.i,0,1,t)}R(t){return this.u={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new Yr;Jr(t),hn(t,15,"classifications_out");const e=new jr;fn(e,wi,this.i);const n=new zr;Je(n,_e("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Dr(n),hn(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),un(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{this.u=Ei(ri(t)),Wi(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};qi.prototype.classify=qi.prototype.R,qi.prototype.setOptions=qi.prototype.o,qi.createFromModelPath=function(t,e){return Gi(qi,t,{baseOptions:{modelAssetPath:e}})},qi.createFromModelBuffer=function(t,e){return Gi(qi,t,{baseOptions:{modelAssetBuffer:e}})},qi.createFromOptions=function(t,e){return Gi(qi,t,e)};var Ji=class extends Ri{constructor(t,e){super(new Ci(t,e)),this.u={embeddings:[]},on(t=this.i=new Ai,0,1,e=new mi)}o(t){var e=this.i,n=en(this.i,fi,2);return n=n?ke(n):new fi,void 0!==t.l2Normalize?Ge(n,1,ge(t.l2Normalize)):"l2Normalize"in t&&Ge(n,1),void 0!==t.quantize?Ge(n,2,ge(t.quantize)):"quantize"in t&&Ge(n,2),on(e,0,2,n),zi(this,t)}get baseOptions(){return en(this.i,mi,1)}set baseOptions(t){on(this.i,0,1,t)}T(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.u}v(){var t=new Yr;Jr(t),hn(t,15,"embeddings_out");const e=new jr;fn(e,_i,this.i);const n=new zr;Je(n,_e("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Dr(n),hn(n,4,"EMBEDDINGS:embeddings_out"),n.o(e),un(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=li(t),this.u=function(t){return{embeddings:rn(t,si).map((t=>{const e={headIndex:me(Ce(t,3))??0??-1,headName:Se(Ce(t,4))??""??""};if(void 0!==tn(t,ii,Xe(t,1))){var n=void 0;t=en(t,ii,Xe(t,1)).l;let s=Rt(t);const a=2&s?1:2;n=!!n;let u=We(t,s);var r=Wt(u);if(!(4&r)){(4&r||Object.isFrozen(u))&&(u=Mt(u),r=an(r,s,n),s=De(t,s,1,u));for(var i=0,o=0;i<u.length;i++){const t=de(u[i]);null!=t&&(u[o++]=t)}o<i&&(u.length=o),r=$t(r=Re(r,s,n),20,!0),r=$t(r,4096,!1),r=$t(r,8192,!1),Ht(u,r),2&r&&Object.freeze(u)}He(r)||(i=r,(o=1===a)?r=$t(r,2,!0):n||(r=$t(r,32,!1)),r!==i&&Ht(u,r),o&&Object.freeze(u)),2===a&&He(r)&&(u=Mt(u),r=an(r,s,n),Ht(u,r),De(t,s,1,u)),e.floatEmbedding=u}else n=new Uint8Array(0),e.quantizedEmbedding=en(t,oi,Xe(t,2))?.O()?.P()??n;return e})),timestampMs:ln(cn(t))}}(t),Wi(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{Wi(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ji.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ii(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ii(Ti(t.quantizedEmbedding),Ti(e.quantizedEmbedding))}return t},Ji.prototype.embed=Ji.prototype.T,Ji.prototype.setOptions=Ji.prototype.o,Ji.createFromModelPath=function(t,e){return Gi(Ji,t,{baseOptions:{modelAssetPath:e}})},Ji.createFromModelBuffer=function(t,e){return Gi(Ji,t,{baseOptions:{modelAssetBuffer:e}})},Ji.createFromOptions=function(t,e){return Gi(Ji,t,e)},exports.FilesetResolver=Bi,exports.LanguageDetector=Hi,exports.TaskRunner=Ri,exports.TextClassifier=qi,exports.TextEmbedder=Ji;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t="undefined"!=typeof self?self:{};function e(e,n){t:{for(var r=["CLOSURE_FLAGS"],i=t,o=0;o<r.length;o++)if(null==(i=i[r[o]])){r=null;break t}r=i}return null!=(e=r&&r[e])?e:n}function n(){throw Error("Invalid UTF8")}function r(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}let i,o;const s="undefined"!=typeof TextDecoder;let a;const u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(a||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)r[n++]=e;else{if(2048>e)r[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const o=t.charCodeAt(++i);if(56320<=o&&57343>=o){e=1024*(e-55296)+o-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}var l,h=e(610401301,!1),f=e(572417392,!0);const d=t.navigator;function g(t){return!!h&&(!!l&&l.brands.some((({brand:e})=>e&&-1!=e.indexOf(t))))}function p(e){var n;return(n=t.navigator)&&(n=n.userAgent)||(n=""),-1!=n.indexOf(e)}function y(){return!!h&&(!!l&&0<l.brands.length)}function m(){return y()?g("Chromium"):(p("Chrome")||p("CriOS"))&&!(!y()&&p("Edge"))||p("Silk")}l=d&&d.userAgentData||null;var v=!y()&&(p("Trident")||p("MSIE"));!p("Android")||m(),m(),p("Safari")&&(m()||!y()&&p("Coast")||!y()&&p("Opera")||!y()&&p("Edge")||(y()?g("Microsoft Edge"):p("Edg/"))||y()&&g("Opera"));var b={},w=null;function A(t){var e=t.length,n=3*e/4;n%3?n=Math.floor(n):-1!="=.".indexOf(t[e-1])&&(n=-1!="=.".indexOf(t[e-2])?n-2:n-1);var r=new Uint8Array(n),i=0;return function(t,e){function n(e){for(;r<t.length;){var n=t.charAt(r++),i=w[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return e}_();for(var r=0;;){var i=n(-1),o=n(0),s=n(64),a=n(64);if(64===a&&-1===i)break;e(i<<2|o>>4),64!=s&&(e(o<<4&240|s>>2),64!=a&&e(s<<6&192|a))}}(t,(function(t){r[i++]=t})),i!==n?r.subarray(0,i):r}function _(){if(!w){w={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=t.concat(e[n].split(""));b[n]=r;for(var i=0;i<r.length;i++){var o=r[i];void 0===w[o]&&(w[o]=i)}}}}var S="undefined"!=typeof Uint8Array,E=!v&&"function"==typeof btoa;function T(t){if(!E){var e;void 0===e&&(e=0),_(),e=b[e];var n=Array(Math.floor(t.length/3)),r=e[64]||"";let u=0,c=0;for(;u<t.length-2;u+=3){var i=t[u],o=t[u+1],s=t[u+2],a=e[i>>2];i=e[(3&i)<<4|o>>4],o=e[(15&o)<<2|s>>6],s=e[63&s],n[c++]=a+i+o+s}switch(a=0,s=r,t.length-u){case 2:s=e[(15&(a=t[u+1]))<<2]||r;case 1:t=t[u],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+s+r}return n.join("")}for(e="",n=0,r=t.length-10240;n<r;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const I=/[-_.]/g,x={"-":"+",_:"/",".":"="};function P(t){return x[t]||""}function O(t){if(!E)return A(t);I.test(t)&&(t=t.replace(I,P)),t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function L(t){return S&&null!=t&&t instanceof Uint8Array}let j;function B(){return j||=new Uint8Array(0)}var F={};let k;function U(t){if(t!==F)throw Error("illegal external caller")}function N(){return k||=new C(null,F)}function V(t){U(F);var e=t.g;return null==(e=null==e||L(e)?e:"string"==typeof e?O(e):null)?e:t.g=e}var C=class{constructor(t,e){if(U(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}i(){const t=V(this);return t?new Uint8Array(t):B()}};function M(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function D(){return Error("Failed to read varint, encoding is invalid.")}function G(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function z(t){if("string"==typeof t)return{buffer:O(t),B:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),B:!1};if(t.constructor===Uint8Array)return{buffer:t,B:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),B:!1};if(t.constructor===C)return{buffer:V(t)||B(),B:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),B:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function $(){return"function"==typeof BigInt}var W=!f;let R=!f;const H="function"==typeof Uint8Array.prototype.slice;let q,J=0,K=0;function Y(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[e,r]=rt(n,t);t=r,n=e}J=n>>>0,K=t>>>0}function X(t){const e=q||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),K=0,J=e.getUint32(0,!0)}function Q(t,e){return 4294967296*e+(t>>>0)}function Z(t,e){const n=2147483648&e;return n&&(e=~e>>>0,0==(t=1+~t>>>0)&&(e=e+1>>>0)),t=Q(t,e),n?-t:t}function tt(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else $()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+et(n)+et(t));return n}function et(t){return t=String(t),"0000000".slice(t.length)+t}function nt(t){if(16>t.length)Y(Number(t));else if($())t=BigInt(t),J=Number(t&BigInt(4294967295))>>>0,K=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+("-"===t[0]);K=J=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const e=Number(t.slice(r,i));K*=1e6,J=1e6*J+e,4294967296<=J&&(K+=Math.trunc(J/4294967296),K>>>=0,J>>>=0)}if(e){const[t,e]=rt(J,K);J=t,K=e}}}function rt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function it(t,e){let n,r=0,i=0,o=0;const s=t.i;let a=t.g;do{n=s[a++],r|=(127&n)<<o,o+=7}while(32>o&&128&n);for(32<o&&(i|=(127&n)>>4),o=3;32>o&&128&n;o+=7)n=s[a++],i|=(127&n)<<o;if(lt(t,a),128>n)return e(r>>>0,i>>>0);throw D()}function ot(t){let e=0,n=t.g;const r=n+10,i=t.i;for(;n<r;){const r=i[n++];if(e|=r,0==(128&r))return lt(t,n),!!(127&e)}throw D()}function st(t){const e=t.i;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw D();return lt(t,n),i}function at(t){var e=t.i;const n=t.g;var r=e[n],i=e[n+1];const o=e[n+2];return e=e[n+3],lt(t,t.g+4),t=2*((i=(r<<0|i<<8|o<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,255==r?i?NaN:1/0*t:0==r?t*Math.pow(2,-149)*i:t*Math.pow(2,r-150)*(i+Math.pow(2,23))}function ut(t){return st(t)}function ct(t,e,{F:n=!1}={}){t.F=n,e&&(e=z(e),t.i=e.buffer,t.m=e.B,t.u=0,t.j=t.i.length,t.g=t.u)}function lt(t,e){if(t.g=e,e>t.j)throw G(t.j,e)}function ht(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,r=n+e;if(r>t.j)throw G(e,t.j-n);return t.g=r,n}function ft(t,e){if(0==e)return N();var n=ht(t,e);return t.F&&t.m?n=t.i.subarray(n,n+e):(t=t.i,n=n===(e=n+e)?B():H?t.slice(n,e):new Uint8Array(t.subarray(n,e))),0==n.length?N():new C(n,F)}var dt=[];function gt(t){var e=t.g;if(e.g==e.j)return!1;t.j=t.g.g;var n=st(t.g)>>>0;if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw M(n,t.j);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.j})`);return t.m=e,t.i=n,!0}function pt(t){switch(t.i){case 0:0!=t.i?pt(t):ot(t.g);break;case 1:lt(t=t.g,t.g+8);break;case 2:if(2!=t.i)pt(t);else{var e=st(t.g)>>>0;lt(t=t.g,t.g+e)}break;case 5:lt(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!gt(t))throw Error("Unmatched start-group tag: stream EOF");if(4==t.i){if(t.m!=e)throw Error("Unmatched end-group tag");break}pt(t)}break;default:throw M(t.i,t.j)}}function yt(t,e,n){const r=t.g.j,i=st(t.g)>>>0,o=t.g.g+i;let s=o-r;if(0>=s&&(t.g.j=o,n(e,t,void 0,void 0,void 0),s=o-t.g.g),s)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-s} bytes, either the data ended unexpectedly or the message misreported its own length`);t.g.g=o,t.g.j=r}function mt(t){var e=st(t.g)>>>0,a=ht(t=t.g,e);if(t=t.i,s){var u,c=t;(u=o)||(u=o=new TextDecoder("utf-8",{fatal:!0})),e=a+e,c=0===a&&e===c.length?c:c.subarray(a,e);try{var l=u.decode(c)}catch(t){if(void 0===i){try{u.decode(new Uint8Array([128]))}catch(t){}try{u.decode(new Uint8Array([97])),i=!0}catch(t){i=!1}}throw!i&&(o=void 0),t}}else{e=(l=a)+e,a=[];let i,o=null;for(;l<e;){var h=t[l++];128>h?a.push(h):224>h?l>=e?n():(i=t[l++],194>h||128!=(192&i)?(l--,n()):a.push((31&h)<<6|63&i)):240>h?l>=e-1?n():(i=t[l++],128!=(192&i)||224===h&&160>i||237===h&&160<=i||128!=(192&(u=t[l++]))?(l--,n()):a.push((15&h)<<12|(63&i)<<6|63&u)):244>=h?l>=e-2?n():(i=t[l++],128!=(192&i)||0!=i-144+(h<<28)>>30||128!=(192&(u=t[l++]))||128!=(192&(c=t[l++]))?(l--,n()):(h=(7&h)<<18|(63&i)<<12|(63&u)<<6|63&c,h-=65536,a.push(55296+(h>>10&1023),56320+(1023&h)))):n(),8192<=a.length&&(o=r(o,a),a.length=0)}l=r(o,a)}return l}function vt(t){const e=st(t.g)>>>0;return ft(t.g,e)}function bt(t,e,n){var r=st(t.g)>>>0;for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var wt=[];function At(t){return t?/^\d+$/.test(t)?(nt(t),new _t(J,K)):null:St||=new _t(0,0)}var _t=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let St;function Et(t){return t?/^-?\d+$/.test(t)?(nt(t),new Tt(J,K)):null:It||=new Tt(0,0)}var Tt=class{constructor(t,e){this.i=t>>>0,this.g=e>>>0}};let It;function xt(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Pt(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Ot(t,e){if(0<=e)Pt(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Lt(t){var e=J;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function jt(t,e){0!==e.length&&(t.j.push(e),t.i+=e.length)}function Bt(t,e,n){Pt(t.g,8*e+n)}function Ft(t,e){return Bt(t,e,2),e=t.g.end(),jt(t,e),e.push(t.i),e}function kt(t,e){var n=e.pop();for(n=t.i+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.i++;e.push(n),t.i++}function Ut(t,e,n){Bt(t,e,2),Pt(t.g,n.length),jt(t,t.g.end()),jt(t,n)}var Nt;class Vt{constructor(t,e,n,r){this.g=t,this.i=e,this.j=n,this.H=r}}function Ct(t){return Array.prototype.slice.call(t)}var Mt=(Nt="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0)?(t,e)=>{t[Nt]|=e}:(t,e)=>{void 0!==t.g?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})};function Dt(t){const e=$t(t);1!=(1&e)&&(Object.isFrozen(t)&&(t=Ct(t)),Rt(t,1|e))}var Gt=Nt?(t,e)=>{t[Nt]&=~e}:(t,e)=>{void 0!==t.g&&(t.g&=~e)};function zt(t,e,n){return n?t|e:t&~e}var $t=Nt?t=>0|t[Nt]:t=>0|t.g,Wt=Nt?t=>t[Nt]:t=>t.g,Rt=Nt?(t,e)=>(t[Nt]=e,t):(t,e)=>(void 0!==t.g?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}}),t);function Ht(){var t=[];return Mt(t,1),t}function qt(t,e){Rt(e,-14591&(0|t))}function Jt(t,e){Rt(e,-14557&(34|t))}function Kt(t){return 0===(t=t>>14&1023)?536870912:t}function Yt(t){return+!!(512&t)-1}var Xt={},Qt={};function Zt(t){return!(!t||"object"!=typeof t||t.g!==Qt)}function te(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&t.constructor===Object}let ee=!f;function ne(t,e,n){if(null!=t)if("string"==typeof t)t=t?new C(t,F):N();else if(t.constructor!==C)if(L(t))t=t.length?new C(n?t:new Uint8Array(t),F):N();else{if(!e)throw Error();t=void 0}return t}function re(t,e,n){if(!Array.isArray(t)||t.length)return!1;const r=$t(t);return!!(1&r)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(Rt(t,1|r),!0)}var ie;const oe=[];function se(t){if(2&t)throw Error()}let ae,ue,ce;function le(t,e){(e=ae?e[ae]:void 0)&&(t[ae]=Ct(e))}Rt(oe,55),ie=Object.freeze(oe);function he(){const t=Error("int32");return t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity="warning",t}function fe(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function de(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}Object.freeze(new class{}),Object.freeze(new class{});const ge=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function pe(t){const e=typeof t;return"number"===e?Number.isFinite(t):"string"===e&&ge.test(t)}function ye(t){if(null==t)return t;if("string"==typeof t){if(!t)return;t=+t}return"number"==typeof t&&Number.isFinite(t)?0|t:void 0}function me(t){return"-"!==t[0]&&(20>t.length||20===t.length&&184467>Number(t.substring(0,6)))}function ve(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(Y(t),t=Z(J,K)),t}function be(t){var e=Math.trunc(Number(t));if(Number.isSafeInteger(e))return String(e);if(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),!("-"===t[0]?20>t.length||20===t.length&&-922337<Number(t.substring(0,7)):19>t.length||19===t.length&&922337>Number(t.substring(0,6))))if(nt(t),t=J,2147483648&(e=K))if($())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=rt(t,e);t="-"+tt(n,r)}else t=tt(t,e);return t}function we(t){if("string"!=typeof t)throw Error();return t}function Ae(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function _e(t){return null==t||"string"==typeof t?t:void 0}function Se(t,e,n){if(null!=t&&"object"==typeof t&&t.D===Xt)return t;if(Array.isArray(t)){var r=$t(t),i=r;return 0===i&&(i|=32&n),(i|=2&n)!==r&&Rt(t,i),new e(t)}}let Ee,Te,Ie;function xe(t){switch(typeof t){case"boolean":return Te||=[0,void 0,!0];case"number":return 0<t?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}function Pe(t,e,n){if(null==t&&(t=Ee),Ee=void 0,null==t){var r=96;n?(t=[n],r|=512):t=[],e&&(r=-16760833&r|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error();if(64&(r=$t(t)))return t;if(r|=64,n&&(r|=512,n!==t[0]))throw Error();t:{const i=(n=t).length;if(i){const t=i-1;if(te(n[t])){if(1024<=(e=t-Yt(r|=256)))throw Error();r=-16760833&r|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,i-Yt(r))))throw Error();r=-16760833&r|(1023&e)<<14}}}return Rt(t,r),t}function Oe(t,e,n,r,i,o){if(null!=t){if(Array.isArray(t))t=i&&0==t.length&&1&$t(t)?void 0:o&&2&$t(t)?t:Le(t,e,n,void 0!==r,i,o);else if(te(t)){const s={};for(let a in t)s[a]=Oe(t[a],e,n,r,i,o);t=s}else t=e(t,r);return t}}function Le(t,e,n,r,i,o){const s=r||n?$t(t):0;r=r?!!(32&s):void 0;const a=Ct(t);for(let t=0;t<a.length;t++)a[t]=Oe(a[t],e,n,r,i,o);return n&&(le(a,t),n(s,a)),a}function je(t){return t.D===Xt?t.toJSON():function(t){switch(typeof t){case"number":return isFinite(t)?t:String(t);case"boolean":return t?1:0;case"object":if(t){if(Array.isArray(t))return ee||!re(t,void 0,9999)?t:void 0;if(L(t))return T(t);if(t instanceof C){const e=t.g;return null==e?"":"string"==typeof e?e:t.g=T(e)}}}return t}(t)}function Be(t,e,n=Jt){if(null!=t){if(S&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var r=$t(t);return 2&r?t:(e&&=0===r||!!(32&r)&&!(64&r||!(16&r)),e?Rt(t,-12293&(34|r)):Le(t,Be,4&r?Jt:n,!0,!1,!0))}return t.D===Xt&&(n=t.l,t=2&(r=Wt(n))?t:ke(t,n,r,!0)),t}}function Fe(t){const e=t.l;return ke(t,e,Wt(e),!1)}function ke(t,e,n,r){return t=t.constructor,Ee=e=Ue(e,n,r),e=new t(e),Ee=void 0,e}function Ue(t,e,n){const r=n||2&e?Jt:qt,i=!!(32&e);return t=function(t,e,n){const r=Ct(t);var i=r.length;const o=256&e?r[i-1]:void 0;for(i+=o?-1:0,e=512&e?1:0;e<i;e++)r[e]=n(r[e]);if(o){e=r[e]={};for(const t in o)e[t]=n(o[t])}return le(r,t),r}(t,e,(t=>Be(t,i,r))),Mt(t,32|(n?2:0)),t}function Ne(t){const e=t.l,n=Wt(e);return 2&n?ke(t,e,n,!1):t}function Ve(t,e){return Ce(t=t.l,Wt(t),e)}function Ce(t,e,n,r){if(-1===n)return null;if(n>=Kt(e)){if(256&e)return t[t.length-1][n]}else{var i=t.length;if(r&&256&e&&null!=(r=t[i-1][n]))return r;if((e=n+Yt(e))<i)return t[e]}}function Me(t,e,n,r){const i=t.l;let o=Wt(i);return se(o),De(i,o,e,n,r),t}function De(t,e,n,r,i){const o=Kt(e);if(n>=o||i){let s=e;if(256&e)i=t[t.length-1];else{if(null==r)return s;i=t[o+Yt(e)]={},s|=256}return i[n]=r,n<o&&(t[n+Yt(e)]=void 0),s!==e&&Rt(t,s),s}return t[n+Yt(e)]=r,256&e&&(n in(t=t[t.length-1])&&delete t[n]),e}function Ge(t,e,n,r,i){var o=2&e;let s=Ce(t,e,n,i);Array.isArray(s)||(s=ie);const a=!(2&r);r=!(1&r);const u=!!(32&e);let c=$t(s);return 0!==c||!u||o||a?1&c||(c|=1,Rt(s,c)):(c|=33,Rt(s,c)),o?(t=!1,2&c||(Mt(s,34),t=!!(4&c)),(r||t)&&Object.freeze(s)):(o=!!(2&c)||!!(2048&c),r&&o?(s=Ct(s),r=1,u&&!a&&(r|=32),Rt(s,r),De(t,e,n,s,i)):a&&32&c&&!o&&Gt(s,32)),s}function ze(t){t=t.l;let e=Wt(t);const n=Ce(t,e,1),r=ne(n,!0,!!(34&e));return null!=r&&r!==n&&De(t,e,1,r),r}function $e(t,e){return t=Ce(t,e,1),Array.isArray(t)?t:ie}function We(t,e,n){return 0===t&&(t=sn(t,e,n)),zt(t,1,!0)}function Re(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function He(t,e,n){{const s=t.l;let a=Wt(s);if(se(a),null==n)De(s,a,e);else{var r,i=t=$t(n),o=!!(2&t)||Object.isFrozen(n);if((r=!o)&&(r=!1),!(4&t))for(t=21,o&&(n=Ct(n),i=0,t=sn(t,a,!0)),o=0;o<n.length;o++)n[o]=we(n[o]);r&&(n=Ct(n),i=0,t=sn(t,a,!0)),t!==i&&Rt(n,t),De(s,a,e,n)}}}function qe(t,e){t=t.l;let n=Wt(t);se(n),De(t,n,2,""===e?void 0:e)}function Je(t,e,n,r){const i=Wt(t);se(i),t=Ge(t,i,e,2),r=n(r,!!(4&(e=$t(t)))&&!!(4096&e)),t.push(r)}function Ke(t){return t}function Ye(t,e){return Xe(t=t.l,Wt(t),si)===e?e:-1}function Xe(t,e,n){let r=0;for(let i=0;i<n.length;i++){const o=n[i];null!=Ce(t,e,o)&&(0!==r&&(e=De(t,e,r)),r=o)}return r}function Qe(t,e,n,r){let i=Wt(t);se(i);const o=Ce(t,i,n,r);let s;if(null!=o&&o.D===Xt)return(e=Ne(o))!==o&&De(t,i,n,e,r),e.l;if(Array.isArray(o)){const t=$t(o);s=2&t?Ue(o,t,!1):o,s=Pe(s,e[0],e[1])}else s=Pe(void 0,e[0],e[1]);return s!==o&&De(t,i,n,s,r),s}function Ze(t,e,n,r){t=t.l;let i=Wt(t);const o=Ce(t,i,n,r);return(e=Se(o,e,i))!==o&&null!=e&&De(t,i,n,e,r),e}function tn(t,e,n){if(null==(e=Ze(t,e,n,!1)))return e;t=t.l;let r=Wt(t);if(!(2&r)){const i=Ne(e);i!==e&&De(t,r,n,e=i,!1)}return e}function en(t,e,n,r,i){var o=!!(2&e),s=o?1:2;const a=1===s;s=2===s,r=!!r,i&&=!o,o=$e(t,e);var u=$t(o);const c=!!(4&u);if(!c){var l,h=o,f=e;(l=!!(2&(u=We(u,e,r))))&&(f=zt(f,2,!0));let t=!l,i=!0,s=0,a=0;for(;s<h.length;s++){const e=Se(h[s],n,f);if(e instanceof n){if(!l){const n=!!(2&$t(e.l));t&&=!n,i&&=n}h[a++]=e}}a<s&&(h.length=a),u=zt(u,4,!0),u=zt(u,16,i),u=zt(u,8,t),Rt(h,u),l&&Object.freeze(h)}if(n=!!(8&u)||a&&!o.length,i&&!n){for(Re(u)&&(o=Ct(o),u=sn(u,e,r),e=De(t,e,1,o)),i=o,n=u,h=0;h<i.length;h++)(u=i[h])!==(f=Ne(u))&&(i[h]=f);n=zt(n,8,!0),n=zt(n,16,!i.length),Rt(i,n),u=n}return Re(u)||(i=u,a?u=zt(u,!o.length||16&u&&(!c||32&u)?2:2048,!0):r||(u=zt(u,32,!1)),u!==i&&Rt(o,u),a&&Object.freeze(o)),s&&Re(u)&&(o=Ct(o),u=sn(u,e,r),Rt(o,u),De(t,e,1,o)),o}function nn(t,e){t=t.l;const n=Wt(t);return en(t,n,e,!1,!(2&n))}function rn(t,e,n,r,i){return null==r&&(r=void 0),Me(t,n,r,i)}function on(t,e,n){var r=gi;null==n&&(n=void 0),t=t.l;let i=Wt(t);se(i),(r=Xe(t,i,r))&&r!==e&&null!=n&&(i=De(t,i,r)),De(t,i,e,n)}function sn(t,e,n){return t=zt(t,2,!!(2&e)),t=zt(t,32,!!(32&e)&&n),zt(t,2048,!1)}function an(t,e){var n=Gr;t=t.l;const r=Wt(t);se(r),t=en(t,r,n,!0),e=null!=e?e:new n,t.push(e),2&$t(e.l)?Gt(t,8):Gt(t,16)}function un(t){return null==(t=Ve(t,2))?t:pe(t)?"number"==typeof t?ve(t):be(t):void 0}function cn(t){return t??0}function ln(t,e,n){Je(t.l,e,we,n)}function hn(t,e,n){e.g?e.j(t,e.g,e.i,n,!0):e.j(t,e.i,n,!0)}var fn=class{constructor(t,e){this.l=Pe(t,e)}toJSON(){return dn(this,Le(this.l,je,void 0,void 0,!1,!1),!0)}B(){return!!(2&$t(this.l))}};function dn(t,e,n){const r=t.constructor.A;var i=Wt(n?t.l:e),o=Kt(i),s=!1;if(r&&ee){if(!n){var a;if((e=Ct(e)).length&&te(a=e[e.length-1]))for(s=0;s<r.length;s++)if(r[s]>=o){Object.assign(e[e.length-1]={},a);break}s=!0}var u;o=e,n=!n,t=Kt(a=Wt(t.l)),a=Yt(a);for(let e=0;e<r.length;e++){var c=r[e];if(c<t){var l=o[c+=a];null==l?o[c]=n?ie:Ht():n&&l!==ie&&Dt(l)}else{if(!u){var h=void 0;o.length&&te(h=o[o.length-1])?u=h:o.push(u={})}l=u[c],null==u[c]?u[c]=n?ie:Ht():n&&l!==ie&&Dt(l)}}}if(!(u=e.length))return e;let f,d;if(te(h=e[u-1])){t:{var g=h;for(var p in o={},n=!1,g)t=g[p],Array.isArray(t)&&(a=t,(!R&&re(t,r,+p)||!W&&Zt(t)&&0===t.size)&&(t=null),t!=a&&(n=!0)),null!=t?o[p]=t:n=!0;if(n){for(let t in o){g=o;break t}g=null}}g!=h&&(f=!0),u--}for(i=Yt(i);0<u&&(null==(h=e[p=u-1])||!R&&re(h,r,p-i)||!W&&Zt(h)&&0===h.size);u--)d=!0;return f||d?(e=s?e:Array.prototype.slice.call(e,0,u),s&&(e.length=u),g&&e.push(g),e):e}function gn(t){return Array.isArray(t)?t[0]instanceof Vt?t:[gr,t]:[t,void 0]}function pn(t,e){if(Array.isArray(e)){var n=$t(e);if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const n=t(e[r]);null!=n&&(e[i++]=n)}return i<r&&(e.length=i),Rt(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}fn.prototype.D=Xt,fn.prototype.toString=function(){return dn(this,this.l,!1).toString()};const yn=Symbol();function mn(t){let e=t[yn];if(!e){const n=Pn(t),r=zn(t),i=r.u;e=i?(t,e)=>i(t,e,r):(t,e)=>{for(;gt(e)&&4!=e.i;){var i=e.m,o=r[i];if(!o){var s=r.C;s&&(s=s[i])&&(o=r[i]=vn(s))}o&&o(e,t,i)||(i=(o=e).j,pt(o),o.G?o=void 0:(s=o.g.g-i,o.g.g=i,o=ft(o.g,s)),i=t,o&&(ae||=Symbol(),(s=i[ae])?s.push(o):i[ae]=[o]))}n===bn||n===wn||n.m||(t[ce||=Symbol()]=n)},t[yn]=e}return e}function vn(t){const e=(t=gn(t))[0].g;if(t=t[1]){const n=mn(t),r=zn(t).v;return(t,i,o)=>e(t,i,o,r,n)}return e}let bn,wn;function An(){}function _n(t,e){En(this,t),En(this,e)}function Sn(t,e,n,r){t in n&&!(t in r)&&(In(r,t,xn((n=gn(n[t]))[0],n[1])),r[t]?On(t,r,e):r[t]=null)}function En(t,e){const n=t.C,r=t.v[1]?0:-1,i=e.length;for(let s=0;s<i;s++){var o=e[s];if(o&&"object"==typeof o)if(s===i-1&&te(o))for(const e in o){const r=+e;if(Number.isNaN(r))continue;const i=o[e];i&&"object"==typeof i&&Sn(r,i,n,t)}else Sn(s-r,o,n,t)}}const Tn=Symbol();function In(t,e,n){const r=n[1];let i;if(r){const n=r[Tn];i=n?n.v:xe(r[0]),t[e]=n??r}i&&i===Te?(t=t.g||(t.g=[]),Array.isArray(t)?t.push(e):t.add(e)):n[0]&&(t=t.i||(t.i=[]),Array.isArray(t)?t.push(e):t.add(e))}function xn(t,e){return[t.j,!e||0<e[0]?void 0:e]}function Pn(t){var e=t[Tn];if(e)return e;if((e=Bn(t,t[Tn]={},xn,xn,In)).C)e.j=_n;else if(e.j=An,!e.i&&!e.g){let n=!0;for(let t in e){isNaN(t)||(n=!1);break}n?(e=xe(t[0])===Te,e=t[Tn]=e?wn||={j:An,v:xe(!0)}:bn||={j:An}):e.m=!0}return e}function On(t,e,n){var r;if((r=e[t])?Array.isArray(r)&&(e[t]=r=Pn(r)):r=void 0,r){var i=e.i;if((i=(i?Array.isArray(i)?e.i=new Set(i):i:ue||=new Set).has(t))||(i=((i=e.g)?Array.isArray(i)?e.g=new Set(i):i:ue||=new Set).has(t)),i){if(Array.isArray(n))for(t=0;t<n.length;t++){if((e=n[t])instanceof fn)e=e.l;else if(!Array.isArray(e))throw Error();Ln(e,r)}}else{if(n instanceof fn)n=n.l;else if(!Array.isArray(n))throw Error();Ln(n,r)}}}function Ln(t,e){if(e!==bn&&e!==wn){e.m||(t[ce||=Symbol()]=e);var n=t.length,r=e.v[1]?0:-1;for(let o=0;o<t.length;o++){var i=t[o];if(i&&"object"==typeof i)if(o===n-1&&te(i))for(const t in i){const n=+t;if(Number.isNaN(n))continue;const r=i[t];r&&"object"==typeof r&&On(n,e,r)}else On(o-r,e,i)}}}function jn(t,e,n){t[e]=n}function Bn(t,e,n,r,i=jn){e.v=xe(t[0]);let o=0;var s=t[++o];s&&s.constructor===Object&&(e.C=s,"function"==typeof(s=t[++o])&&(e.u=s,e.s=t[++o],s=t[++o]));const a={};for(;Array.isArray(s)&&"number"==typeof s[0]&&0<s[0];){for(var u=0;u<s.length;u++)a[s[u]]=s;s=t[++o]}for(u=1;void 0!==s;){let h;"number"==typeof s&&(u+=s,s=t[++o]);var c=void 0;if(s instanceof Vt?h=s:(h=pr,o--),h.H){s=t[++o],c=t;var l=o;"function"==typeof s&&(s=s(),c[l]=s),c=s}for(l=u+1,"number"==typeof(s=t[++o])&&0>s&&(l-=s,s=t[++o]);u<l;u++){const t=a[u];i(e,u,c?r(h,c,t):n(h,t))}}return e}const Fn=Symbol();function kn(t){let e=t[Fn];if(!e){const n=Cn(t);e=(t,e)=>Wn(t,e,n),t[Fn]=e}return e}const Un=Symbol();function Nn(t){return t.i}function Vn(t,e){let n,r;const i=t.i;return(t,o,s)=>i(t,o,s,r||=Cn(e).v,n||=kn(e))}function Cn(t){let e=t[Un];return e||(e=Bn(t,t[Un]={},Nn,Vn),Mn in t&&Un in t&&(t.length=0),e)}const Mn=Symbol();function Dn(t,e){const n=t.g;return e?(t,r,i)=>n(t,r,i,e):n}function Gn(t,e,n){const r=t.g;let i,o;return(t,s,a)=>r(t,s,a,o||=zn(e).v,i||=mn(e),n)}function zn(t){let e=t[Mn];return e||(Pn(t),e=Bn(t,t[Mn]={},Dn,Gn),Mn in t&&Un in t&&(t.length=0),e)}function $n(t,e){var n=t[e];if(n)return n;if((n=t.C)&&(n=n[e])){var r=(n=gn(n))[0].i;if(n=n[1]){const e=kn(n),i=Cn(n).v;n=(n=t.s)?n(i,e):(t,n,o)=>r(t,n,o,i,e)}else n=r;return t[e]=n}}function Wn(t,e,n){for(var r=Wt(t),i=Yt(r),o=t.length,s=512&r?1:0,a=o+(256&r?-1:0);s<a;s++){const r=t[s];if(null==r)continue;const o=s-i,a=$n(n,o);a&&a(e,r,o)}if(256&r){r=t[o-1];for(let t in r)i=+t,Number.isNaN(i)||null!=(o=r[t])&&(a=$n(n,i))&&a(e,o,i)}if(t=ae?t[ae]:void 0)for(jt(e,e.g.end()),n=0;n<t.length;n++)jt(e,V(t[n])||B())}function Rn(t,e){return new Vt(t,e,!1,!1)}function Hn(t,e){return new Vt(t,e,!0,!1)}function qn(t,e,n){De(t,Wt(t),e,n)}function Jn(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){e=be(e);break t}if("number"==typeof e){e=ve(e);break t}}e=void 0}null!=e&&("string"==typeof e&&Et(e),null!=e&&(Bt(t,n,0),"number"==typeof e?(t=t.g,Y(e),xt(t,J,K)):(n=Et(e),xt(t.g,n.i,n.g))))}function Kn(t,e,n){null!=(e=ye(e))&&null!=e&&(Bt(t,n,0),Ot(t.g,e))}function Yn(t,e,n){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Bt(t,n,0),t.g.g.push(e?1:0))}function Xn(t,e,n){null!=(e=_e(e))&&Ut(t,n,c(e))}function Qn(t,e,n,r,i){null!=(e=e instanceof fn?e.l:Array.isArray(e)?Pe(e,r[0],r[1]):void 0)&&(n=Ft(t,n),i(e,t),kt(t,n))}function Zn(t,e,n){null!=(e=null==e||"string"==typeof e||L(e)||e instanceof C?e:void 0)&&Ut(t,n,z(e).buffer)}var tr,er=Rn((function(t,e,n){return 5===t.i&&(qn(e,n,at(t.g)),!0)}),(function(t,e,n){null!=(e=fe(e))&&(Bt(t,n,5),t=t.g,X(e),Lt(t))})),nr=Hn((function(t,e,n){return(5===t.i||2===t.i)&&(e=Ge(e,Wt(e),n,2,!1),2==t.i?bt(t,at,e):e.push(at(t.g)),!0)}),(function(t,e,n){if(null!=(e=pn(fe,e))&&e.length){Bt(t,n,2),Pt(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,X(e[r]),Lt(n)}})),rr=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,it(t.g,Z)),!0)}),Jn),ir=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,0===(t=it(t.g,Z))?void 0:t),!0)}),Jn),or=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,it(t.g,Q)),!0)}),(function(t,e,n){t:if(null!=e){if(pe(e)){if("string"==typeof e){var r=Math.trunc(Number(e));Number.isSafeInteger(r)&&0<=r?e=String(r):(-1!==(r=e.indexOf("."))&&(e=e.substring(0,r)),me(e)||(nt(e),e=tt(J,K)));break t}if("number"==typeof e){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(t){if(0>t){Y(t);const e=tt(J,K);return t=Number(e),Number.isSafeInteger(t)?t:e}return me(String(t))?t:(Y(t),Q(J,K))}(e);break t}}e=void 0}null!=e&&("string"==typeof e&&At(e),null!=e&&(Bt(t,n,0),"number"==typeof e?(t=t.g,Y(e),xt(t,J,K)):(n=At(e),xt(t.g,n.i,n.g))))})),sr=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,st(t.g)),!0)}),Kn),ar=Hn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ge(e,Wt(e),n,2,!1),2==t.i?bt(t,st,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=pn(ye,e))&&e.length){n=Ft(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);kt(t,n)}})),ur=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,0===(t=st(t.g))?void 0:t),!0)}),Kn),cr=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,ot(t.g)),!0)}),Yn),lr=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,!1===(t=ot(t.g))?void 0:t),!0)}),Yn),hr=Hn((function(t,e,n){return 2===t.i&&(Je(e,n,Ke,t=mt(t)),!0)}),(function(t,e,n){if(null!=(e=pn(_e,e)))for(let s=0;s<e.length;s++){var r=t,i=n,o=e[s];null!=o&&Ut(r,i,c(o))}})),fr=Rn((function(t,e,n){return 2===t.i&&(qn(e,n,""===(t=mt(t))?void 0:t),!0)}),Xn),dr=Rn((function(t,e,n){return 2===t.i&&(qn(e,n,mt(t)),!0)}),Xn),gr=new Vt((function(t,e,n,r,i){return 2===t.i&&(yt(t,Qe(e,r,n,!0),i),!0)}),Qn,!1,!0),pr=new Vt((function(t,e,n,r,i){return 2===t.i&&(yt(t,Qe(e,r,n),i),!0)}),Qn,!1,!0);tr=new Vt((function(t,e,n,r,i){if(2!==t.i)return!1;r=Pe(void 0,r[0],r[1]);let o=Wt(e);se(o);let s=Ge(e,o,n,3);return o=Wt(e),4&$t(s)&&(s=Ct(s),Rt(s,-2079&(1|$t(s))),De(e,o,n,s)),s.push(r),yt(t,r,i),!0}),(function(t,e,n,r,i){if(Array.isArray(e))for(let o=0;o<e.length;o++)Qn(t,e[o],n,r,i)}),!0,!0);var yr=new Vt((function(t,e,n,r,i,o){if(2!==t.i)return!1;let s=Wt(e);return se(s),(o=Xe(e,s,o))&&n!==o&&De(e,s,o),yt(t,e=Qe(e,r,n),i),!0}),Qn,!1,!0),mr=Rn((function(t,e,n){return 2===t.i&&(qn(e,n,vt(t)),!0)}),Zn),vr=Rn((function(t,e,n){return 0===t.i&&(qn(e,n,st(t.g)),!0)}),(function(t,e,n){null!=(e=ye(e))&&(e=parseInt(e,10),Bt(t,n,0),Ot(t.g,e))})),br=Hn((function(t,e,n){return(0===t.i||2===t.i)&&(e=Ge(e,Wt(e),n,2,!1),2==t.i?bt(t,ut,e):e.push(st(t.g)),!0)}),(function(t,e,n){if(null!=(e=pn(ye,e))&&e.length){n=Ft(t,n);for(let n=0;n<e.length;n++)Ot(t.g,e[n]);kt(t,n)}}));class wr{constructor(t,e){this.i=t,this.g=e,this.j=rn,this.defaultValue=void 0}}function Ar(t,e){return(n,r)=>{t:{if(wt.length){const t=wt.pop();t.o(r),ct(t.g,n,r),n=t}else n=new class{constructor(t,e){if(dt.length){const n=dt.pop();ct(n,t,e),t=n}else t=new class{constructor(t,e){this.i=null,this.m=!1,this.g=this.j=this.u=0,ct(this,t,e)}clear(){this.i=null,this.m=!1,this.g=this.j=this.u=0,this.F=!1}}(t,e);this.g=t,this.j=this.g.g,this.i=this.m=-1,this.o(e)}o({G:t=!1}={}){this.G=t}}(n,r);try{const r=new t,o=r.l;mn(e)(o,n);var i=r;break t}finally{n.g.clear(),n.m=-1,n.i=-1,100>wt.length&&wt.push(n)}i=void 0}return i}}var _r=[0,fr,Rn((function(t,e,n){return 2===t.i&&(qn(e,n,(t=vt(t))===N()?void 0:t),!0)}),(function(t,e,n){if(null!=e){if(e instanceof fn){const r=e.N;return void(r&&(e=r(e),null!=e&&Ut(t,n,z(e).buffer)))}if(Array.isArray(e))return}Zn(t,e,n)}))],Sr=[0,dr],Er=[0,sr,vr,cr,-1,ar,vr,-1],Tr=[0,cr,-1],Ir=class extends fn{constructor(){super()}};Ir.A=[6];var xr=[0,cr,dr,cr,vr,-1,br,dr,-1,Tr,vr],Pr=[0,dr,-2],Or=class extends fn{constructor(){super()}},Lr=[0],jr=[0,sr,cr,-2],Br=class extends fn{constructor(t){super(t,2)}},Fr={},kr=[-2,Fr,cr];Fr[336783863]=[0,dr,cr,-1,sr,[0,[1,2,3,4,5],yr,Lr,yr,xr,yr,Pr,yr,jr,yr,Er],Sr];var Ur=[0,fr,lr],Nr=[0,ir,-1,lr,-3,ir,ar,fr,ur,ir,-1,lr,ur,lr,-2,fr],Vr=[-1,{}],Cr=[0,dr,1,Vr],Mr=[0,dr,hr,Vr];function Dr(t){ln(t,3,"TEXT:text_in")}var Gr=class extends fn{constructor(t){super(t,500)}o(t){return rn(this,0,7,t)}};Gr.A=[3,4,5,6,8,13,17,1005];var zr=[-500,fr,-1,hr,-3,kr,tr,_r,ur,-1,Cr,Mr,tr,Ur,fr,Nr,ur,hr,987,hr],$r=[0,fr,-1,Vr],Wr=[-500,dr,-1,[-1,{}],998,dr],Rr=[-500,dr,hr,-1,[-2,{},cr],997,hr,-1],Hr=[-500,dr,hr,Vr,998,hr];function qr(t){ln(t,10,"text_in")}var Jr,Kr=class extends fn{constructor(){super(void 0,500)}o(t){return rn(this,0,1001,t)}};Kr.A=[1,6,7,9,10,15,16,17,14,1002],Kr.prototype.g=(Jr=[-500,tr,zr,4,tr,Wr,tr,Rr,ur,tr,Hr,hr,ur,Cr,Mr,tr,$r,hr,-2,Nr,fr,-1,lr,979,Vr,tr,_r],function(){const t=new class{constructor(){this.j=[],this.i=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const t=this.g;return this.g=[],t}}}};Wn(this.l,t,Cn(Jr)),jt(t,t.g.end());const e=new Uint8Array(t.i),n=t.j,r=n.length;let i=0;for(let t=0;t<r;t++){const r=n[t];e.set(r,i),i+=r.length}return t.j=[e],e});var Yr=class extends fn{constructor(t){super(t)}},Xr=[0,sr,er,dr,-1],Qr=class extends fn{constructor(t){super(t)}g(){return nn(this,Yr)}};Qr.A=[1];var Zr=class extends fn{constructor(t){super(t)}},ti=[0,1,sr,dr,[0,tr,Xr]],ei=class extends fn{constructor(t){super(t)}};ei.A=[1];var ni=Ar(ei,[0,tr,ti,rr]),ri=class extends fn{constructor(t){super(t)}};ri.A=[1];var ii=class extends fn{constructor(t){super(t)}I(){const t=ze(this);return null==t?N():t}},oi=class extends fn{constructor(t){super(t)}},si=[1,2],ai=[0,si,yr,[0,nr],yr,[0,mr],sr,dr],ui=class extends fn{constructor(t){super(t)}};ui.A=[1];var ci=Ar(ui,[0,tr,ai,rr]),li=class extends fn{constructor(t){super(t)}};li.A=[4,5];var hi=class extends fn{constructor(t){super(t)}},fi=[0,cr,-1],di=class extends fn{constructor(t){super(t)}},gi=[1,2,3,4,5],pi=class extends fn{constructor(t){super(t)}g(){return null!=ze(this)}i(){return null!=_e(Ve(this,2))}},yi=class extends fn{constructor(t){super(t)}},mi=[0,[0,mr,dr,[0,sr,rr,-1],[0,or,rr]],cr,[0,gi,yr,jr,yr,xr,yr,Er,yr,Lr,yr,Pr],vr],vi=class extends fn{constructor(t){super(t)}},bi=new wr(462704549,vi);Fr[462704549]=[0,mi,[0,dr,sr,er,hr,-1]];var wi=class extends fn{constructor(t){super(t)}},Ai=new wr(477589892,wi);function _i(t,e){if(e=e?Fe(e):new li,void 0!==t.displayNamesLocale?Me(e,1,Ae(t.displayNamesLocale)):void 0===t.displayNamesLocale&&Me(e,1),void 0!==t.maxResults){var n=t.maxResults;if(null!=n){if("number"!=typeof n)throw he();if(!Number.isFinite(n))throw he();n|=0}Me(e,2,n)}else"maxResults"in t&&Me(e,2);if(void 0!==t.scoreThreshold){if(null!=(n=t.scoreThreshold)&&"number"!=typeof n)throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);Me(e,3,n)}else"scoreThreshold"in t&&Me(e,3);return void 0!==t.categoryAllowlist?He(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&Me(e,4),void 0!==t.categoryDenylist?He(e,5,t.categoryDenylist):"categoryDenylist"in t&&Me(e,5),e}function Si(t){const e={classifications:nn(t,Zr).map((t=>function(t,e=-1,n=""){return{categories:t.map((t=>{var e=ye(Ve(t,1))??0??-1;const n=t.l;let r=Wt(n);const i=Ce(n,r,2),o=fe(i);return null!=o&&o!==i&&De(n,r,2,o),{index:e,score:o??0??0,categoryName:_e(Ve(t,3))??""??"",displayName:_e(Ve(t,4))??""??""}})),headIndex:e,headName:n}}(tn(t,Qr,4)?.g()??[],ye(Ve(t,2))??0,_e(Ve(t,3))??"")))};return null!=un(t)&&(e.timestampMs=cn(un(t))),e}function Ei(t){return Array.from(t,(t=>127<t?t-256:t))}function Ti(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let o=0;o<t.length;o++)n+=t[o]*e[o],r+=t[o]*t[o],i+=e[o]*e[o];if(0>=r||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Ii;Fr[477589892]=[0,mi,fi];const xi=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 Pi(){if(void 0===Ii)try{await WebAssembly.instantiate(xi),Ii=!0}catch{Ii=!1}return Ii}async function Oi(t,e=""){const n=await Pi()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Li=class{};async function ji(t){if("function"!=typeof importScripts){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((t,n)=>{e.addEventListener("load",(()=>{t()}),!1),e.addEventListener("error",(t=>{n(t)}),!1),document.body.appendChild(e)}))}importScripts(t.toString())}Li.forVisionTasks=function(t){return Oi("vision",t)},Li.forTextTasks=function(t){return Oi("text",t)},Li.forAudioTasks=function(t){return Oi("audio",t)},Li.isSimdSupported=function(){return Pi()};function Bi(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.h.stringToNewUTF8(e)),t.h._free(e)}function Fi(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let n=0;n<e.length;n++)r[n]=t.h.stringToNewUTF8(e[n]);e=t.h._malloc(4*r.length),t.h.HEAPU32.set(r,e>>2),n(e);for(const e of r)t.h._free(e);t.h._free(e)}function ki(t,e,n){t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=n}function Ui(t,e,n){let r=[];t.h.simpleListeners=t.h.simpleListeners||{},t.h.simpleListeners[e]=(t,e,i)=>{e?(n(r,i),r=[]):r.push(t)}}const Ni=function(t){return class extends t{M(){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:((t="undefined"==typeof OffscreenCanvas)||(t=(t=navigator.userAgent).includes("Safari")&&!t.includes("Chrome")),t?(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.h.canvas=document.createElement("canvas")):this.h.canvas=new OffscreenCanvas(1,1))}async initializeGraph(t){const 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){const n=t.length,r=this.h._malloc(n);this.h.HEAPU8.set(t,r),e?this.h._changeBinaryGraph(n,r):this.h._changeTextGraph(n,r),this.h._free(r)}configureAudio(t,e,n,r,i){this.h._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Bi(this,r||"input_audio",(r=>{Bi(this,i=i||"audio_header",(i=>{this.h._configureAudio(r,i,t,e,n)}))}))}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,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,i){const 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),Bi(this,r,(t=>{this.h._addAudioToInputStream(this.g,e,n,t,i)}))}addGpuBufferToStream(t,e,n){Bi(this,e,(e=>{if(!this.h.canvas)throw Error("No OpenGL canvas configured.");e?this.h._bindTextureToStream(e):this.h._bindTextureToCanvas();const r=this.h.canvas.getContext("webgl2")||this.h.canvas.getContext("webgl");if(!r)throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),this.h.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[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);const[s,a]=[i,o];this.h._addBoundTextureToStream(e,s,a,n)}))}addBoolToStream(t,e,n){Bi(this,e,(e=>{this.h._addBoolToInputStream(t,e,n)}))}addDoubleToStream(t,e,n){Bi(this,e,(e=>{this.h._addDoubleToInputStream(t,e,n)}))}addFloatToStream(t,e,n){Bi(this,e,(e=>{this.h._addFloatToInputStream(t,e,n)}))}addIntToStream(t,e,n){Bi(this,e,(e=>{this.h._addIntToInputStream(t,e,n)}))}addStringToStream(t,e,n){Bi(this,e,(e=>{Bi(this,t,(t=>{this.h._addStringToInputStream(t,e,n)}))}))}addStringRecordToStream(t,e,n){Bi(this,e,(e=>{Fi(this,Object.keys(t),(r=>{Fi(this,Object.values(t),(i=>{this.h._addFlatHashMapToInputStream(r,i,Object.keys(t).length,e,n)}))}))}))}addProtoToStream(t,e,n,r){Bi(this,n,(n=>{Bi(this,e,(e=>{const i=this.h._malloc(t.length);this.h.HEAPU8.set(t,i),this.h._addProtoToInputStream(i,t.length,e,n,r),this.h._free(i)}))}))}addEmptyPacketToStream(t,e){Bi(this,t,(t=>{this.h._addEmptyPacketToInputStream(t,e)}))}addBoolVectorToStream(t,e,n){Bi(this,e,(e=>{const r=this.h._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(r,e);this.h._addBoolVectorToInputStream(r,e,n)}))}addDoubleVectorToStream(t,e,n){Bi(this,e,(e=>{const r=this.h._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(r,e);this.h._addDoubleVectorToInputStream(r,e,n)}))}addFloatVectorToStream(t,e,n){Bi(this,e,(e=>{const r=this.h._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(r,e);this.h._addFloatVectorToInputStream(r,e,n)}))}addIntVectorToStream(t,e,n){Bi(this,e,(e=>{const r=this.h._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(r,e);this.h._addIntVectorToInputStream(r,e,n)}))}addStringVectorToStream(t,e,n){Bi(this,e,(e=>{const r=this.h._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Bi(this,e,(t=>{this.h._addStringVectorEntry(r,t)}));this.h._addStringVectorToInputStream(r,e,n)}))}addBoolToInputSidePacket(t,e){Bi(this,e,(e=>{this.h._addBoolToInputSidePacket(t,e)}))}addDoubleToInputSidePacket(t,e){Bi(this,e,(e=>{this.h._addDoubleToInputSidePacket(t,e)}))}addFloatToInputSidePacket(t,e){Bi(this,e,(e=>{this.h._addFloatToInputSidePacket(t,e)}))}addIntToInputSidePacket(t,e){Bi(this,e,(e=>{this.h._addIntToInputSidePacket(t,e)}))}addStringToInputSidePacket(t,e){Bi(this,e,(e=>{Bi(this,t,(t=>{this.h._addStringToInputSidePacket(t,e)}))}))}addProtoToInputSidePacket(t,e,n){Bi(this,n,(n=>{Bi(this,e,(e=>{const r=this.h._malloc(t.length);this.h.HEAPU8.set(t,r),this.h._addProtoToInputSidePacket(r,t.length,e,n),this.h._free(r)}))}))}addBoolVectorToInputSidePacket(t,e){Bi(this,e,(e=>{const n=this.h._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const e of t)this.h._addBoolVectorEntry(n,e);this.h._addBoolVectorToInputSidePacket(n,e)}))}addDoubleVectorToInputSidePacket(t,e){Bi(this,e,(e=>{const n=this.h._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const e of t)this.h._addDoubleVectorEntry(n,e);this.h._addDoubleVectorToInputSidePacket(n,e)}))}addFloatVectorToInputSidePacket(t,e){Bi(this,e,(e=>{const n=this.h._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const e of t)this.h._addFloatVectorEntry(n,e);this.h._addFloatVectorToInputSidePacket(n,e)}))}addIntVectorToInputSidePacket(t,e){Bi(this,e,(e=>{const n=this.h._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const e of t)this.h._addIntVectorEntry(n,e);this.h._addIntVectorToInputSidePacket(n,e)}))}addStringVectorToInputSidePacket(t,e){Bi(this,e,(e=>{const n=this.h._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const e of t)Bi(this,e,(t=>{this.h._addStringVectorEntry(n,t)}));this.h._addStringVectorToInputSidePacket(n,e)}))}attachBoolListener(t,e){ki(this,t,e),Bi(this,t,(t=>{this.h._attachBoolListener(t)}))}attachBoolVectorListener(t,e){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachBoolVectorListener(t)}))}attachIntListener(t,e){ki(this,t,e),Bi(this,t,(t=>{this.h._attachIntListener(t)}))}attachIntVectorListener(t,e){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachIntVectorListener(t)}))}attachDoubleListener(t,e){ki(this,t,e),Bi(this,t,(t=>{this.h._attachDoubleListener(t)}))}attachDoubleVectorListener(t,e){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachDoubleVectorListener(t)}))}attachFloatListener(t,e){ki(this,t,e),Bi(this,t,(t=>{this.h._attachFloatListener(t)}))}attachFloatVectorListener(t,e){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachFloatVectorListener(t)}))}attachStringListener(t,e){ki(this,t,e),Bi(this,t,(t=>{this.h._attachStringListener(t)}))}attachStringVectorListener(t,e){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachStringVectorListener(t)}))}attachProtoListener(t,e,n){ki(this,t,e),Bi(this,t,(t=>{this.h._attachProtoListener(t,n||!1)}))}attachProtoVectorListener(t,e,n){Ui(this,t,e),Bi(this,t,(t=>{this.h._attachProtoVectorListener(t,n||!1)}))}attachAudioListener(t,e,n){this.h._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),ki(this,t,((t,n)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,n)})),Bi(this,t,(t=>{this.h._attachAudioListener(t,n||!1)}))}finishProcessing(){this.h._waitUntilIdle()}closeGraph(){this.h._closeGraph(),this.h.simpleListeners=void 0,this.h.emptyPacketListeners=void 0}});var Vi=class extends Ni{};async function Ci(t,e,n){return t=await(async(t,e,n,r)=>{if(e&&await ji(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(n&&(await ji(n),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&r&&((e=self.Module).locateFile=r.locateFile,r.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=r.mainScriptUrlOrBlob)),r=await self.ModuleFactory(self.Module||r),self.ModuleFactory=self.Module=void 0,new t(r,null)})(t,e.wasmLoaderPath,e.assetLoaderPath,{locateFile:t=>t.endsWith(".wasm")?e.wasmBinaryPath.toString():e.assetBinaryPath&&t.endsWith(".data")?e.assetBinaryPath.toString():t}),await t.o(n),t}async function Mi(t,e,n){return Ci(t,e,n)}function Di(t,e){const n=tn(t.baseOptions,pi,1)||new pi;"string"==typeof e?(Me(n,2,Ae(e)),Me(n,1)):e instanceof Uint8Array&&(Me(n,1,ne(e,!1,!1)),Me(n,2)),rn(t.baseOptions,0,1,n)}function Gi(t,e){const n=e.baseOptions||{};if(e.baseOptions?.modelAssetBuffer&&e.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(tn(t.baseOptions,pi,1)?.g()||tn(t.baseOptions,pi,1)?.i()||e.baseOptions?.modelAssetBuffer||e.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");return function(t,e){let n=tn(t.baseOptions,di,3);if(!n){var r=n=new di;on(r,4,new Or)}"delegate"in e&&("GPU"===e.delegate?on(e=n,2,r=new Ir):on(e=n,4,r=new Or)),rn(t.baseOptions,0,3,n)}(t,n),n.modelAssetPath?fetch(n.modelAssetPath.toString()).then((t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${n.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),Di(t,"/model.dat"),t.u()})):(Di(t,n.modelAssetBuffer),t.u(),Promise.resolve())}function zi(t){try{const e=t.m.length;if(1===e)throw Error(t.m[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.m.map((t=>t.message)).join(", "))}finally{t.m=[]}}function $i(t,e){t.j=Math.max(t.j,e)}var Wi=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.M(),this.g.setGraph(t,e),zi(this)}finishProcessing(){this.g.finishProcessing(),zi(this)}close(){this.g.closeGraph()}};Wi.prototype.close=Wi.prototype.close;var Ri=class extends Wi{constructor(t,e){super(new Vi(t,e)),this.s={languages:[]},rn(t=this.i=new vi,0,1,e=new yi)}o(t){return rn(this.i,0,2,_i(t,tn(this.i,li,2))),Gi(this,t)}get baseOptions(){return tn(this.i,yi,1)}set baseOptions(t){rn(this.i,0,1,t)}K(t){return this.s={languages:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new Kr;qr(t),ln(t,15,"classifications_out");const e=new Br;hn(e,bi,this.i);const n=new Gr;qe(n,Ae("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Dr(n),ln(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),an(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{if(({classifications:t}=Si(ni(t))),1!==t.length)throw Error(`Expected 1 classification head, got ${t.length}`);this.s.languages=t[0].categories.map((t=>({languageCode:t.categoryName,probability:t.score}))),$i(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{$i(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Ri.prototype.detect=Ri.prototype.K,Ri.prototype.setOptions=Ri.prototype.o,Ri.createFromModelPath=function(t,e){return Mi(Ri,t,{baseOptions:{modelAssetPath:e}})},Ri.createFromModelBuffer=function(t,e){return Mi(Ri,t,{baseOptions:{modelAssetBuffer:e}})},Ri.createFromOptions=function(t,e){return Mi(Ri,t,e)};var Hi=class extends Wi{constructor(t,e){super(new Vi(t,e)),this.s={classifications:[]},rn(t=this.i=new vi,0,1,e=new yi)}o(t){return rn(this.i,0,2,_i(t,tn(this.i,li,2))),Gi(this,t)}get baseOptions(){return tn(this.i,yi,1)}set baseOptions(t){rn(this.i,0,1,t)}J(t){return this.s={classifications:[]},this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new Kr;qr(t),ln(t,15,"classifications_out");const e=new Br;hn(e,bi,this.i);const n=new Gr;qe(n,Ae("mediapipe.tasks.text.text_classifier.TextClassifierGraph")),Dr(n),ln(n,4,"CLASSIFICATIONS:classifications_out"),n.o(e),an(t,n),this.g.attachProtoListener("classifications_out",((t,e)=>{this.s=Si(ni(t)),$i(this,e)})),this.g.attachEmptyPacketListener("classifications_out",(t=>{$i(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Hi.prototype.classify=Hi.prototype.J,Hi.prototype.setOptions=Hi.prototype.o,Hi.createFromModelPath=function(t,e){return Mi(Hi,t,{baseOptions:{modelAssetPath:e}})},Hi.createFromModelBuffer=function(t,e){return Mi(Hi,t,{baseOptions:{modelAssetBuffer:e}})},Hi.createFromOptions=function(t,e){return Mi(Hi,t,e)};var qi=class extends Wi{constructor(t,e){super(new Vi(t,e)),this.s={embeddings:[]},rn(t=this.i=new wi,0,1,e=new yi)}o(t){var e=this.i,n=tn(this.i,hi,2);return n=n?Fe(n):new hi,void 0!==t.l2Normalize?Me(n,1,de(t.l2Normalize)):"l2Normalize"in t&&Me(n,1),void 0!==t.quantize?Me(n,2,de(t.quantize)):"quantize"in t&&Me(n,2),rn(e,0,2,n),Gi(this,t)}get baseOptions(){return tn(this.i,yi,1)}set baseOptions(t){rn(this.i,0,1,t)}L(t){return this.g.addStringToStream(t,"text_in",this.j+1),this.finishProcessing(),this.s}u(){var t=new Kr;qr(t),ln(t,15,"embeddings_out");const e=new Br;hn(e,Ai,this.i);const n=new Gr;qe(n,Ae("mediapipe.tasks.text.text_embedder.TextEmbedderGraph")),Dr(n),ln(n,4,"EMBEDDINGS:embeddings_out"),n.o(e),an(t,n),this.g.attachProtoListener("embeddings_out",((t,e)=>{t=ci(t),this.s=function(t){return{embeddings:nn(t,oi).map((t=>{const e={headIndex:ye(Ve(t,3))??0??-1,headName:_e(Ve(t,4))??""??""};if(void 0!==Ze(t,ri,Ye(t,1))){var n=void 0;t=tn(t,ri,Ye(t,1)).l;let s=Wt(t);const a=2&s?1:2;n=!!n;let u=$e(t,s);var r=$t(u);if(!(4&r)){(4&r||Object.isFrozen(u))&&(u=Ct(u),r=sn(r,s,n),s=De(t,s,1,u));for(var i=0,o=0;i<u.length;i++){const t=fe(u[i]);null!=t&&(u[o++]=t)}o<i&&(u.length=o),r=zt(r=We(r,s,n),20,!0),r=zt(r,4096,!1),r=zt(r,8192,!1),Rt(u,r),2&r&&Object.freeze(u)}Re(r)||(i=r,(o=1===a)?r=zt(r,2,!0):n||(r=zt(r,32,!1)),r!==i&&Rt(u,r),o&&Object.freeze(u)),2===a&&Re(r)&&(u=Ct(u),r=sn(r,s,n),Rt(u,r),De(t,s,1,u)),e.floatEmbedding=u}else n=new Uint8Array(0),e.quantizedEmbedding=tn(t,ii,Ye(t,2))?.I()?.i()??n;return e})),timestampMs:cn(un(t))}}(t),$i(this,e)})),this.g.attachEmptyPacketListener("embeddings_out",(t=>{$i(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};qi.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ti(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ti(Ei(t.quantizedEmbedding),Ei(e.quantizedEmbedding))}return t},qi.prototype.embed=qi.prototype.L,qi.prototype.setOptions=qi.prototype.o,qi.createFromModelPath=function(t,e){return Mi(qi,t,{baseOptions:{modelAssetPath:e}})},qi.createFromModelBuffer=function(t,e){return Mi(qi,t,{baseOptions:{modelAssetBuffer:e}})},qi.createFromOptions=function(t,e){return Mi(qi,t,e)},exports.FilesetResolver=Li,exports.LanguageDetector=Ri,exports.TaskRunner=Wi,exports.TextClassifier=Hi,exports.TextEmbedder=qi;
2
2
  //# sourceMappingURL=text_bundle_cjs.js.map