@mediapipe/tasks-vision 1.0.0-rc.20260708 → 1.0.0-rc.20260709
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 +1 -1
- package/vision_bundle.cjs +1 -1
- package/vision_bundle.cjs.map +1 -1
- package/vision_bundle.js +1 -1
- package/vision_bundle.js.map +1 -1
- package/vision_bundle.mjs +1 -1
- package/vision_bundle.mjs.map +1 -1
- package/wasm/vision_wasm_internal.js +9 -9
- package/wasm/vision_wasm_internal.wasm +0 -0
- package/wasm/vision_wasm_module_internal.js +9 -9
- package/wasm/vision_wasm_module_internal.wasm +0 -0
- package/wasm/vision_wasm_nosimd_internal.js +9 -9
- package/wasm/vision_wasm_nosimd_internal.wasm +0 -0
package/vision_bundle.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,s=0;s<n.length;s++)if(null==(i=i[n[s]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(e,r){e=e.split(".");for(var n,i=t;e.length&&(n=e.shift());)e.length||void 0===r?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=r}function n(){throw Error("Invalid UTF8")}function i(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var s,o,a=void 0,h="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}function l(e){t.setTimeout(()=>{throw e},0)}var d=e(610401301,!1),f=e(748402147,!0);function p(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var g,m=t.navigator;function _(t){return _[" "](t),t}g=m&&m.userAgentData||null,_[" "]=function(){};var v={},y=null;function E(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=y[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}A();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),s=r(64);if(64===s&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function A(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));v[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===y[e]&&(y[e]=t)}}}}var w="undefined"!=typeof Uint8Array,T=!(!(d&&g&&g.brands.length>0)&&(-1!=p().indexOf("Trident")||-1!=p().indexOf("MSIE")))&&"function"==typeof btoa,b=/[-_.]/g,k={"-":"+",_:"/",".":"="};function S(t){return k[t]||""}function L(t){if(!T)return E(t);t=b.test(t)?t.replace(b,S):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function x(t){return w&&null!=t&&t instanceof Uint8Array}var R={};function F(){return C||=new N(null,R)}function I(t){O(R);var e=t.g;return null==(e=null==e||x(e)?e:"string"==typeof e?L(e):null)?e:t.g=e}var C,N=class{h(){return new Uint8Array(I(this)||0)}constructor(t,e){if(O(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function O(t){if(t!==R)throw Error("illegal external caller")}function M(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var D=void 0;function P(t){return M(t=Error(t),"warning"),t}function $(t,e){if(null!=t){var r=D??={},n=r[t]||0;n>=e||(r[t]=n+1,M(t=Error(),"incident"),l(t))}}function U(){return"function"==typeof BigInt}var B="function"==typeof Symbol&&"symbol"==typeof Symbol();function G(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var j,V=G("jas",void 0,!0),H=G(void 0,"0di"),K=G(void 0,"1oa"),X=G(void 0,Symbol()),W=G(void 0,"0ub"),z=G(void 0,"0ubs"),Y=G(void 0,"0ubsb"),q=G(void 0,"0actk"),J=G("m_m","Ra",!0),Z=G(),Q={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},tt=Object.defineProperties,et=B?V:"Ga",rt=[];function nt(t,e){B||et in t||tt(t,Q),t[et]|=e}function it(t,e){B||et in t||tt(t,Q),t[et]=e}function st(t){return nt(t,34),t}function ot(t){return nt(t,8192),t}it(rt,7),j=Object.freeze(rt);var at={};function ht(t,e){return void 0===e?t.h!==ut&&!!(2&t.v[et]):!!(2&e)&&t.h!==ut}var ut={};function ct(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,R):F();else if(t.constructor!==N)if(x(t))t=t.length?new N(new Uint8Array(t),R):F();else{if(!e)throw Error();t=void 0}return t}class lt{constructor(t,e,r){this.g=t,this.h=e,this.l=r}next(){var t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var dt=Object.freeze({});function ft(t,e,r){var n,i=128&e?0:-1,s=t.length;(n=!!s)&&(n=null!=(n=t[s-1])&&"object"==typeof n&&n.constructor===Object);var o=s+(n?-1:0);for(e=128&e?1:0;e<o;e++)r(e-i,t[e]);if(n){t=t[s-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var pt={};function gt(t){return 128&t?pt:void 0}function mt(t){return t.Pa=!0,t}var _t=mt(t=>"number"==typeof t),vt=mt(t=>"string"==typeof t),yt=mt(t=>"boolean"==typeof t),Et="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function At(t){var e=t;if(vt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(_t(e)&&!Number.isSafeInteger(e))throw Error(String(e));return Et?BigInt(t):t=yt(t)?t?"1":"0":vt(t)?t.trim()||"0":String(t)}var wt=mt(t=>Et?t>=bt&&t<=St:"-"===t[0]?Lt(t,Tt):Lt(t,kt)),Tt=Number.MIN_SAFE_INTEGER.toString(),bt=Et?BigInt(Number.MIN_SAFE_INTEGER):void 0,kt=Number.MAX_SAFE_INTEGER.toString(),St=Et?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Lt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var xt,Rt="function"==typeof Uint8Array.prototype.slice,Ft=0,It=0;function Ct(t){var e=t>>>0;Ft=e,It=(t-e)/4294967296>>>0}function Nt(t){if(t<0){Ct(-t);let[e,r]=jt(Ft,It);Ft=e>>>0,It=r>>>0}else Ct(t)}function Ot(t){var e=xt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),It=0,Ft=e.getUint32(0,!0)}function Mt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:$t(t,e)}function Dt(t,e){return At(U()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):$t(t,e))}function Pt(t,e){return U()?At(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):At(Bt(t,e))}function $t(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else U()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Ut(r)+Ut(t));return r}function Ut(t){return t=String(t),"0000000".slice(t.length)+t}function Bt(t,e){if(2147483648&e)if(U())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=jt(t,e);t="-"+$t(r,n)}else t=$t(t,e);return t}function Gt(t){if(t.length<16)Nt(Number(t));else if(U())t=BigInt(t),Ft=Number(t&BigInt(4294967295))>>>0,It=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);It=Ft=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));It*=1e6,(Ft=1e6*Ft+e)>=4294967296&&(It+=Math.trunc(Ft/4294967296),It>>>=0,Ft>>>=0)}if(e){let[t,e]=jt(Ft,It);Ft=t,It=e}}}function jt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Vt(t){return Array.prototype.slice.call(t)}var Ht="function"==typeof BigInt?BigInt.asIntN:void 0,Kt="function"==typeof BigInt?BigInt.asUintN:void 0,Xt=Number.isSafeInteger,Wt=Number.isFinite,zt=Math.trunc,Yt=At(0);function qt(t){if("number"!=typeof t)throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function Jt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Zt(t){if("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}function Qt(t){return null==t||"boolean"==typeof t?t:"number"==typeof t?!!t:void 0}var te=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function ee(t){switch(typeof t){case"bigint":return!0;case"number":return Wt(t);case"string":return te.test(t);default:return!1}}function re(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Wt(t)?0|t:void 0}function ne(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Wt(t)?t>>>0:void 0}function ie(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Gt(t),Bt(Ft,It))}function se(t){if(t=zt(t),!Xt(t)){Nt(t);var e=Ft,r=It;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Mt(e,r))?t?-e:e:t?"-"+e:e}return t}function oe(t){var e=zt(Number(t));return Xt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),ie(t))}function ae(t){var e=zt(Number(t));return Xt(e)?At(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),U()?At(Ht(64,BigInt(t))):At(ie(t)))}function he(t){return Xt(t)?t=At(se(t)):(t=zt(t),Xt(t)?t=String(t):(Nt(t),t=Bt(Ft,It)),t=At(t)),t}function ue(t){var e=typeof t;return null==t?t:"bigint"===e?At(Ht(64,t)):ee(t)?"string"===e?ae(t):he(t):void 0}function ce(t){if("string"!=typeof t)throw Error();return t}function le(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function de(t){return null==t||"string"==typeof t?t:void 0}function fe(t,e,r,n){return null!=t&&t[J]===at?t:Array.isArray(t)?((n=(r=0|t[et])|32&n|2&n)!==r&&it(t,n),new e(t)):(r?2&n?((t=e[H])||(st((t=new e).v),t=e[H]=t),e=t):e=new e:e=void 0,e)}function pe(t,e,r){if(e)t:{if(!ee(e=t))throw P("int64");switch(typeof e){case"string":e=ae(e);break t;case"bigint":e=At(Ht(64,e));break t;default:e=he(e)}}else e=ue(t);return null==(t=e)?r?Yt:void 0:t}function ge(t){return t}var me={},_e=function(){try{return _(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ve{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}var ye=_e?(Object.setPrototypeOf(ve.prototype,Map.prototype),Object.defineProperties(ve.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ve):class extends Map{constructor(){super()}};function Ee(t){return t}function Ae(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var we,Te=class extends ye{constructor(t,e,r=Ee,n=Ee){super(),this.J=0|t[et],this.K=e,this.S=r,this.fa=this.K?be:n;for(let i=0;i<t.length;i++){let s=t[i],o=r(s[0],!1,!0),a=s[1];e?void 0===a&&(a=null):a=n(s[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}V(t){return ot(Array.from(super.entries(),t))}clear(){Ae(this),super.clear()}delete(t){return Ae(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new lt(t,ke,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new lt(t,Te.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach((r,n,i)=>{t.call(e,i.get(n),n,i)}):super.forEach(t,e)}set(t,e){return Ae(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Oa(t){var e=this.S(t[0],!1,!0);t=t[1],t=this.K?void 0===t?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);var e=super.get(t);if(void 0!==e){var r=this.K;return r?((r=this.fa(e,!1,!0,r,this.ra,this.J))!==e&&super.set(t,r),r):e}}[Symbol.iterator](){return this.entries()}};function be(t,e,r,n,i,s){return t=fe(t,n,r,s),i&&(t=Xe(t)),t}function ke(t){return[t,this.get(t)]}function Se(){return we||=new Te(st([]),void 0,void 0,void 0,me)}function Le(t){return X?t[X]:void 0}function xe(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}Te.prototype.toJSON=void 0;var Re,Fe,Ie,Ce=class{},Ne={La:!0};function Oe(t,e){e<100||$(z,1)}function Me(t,e,r,n){var i=void 0!==n;n=!!n;var s,o=X;!i&&B&&o&&(s=t[o])&&xe(s,Oe),o=[];var a=t.length;s=4294967295;var h=!1,u=!!(64&e),c=u?128&e?0:-1:void 0;if(!(1&e)){var l=a&&t[a-1];null!=l&&"object"==typeof l&&l.constructor===Object?s=--a:l=void 0,!u||128&e||i||(h=!0,s=(Re??ge)(s-c,c,t,l,void 0)+c)}e=void 0;for(var d=0;d<a;d++){let i=t[d];if(null!=i&&null!=(i=r(i,n)))if(u&&d>=s){let t=d-c;(e??={})[t]=i}else o[d]=i}if(l)for(let t in l){if(null==(a=l[t])||null==(a=r(a,n)))continue;let i;d=+t,u&&!Number.isNaN(d)&&(i=d+c)<s?o[i]=a:(e??={})[t]=a}return e&&(h?o.push(e):o[s]=e),i&&X&&(t=Le(t))&&t instanceof Ce&&(o[X]=function(t){var e=new Ce;return xe(t,(t,r,n)=>{e[r]=Vt(n)}),e.da=t.da,e}(t)),o}function De(t){return t[0]=Pe(t[0]),t[1]=Pe(t[1]),t}function Pe(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return wt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[et];return 0===t.length&&1&e?void 0:Me(t,e,Pe)}if(null!=t&&t[J]===at)return $e(t);if(t instanceof N){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(T){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),A(),r=v[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,u=0;for(;t<e.length-2;t+=3){var s=e[t],o=e[t+1],a=e[t+2],h=r[s>>2];s=r[(3&s)<<4|o>>4],o=r[(15&o)<<2|a>>6],a=r[63&a],n[u++]=h+s+o+a}switch(h=0,a=i,e.length-t){case 2:a=r[(15&(h=e[t+1]))<<2]||i;case 1:e=e[t],n[u]=r[e>>2]+r[(3&e)<<4|h>>4]+a+i}e=n.join("")}t=t.g=e}return t}return t instanceof Te?t=0!==t.size?t.V(De):void 0:void 0}return t}function $e(t){return Me(t=t.v,0|t[et],Pe)}function Ue(t,e){return Be(t,e[0],e[1])}function Be(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[et],f&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(f)throw Error("carr");$(q,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&it(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var o=s-1;let t=r[o];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(s=+a)<o&&(r[s+e]=t[a],delete t[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return it(t,64|i|n),t}function Ge(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[et];return 0===t.length&&1&r?void 0:je(t,r,e)}if(null!=t&&t[J]===at)return He(t);if(t instanceof Te){if(2&(e=t.J))return t;if(!t.size)return;if(r=st(t.V()),t.K)for(t=0;t<r.length;t++){let n=r[t],i=n[1];i=null==i||"object"!=typeof i?void 0:null!=i&&i[J]===at?He(i):Array.isArray(i)?je(i,0|i[et],!!(32&e)):void 0,n[1]=i}return r}return t instanceof N?t:void 0}function je(t,e,r){return 2&e||(!r||4096&e||16&e?t=Ke(t,e,!1,r&&!(16&e)):(nt(t,34),4&e&&Object.freeze(t))),t}function Ve(t,e,r){return t=new t.constructor(e),r&&(t.h=ut),t.m=ut,t}function He(t){var e=t.v,r=0|e[et];return ht(t,r)?t:qe(t,e,r)?Ve(t,e):Ke(e,r)}function Ke(t,e,r,n){return n??=!!(34&e),t=Me(t,e,Ge,n),n=32,r&&(n|=2),it(t,e=16769217&e|n),t}function Xe(t){var e=t.v,r=0|e[et];return ht(t,r)?qe(t,e,r)?Ve(t,e,!0):new t.constructor(Ke(e,r,!1)):t}function We(t){if(t.h!==ut)return!1;var e=t.v;return nt(e=Ke(e,0|e[et]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function ze(t){if(!We(t)&&ht(t,0|t.v[et]))throw Error()}function Ye(t,e){void 0===e&&(e=0|t[et]),32&e&&!(4096&e)&&it(t,4096|e)}function qe(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(it(e,2|r),t.h=ut,!0)}var Je=At(0),Ze={};function Qe(t,e,r,n,i){if(null!==(e=tr(t.v,e,r,i))||n&&t.m!==ut)return e}function tr(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),s=t.length-1;if(!(s<1+(r?0:-1))){if(i>=s){var o=t[s];if(null!=o&&"object"==typeof o&&o.constructor===Object){r=o[e];var a=!0}else{if(i!==s)return;r=o}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?o[e]=n:t[i]=n,n}return r}}function er(t,e,r,n){ze(t),rr(t=t.v,0|t[et],e,r,n)}function rr(t,e,r,n,i){var s=r+(i?0:-1),o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){let i=t[o];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return s<=o?(t[s]=n,e):(void 0!==n&&(r>=(o=(e??=0|t[et])>>14&1023||536870912)?null!=n&&(t[o+(i?0:-1)]={[r]:n}):t[s]=n),e)}function nr(t,e,r,n){var i=t.v;return void 0!==yr(i,0|i[et],e,t=pr(t,n)===r?r:-1)}function ir(){return void 0===dt?2:4}function sr(t,e,r,n,i){var s=t.v,o=0|s[et];n=ht(t,o)?1:n,i=!!i||3===n,2===n&&We(t)&&(o=0|(s=t.v)[et]);var a=(t=ar(s,e))===j?7:0|t[et],h=hr(a,o),u=!(4&h);if(u){4&h&&(t=Vt(t),a=0,h=Lr(h,o),o=rr(s,o,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&h|4,h=r&=-1025,h&=-4097}return h!==a&&(it(t,h),2&h&&Object.freeze(t)),or(t,h,s,o,e,n,u,i)}function or(t,e,r,n,i,s,o,a){var h=e;return 1===s||4===s&&(2&e||!(16&e)&&32&n)?ur(e)||((e|=!t.length||o&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==h&&it(t,e),Object.freeze(t)):(2===s&&ur(e)&&(t=Vt(t),h=0,e=Lr(e,n),n=rr(r,n,i,t)),ur(e)||(a||(e|=16),e!==h&&it(t,e))),2&e||!(4096&e||16&e)||Ye(r,n),t}function ar(t,e,r){return t=tr(t,e,r),Array.isArray(t)?t:j}function hr(t,e){return 2&e&&(t|=2),1|t}function ur(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function cr(t){return ct(t,!0)}function lr(t){t=Vt(t);for(let e=0;e<t.length;e++){let r=t[e]=Vt(t[e]);Array.isArray(r[1])&&(r[1]=st(r[1]))}return ot(t)}function dr(t,e,r,n){ze(t),rr(t=t.v,0|t[et],e,("0"===n?0===Number(r):r===n)?void 0:r)}function fr(t,e,r){if(2&e)throw Error();var n=gt(e),i=ar(t,r,n),s=i===j?7:0|i[et],o=hr(s,e);return(2&o||ur(o)||16&o)&&(o===s||ur(o)||it(i,o),i=Vt(i),s=0,o=Lr(o,e),rr(t,e,r,i,n)),(o&=-13)!==s&&it(i,o),i}function pr(t,e){return _r(gr(t=t.v),t,void 0,e)}function gr(t){if(B)return t[K]??(t[K]=new Map);if(K in t)return t[K];var e=new Map;return Object.defineProperty(t,K,{value:e}),e}function mr(t,e,r,n,i){var s=gr(t),o=_r(s,t,e,r,i);return o!==n&&(o&&(e=rr(t,e,o,void 0,i)),s.set(r,n)),e}function _r(t,e,r,n,i){var s=t.get(n);if(null!=s)return s;s=0;for(let t=0;t<n.length;t++){let o=n[t];null!=tr(e,o,i)&&(0!==s&&(r=rr(e,r,s,void 0,i)),s=o)}return t.set(n,s),s}function vr(t,e,r){var n=0|t[et],i=gt(n),s=tr(t,r,i);if(null!=s&&s[J]===at){if(!ht(s))return We(s),s.v;var o=s.v}else Array.isArray(s)&&(o=s);if(o){let t=0|o[et];2&t&&(o=Ke(o,t))}return(o=Ue(o,e))!==s&&rr(t,n,r,o,i),o}function yr(t,e,r,n,i){var s=!1;if(null!=(n=tr(t,n,i,t=>{var n=fe(t,r,!1,e);return s=n!==t&&null!=n,n})))return s&&!ht(n)&&Ye(t,e),n}function Er(t,e,r,n){var i=t.v,s=0|i[et];if(null==(e=yr(i,s,e,r,n)))return e;if(!ht(t,s=0|i[et])){let o=Xe(e);o!==e&&(We(t)&&(s=0|(i=t.v)[et]),Ye(i,s=rr(i,s,r,e=o,n)))}return e}function Ar(t,e,r,n,i,s,o,a){var h=ht(t,r);s=h?1:s,o=!!o||3===s,h=a&&!h,(2===s||h)&&We(t)&&(r=0|(e=t.v)[et]);var u=(t=ar(e,i))===j?7:0|t[et],c=hr(u,r);if(a=!(4&c)){var l=t,d=r;let e=!!(2&c);e&&(d|=2);let i=!e,s=!0,o=0,a=0;for(;o<l.length;o++){let t=fe(l[o],n,!1,d);if(t instanceof n){if(!e){let e=ht(t);i&&=!e,s&&=e}l[a++]=t}}a<o&&(l.length=a),c|=4,c=s?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==u&&(it(t,c),2&c&&Object.freeze(t)),h&&!(8&c||!t.length&&(1===s||4===s&&(2&c||!(16&c)&&32&r)))){for(ur(c)&&(t=Vt(t),c=Lr(c,r),r=rr(e,r,i,t)),n=t,h=c,u=0;u<n.length;u++)(l=n[u])!==(c=Xe(l))&&(n[u]=c);h|=8,it(t,c=h=n.length?4096|h:-4097&h)}return or(t,c,e,r,i,s,a,o)}function wr(t,e,r){var n=t.v;return Ar(t,n,0|n[et],e,r,ir(),!1,!0)}function Tr(t){return null==t&&(t=void 0),t}function br(t,e,r,n,i){return er(t,r,n=Tr(n),i),n&&!ht(n)&&Ye(t.v),t}function kr(t,e,r,n){t:{var i=n=Tr(n);ze(t);let s=t.v,o=0|s[et];if(null==i){let t=gr(s);if(_r(t,s,o,r)!==e)break t;t.set(r,0)}else o=mr(s,o,r,e);rr(s,o,e,i)}n&&!ht(n)&&Ye(t.v)}function Sr(t,e,r){ze(t);var n=0|(t=t.v)[et];if(null==r)rr(t,n,e);else{var i=r===j?7:0|r[et],s=i,o=ur(i),a=o||Object.isFrozen(r),h=!0,u=!0;for(let t=0;t<r.length;t++){var c=r[t];o||(c=ht(c),h&&=!c,u&&=c)}o||(i=h?13:5,i=u?-4097&i:4096|i),a&&i===s||(r=Vt(r),s=0,i=Lr(i,n)),i!==s&&it(r,i),n=rr(t,n,e,r),2&i||!(4096&i||16&i)||Ye(t,n)}}function Lr(t,e){return-273&(2&e?2|t:-3&t)}function xr(t,e,r,n){var i=n;ze(t),t=Ar(t,n=t.v,0|n[et],r,e,2,!0),i=null!=i?i:new r,t.push(i),e=r=t===j?7:0|t[et],(i=ht(i))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&it(t,r),i||Ye(n)}function Rr(t,e,r){return re(Qe(t,e,void 0,r))}function Fr(t,e){return Qe(t,e,void 0,void 0,Jt)??0}function Ir(t,e,r){return Er(t,e,r=pr(t,co)===r?r:-1,void 0)}function Cr(t,e){dr(t,3,null==e?e:Zt(e),!1)}function Nr(t,e,r){if(null!=r){if("number"!=typeof r)throw P("int32");if(!Wt(r))throw P("int32");r|=0}er(t,e,r)}function Or(t,e,r){er(t,e,null==r?r:qt(r))}function Mr(t,e,r){dr(t,e,null==r?r:qt(r),0)}function Dr(t,e,r){dr(t,e,le(r),"")}function Pr(t,e,r){{ze(t);let o=t.v,a=0|o[et];if(null==r)rr(o,a,e);else{var n=t=r===j?7:0|r[et],i=ur(t),s=i||Object.isFrozen(r);for(i||(t=0),s||(r=Vt(r),n=0,t=Lr(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,i=0;i<r.length;i++){let e=r[i],o=ce(e);Object.is(e,o)||(s&&(r=Vt(r),n=0,t=Lr(t,a),s=!1),r[i]=o)}t!==n&&(s&&(r=Vt(r),t=Lr(t,a)),it(r,t)),rr(o,a,e,r)}}}function $r(t,e,r){ze(t),sr(t,e,de,2,!0).push(ce(r))}var Ur=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Br(t,e){if("string"==typeof t)return new Ur(L(t),e);if(Array.isArray(t))return new Ur(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new Ur(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new Ur(t,!1);if(t.constructor===N)return e=I(t)||new Uint8Array(0),new Ur(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Ur(t,!1);throw Error()}function Gr(t,e){var r=0,n=0,i=0,s=t.h,o=t.g;do{var a=s[o++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=s[o++]))<<i;if(Wr(t,o),!(128&a))return e(r>>>0,n>>>0);throw Error()}function jr(t){for(var e=0,r=t.g,n=r+10,i=t.h;r<n;){let n=i[r++];if(e|=n,!(128&n))return Wr(t,r),!!(127&e)}throw Error()}function Vr(t){var e=t.h,r=t.g,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return Wr(t,r),i}function Hr(t){return Vr(t)>>>0}function Kr(t){var e=t.h,r=t.g,n=e[r],i=e[r+1],s=e[r+2];return e=e[r+3],Wr(t,t.g+4),t=2*((i=(n|i<<8|s<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function Xr(t){return Vr(t)}function Wr(t,e){if(t.g=e,e>t.l)throw Error()}function zr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.l)throw Error();return t.g=e,r}function Yr(t,e){if(0==e)return F();var r=zr(t,e);return t.Y&&t.j?r=t.h.subarray(r,r+e):(t=t.h,r=r===(e=r+e)?new Uint8Array(0):Rt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?F():new N(r,R)}var qr=class{constructor(t,e,r,n){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(t,e,r,n)}init(t,e,r,{Y:n=!1,ea:i=!1}={}){this.Y=n,this.ea=i,t&&(t=Br(t,this.ea),this.h=t.buffer,this.j=t.g,this.m=e||0,this.l=void 0!==r?this.m+r:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}},Jr=[],Zr=0;function Qr(t,e,r,n){if(cn.length){let i=cn.pop();return i.u(n),i.g.init(t,e,r,n),i}return new un(t,e,r,n)}function tn(t){t.g.clear(),t.l=-1,t.h=-1,cn.length<100&&cn.push(t)}function en(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var r=Hr(t.g);if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.h=r,!0}function rn(t){try{switch(t.h){case 0:0!=t.h?rn(t):jr(t.g);break;case 1:var e=t.g;Wr(e,e.g+8);break;case 2:if(2!=t.h)rn(t);else{var r=Hr(t.g),n=t.g;Wr(n,n.g+r)}break;case 5:var i=t.g;Wr(i,i.g+4);break;case 3:nn();let s=t.l;try{for(;;){if(!en(t))throw Error();if(4==t.h){if(t.l!=s)throw Error();break}rn(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Zr>0&&Zr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function nn(){if(Zr>=100)throw new SyntaxError;Zr++}function sn(t,e,r){var n=t.g.l,i=Hr(t.g),s=(i=t.g.g+i)-n;if(s<=0&&(t.g.l=i,r(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=n,e}function on(t){var e=Hr(t.g),r=zr(t=t.g,e);if(t=t.h,h){var o,u=t;(o=s)||(o=s=new TextDecoder("utf-8",{fatal:!0})),e=r+e,u=0===r&&e===u.length?u:u.subarray(r,e);try{var c=o.decode(u)}catch(t){if(void 0===a){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(s=void 0),t}}else{e=(c=r)+e,r=[];let s,a=null;for(;c<e;){var l=t[c++];l<128?r.push(l):l<224?c>=e?n():(s=t[c++],l<194||128!=(192&s)?(c--,n()):r.push((31&l)<<6|63&s)):l<240?c>=e-1?n():(s=t[c++],128!=(192&s)||224===l&&s<160||237===l&&s>=160||128!=(192&(o=t[c++]))?(c--,n()):r.push((15&l)<<12|(63&s)<<6|63&o)):l<=244?c>=e-2?n():(s=t[c++],128!=(192&s)||s-144+(l<<28)>>30||128!=(192&(o=t[c++]))||128!=(192&(u=t[c++]))?(c--,n()):(l=(7&l)<<18|(63&s)<<12|(63&o)<<6|63&u,l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))):n(),r.length>=8192&&(a=i(a,r),r.length=0)}c=i(a,r)}return c}function an(t){var e=Hr(t.g);return Yr(t.g,e)}function hn(t,e,r){var n=Hr(t.g);for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var un=class{constructor(t,e,r,n){if(Jr.length){let i=Jr.pop();i.init(t,e,r,n),t=i}else t=new qr(t,e,r,n);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.u(n)}u({ha:t=!1}={}){this.ha=t}},cn=[];function ln(t){return new pn(4294967295&t,Math.floor(t/4294967296))}function dn(t){return t?/^\d+$/.test(t)?(Gt(t),new pn(Ft,It)):null:fn||=new pn(0,0)}var fn,pn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function gn(t){return new kn(4294967295&t,Math.floor(t/4294967296))}function mn(t){return t?/^-?\d+$/.test(t)?(Gt(t),new kn(Ft,It)):null:_n||=new kn(0,0)}var _n,vn,yn,En,An,wn,Tn,bn,kn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function Sn(t,e,r){return"undefined"!=typeof BigInt64Array?(Tn||(Tn=new BigInt64Array(1),bn=new Uint32Array(Tn.buffer),Tn[0]=BigInt(1),wn=1===bn[0]),Tn[0]=t,new e(bn[t=wn?0:1],bn[1-t])):(An||(vn=BigInt(Number.MIN_SAFE_INTEGER),yn=BigInt(Number.MAX_SAFE_INTEGER),En=BigInt(4294967295),An=BigInt(32)),t>=vn&&t<=yn?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&En),Number(t>>An))))}function Ln(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function xn(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Rn(t,e){if(e>=0)xn(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Fn(t){var e=Ft;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var In=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function Cn(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Nn(t,e,r){xn(t.g,8*e+r)}function On(t,e){return Nn(t,e,2),e=t.g.end(),Cn(t,e),e.push(t.h),e}function Mn(t,e){var r=e.pop();for(r=t.h+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.h++;e.push(r),t.h++}function Dn(t,e,r){Nn(t,e,2),xn(t.g,r.length),Cn(t,t.g.end()),Cn(t,r)}function Pn(t,e,r,n){null!=r&&(e=On(t,e),n(r,t),Mn(t,e))}var $n=class{constructor(){this.l=[],this.h=0,this.g=new In}};function Un(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Bn=Un(),Gn=Un(),jn=Un(),Vn=Un(),Hn=Un(),Kn=Un(),Xn=Un(),Wn=Un(),zn=Un(),Yn=Un();function qn(t,e,r){var n=t.v;X&&X in n&&(n=n[X])&&delete n[e.g],e.h?e.j(t,e.h,e.g,r,e.l):e.j(t,e.g,r,e.l)}var Jn=class{constructor(t,e){this.v=Be(t,e,void 0,2048)}toJSON(){return $e(this)}j(){var t=ia,e=this.v,r=t.g,n=X;if(B&&n&&null!=e[n]?.[r]&&$(W,3),e=t.g,Z&&X&&void 0===Z&&(n=(r=this.v)[X])&&(n=n.da))try{n(r,e,Ne)}catch(t){l(t)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){var t=this.v,e=0|t[et];return qe(this,t,e)?Ve(this,t,!0):new this.constructor(Ke(t,e,!1))}};Jn.prototype[J]=at,Jn.prototype.toString=function(){return this.v.toString()};var Zn=class{constructor(t,e,r){this.g=t,this.h=e,t=Bn,this.l=!!t&&r===t||!1}};function Qn(t,e){return new Zn(t,e,Bn)}function ti(t,e,r,n,i){Pn(t,r,di(e,n),i)}var ei,ri,ni=Qn(function(t,e,r,n,i){return 2===t.h&&(sn(t,vr(e,n,r),i),!0)},ti),ii=Qn(function(t,e,r,n,i){return 2===t.h&&(sn(t,vr(e,n,r),i),!0)},ti),si=Symbol(),oi=Symbol(),ai=Symbol(),hi=Symbol(),ui=Symbol();function ci(t,e,r,n){var i=n[t];if(i)return i;(i={}).qa=n,i.T=function(t){switch(typeof t){case"boolean":return Fe||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Ie||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var s=n[1],o=1;s&&s.constructor===Object&&(i.ba=s,"function"==typeof(s=n[++o])&&(i.ma=!0,ei??=s,ri??=n[o+1],s=n[o+=2]));for(var a={};s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var h=0;h<s.length;h++)a[s[h]]=s;s=n[++o]}for(h=1;void 0!==s;){let t;"number"==typeof s&&(h+=s,s=n[++o]);var u=void 0;if(s instanceof Zn?t=s:(t=ni,o--),t?.l){s=n[++o],u=n;var c=o;"function"==typeof s&&(s=s(),u[c]=s),u=s}for(c=h+1,"number"==typeof(s=n[++o])&&s<0&&(c-=s,s=n[++o]);h<c;h++){let n=a[h];u?r(i,h,t,u,n):e(i,h,t,n)}}return n[t]=i}function li(t){return Array.isArray(t)?t[0]instanceof Zn?t:[ii,t]:[t,void 0]}function di(t,e){return t instanceof Jn?t.v:Array.isArray(t)?Ue(t,e):void 0}function fi(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function pi(t,e,r,n,i){var s,o,a=r.g;t[e]=(t,e,r)=>a(t,e,r,o||=ci(oi,fi,pi,n).T,s||=gi(n),i)}function gi(t){var e=t[ai];if(null!=e)return e;var r=ci(oi,fi,pi,t);return e=r.ma?(t,e)=>ei(t,e,r):(t,e)=>{t:{nn();try{for(;en(e)&&4!=e.h;){let h=e.l,u=r[h];if(null==u){let t=r.ba;if(t){let e=t[h];if(e){let t=_i(e);null!=t&&(u=r[h]=t)}}}if(null==u||!u(e,t,h)){var n=e;let r=n.m;if(rn(n),n.ha)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=Yr(n.g,t)}n=void 0;var s=t,o=h,a=i;a&&((n=s[X]??(s[X]=new Ce))[o]??(n[o]=[])).push(a)}}let u=Le(t);u&&(u.da=r.qa[ui]);var h=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Zr>0&&Zr--}h=void 0}return h},t[ai]=e,t[ui]=mi.bind(t),e}function mi(t,e,r,n){var i=this[oi],s=this[ai],o=Ue(void 0,i.T),a=Le(t);if(a){var h=!1,u=i.ba;if(u){if(i=(e,r,i)=>{if(0!==i.length)if(u[r])for(let t of i){e=Qr(t);try{h=!0,s(o,e)}finally{tn(e)}}else n?.(t,r,i)},null==e)xe(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(h){let n=0|t[et];if(2&n&&2048&n&&!r?.La)throw Error();let i=gt(n),s=(e,s)=>{if(null!=tr(t,e,i)){if(1===r?.Sa)return;throw Error()}null!=s&&(n=rr(t,n,e,s,i)),delete a[e]};null==e?ft(o,0|o[et],(t,e)=>{s(t,e)}):s(e,tr(o,e,i))}}}}function _i(t){var e=(t=li(t))[0].g;if(t=t[1]){let r=gi(t),n=ci(oi,fi,pi,t).T;return(t,i,s)=>e(t,i,s,n,r)}return e}function vi(t,e,r){t[e]=r.h}function yi(t,e,r,n){var i,s,o=r.h;t[e]=(t,e,r)=>o(t,e,r,s||=ci(si,vi,yi,n).T,i||=Ei(n))}function Ei(t){var e=t[hi];if(!e){let r=ci(si,vi,yi,t);e=(t,e)=>Ai(t,e,r),t[hi]=e}return e}function Ai(t,e,r){ft(t,0|t[et],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.ba)&&(r=r[e])){var n=(r=li(r))[0].h;if(r=r[1]){let e=Ei(r),i=ci(si,vi,yi,r).T;r=t.ma?ri(i,e):(t,r,s)=>n(t,r,s,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||$(Y,3)}}),(t=Le(t))&&xe(t,(t,r,n)=>{for(Cn(e,e.g.end()),t=0;t<n.length;t++)Cn(e,I(n[t])||new Uint8Array(0))})}var wi=At(0);function Ti(t,e){if(Array.isArray(e)){var r=0|e[et];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&it(e,t),2&t&&Object.freeze(e),e}}var bi=(t,e)=>{var r=new $n;Ai(t.v,r,ci(si,vi,yi,e)),Cn(r,r.g.end()),t=new Uint8Array(r.h);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function ki(t,e,r){return new Zn(t,e,r)}function Si(t,e,r){return new Zn(t,e,r)}function Li(t,e,r){rr(t,0|t[et],e,r,gt(0|t[et]))}var xi=Qn(function(t,e,r,n,i){if(2!==t.h)return!1;if(t=Vt(t=sn(t,Ue([void 0,void 0],n),i)),i=gt(n=0|e[et]),2&n)throw Error();var s=tr(e,r,i);if(s instanceof Te)2&s.J?((s=s.V()).push(t),rr(e,n,r,s,i)):s.Oa(t);else if(Array.isArray(s)){var o=0|s[et];8192&o||it(s,o|=8192),2&o&&rr(e,n,r,s=lr(s),i),s.push(t)}else rr(e,n,r,ot([t]),i);return!0},function(t,e,r,n,i){if(e instanceof Te)e.forEach((e,s)=>{Pn(t,r,Ue([s,e],n),i)});else if(Array.isArray(e)){for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)&&Pn(t,r,Ue(o,n),i)}ot(e)}});function Ri(t,e,r){null!=(e=Jt(e))&&(Nn(t,r,5),t=t.g,Ot(e),Fn(t))}function Fi(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ht(64,t));if(ee(t)){if("string"===e)return oe(t);if("number"===e)return se(t)}}(e),null!=e){if("string"==typeof e)mn(e);if(null!=e)switch(Nn(t,r,0),typeof e){case"number":t=t.g,Nt(e),Ln(t,Ft,It);break;case"bigint":r=Sn(e,kn,gn),Ln(t.g,r.h,r.g);break;default:r=mn(e),Ln(t.g,r.h,r.g)}}}function Ii(t,e,r){null!=(e=re(e))&&null!=e&&(Nn(t,r,0),Rn(t.g,e))}function Ci(t,e,r){null!=(e=Qt(e))&&(Nn(t,r,0),t.g.g.push(e?1:0))}function Ni(t,e,r){null!=(e=de(e))&&Dn(t,r,c(e))}function Oi(t,e,r,n,i){Pn(t,r,di(e,n),i)}function Mi(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof N?e:void 0)&&Dn(t,r,Br(e,!0).buffer)}function Di(t,e,r){null!=(e=ne(e))&&null!=e&&(Nn(t,r,0),xn(t.g,e))}function Pi(t,e,r){null!=(e=re(e))&&(e=parseInt(e,10),Nn(t,r,0),Rn(t.g,e))}function $i(t,e,r){return(5===t.h||2===t.h)&&(e=fr(e,0|e[et],r),2==t.h?hn(t,Kr,e):e.push(Kr(t.g)),!0)}var Ui=ki(function(t,e,r){return 5===t.h&&(Li(e,r,Kr(t.g)),!0)},Ri,Wn),Bi=Si($i,function(t,e,r){if(null!=(e=Ti(Jt,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Nn(n,i,5),n=n.g,Ot(s),Fn(n))}},Wn),Gi=Si($i,function(t,e,r){if(null!=(e=Ti(Jt,e))&&e.length){Nn(t,r,2),xn(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,Ot(e[n]),Fn(r)}},Wn),ji=ki(function(t,e,r){return 5===t.h&&(Li(e,r,0===(t=Kr(t.g))?void 0:t),!0)},Ri,Wn),Vi=ki(function(t,e,r){return 0!==t.h?t=!1:(Li(e,r,Gr(t.g,Pt)),t=!0),t},Fi,Kn),Hi=ki(function(t,e,r){return 0!==t.h?e=!1:(Li(e,r,(t=Gr(t.g,Pt))===wi?void 0:t),e=!0),e},Fi,Kn),Ki=ki(function(t,e,r){return 0!==t.h?t=!1:(Li(e,r,Gr(t.g,Dt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Kt(64,t));if(ee(t)){if("string"===e)return e=zt(Number(t)),Xt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(Gt(t),t=$t(Ft,It))),t;if("number"===e)return(t=zt(t))>=0&&Xt(t)||(Nt(t),t=Mt(Ft,It)),t}}(e),null!=e){if("string"==typeof e)dn(e);if(null!=e)switch(Nn(t,r,0),typeof e){case"number":t=t.g,Nt(e),Ln(t,Ft,It);break;case"bigint":r=Sn(e,pn,ln),Ln(t.g,r.h,r.g);break;default:r=dn(e),Ln(t.g,r.h,r.g)}}},Xn),Xi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,Vr(t.g)),!0)},Ii,Vn),Wi=Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[et],r),2==t.h?hn(t,Vr,e):e.push(Vr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(re,e))&&e.length){r=On(t,r);for(let r=0;r<e.length;r++)Rn(t.g,e[r]);Mn(t,r)}},Vn),zi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Vr(t.g))?void 0:t),!0)},Ii,Vn),Yi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,jr(t.g)),!0)},Ci,Gn),qi=ki(function(t,e,r){return 0===t.h&&(Li(e,r,!1===(t=jr(t.g))?void 0:t),!0)},Ci,Gn),Ji=Si(function(t,e,r){return 2===t.h&&(t=on(t),fr(e,0|e[et],r).push(t),!0)},function(t,e,r){if(null!=(e=Ti(de,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&Dn(n,i,c(s))}},jn),Zi=ki(function(t,e,r){return 2===t.h&&(Li(e,r,""===(t=on(t))?void 0:t),!0)},Ni,jn),Qi=ki(function(t,e,r){return 2===t.h&&(Li(e,r,on(t)),!0)},Ni,jn),ts=function(t,e,r=Bn){return new Zn(t,e,r)}(function(t,e,r,n,i){return 2===t.h&&(n=Ue(void 0,n),fr(e,0|e[et],r).push(n),sn(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)Oi(t,e[s],r,n,i);1&(t=0|e[et])||it(e,1|t)}}),es=Qn(function(t,e,r,n,i,s){if(2!==t.h)return!1;var o=0|e[et];return mr(e,o,s,r,gt(o)),sn(t,e=vr(e,n,r),i),!0},Oi),rs=ki(function(t,e,r){return 2===t.h&&(Li(e,r,an(t)),!0)},Mi,zn),ns=Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[et],r),2==t.h?hn(t,Hr,e):e.push(Hr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(ne,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Nn(n,i,0),xn(n.g,s))}},Hn),is=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Hr(t.g))?void 0:t),!0)},Di,Hn),ss=ki(function(t,e,r){return 0===t.h&&(Li(e,r,Vr(t.g)),!0)},Pi,Yn),os=ki(function(t,e,r){return 0===t.h&&(Li(e,r,0===(t=Vr(t.g))?void 0:t),!0)},Pi,Yn);class as{constructor(t,e){var r=Rs;this.g=t,this.h=e,this.m=Er,this.j=br,this.defaultValue=void 0,this.l=null!=r.Qa?pt:void 0}register(){_(this)}}function hs(t,e){return new as(t,e)}function us(t,e){return(r,n)=>{t:{let s={ea:!0};n&&Object.assign(s,n),r=Qr(r,void 0,void 0,s);try{let n=new t,s=n.v;gi(e)(s,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{tn(r)}i=void 0}return i}}function cs(t){return e=>bi(e,t)}function ls(t){return function(){return bi(this,t)}}var ds,fs=class extends Jn{constructor(t){super(t)}},ps=[0,Zi,ki(function(t,e,r){return 2===t.h&&(Li(e,r,(t=an(t))===F()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof Jn){let n=e.Ta;return void(n?(e=n(e),null!=e&&Dn(t,r,Br(e,!0).buffer)):$(Y,3))}if(Array.isArray(e))return void $(Y,3)}Mi(t,e,r)},zn)],gs=globalThis.trustedTypes;var ms=class{constructor(t){this.g=t}toString(){return this.g+""}};function _s(t){var e;return void 0===ds&&(ds=function(){var t=null;if(!gs)return t;try{let e=t=>t;t=gs.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=ds)?e.createScriptURL(t):t,new ms(t)}function vs(t,...e){if(0===e.length)return _s(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return _s(r)}var ys=[0,Xi,ss,Yi,-1,Wi,ss,-1,Yi,-1],Es=[0,ss,-1,Yi],As=class extends Jn{constructor(t){super(t)}},ws=[0,Yi,Qi,Yi,ss,-1,Si(function(t,e,r){return(0===t.h||2===t.h)&&(e=fr(e,0|e[et],r),2==t.h?hn(t,Xr,e):e.push(Vr(t.g)),!0)},function(t,e,r){if(null!=(e=Ti(re,e))&&e.length){r=On(t,r);for(let r=0;r<e.length;r++)Rn(t.g,e[r]);Mn(t,r)}},Yn),Qi,-1,[0,Yi,-1],ss,Yi,-1,Es],Ts=[0,3,Yi,-1,2,[0,[2],Xi,es,[0,ki(function(t,e,r){return 0===t.h&&(Li(e,r,Hr(t.g)),!0)},Di,Hn)]],[0,ss,Yi,ss,Yi,ss,Yi,Qi,-1],[0,[3,4],Qi,-1,es,[0,Xi],es,[0,ss]],[0]],bs=[0,Qi,-2],ks=class extends Jn{constructor(t){super(t)}},Ss=[0],Ls=class extends Jn{constructor(t){super(t)}},xs=[0,Xi,Yi,1,Yi,-4],Rs=class extends Jn{constructor(t){super(t,2)}},Fs={};Fs[336783863]=[0,Qi,Yi,-1,Xi,[0,[1,2,3,4,5,6,7,8,9],es,Ss,es,ws,es,bs,es,xs,es,ys,es,[0,Qi,-2],es,[0,Qi,ss],es,Ts,es,Es],[0,Qi],Yi,[0,[1,3],[2,4],es,[0,Wi],-1,es,[0,Ji],-1,ts,[0,Qi,-1]],Qi];var Is=[0,Hi,-1,qi,-3,Hi,Wi,Zi,zi,Hi,-1,qi,zi,qi,-2,Zi];function Cs(t,e){$r(t,3,e)}function Ns(t,e){$r(t,4,e)}var Os=class extends Jn{constructor(t){super(t,500)}u(t){return br(this,0,7,t)}},Ms=[-1,{}],Ds=[0,Qi,1,Ms],Ps=[0,Qi,Ji,Ms];function $s(t,e){xr(t,1,Os,e)}function Us(t,e){$r(t,10,e)}function Bs(t,e){$r(t,15,e)}var Gs=class extends Jn{constructor(t){super(t,500)}u(t){return br(this,0,1001,t)}},js=[-500,ts,[-500,Zi,-1,Ji,-3,[-2,Fs,Yi],ts,ps,zi,-1,Ds,Ps,ts,[0,Zi,qi],Zi,Is,zi,Ji,987,Ji],4,ts,[-500,Qi,-1,[-1,{}],998,Qi],ts,[-500,Qi,Ji,-1,[-2,{},Yi],997,Ji,-1],zi,ts,[-500,Qi,Ji,Ms,998,Ji],Ji,zi,Ds,Ps,ts,[0,Zi,-1,Ms],Ji,-2,Is,Zi,-1,qi,[0,qi,is],978,Ms,ts,ps];Gs.prototype.g=ls(js);var Vs=us(Gs,js),Hs=class extends Jn{constructor(t){super(t)}},Ks=class extends Jn{constructor(t){super(t)}g(){return wr(this,Hs,1)}},Xs=[0,ts,[0,Xi,Ui,Qi,-1]],Ws=us(Ks,Xs),zs=class extends Jn{constructor(t){super(t)}},Ys=class extends Jn{constructor(t){super(t)}},qs=class extends Jn{constructor(t){super(t)}l(){return Er(this,zs,2)}g(){return wr(this,Ys,5)}},Js=us(class extends Jn{constructor(t){super(t)}},[0,Ji,Wi,Gi,[0,ss,[0,Xi,-3],[0,Ui,-3],[0,Xi,-1,[0,ts,[0,Xi,-2]]],ts,[0,Ui,-1,Qi,Ui]],Qi,-1,Vi,ts,[0,Xi,Ui],Ji,Vi]),Zs=class extends Jn{constructor(t){super(t)}},Qs=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,Ui,-4]]),to=class extends Jn{constructor(t){super(t)}},eo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,Ui,-4]]),ro=class extends Jn{constructor(t){super(t)}},no=[0,Xi,-1,Gi,ss],io=class extends Jn{constructor(t){super(t)}};io.prototype.g=ls([0,Ui,-4,Vi]);var so=class extends Jn{constructor(t){super(t)}},oo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,1,Xi,Qi,Xs],Vi]),ao=class extends Jn{constructor(t){super(t)}},ho=class extends Jn{constructor(t){super(t)}g(){var t=Qe(this,1,void 0,void 0,cr);return null==t?F():t}},uo=class extends Jn{constructor(t){super(t)}},co=[1,2],lo=us(class extends Jn{constructor(t){super(t)}},[0,ts,[0,co,es,[0,Gi],es,[0,rs],Xi,Qi],Vi]),fo=class extends Jn{constructor(t){super(t)}},po=[0,Qi,Xi,Ui,Ji,-1],go=class extends Jn{constructor(t){super(t)}},mo=[0,Yi,-1],_o=class extends Jn{constructor(t){super(t)}g(){nr(this,As,2,vo)}},vo=[1,2,3,4,5,6],yo=class extends Jn{constructor(t){super(t)}g(){return null!=Qe(this,1,void 0,void 0,cr)}l(){return null!=de(Qe(this,2))}},Eo=class extends Jn{constructor(t){super(t)}g(){return Qt(Qe(this,2))??!1}},Ao=[0,rs,Qi,[0,Xi,Vi,-1],[0,Ki,Vi]],wo=[0,Ao,Yi,[0,vo,es,xs,es,ws,es,ys,es,Ss,es,bs,es,Ts],ss],To=cs(wo),bo=class extends Jn{constructor(t){super(t)}},ko=[0,wo,Ui,-1,Xi],So=hs(502141897,bo);Fs[502141897]=ko;var Lo=us(class extends Jn{constructor(t){super(t)}},[0,[0,ss,-1,Bi,ns],no]),xo=class extends Jn{constructor(t){super(t)}},Ro=class extends Jn{constructor(t){super(t)}},Fo=[0,wo,Ui,[0,wo],Yi],Io=hs(508968150,Ro);Fs[508968150]=[0,wo,ko,Fo,Ui,[0,[0,Ao]]],Fs[508968149]=Fo;var Co=class extends Jn{constructor(t){super(t)}l(){return Er(this,fo,2)}g(){er(this,2)}},No=[0,wo,po];Fs[478825465]=No;var Oo=class extends Jn{constructor(t){super(t)}},Mo=class extends Jn{constructor(t){super(t)}},Do=class extends Jn{constructor(t){super(t)}},Po=class extends Jn{constructor(t){super(t)}},$o=class extends Jn{constructor(t){super(t)}},Uo=[0,wo,[0,wo],No,-1],Bo=[0,wo,Ui,Xi],Go=[0,wo,Ui],jo=[0,wo,Bo,Go,Ui],Vo=hs(479097054,$o);Fs[479097054]=[0,wo,jo,Uo],Fs[463370452]=Uo,Fs[464864288]=Bo;var Ho=hs(462713202,Po);Fs[462713202]=jo,Fs[474472470]=Go;var Ko=class extends Jn{constructor(t){super(t)}},Xo=class extends Jn{constructor(t){super(t)}},Wo=class extends Jn{constructor(t){super(t)}},zo=class extends Jn{constructor(t){super(t)}},Yo=[0,wo,Ui,-1,Xi],qo=[0,wo,Ui,Yi];zo.prototype.g=ls([0,wo,Go,[0,wo],ko,Fo,Yo,qo]);var Jo=class extends Jn{constructor(t){super(t)}},Zo=hs(456383383,Jo);Fs[456383383]=[0,wo,po];var Qo=class extends Jn{constructor(t){super(t)}},ta=hs(476348187,Qo);Fs[476348187]=[0,wo,mo];var ea=class extends Jn{constructor(t){super(t)}},ra=class extends Jn{constructor(t){super(t)}},na=[0,ss,-1],ia=hs(458105876,class extends Jn{constructor(t){super(t)}g(){var t=this.v,e=0|t[et],r=ht(this,e);return t=function(t,e,r,n){var i=ra;!n&&We(t)&&(r=0|(e=t.v)[et]);var s=tr(e,2);if(t=!1,null==s){if(n)return Se();s=[]}else if(s.constructor===Te){if(!(2&s.J)||n)return s;s=s.V()}else Array.isArray(s)?t=!!(2&s[et]):s=[];if(n){if(!s.length)return Se();t||(t=!0,st(s))}else t&&(t=!1,ot(s),s=lr(s));return!t&&32&r&&nt(s,32),r=rr(e,r,2,n=new Te(s,i,pe,void 0)),t||Ye(e,r),n}(this,t,e,r),!r&&ra&&(t.ra=!0),t}});Fs[458105876]=[0,na,xi,[!0,Vi,[0,Qi,-1,Ji]],[0,Wi,Yi,ss],Yi];var sa=class extends Jn{constructor(t){super(t)}},oa=hs(458105758,sa);Fs[458105758]=[0,wo,Qi,na];var aa=class extends Jn{constructor(t){super(t)}},ha=class extends Jn{constructor(t){super(t)}},ua=class extends Jn{constructor(t){super(t)}},ca=cs([0,ts,[0,os,ts,[0,ji,-1],qi]]),la=class extends Jn{constructor(t){super(t)}},da=[0,ji,-1,qi],fa=class extends Jn{constructor(t){super(t)}},pa=class extends Jn{constructor(t){super(t)}},ga=[1,2];pa.prototype.g=ls([0,ga,es,da,es,[0,ts,da]]);var ma=class extends Jn{constructor(t){super(t)}},_a=hs(443442058,ma);Fs[443442058]=[0,wo,Qi,Xi,Ui,Ji,-1,Yi,Ui],Fs[514774813]=Yo;var va=class extends Jn{constructor(t){super(t)}},ya=hs(516587230,va);function Ea(t,e){return e=e?e.clone():new fo,void 0!==t.displayNamesLocale?er(e,1,le(t.displayNamesLocale)):void 0===t.displayNamesLocale&&er(e,1),void 0!==t.maxResults?Nr(e,2,t.maxResults):"maxResults"in t&&er(e,2),void 0!==t.scoreThreshold?Or(e,3,t.scoreThreshold):"scoreThreshold"in t&&er(e,3),void 0!==t.categoryAllowlist?Pr(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&er(e,4),void 0!==t.categoryDenylist?Pr(e,5,t.categoryDenylist):"categoryDenylist"in t&&er(e,5),e}function Aa(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function wa(t,e=-1,r=""){return{categories:t.map(t=>({index:Rr(t,1)??0??-1,score:Fr(t,2)??0,categoryName:de(Qe(t,3))??""??"",displayName:de(Qe(t,4))??""??""})),headIndex:e,headName:r}}function Ta(t){var e={classifications:wr(t,so,1).map(t=>wa(Er(t,Ks,4)?.g()??[],Rr(t,2)??0,de(Qe(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(wt(t)?t=Number(t):(t=Ht(64,t),t=wt(t)?Number(t):String(t)),t):ee(t)?"number"==typeof t?se(t):oe(t):void 0}(Qe(t,2,void 0,void 0,ue))&&(e.timestampMs=Aa(Qe(t,2,void 0,void 0,ue)??Je)),e}function ba(t){var e=sr(t,3,Jt,ir()),r=sr(t,2,re,ir()),n=sr(t,1,de,ir()),i=sr(t,9,de,ir()),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:r[t]??-1,categoryName:n[t]??"",displayName:i[t]??""});if((e=Er(t,qs,4)?.l())&&(s.boundingBox={originX:Rr(e,1,Ze)??0,originY:Rr(e,2,Ze)??0,width:Rr(e,3,Ze)??0,height:Rr(e,4,Ze)??0,angle:0}),Er(t,qs,4)?.g().length)for(let e of Er(t,qs,4).g())s.keypoints.push({x:Qe(e,1,void 0,Ze,Jt)??0,y:Qe(e,2,void 0,Ze,Jt)??0,score:Qe(e,4,void 0,Ze,Jt)??0,label:de(Qe(e,3,void 0,Ze))??""});return s}function ka(t){var e=[];for(let r of wr(t,to,1))e.push({x:Fr(r,1)??0,y:Fr(r,2)??0,z:Fr(r,3)??0,visibility:Fr(r,4)??0});return e}function Sa(t){var e=[];for(let r of wr(t,Zs,1))e.push({x:Fr(r,1)??0,y:Fr(r,2)??0,z:Fr(r,3)??0,visibility:Fr(r,4)??0});return e}function La(t){return Array.from(t,t=>t>127?t-256:t)}function xa(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],n+=t[s]*t[s],i+=e[s]*e[s];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}Fs[516587230]=[0,wo,Yo,qo,Ui],Fs[518928384]=qo;var Ra,Fa=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 Ia(t){if(t)return!0;if(void 0===Ra)try{await WebAssembly.instantiate(Fa),Ra=!0}catch{Ra=!1}return Ra}async function Ca(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Ia(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var Na=class{};Na.forVisionTasks=function(t,e=!1){return Ca("vision",t??vs``,e)},Na.forTextTasks=function(t,e=!1){return Ca("text",t??vs``,e)},Na.forGenAiTasks=function(t,e=!1){return Ca("genai",t??vs``,e)},Na.forAudioTasks=function(t,e=!1){return Ca("audio",t??vs``,e)},Na.isSimdSupported=function(t=!1){return Ia(t)};var Oa=class{close(){}};function Ma(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Da(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Pa(t){return 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]}function $a(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Ua(t,e,r){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(r?t.i._bindTextureToStream(r):t.i._bindTextureToCanvas(),!(r=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);var[n,i]=Pa(e);return!t.l||n===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=i),[n,i]}function Ba(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Ga(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function ja(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var Va=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Ma()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),$a(this,n||"input_audio",n=>{$a(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){Ga(this,"__graph_config__",e=>{t(e)}),$a(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),$a(this,n,t=>{this.i._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){$a(this,e,e=>{var[n,i]=Ua(this,t,e);this.i._addBoundTextureToStream(e,n,i,r)})}addBoolToStream(t,e,r){$a(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){$a(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){$a(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){$a(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){$a(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){$a(this,e,e=>{$a(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){$a(this,e,e=>{Ba(this,Object.keys(t),n=>{Ba(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){$a(this,r,r=>{$a(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){$a(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){$a(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)$a(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){$a(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){$a(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){$a(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){$a(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){$a(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){$a(this,e,e=>{$a(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){$a(this,r,r=>{$a(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){$a(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)$a(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ga(this,t,e),$a(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){ja(this,t,e),$a(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ga(this,t,e),$a(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){ja(this,t,e),$a(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ga(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),$a(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}};function Ha(t){return class extends t{Ka(){this.i._registerModelResourcesGraphService()}}}var Ka=Ha(Va),Xa=class extends Ka{};async function Wa(t,e,r,n){return t=await(async(t,e,r,n,i)=>{if(e&&await Da(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Da(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,n)})(t,r.wasmLoaderPath,r.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&t.endsWith(".data")?r.assetBinaryPath.toString():t}),t.na=new Oa,await t.u(n),t}async function za(t,e,r,n){return Wa(t,e,r,n)}function Ya(t,e){var r=Er(t.baseOptions,yo,1)||new yo;"string"==typeof e?(er(r,2,le(e)),er(r,1)):e instanceof Uint8Array&&(er(r,1,ct(e,!1)),er(r,2)),br(t.baseOptions,0,1,r)}function qa(t){try{let e=t.H.length;if(1===e)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map(t=>t.message).join(", "))}finally{t.H=[]}}function Ja(t,e){t.C=Math.max(t.C,e)}function Za(t,e){t.B=new Os,Dr(t.B,2,"PassThroughCalculator"),Cs(t.B,"free_memory"),Ns(t.B,"free_memory_unused_out"),Us(e,"free_memory"),$s(e,t.B)}function Qa(t,e){Cs(t.B,e),Ns(t.B,e+"_unused_out")}function th(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var eh=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){let e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(Er(this.baseOptions,yo,1)?.g()||Er(this.baseOptions,yo,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=Er(t.baseOptions,_o,3);if(!r){var n=r=new _o,i=new ks;kr(n,4,vo,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new As,kr(e,2,vo,n)):(e=r,n=new ks,kr(e,4,vo,n))),br(t.baseOptions,0,3,r)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),Ya(this,"/model.dat"),this.m(),this.L()});if(e.modelAssetBuffer instanceof Uint8Array)Ya(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(e.modelAssetBuffer).then(t=>{Ya(this,t),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){var t;if(this.g.ca(e=>{t=Vs(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.H.push(Error(e))}),this.g.Ka(),this.g.setGraph(t,e),this.B=void 0,qa(this)}finishProcessing(){this.g.finishProcessing(),qa(this)}close(){this.B=void 0,this.na?.close(),this.g.closeGraph()}};function rh(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}eh.prototype.close=eh.prototype.close;class nh{constructor(t,e,r,n){this.g=t,this.h=e,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function ih(t,e,r){var n=t.g;if(r=rh(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(t.h,r),r}function sh(t,e){var r=t.g,n=rh(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);var i=rh(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(t.O),r.vertexAttribPointer(t.O,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);var s=rh(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(t.L),r.vertexAttribPointer(t.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new nh(r,n,i,s)}function oh(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function ah(t,e,r,n){return oh(t,e),t.h||(t.m(),t.D()),r?(t.o||(t.o=sh(t,!0)),r=t.o):(t.A||(t.A=sh(t,!1)),r=t.A),e.useProgram(t.h),r.bind(),t.l(),t=n(),r.g.bindVertexArray(null),t}function hh(t,e,r){return oh(t,e),t=rh(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function uh(t,e,r){oh(t,e),t.B||(t.B=rh(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function ch(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var lh=class{H(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){var t=this.g;if(this.h=rh(t.createProgram(),"Failed to create WebGL program"),this.X=ih(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.W=ih(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.O=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.o&&this.o.close()}};var dh=class extends lh{H(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.C=hh(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=hh(this,t,t.NEAREST)}m(){super.m();var t=this.g;this.P=rh(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=rh(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.M=rh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.M,0),t.uniform1i(this.P,1),t.uniform1i(this.U,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},fh=class extends lh{H(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.j=hh(this,t),t.activeTexture(t.TEXTURE2),this.C=hh(this,t)}m(){super.m();var t=this.g;this.M=rh(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.P=rh(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=rh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.M,1),t.uniform1i(this.P,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function ph(t,e){switch(e){case 0:return t.g.find(t=>t instanceof Uint8Array);case 1:return t.g.find(t=>t instanceof Float32Array);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function gh(t){var e=ph(t,1);if(!e){if(e=ph(t,0))e=new Float32Array(e).map(t=>t/255);else{e=new Float32Array(t.width*t.height);let n=_h(t);var r=yh(t);if(uh(r,n,mh(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,r);for(let t=0,n=0;t<e.length;++t,n+=4)e[t]=r[n]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function mh(t){var e=ph(t,2);if(!e){let r=_h(t);e=Eh(t);let n=gh(t),i=vh(t);r.texImage2D(r.TEXTURE_2D,0,i,t.width,t.height,0,r.RED,r.FLOAT,n),Ah(t)}return e}function _h(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=rh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function vh(t){if(t=_h(t),!wh)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))wh=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");wh=t.R16F}return wh}function yh(t){return t.l||(t.l=new lh),t.l}function Eh(t){var e=_h(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=ph(t,2);return r||(r=hh(yh(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(r),t.j=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Ah(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var wh,Th=class{constructor(t,e,r,n,i,s,o){this.g=t,this.m=e,this.j=r,this.canvas=n,this.l=i,this.width=s,this.height=o,this.j&&(0===--bh&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Fa(){return!!ph(this,0)}ka(){return!!ph(this,1)}R(){return!!ph(this,2)}ja(){return(e=ph(t=this,0))||(e=gh(t),e=new Uint8Array(e.map(t=>Math.round(255*t))),t.g.push(e)),e;var t,e}ia(){return gh(this)}N(){return mh(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof Uint8Array)r=new Uint8Array(e);else if(e instanceof Float32Array)r=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let t=_h(this),e=yh(this);t.activeTexture(t.TEXTURE1),r=hh(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,r);let n=vh(this);t.texImage2D(t.TEXTURE_2D,0,n,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),uh(e,t,r),ah(e,t,!1,()=>{Eh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Ah(this)}),ch(e),Ah(this)}}t.push(r)}return new Th(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&_h(this).deleteTexture(ph(this,2)),bh=-1}};Th.prototype.close=Th.prototype.close,Th.prototype.clone=Th.prototype.clone,Th.prototype.getAsWebGLTexture=Th.prototype.N,Th.prototype.getAsFloat32Array=Th.prototype.ia,Th.prototype.getAsUint8Array=Th.prototype.ja,Th.prototype.hasWebGLTexture=Th.prototype.R,Th.prototype.hasFloat32Array=Th.prototype.ka,Th.prototype.hasUint8Array=Th.prototype.Fa;var bh=250,kh={color:"white",lineWidth:4,radius:6};function Sh(t){return{...kh,fillColor:(t=t||{}).color,...t}}function Lh(t,e){return t instanceof Function?t(e):t}function xh(t,e,r){return Math.max(Math.min(e,r),Math.min(Math.max(e,r),t))}function Rh(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Fh(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Ih(t,e,r){if(e.R())r(e.N());else{let n=e.ka()?e.ia():e.ja();t.m=t.m??new lh;let i=Fh(t);r((t=new Th([n],e.m,!1,i.canvas,t.m,e.width,e.height)).N()),t.close()}}function Ch(t,e,r,n){var i=function(t){return t.g||(t.g=new dh),t.g}(t),s=Fh(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;ah(i,s,!0,()=>{!function(t,e,r,n){var i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.C),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(let[r,n]of t){t=r;let i=n,s=e.next();if(s.done)return!1;let[o,a]=s.value;if(t!==o||i[0]!==a[0]||i[1]!==a[1]||i[2]!==a[2]||i[3]!==a[3])return!1}return!!e.next().done}(t.I,n))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=n;let e=Array(1024).fill(0);n.forEach((t,r)=>{if(4!==t.length)throw Error(`Color at index ${r} is not a four-channel value.`);e[4*r]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]}),i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,256,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array(e))}}(i,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);var t=i.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}function Nh(t,e,r,n){var i=Fh(t),s=function(t){return t.h||(t.h=new fh),t.h}(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;ah(s,i,!0,()=>{var t=s.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,s.C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(t=s.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}var Oh=class{constructor(t,e){"undefined"!=typeof CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}ya(t,e){if(t){var r=Rh(this);e=Sh(e),r.save();var n=r.canvas,i=0;for(let s of t)r.fillStyle=Lh(e.fillColor,{index:i,from:s}),r.strokeStyle=Lh(e.color,{index:i,from:s}),r.lineWidth=Lh(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,Lh(e.radius,{index:i,from:s}),0,2*Math.PI),r.fill(t),r.stroke(t),++i;r.restore()}}xa(t,e,r){if(t&&e){var n=Rh(this);r=Sh(r),n.save();var i=n.canvas,s=0;for(let o of e){n.beginPath(),e=t[o.start];let a=t[o.end];e&&a&&(n.strokeStyle=Lh(r.color,{index:s,from:e,to:a}),n.lineWidth=Lh(r.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*i.width,e.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++s,n.stroke()}n.restore()}}ua(t,e){var r=Rh(this);e=Sh(e),r.save(),r.beginPath(),r.lineWidth=Lh(e.lineWidth,{}),r.strokeStyle=Lh(e.color,{}),r.fillStyle=Lh(e.fillColor,{}),r.moveTo(t.originX,t.originY),r.lineTo(t.originX+t.width,t.originY),r.lineTo(t.originX+t.width,t.originY+t.height),r.lineTo(t.originX,t.originY+t.height),r.lineTo(t.originX,t.originY),r.stroke(),r.fill(),r.restore()}va(t,e,r=[0,0,0,255]){this.l?function(t,e,r,n){var i=Fh(t);Ih(t,e,e=>{Ch(t,e,r,n),(e=Rh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,r,e):Ch(this,t.N(),r,e)}wa(t,e,r){this.l?function(t,e,r,n){var i=Fh(t);Ih(t,e,e=>{Nh(t,e,r,n),(e=Rh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,e,r):Nh(this,t.N(),e,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Mh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof ImageData);case 1:return t.g.find(t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function Dh(t){var e=Mh(t,0);if(!e){e=$h(t);let r=Uh(t),n=new Uint8Array(t.width*t.height*4);uh(r,e,Ph(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),ch(r),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function Ph(t){var e=Mh(t,2);if(!e){let r=$h(t);e=Bh(t);let n=Mh(t,1)||Dh(t);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),Gh(t)}return e}function $h(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=rh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function Uh(t){return t.l||(t.l=new lh),t.l}function Bh(t){var e=$h(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=Mh(t,2);return r||(r=hh(Uh(t),e),t.g.push(r),t.m=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Gh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function jh(t){var e=$h(t);return ah(Uh(t),e,!0,()=>function(t,e){var r=t.canvas;if(r.width===t.width&&r.height===t.height)return e();var n=r.width,i=r.height;return r.width=t.width,r.height=t.height,t=e(),r.width=n,r.height=i,t}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}Oh.prototype.close=Oh.prototype.close,Oh.prototype.drawConfidenceMask=Oh.prototype.wa,Oh.prototype.drawCategoryMask=Oh.prototype.va,Oh.prototype.drawBoundingBox=Oh.prototype.ua,Oh.prototype.drawConnectors=Oh.prototype.xa,Oh.prototype.drawLandmarks=Oh.prototype.ya,Oh.lerp=function(t,e,r,n,i){return xh(n*(1-(t-e)/(r-e))+i*(1-(r-t)/(r-e)),n,i)},Oh.clamp=xh;var Vh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.j=e,this.m=r,this.canvas=n,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Hh&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Ea(){return!!Mh(this,0)}la(){return!!Mh(this,1)}R(){return!!Mh(this,2)}Ca(){return Dh(this)}Ba(){var t=Mh(this,1);return t||(Ph(this),Bh(this),t=jh(this),Gh(this),this.g.push(t),this.j=!0),t}N(){return Ph(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof ImageData)r=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let t=$h(this),e=Uh(this);t.activeTexture(t.TEXTURE1),r=hh(e,t),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),uh(e,t,r),ah(e,t,!1,()=>{Bh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Gh(this)}),ch(e),Gh(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Ph(this),Bh(this),r=jh(this),Gh(this)}t.push(r)}return new Vh(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Mh(this,1).close(),this.m&&$h(this).deleteTexture(Mh(this,2)),Hh=-1}};Vh.prototype.close=Vh.prototype.close,Vh.prototype.clone=Vh.prototype.clone,Vh.prototype.getAsWebGLTexture=Vh.prototype.N,Vh.prototype.getAsImageBitmap=Vh.prototype.Ba,Vh.prototype.getAsImageData=Vh.prototype.Ca,Vh.prototype.hasWebGLTexture=Vh.prototype.R,Vh.prototype.hasImageBitmap=Vh.prototype.la,Vh.prototype.hasImageData=Vh.prototype.Ea;var Hh=250;function Kh(...t){return t.map(([t,e])=>({start:t,end:e}))}var Xh,Wh=Ha((Xh=Va,class extends Xh{get ga(){return this.i}pa(t,e,r){$a(this,e,e=>{var[n,i]=Ua(this,t,e);this.ga._addBoundTextureAsImageToStream(e,n,i,r)})}Z(t,e){Ga(this,t,e),$a(this,t,t=>{this.ga._attachImageListener(t)})}aa(t,e){ja(this,t,e),$a(this,t,t=>{this.ga._attachImageVectorListener(t)})}})),zh=class extends Wh{};async function Yh(t,e,r){return za(t,r.canvas??(Ma()?void 0:document.createElement("canvas")),e,r)}function qh(t,e,r,n){if(t.na&&void 0!==n&&Er(t.baseOptions,_o,3)?.g(),t.U){let s=new io;if(r?.regionOfInterest){if(!t.oa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Or(s,1,(i.left+i.right)/2),Or(s,2,(i.top+i.bottom)/2),Or(s,4,i.right-i.left),Or(s,3,i.bottom-i.top)}else Or(s,1,.5),Or(s,2,.5),Or(s,4,1),Or(s,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(Or(s,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[t,n]=Pa(e);r=Fr(s,3)*n/t,i=Fr(s,4)*t/n,Or(s,4,r),Or(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.U,n)}t.g.pa(e,t.X,n??performance.now()),t.finishProcessing(n)}function Jh(t,e,r){if(t.baseOptions?.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");qh(t,e,r,t.C+1)}function Zh(t,e,r,n){if(!t.baseOptions?.g())throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");qh(t,e,r,n)}function Qh(t,e,r,n){var i=e.data,s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new Th([i],r,!1,t.g.i.canvas,t.P,s,e),n?t.clone():t}var tu=class extends eh{constructor(t,e,r,n){super(t),this.g=t,this.X=e,this.U=r,this.oa=n,this.P=new lh}l(t,e=!0){if("runningMode"in t){var r=!!t.runningMode&&"IMAGE"!==t.runningMode;er(this.baseOptions,2,null==r?r:Zt(r))}if(void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};tu.prototype.close=tu.prototype.close;var eu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},br(t=this.h=new bo,0,1,e=new Eo),Or(this.h,2,.5),Or(this.h,3,.3)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"minDetectionConfidence"in t&&Or(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Or(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},Jh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect_in"),Bs(t,"detections");var e=new Rs;qn(e,So,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect_in"),Ns(r,"DETECTIONS:detections"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Js(e),this.j.detections.push(ba(t));Ja(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};eu.prototype.detectForVideo=eu.prototype.G,eu.prototype.detect=eu.prototype.F,eu.prototype.setOptions=eu.prototype.u,eu.createFromModelPath=async function(t,e){return Yh(eu,t,{baseOptions:{modelAssetPath:e}})},eu.createFromModelBuffer=function(t,e){return Yh(eu,t,{baseOptions:{modelAssetBuffer:e}})},eu.createFromOptions=function(t,e){return Yh(eu,t,e)};var ru=Kh([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),nu=Kh([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),iu=Kh([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),su=Kh([474,475],[475,476],[476,477],[477,474]),ou=Kh([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),au=Kh([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),hu=Kh([469,470],[470,471],[471,472],[472,469]),uu=Kh([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),cu=[...ru,...nu,...iu,...ou,...au,...uu],lu=Kh([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function du(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var fu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,br(t=this.h=new Ro,0,1,e=new Eo),this.A=new xo,br(this.h,0,3,this.A),this.o=new bo,br(this.h,0,2,this.o),Nr(this.o,4,1),Or(this.o,2,.5),Or(this.A,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numFaces"in t&&Nr(this.o,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Or(this.o,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Or(this.A,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return du(this),Jh(this,t,e),this.j}G(t,e,r){return du(this),Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"face_landmarks");var e=new Rs;qn(e,Io,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"NORM_LANDMARKS:face_landmarks"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("face_landmarks",(t,e)=>{for(let e of t)t=eo(e),this.j.faceLandmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Ja(this,t)}),this.outputFaceBlendshapes&&(Bs(t,"blendshapes"),Ns(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(t,e)=>{if(this.outputFaceBlendshapes)for(let e of t)t=Ws(e),this.j.faceBlendshapes.push(wa(t.g()??[]));Ja(this,e)}),this.g.attachEmptyPacketListener("blendshapes",t=>{Ja(this,t)})),this.outputFacialTransformationMatrixes&&(Bs(t,"face_geometry"),Ns(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(t,e)=>{if(this.outputFacialTransformationMatrixes)for(let e of t)(t=Er(t=Lo(e),ro,2))&&this.j.facialTransformationMatrixes.push({rows:Rr(t,1)??0??0,columns:Rr(t,2)??0??0,data:sr(t,3,Jt,ir()).slice()??[]});Ja(this,e)}),this.g.attachEmptyPacketListener("face_geometry",t=>{Ja(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};fu.prototype.detectForVideo=fu.prototype.G,fu.prototype.detect=fu.prototype.F,fu.prototype.setOptions=fu.prototype.u,fu.createFromModelPath=function(t,e){return Yh(fu,t,{baseOptions:{modelAssetPath:e}})},fu.createFromModelBuffer=function(t,e){return Yh(fu,t,{baseOptions:{modelAssetBuffer:e}})},fu.createFromOptions=function(t,e){return Yh(fu,t,e)},fu.FACE_LANDMARKS_LIPS=ru,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LIPS",fu.FACE_LANDMARKS_LIPS),fu.FACE_LANDMARKS_LEFT_EYE=nu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYE",fu.FACE_LANDMARKS_LEFT_EYE),fu.FACE_LANDMARKS_LEFT_EYEBROW=iu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",fu.FACE_LANDMARKS_LEFT_EYEBROW),fu.FACE_LANDMARKS_LEFT_IRIS=su,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_IRIS",fu.FACE_LANDMARKS_LEFT_IRIS),fu.FACE_LANDMARKS_RIGHT_EYE=ou,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYE",fu.FACE_LANDMARKS_RIGHT_EYE),fu.FACE_LANDMARKS_RIGHT_EYEBROW=au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",fu.FACE_LANDMARKS_RIGHT_EYEBROW),fu.FACE_LANDMARKS_RIGHT_IRIS=hu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_IRIS",fu.FACE_LANDMARKS_RIGHT_IRIS),fu.FACE_LANDMARKS_FACE_OVAL=uu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_FACE_OVAL",fu.FACE_LANDMARKS_FACE_OVAL),fu.FACE_LANDMARKS_CONTOURS=cu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_CONTOURS",fu.FACE_LANDMARKS_CONTOURS),fu.FACE_LANDMARKS_TESSELATION=lu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_TESSELATION",fu.FACE_LANDMARKS_TESSELATION);var pu=Kh([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function gu(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function mu(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function _u(t,e=!0){var r=[];for(let i of t){var n=Ws(i);t=[];for(let r of n.g())n=e&&null!=Rr(r,1)?Rr(r,1)??0:-1,t.push({score:Fr(r,2)??0,index:n,categoryName:de(Qe(r,3))??""??"",displayName:de(Qe(r,4))??""??""});r.push(t)}return r}var vu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],br(t=this.j=new $o,0,1,e=new Eo),this.o=new Po,br(this.j,0,2,this.o),this.D=new Do,br(this.o,0,3,this.D),this.A=new Mo,br(this.o,0,2,this.A),this.h=new Oo,br(this.j,0,3,this.h),Or(this.A,2,.5),Or(this.o,4,.5),Or(this.D,2,.5)}get baseOptions(){return Er(this.j,Eo,1)}set baseOptions(t){br(this.j,0,1,t)}u(t){if(Nr(this.A,3,t.numHands??1),"minHandDetectionConfidence"in t&&Or(this.A,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.o,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Or(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Co,r=e,n=Ea(t.cannedGesturesClassifierOptions,Er(this.h,Co,3)?.l());br(r,0,2,n),br(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&Er(this.h,Co,3)?.g();return t.customGesturesClassifierOptions?(br(r=e=new Co,0,2,n=Ea(t.customGesturesClassifierOptions,Er(this.h,Co,4)?.l())),br(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&Er(this.h,Co,4)?.g(),this.l(t)}Ia(t,e){return gu(this),Jh(this,t,e),mu(this)}Ja(t,e,r){return gu(this),Zh(this,t,r,e),mu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"hand_gestures"),Bs(t,"hand_landmarks"),Bs(t,"world_hand_landmarks"),Bs(t,"handedness");var e=new Rs;qn(e,Vo,this.j);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"HAND_GESTURES:hand_gestures"),Ns(r,"LANDMARKS:hand_landmarks"),Ns(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ns(r,"HANDEDNESS:handedness"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t){t=eo(e);let r=[];for(let e of wr(t,to,1))r.push({x:Fr(e,1)??0,y:Fr(e,2)??0,z:Fr(e,3)??0,visibility:Fr(e,4)??0});this.landmarks.push(r)}Ja(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t){t=Qs(e);let r=[];for(let e of wr(t,Zs,1))r.push({x:Fr(e,1)??0,y:Fr(e,2)??0,z:Fr(e,3)??0,visibility:Fr(e,4)??0});this.worldLandmarks.push(r)}Ja(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("hand_gestures",(t,e)=>{this.gestures.push(..._u(t,!1)),Ja(this,e)}),this.g.attachEmptyPacketListener("hand_gestures",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{this.handedness.push(..._u(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function yu(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}vu.prototype.recognizeForVideo=vu.prototype.Ja,vu.prototype.recognize=vu.prototype.Ia,vu.prototype.setOptions=vu.prototype.u,vu.createFromModelPath=function(t,e){return Yh(vu,t,{baseOptions:{modelAssetPath:e}})},vu.createFromModelBuffer=function(t,e){return Yh(vu,t,{baseOptions:{modelAssetBuffer:e}})},vu.createFromOptions=function(t,e){return Yh(vu,t,e)},vu.HAND_CONNECTIONS=pu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$gesture_recognizer$gesture_recognizer.GestureRecognizer.HAND_CONNECTIONS",vu.HAND_CONNECTIONS);var Eu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],br(t=this.h=new Po,0,1,e=new Eo),this.o=new Do,br(this.h,0,3,this.o),this.j=new Mo,br(this.h,0,2,this.j),Nr(this.j,3,1),Or(this.j,2,.5),Or(this.o,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numHands"in t&&Nr(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&Or(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Or(this.o,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Jh(this,t,e),yu(this)}G(t,e,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Zh(this,t,r,e),yu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"hand_landmarks"),Bs(t,"world_hand_landmarks"),Bs(t,"handedness");var e=new Rs;qn(e,Ho,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"LANDMARKS:hand_landmarks"),Ns(r,"WORLD_LANDMARKS:world_hand_landmarks"),Ns(r,"HANDEDNESS:handedness"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t)t=eo(e),this.landmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t)t=Qs(e),this.worldLandmarks.push(Sa(t));Ja(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{var r=this.handedness,n=r.push,i=[];for(let e of t){t=Ws(e);let r=[];for(let e of t.g())r.push({score:Fr(e,2)??0,index:Rr(e,1)??0??-1,categoryName:de(Qe(e,3))??""??"",displayName:de(Qe(e,4))??""??""});i.push(r)}n.call(r,...i),Ja(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Eu.prototype.detectForVideo=Eu.prototype.G,Eu.prototype.detect=Eu.prototype.F,Eu.prototype.setOptions=Eu.prototype.u,Eu.createFromModelPath=function(t,e){return Yh(Eu,t,{baseOptions:{modelAssetPath:e}})},Eu.createFromModelBuffer=function(t,e){return Yh(Eu,t,{baseOptions:{modelAssetBuffer:e}})},Eu.createFromOptions=function(t,e){return Yh(Eu,t,e)},Eu.HAND_CONNECTIONS=pu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$hand_landmarker$hand_landmarker.HandLandmarker.HAND_CONNECTIONS",Eu.HAND_CONNECTIONS);var Au=Kh([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function wu(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function Tu(t){try{if(!t.D)return t.h;t.D(t.h)}finally{th(t)}}function bu(t,e){t=eo(t),e.push(ka(t))}var ku=class extends tu{constructor(t,e){super(new zh(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,br(t=this.j=new zo,0,1,e=new Eo),this.I=new Do,br(this.j,0,2,this.I),this.W=new Ko,br(this.j,0,3,this.W),this.o=new bo,br(this.j,0,4,this.o),this.O=new xo,br(this.j,0,5,this.O),this.A=new Xo,br(this.j,0,6,this.A),this.M=new Wo,br(this.j,0,7,this.M),Or(this.o,2,.5),Or(this.o,3,.3),Or(this.O,2,.5),Or(this.A,2,.5),Or(this.A,3,.3),Or(this.M,2,.5),Or(this.I,2,.5)}get baseOptions(){return Er(this.j,Eo,1)}set baseOptions(t){br(this.j,0,1,t)}u(t){return"minFaceDetectionConfidence"in t&&Or(this.o,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&Or(this.o,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&Or(this.O,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&Or(this.A,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&Or(this.A,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&Or(this.M,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&Or(this.I,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.D="function"==typeof e?e:r,wu(this),Jh(this,t,n),Tu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.D="function"==typeof r?r:n,wu(this),Zh(this,t,i,e),Tu(this)}m(){var t=new Gs;Us(t,"input_frames_image"),Bs(t,"pose_landmarks"),Bs(t,"pose_world_landmarks"),Bs(t,"face_landmarks"),Bs(t,"left_hand_landmarks"),Bs(t,"left_hand_world_landmarks"),Bs(t,"right_hand_landmarks"),Bs(t,"right_hand_world_landmarks");var e=new Rs,r=new fs;Dr(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(t,e){if(null!=e)if(Array.isArray(e))er(t,2,Me(e,0,Pe));else{if(!("string"==typeof e||e instanceof N||x(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");dr(t,2,ct(e,!1),F())}}(r,this.j.g());var n=new Os;Dr(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),xr(n,8,fs,r),Cs(n,"IMAGE:input_frames_image"),Ns(n,"POSE_LANDMARKS:pose_landmarks"),Ns(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Ns(n,"FACE_LANDMARKS:face_landmarks"),Ns(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Ns(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Ns(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Ns(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.u(e),$s(t,n),Za(this,t),this.g.attachProtoListener("pose_landmarks",(t,e)=>{bu(t,this.h.poseLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("pose_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("pose_world_landmarks",(t,e)=>{var r=this.h.poseWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("pose_world_landmarks",t=>{Ja(this,t)}),this.outputPoseSegmentationMasks&&(Ns(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Qa(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(t,e)=>{this.h.poseSegmentationMasks=[Qh(this,t,!0,!this.D)],Ja(this,e)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",t=>{this.h.poseSegmentationMasks=[],Ja(this,t)})),this.g.attachProtoListener("face_landmarks",(t,e)=>{bu(t,this.h.faceLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{Ja(this,t)}),this.outputFaceBlendshapes&&(Bs(t,"extra_blendshapes"),Ns(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(t,e)=>{var r=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=Ws(t),r.push(wa(t.g()??[]))),Ja(this,e)}),this.g.attachEmptyPacketListener("extra_blendshapes",t=>{Ja(this,t)})),this.g.attachProtoListener("left_hand_landmarks",(t,e)=>{bu(t,this.h.leftHandLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("left_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("left_hand_world_landmarks",(t,e)=>{var r=this.h.leftHandWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("right_hand_landmarks",(t,e)=>{bu(t,this.h.rightHandLandmarks),Ja(this,e)}),this.g.attachEmptyPacketListener("right_hand_landmarks",t=>{Ja(this,t)}),this.g.attachProtoListener("right_hand_world_landmarks",(t,e)=>{var r=this.h.rightHandWorldLandmarks;t=Qs(t),r.push(Sa(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ku.prototype.detectForVideo=ku.prototype.G,ku.prototype.detect=ku.prototype.F,ku.prototype.setOptions=ku.prototype.u,ku.createFromModelPath=function(t,e){return Yh(ku,t,{baseOptions:{modelAssetPath:e}})},ku.createFromModelBuffer=function(t,e){return Yh(ku,t,{baseOptions:{modelAssetBuffer:e}})},ku.createFromOptions=function(t,e){return Yh(ku,t,e)},ku.HAND_CONNECTIONS=pu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.HAND_CONNECTIONS",ku.HAND_CONNECTIONS),ku.POSE_CONNECTIONS=Au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.POSE_CONNECTIONS",ku.POSE_CONNECTIONS),ku.FACE_LANDMARKS_LIPS=ru,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LIPS",ku.FACE_LANDMARKS_LIPS),ku.FACE_LANDMARKS_LEFT_EYE=nu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYE",ku.FACE_LANDMARKS_LEFT_EYE),ku.FACE_LANDMARKS_LEFT_EYEBROW=iu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",ku.FACE_LANDMARKS_LEFT_EYEBROW),ku.FACE_LANDMARKS_LEFT_IRIS=su,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_IRIS",ku.FACE_LANDMARKS_LEFT_IRIS),ku.FACE_LANDMARKS_RIGHT_EYE=ou,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYE",ku.FACE_LANDMARKS_RIGHT_EYE),ku.FACE_LANDMARKS_RIGHT_EYEBROW=au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",ku.FACE_LANDMARKS_RIGHT_EYEBROW),ku.FACE_LANDMARKS_RIGHT_IRIS=hu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_IRIS",ku.FACE_LANDMARKS_RIGHT_IRIS),ku.FACE_LANDMARKS_FACE_OVAL=uu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_FACE_OVAL",ku.FACE_LANDMARKS_FACE_OVAL),ku.FACE_LANDMARKS_CONTOURS=cu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_CONTOURS",ku.FACE_LANDMARKS_CONTOURS),ku.FACE_LANDMARKS_TESSELATION=lu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_TESSELATION",ku.FACE_LANDMARKS_TESSELATION);var Su=class extends tu{constructor(t,e){super(new zh(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},br(t=this.h=new Jo,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return br(this.h,0,2,Ea(t,Er(this.h,fo,2))),this.l(t)}sa(t,e){return this.j={classifications:[]},Jh(this,t,e),this.j}ta(t,e,r){return this.j={classifications:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"input_image"),Us(t,"norm_rect"),Bs(t,"classifications");var e=new Rs;qn(e,Zo,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Cs(r,"IMAGE:input_image"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"CLASSIFICATIONS:classifications"),r.u(e),$s(t,r),this.g.attachProtoListener("classifications",(t,e)=>{this.j=Ta(oo(t)),Ja(this,e)}),this.g.attachEmptyPacketListener("classifications",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Su.prototype.classifyForVideo=Su.prototype.ta,Su.prototype.classify=Su.prototype.sa,Su.prototype.setOptions=Su.prototype.u,Su.createFromModelPath=function(t,e){return Yh(Su,t,{baseOptions:{modelAssetPath:e}})},Su.createFromModelBuffer=function(t,e){return Yh(Su,t,{baseOptions:{modelAssetBuffer:e}})},Su.createFromOptions=function(t,e){return Yh(Su,t,e)};var Lu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!0),this.h=new Qo,this.embeddings={embeddings:[]},br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){var e=this.h,r=Er(this.h,go,2);if(r=r?r.clone():new go,void 0!==t.l2Normalize){var n=t.l2Normalize;er(r,1,null==n?n:Zt(n))}else"l2Normalize"in t&&er(r,1);return void 0!==t.quantize?er(r,2,null==(n=t.quantize)?n:Zt(n)):"quantize"in t&&er(r,2),br(e,0,2,r),this.l(t)}za(t,e){return Jh(this,t,e),this.embeddings}Aa(t,e,r){return Zh(this,t,r,e),this.embeddings}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"embeddings_out");var e=new Rs;qn(e,ta,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"EMBEDDINGS:embeddings_out"),r.u(e),$s(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=lo(t),this.embeddings=function(t){return{embeddings:wr(t,uo,1).map(t=>{var e={headIndex:Rr(t,3)??0??-1,headName:de(Qe(t,4))??""??""};if(nr(t,ao,1,co))t=sr(t=Ir(t,ao,1),1,Jt,ir()),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Ir(t,ho,2)?.g()?.h()??r}return e}),timestampMs:Aa(Qe(t,2,void 0,void 0,ue)??Je)}}(t),Ja(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Lu.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=xa(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=xa(La(t.quantizedEmbedding),La(e.quantizedEmbedding))}return t},Lu.prototype.embedForVideo=Lu.prototype.Aa,Lu.prototype.embed=Lu.prototype.za,Lu.prototype.setOptions=Lu.prototype.u,Lu.createFromModelPath=function(t,e){return Yh(Lu,t,{baseOptions:{modelAssetPath:e}})},Lu.createFromModelBuffer=function(t,e){return Yh(Lu,t,{baseOptions:{modelAssetBuffer:e}})},Lu.createFromOptions=function(t,e){return Yh(Lu,t,e)};var xu=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function Ru(t){var e=function(t){return wr(t,Os,1)}(t.ca()).filter(t=>(de(Qe(t,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.o=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(Er(e[0],Rs,7)?.j()?.g()??new Map).forEach((e,r)=>{t.o[Number(r)]=de(Qe(e,1))??""})}function Fu(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Iu(t){try{let e=new xu(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{th(t)}}xu.prototype.close=xu.prototype.close;var Cu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.o=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new sa,this.A=new ea,br(this.h,0,3,this.A),br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?er(this.h,2,le(t.displayNamesLocale)):"displayNamesLocale"in t&&er(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}L(){Ru(this)}segment(t,e,r){var n="function"!=typeof e?e:{};return this.j="function"==typeof e?e:r,Fu(this),Jh(this,t,n),Iu(this)}Ma(t,e,r,n){var i="function"!=typeof r?r:{};return this.j="function"==typeof r?r:n,Fu(this),Zh(this,t,i,e),Iu(this)}Da(){return this.o}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect");var e=new Rs;qn(e,oa,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),r.u(e),$s(t,r),Za(this,t),this.outputConfidenceMasks&&(Bs(t,"confidence_masks"),Ns(r,"CONFIDENCE_MASKS:confidence_masks"),Qa(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Qh(this,t,!0,!this.j)),Ja(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Ja(this,t)})),this.outputCategoryMask&&(Bs(t,"category_mask"),Ns(r,"CATEGORY_MASK:category_mask"),Qa(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Qh(this,t,!1,!this.j),Ja(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Ja(this,t)})),Bs(t,"quality_scores"),Ns(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Ja(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Cu.prototype.getLabels=Cu.prototype.Da,Cu.prototype.segmentForVideo=Cu.prototype.Ma,Cu.prototype.segment=Cu.prototype.segment,Cu.prototype.setOptions=Cu.prototype.u,Cu.createFromModelPath=function(t,e){return Yh(Cu,t,{baseOptions:{modelAssetPath:e}})},Cu.createFromModelBuffer=function(t,e){return Yh(Cu,t,{baseOptions:{modelAssetBuffer:e}})},Cu.createFromOptions=function(t,e){return Yh(Cu,t,e)};var Nu={0:0,1:1,2:2,3:3};function Ou(){return Ma()?void 0:document.createElement("canvas")}var Mu=class extends eh{constructor(t,e){super(new Xa(t,e)),this.o=new lh,this.delegate="CPU",this.h=0,this.baseOptions=new Eo,this.j=0}get i(){return this.g.i}u(t){return this.delegate=t.baseOptions?.delegate??"CPU",super.l(t)}Na(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e;if(0!==this.j&&(this.i._free(this.j),this.j=0),!(e="undefined"!=typeof ImageData&&t instanceof ImageData))if("object"!=typeof t||null===t)e=!1;else{e=t.data;var r=t.width,n=t.height;e=Number.isInteger(r)&&r>0&&Number.isInteger(n)&&n>0&&(e instanceof Uint8ClampedArray||e instanceof Uint8Array)}if(e)e=t.width,r=t.height,t=t.data;else{if([e,r]=Pa(t),"undefined"!=typeof OffscreenCanvas)n=new OffscreenCanvas(e,r);else{if("undefined"==typeof document)throw Error("Canvas is not supported in this environment.");n=document.createElement("canvas")}if(n.width=e,n.height=r,!(n=n.getContext("2d")))throw Error("Canvas 2D context is not supported in this environment.");n.drawImage(t,0,0),t=n.getImageData(0,0,e,r).data}if(!t)throw Error("Unsupported image source or failed to extract image pixels.");n=function({Ha:t,width:e,height:r}){if(e<=0||r<=0)throw Error(`Invalid image dimensions: ${e}x${r}. Dimensions must be positive.`);if(t%(e*r)!==0)throw Error(`Invalid image dimensions or pixel data length. Pixel data length ${t} is not a multiple of the number of pixels (${e*r}).`);if(4!==(t/=e*r)&&3!==t&&1!==t)throw Error(`Invalid image dimensions or pixel data length. Calculated channels: ${t}. Expected 1, 3, or 4.`);return t}({Ha:t.length,width:e,height:r});var i=this.i._malloc(t.length);if(this.i.HEAPU8.set(t,i),this.j=i,!this.i._interactive_segmenter_set_image(this.h,i,e,r,n))throw Error("Failed to set image on native engine.")}segment(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e=function(t){t=t.map(({isCompleted:t,brushMode:e,point:r})=>{e=Nu[e]??0,r=r.map(({x:t,y:e})=>{var r=new aa;return Mr(r,1,t),Mr(r,2,e),r});var n=new ha;if(Cr(n,t),null==e)t=e;else{if(!Wt(e))throw P("enum");t=0|e}return dr(n,1,t,0),Sr(n,2,r),n});var e=new ua;return Sr(e,1,t),ca(e)}(t);t=this.i._malloc(e.length),this.i.HEAPU8.set(e,t);var r=this.i._malloc(12),n=r+4,i=r+8,s=0;try{if(0===(s=this.i._interactive_segmenter_segment(this.h,t,e.length,r,n,i)))throw Error("Segmentation failed.");let h=this.i.HEAPU32[r/4],u=this.i.HEAPU32[n/4];var o=new Float32Array(this.i.HEAPU8.buffer,s,this.i.HEAPU32[i/4]/4),a=new Float32Array(o);if(o=h*u,(a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return new Th([a],!0,!1,this.g.i.canvas??void 0,this.o,h,u)}finally{0!==t&&this.i._free(t),0!==r&&this.i._free(r),0!==s&&this.i._free(s)}}m(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0);var t=new _o;if("GPU"===this.delegate){var e=new As;kr(t,2,vo,e)}else Nr(e=new Ls,1,4),kr(t,1,vo,e);if(br(this.baseOptions,0,3,t),t=To(this.baseOptions),e=this.i._malloc(t.length),this.i.HEAPU8.set(t,e),this.h=this.i._interactive_segmenter_create(e,t.length),this.i._free(e),0===this.h)throw Error("Failed to create native InteractiveSegmenter engine.")}close(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0),this.o.close(),super.close()}};Mu.prototype.close=Mu.prototype.close,Mu.prototype.segment=Mu.prototype.segment,Mu.prototype.setImage=Mu.prototype.Na,Mu.prototype.setOptions=Mu.prototype.u,Mu.createFromModelPath=function(t,e){return za(Mu,Ou(),t,{baseOptions:{modelAssetPath:e}})},Mu.createFromModelBuffer=function(t,e){return za(Mu,Ou(),t,{baseOptions:{modelAssetBuffer:e}})},Mu.createFromOptions=function(t,e){var r=e.canvas??Ou();return za(Mu,r,t,e)};var Du=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};Du.prototype.close=Du.prototype.close;var Pu=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new sa,this.o=new ea,br(this.h,0,3,this.o),br(t=this.h,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,r,n){var i="function"!=typeof r?r:{};if(this.j="function"==typeof r?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new pa,e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var s=new la;Cr(s,!0),Mr(s,1,e.keypoint.x),Mr(s,2,e.keypoint.y),kr(n,1,ga,s)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");{let t=new fa;for(s of e.scribble)Cr(e=new la,!0),Mr(e,1,s.x),Mr(e,2,s.y),xr(t,1,la,e);kr(n,2,ga,t)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter_legacy.proto.RegionOfInterest","roi_in",r),Jh(this,t,i);t:{try{let t=new Du(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=t;break t}this.j(t)}finally{th(this)}o=void 0}return o}m(){var t=new Gs;Us(t,"image_in"),Us(t,"roi_in"),Us(t,"norm_rect_in");var e=new Rs;qn(e,oa,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.interactive_segmenter_legacy.InteractiveSegmenterGraphV2"),Cs(r,"IMAGE:image_in"),Cs(r,"ROI:roi_in"),Cs(r,"NORM_RECT:norm_rect_in"),r.u(e),$s(t,r),Za(this,t),this.outputConfidenceMasks&&(Bs(t,"confidence_masks"),Ns(r,"CONFIDENCE_MASKS:confidence_masks"),Qa(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Qh(this,t,!0,!this.j)),Ja(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],Ja(this,t)})),this.outputCategoryMask&&(Bs(t,"category_mask"),Ns(r,"CATEGORY_MASK:category_mask"),Qa(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Qh(this,t,!1,!this.j),Ja(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,Ja(this,t)})),Bs(t,"quality_scores"),Ns(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,Ja(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Pu.prototype.segment=Pu.prototype.segment,Pu.prototype.setOptions=Pu.prototype.u,Pu.createFromModelPath=function(t,e){return Yh(Pu,t,{baseOptions:{modelAssetPath:e}})},Pu.createFromModelBuffer=function(t,e){return Yh(Pu,t,{baseOptions:{modelAssetBuffer:e}})},Pu.createFromOptions=function(t,e){return Yh(Pu,t,e)};var $u=class extends tu{constructor(t,e){super(new zh(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},br(t=this.h=new ma,0,1,e=new Eo)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?er(this.h,2,le(t.displayNamesLocale)):"displayNamesLocale"in t&&er(this.h,2),void 0!==t.maxResults?Nr(this.h,3,t.maxResults):"maxResults"in t&&er(this.h,3),void 0!==t.scoreThreshold?Or(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&er(this.h,4),void 0!==t.categoryAllowlist?Pr(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&er(this.h,5),void 0!==t.categoryDenylist?Pr(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&er(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},Jh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Zh(this,t,r,e),this.j}m(){var t=new Gs;Us(t,"input_frame_gpu"),Us(t,"norm_rect"),Bs(t,"detections");var e=new Rs;qn(e,_a,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),Cs(r,"IMAGE:input_frame_gpu"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"DETECTIONS:detections"),r.u(e),$s(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=Js(e),this.j.detections.push(ba(t));Ja(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{Ja(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};$u.prototype.detectForVideo=$u.prototype.G,$u.prototype.detect=$u.prototype.F,$u.prototype.setOptions=$u.prototype.u,$u.createFromModelPath=async function(t,e){return Yh($u,t,{baseOptions:{modelAssetPath:e}})},$u.createFromModelBuffer=function(t,e){return Yh($u,t,{baseOptions:{modelAssetBuffer:e}})},$u.createFromOptions=function(t,e){return Yh($u,t,e)};var Uu=class{constructor(t,e,r){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function Bu(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Gu(t){try{let e=new Uu(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.o)return e;t.o(e)}finally{th(t)}}Uu.prototype.close=Uu.prototype.close;var ju=class extends tu{constructor(t,e){super(new zh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,br(t=this.h=new va,0,1,e=new Eo),this.A=new Wo,br(this.h,0,3,this.A),this.j=new Xo,br(this.h,0,2,this.j),Nr(this.j,4,1),Or(this.j,2,.5),Or(this.A,2,.5),Or(this.h,4,.5)}get baseOptions(){return Er(this.h,Eo,1)}set baseOptions(t){br(this.h,0,1,t)}u(t){return"numPoses"in t&&Nr(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Or(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Or(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Or(this.A,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.o="function"==typeof e?e:r,Bu(this),Jh(this,t,n),Gu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.o="function"==typeof r?r:n,Bu(this),Zh(this,t,i,e),Gu(this)}m(){var t=new Gs;Us(t,"image_in"),Us(t,"norm_rect"),Bs(t,"normalized_landmarks"),Bs(t,"world_landmarks"),Bs(t,"segmentation_masks");var e=new Rs;qn(e,ya,this.h);var r=new Os;Dr(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Cs(r,"IMAGE:image_in"),Cs(r,"NORM_RECT:norm_rect"),Ns(r,"NORM_LANDMARKS:normalized_landmarks"),Ns(r,"WORLD_LANDMARKS:world_landmarks"),r.u(e),$s(t,r),Za(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(t,e)=>{this.landmarks=[];for(let e of t)t=eo(e),this.landmarks.push(ka(t));Ja(this,e)}),this.g.attachEmptyPacketListener("normalized_landmarks",t=>{this.landmarks=[],Ja(this,t)}),this.g.attachProtoVectorListener("world_landmarks",(t,e)=>{this.worldLandmarks=[];for(let e of t)t=Qs(e),this.worldLandmarks.push(Sa(t));Ja(this,e)}),this.g.attachEmptyPacketListener("world_landmarks",t=>{this.worldLandmarks=[],Ja(this,t)}),this.outputSegmentationMasks&&(Ns(r,"SEGMENTATION_MASK:segmentation_masks"),Qa(this,"segmentation_masks"),this.g.aa("segmentation_masks",(t,e)=>{this.segmentationMasks=t.map(t=>Qh(this,t,!0,!this.o)),Ja(this,e)}),this.g.attachEmptyPacketListener("segmentation_masks",t=>{this.segmentationMasks=[],Ja(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ju.prototype.detectForVideo=ju.prototype.G,ju.prototype.detect=ju.prototype.F,ju.prototype.setOptions=ju.prototype.u,ju.createFromModelPath=function(t,e){return Yh(ju,t,{baseOptions:{modelAssetPath:e}})},ju.createFromModelBuffer=function(t,e){return Yh(ju,t,{baseOptions:{modelAssetBuffer:e}})},ju.createFromOptions=function(t,e){return Yh(ju,t,e)},ju.POSE_CONNECTIONS=Au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$pose_landmarker$pose_landmarker.PoseLandmarker.POSE_CONNECTIONS",ju.POSE_CONNECTIONS);export{Oh as DrawingUtils,eu as FaceDetector,fu as FaceLandmarker,Na as FilesetResolver,vu as GestureRecognizer,Eu as HandLandmarker,ku as HolisticLandmarker,Su as ImageClassifier,Lu as ImageEmbedder,Cu as ImageSegmenter,xu as ImageSegmenterResult,Mu as InteractiveSegmenter,Pu as InteractiveSegmenterLegacy,Du as InteractiveSegmenterLegacyResult,Vh as MPImage,Th as MPMask,$u as ObjectDetector,ju as PoseLandmarker,eh as TaskRunner,tu as VisionTaskRunner};
|
|
1
|
+
var t="undefined"!=typeof self?self:{};function e(e,r){t:{for(var n=["CLOSURE_FLAGS"],i=t,s=0;s<n.length;s++)if(null==(i=i[n[s]])){n=null;break t}n=i}return null!=(e=n&&n[e])?e:r}function r(e,r){e=e.split(".");for(var n,i=t;e.length&&(n=e.shift());)e.length||void 0===r?i=i[n]&&i[n]!==Object.prototype[n]?i[n]:i[n]={}:i[n]=r}function n(){throw Error("Invalid UTF8")}function i(t,e){return e=String.fromCharCode.apply(null,e),null==t?e:t+e}var s,o,a=void 0,h="undefined"!=typeof TextDecoder,u="undefined"!=typeof TextEncoder;function c(t){if(u)t=(o||=new TextEncoder).encode(t);else{let r=0,n=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)n[r++]=e;else{if(e<2048)n[r++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){let s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,n[r++]=e>>18|240,n[r++]=e>>12&63|128,n[r++]=e>>6&63|128,n[r++]=63&e|128;continue}i--}e=65533}n[r++]=e>>12|224,n[r++]=e>>6&63|128}n[r++]=63&e|128}}t=r===n.length?n:n.subarray(0,r)}return t}function l(e){t.setTimeout(()=>{throw e},0)}var d=e(610401301,!1),f=e(748402147,!0);function p(){var e=t.navigator;return e&&(e=e.userAgent)?e:""}var g,m=t.navigator;function _(t){return _[" "](t),t}g=m&&m.userAgentData||null,_[" "]=function(){};var v={},y=null;function E(t){var e=t.length,r=3*e/4;r%3?r=Math.floor(r):-1!="=.".indexOf(t[e-1])&&(r=-1!="=.".indexOf(t[e-2])?r-2:r-1);var n=new Uint8Array(r),i=0;return function(t,e){function r(e){for(;n<t.length;){let e=t.charAt(n++),r=y[e];if(null!=r)return r;if(!/^[\s\xa0]*$/.test(e))throw Error("Unknown base64 encoding at char: "+e)}return e}A();for(var n=0;;){let t=r(-1),n=r(0),i=r(64),s=r(64);if(64===s&&-1===t)break;e(t<<2|n>>4),64!=i&&(e(n<<4&240|i>>2),64!=s&&e(i<<6&192|s))}}(t,function(t){n[i++]=t}),i!==r?n.subarray(0,i):n}function A(){if(!y){y={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){let n=t.concat(e[r].split(""));v[r]=n;for(let t=0;t<n.length;t++){let e=n[t];void 0===y[e]&&(y[e]=t)}}}}var w="undefined"!=typeof Uint8Array,T=!(!(d&&g&&g.brands.length>0)&&(-1!=p().indexOf("Trident")||-1!=p().indexOf("MSIE")))&&"function"==typeof btoa,b=/[-_.]/g,k={"-":"+",_:"/",".":"="};function S(t){return k[t]||""}function L(t){if(!T)return E(t);t=b.test(t)?t.replace(b,S):t,t=atob(t);var e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function x(t){return w&&null!=t&&t instanceof Uint8Array}var R={};function F(){return C||=new N(null,R)}function I(t){O(R);var e=t.g;return null==(e=null==e||x(e)?e:"string"==typeof e?L(e):null)?e:t.g=e}var C,N=class{h(){return new Uint8Array(I(this)||0)}constructor(t,e){if(O(e),this.g=t,null!=t&&0===t.length)throw Error("ByteString should be constructed with non-empty values")}};function O(t){if(t!==R)throw Error("illegal external caller")}function M(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}var D=void 0;function P(t){return M(t=Error(t),"warning"),t}function $(t,e){if(null!=t){var r=D??={},n=r[t]||0;n>=e||(r[t]=n+1,M(t=Error(),"incident"),l(t))}}function U(){return"function"==typeof BigInt}var B="function"==typeof Symbol&&"symbol"==typeof Symbol();function G(t,e,r=!1){return"function"==typeof Symbol&&"symbol"==typeof Symbol()?r&&Symbol.for&&t?Symbol.for(t):null!=t?Symbol(t):Symbol():e}var j,V=G("jas",void 0,!0),H=G(void 0,"0di"),K=G(void 0,"1oa"),X=G(void 0,Symbol()),W=G(void 0,"0ub"),z=G(void 0,"0ubs"),Y=G(void 0,"0ubsb"),q=G(void 0,"0actk"),J=G("m_m","Sa",!0),Z=G(),Q={Ha:{value:0,configurable:!0,writable:!0,enumerable:!1}},tt=Object.defineProperties,et=B?V:"Ha",rt=[];function nt(t,e){B||et in t||tt(t,Q),t[et]|=e}function it(t,e){B||et in t||tt(t,Q),t[et]=e}function st(t){return nt(t,34),t}function ot(t){return nt(t,8192),t}it(rt,7),j=Object.freeze(rt);var at={};function ht(t,e){return void 0===e?t.h!==ut&&!!(2&t.v[et]):!!(2&e)&&t.h!==ut}var ut={};function ct(t,e){if(null!=t)if("string"==typeof t)t=t?new N(t,R):F();else if(t.constructor!==N)if(x(t))t=t.length?new N(new Uint8Array(t),R):F();else{if(!e)throw Error();t=void 0}return t}class lt{constructor(t,e,r){this.g=t,this.h=e,this.l=r}next(){var t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var dt=Object.freeze({});function ft(t,e,r){var n,i=128&e?0:-1,s=t.length;(n=!!s)&&(n=null!=(n=t[s-1])&&"object"==typeof n&&n.constructor===Object);var o=s+(n?-1:0);for(e=128&e?1:0;e<o;e++)r(e-i,t[e]);if(n){t=t[s-1];for(let e in t)!isNaN(e)&&r(+e,t[e])}}var pt={};function gt(t){return 128&t?pt:void 0}function mt(t){return t.Qa=!0,t}var _t=mt(t=>"number"==typeof t),vt=mt(t=>"string"==typeof t),yt=mt(t=>"boolean"==typeof t),Et="function"==typeof t.BigInt&&"bigint"==typeof t.BigInt(0);function At(t){var e=t;if(vt(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(_t(e)&&!Number.isSafeInteger(e))throw Error(String(e));return Et?BigInt(t):t=yt(t)?t?"1":"0":vt(t)?t.trim()||"0":String(t)}var wt=mt(t=>Et?t>=bt&&t<=St:"-"===t[0]?Lt(t,Tt):Lt(t,kt)),Tt=Number.MIN_SAFE_INTEGER.toString(),bt=Et?BigInt(Number.MIN_SAFE_INTEGER):void 0,kt=Number.MAX_SAFE_INTEGER.toString(),St=Et?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Lt(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let r=0;r<t.length;r++){let n=t[r],i=e[r];if(n>i)return!1;if(n<i)return!0}}var xt,Rt="function"==typeof Uint8Array.prototype.slice,Ft=0,It=0;function Ct(t){var e=t>>>0;Ft=e,It=(t-e)/4294967296>>>0}function Nt(t){if(t<0){Ct(-t);let[e,r]=jt(Ft,It);Ft=e>>>0,It=r>>>0}else Ct(t)}function Ot(t){var e=xt||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),It=0,Ft=e.getUint32(0,!0)}function Mt(t,e){var r=4294967296*e+(t>>>0);return Number.isSafeInteger(r)?r:$t(t,e)}function Dt(t,e){return At(U()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):$t(t,e))}function Pt(t,e){return U()?At(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):At(Bt(t,e))}function $t(t,e){if(t>>>=0,(e>>>=0)<=2097151)var r=""+(4294967296*e+t);else U()?r=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(r=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),r+=8147497*e,e*=2,t>=1e7&&(r+=t/1e7>>>0,t%=1e7),r>=1e7&&(e+=r/1e7>>>0,r%=1e7),r=e+Ut(r)+Ut(t));return r}function Ut(t){return t=String(t),"0000000".slice(t.length)+t}function Bt(t,e){if(2147483648&e)if(U())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{let[r,n]=jt(t,e);t="-"+$t(r,n)}else t=$t(t,e);return t}function Gt(t){if(t.length<16)Nt(Number(t));else if(U())t=BigInt(t),Ft=Number(t&BigInt(4294967295))>>>0,It=Number(t>>BigInt(32)&BigInt(4294967295));else{let e=+("-"===t[0]);It=Ft=0;let r=t.length;for(let n=e,i=(r-e)%6+e;i<=r;n=i,i+=6){let e=Number(t.slice(n,i));It*=1e6,(Ft=1e6*Ft+e)>=4294967296&&(It+=Math.trunc(Ft/4294967296),It>>>=0,Ft>>>=0)}if(e){let[t,e]=jt(Ft,It);Ft=t,It=e}}}function jt(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Vt(t){return Array.prototype.slice.call(t)}var Ht="function"==typeof BigInt?BigInt.asIntN:void 0,Kt="function"==typeof BigInt?BigInt.asUintN:void 0,Xt=Number.isSafeInteger,Wt=Number.isFinite,zt=Math.trunc,Yt=At(0);function qt(t){if("number"!=typeof t)throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function Jt(t){return null==t||"number"==typeof t?t:"NaN"===t||"Infinity"===t||"-Infinity"===t?Number(t):void 0}function Zt(t){if("boolean"!=typeof t){var e=typeof t;throw Error(`Expected boolean but got ${"object"!=e?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}var Qt=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function te(t){switch(typeof t){case"bigint":return!0;case"number":return Wt(t);case"string":return Qt.test(t);default:return!1}}function ee(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Wt(t)?0|t:void 0}function re(t){if(null==t)return t;if("string"==typeof t&&t)t=+t;else if("number"!=typeof t)return;return Wt(t)?t>>>0:void 0}function ne(t){var e=t.length;return("-"===t[0]?e<20||20===e&&t<="-9223372036854775808":e<19||19===e&&t<="9223372036854775807")?t:(Gt(t),Bt(Ft,It))}function ie(t){if(t=zt(t),!Xt(t)){Nt(t);var e=Ft,r=It;(t=2147483648&r)&&(r=~r>>>0,0==(e=1+~e>>>0)&&(r=r+1>>>0)),t="number"==typeof(e=Mt(e,r))?t?-e:e:t?"-"+e:e}return t}function se(t){var e=zt(Number(t));return Xt(e)?String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),ne(t))}function oe(t){var e=zt(Number(t));return Xt(e)?At(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),U()?At(Ht(64,BigInt(t))):At(ne(t)))}function ae(t){return Xt(t)?t=At(ie(t)):(t=zt(t),Xt(t)?t=String(t):(Nt(t),t=Bt(Ft,It)),t=At(t)),t}function he(t){var e=typeof t;return null==t?t:"bigint"===e?At(Ht(64,t)):te(t)?"string"===e?oe(t):ae(t):void 0}function ue(t){if("string"!=typeof t)throw Error();return t}function ce(t){if(null!=t&&"string"!=typeof t)throw Error();return t}function le(t){return null==t||"string"==typeof t?t:void 0}function de(t,e,r,n){return null!=t&&t[J]===at?t:Array.isArray(t)?((n=(r=0|t[et])|32&n|2&n)!==r&&it(t,n),new e(t)):(r?2&n?((t=e[H])||(st((t=new e).v),t=e[H]=t),e=t):e=new e:e=void 0,e)}function fe(t,e,r){if(e)t:{if(!te(e=t))throw P("int64");switch(typeof e){case"string":e=oe(e);break t;case"bigint":e=At(Ht(64,e));break t;default:e=ae(e)}}else e=he(t);return null==(t=e)?r?Yt:void 0:t}function pe(t){return t}var ge={},me=function(){try{return _(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class _e{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,e){return this.g.set(t,e),this.size=this.g.size,this}delete(t){return t=this.g.delete(t),this.size=this.g.size,t}clear(){this.g.clear(),this.size=this.g.size}has(t){return this.g.has(t)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(t,e){return this.g.forEach(t,e)}[Symbol.iterator](){return this.entries()}}var ve=me?(Object.setPrototypeOf(_e.prototype,Map.prototype),Object.defineProperties(_e.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),_e):class extends Map{constructor(){super()}};function ye(t){return t}function Ee(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var Ae,we=class extends ve{constructor(t,e,r=ye,n=ye){super(),this.J=0|t[et],this.K=e,this.S=r,this.fa=this.K?Te:n;for(let i=0;i<t.length;i++){let s=t[i],o=r(s[0],!1,!0),a=s[1];e?void 0===a&&(a=null):a=n(s[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}W(t){return ot(Array.from(super.entries(),t))}clear(){Ee(this),super.clear()}delete(t){return Ee(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new lt(t,be,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new lt(t,we.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach((r,n,i)=>{t.call(e,i.get(n),n,i)}):super.forEach(t,e)}set(t,e){return Ee(this),null==(t=this.S(t,!0,!1))?this:null==e?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Pa(t){var e=this.S(t[0],!1,!0);t=t[1],t=this.K?void 0===t?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);var e=super.get(t);if(void 0!==e){var r=this.K;return r?((r=this.fa(e,!1,!0,r,this.sa,this.J))!==e&&super.set(t,r),r):e}}[Symbol.iterator](){return this.entries()}};function Te(t,e,r,n,i,s){return t=de(t,n,r,s),i&&(t=Ke(t)),t}function be(t){return[t,this.get(t)]}function ke(){return Ae||=new we(st([]),void 0,void 0,void 0,ge)}function Se(t){return X?t[X]:void 0}function Le(t,e){for(let r in t)!isNaN(r)&&e(t,+r,t[r])}we.prototype.toJSON=void 0;var xe,Re,Fe,Ie=class{},Ce={Ma:!0};function Ne(t,e){e<100||$(z,1)}function Oe(t,e,r,n){var i=void 0!==n;n=!!n;var s,o=X;!i&&B&&o&&(s=t[o])&&Le(s,Ne),o=[];var a=t.length;s=4294967295;var h=!1,u=!!(64&e),c=u?128&e?0:-1:void 0;if(!(1&e)){var l=a&&t[a-1];null!=l&&"object"==typeof l&&l.constructor===Object?s=--a:l=void 0,!u||128&e||i||(h=!0,s=(xe??pe)(s-c,c,t,l,void 0)+c)}e=void 0;for(var d=0;d<a;d++){let i=t[d];if(null!=i&&null!=(i=r(i,n)))if(u&&d>=s){let t=d-c;(e??={})[t]=i}else o[d]=i}if(l)for(let t in l){if(null==(a=l[t])||null==(a=r(a,n)))continue;let i;d=+t,u&&!Number.isNaN(d)&&(i=d+c)<s?o[i]=a:(e??={})[t]=a}return e&&(h?o.push(e):o[s]=e),i&&X&&(t=Se(t))&&t instanceof Ie&&(o[X]=function(t){var e=new Ie;return Le(t,(t,r,n)=>{e[r]=Vt(n)}),e.da=t.da,e}(t)),o}function Me(t){return t[0]=De(t[0]),t[1]=De(t[1]),t}function De(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return wt(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[et];return 0===t.length&&1&e?void 0:Oe(t,e,De)}if(null!=t&&t[J]===at)return Pe(t);if(t instanceof N){if(null==(e=t.g))t="";else if("string"==typeof e)t=e;else{if(T){for(var r="",n=0,i=e.length-10240;n<i;)r+=String.fromCharCode.apply(null,e.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?e.subarray(n):e),e=btoa(r)}else{void 0===r&&(r=0),A(),r=v[r],n=Array(Math.floor(e.length/3)),i=r[64]||"";let t=0,u=0;for(;t<e.length-2;t+=3){var s=e[t],o=e[t+1],a=e[t+2],h=r[s>>2];s=r[(3&s)<<4|o>>4],o=r[(15&o)<<2|a>>6],a=r[63&a],n[u++]=h+s+o+a}switch(h=0,a=i,e.length-t){case 2:a=r[(15&(h=e[t+1]))<<2]||i;case 1:e=e[t],n[u]=r[e>>2]+r[(3&e)<<4|h>>4]+a+i}e=n.join("")}t=t.g=e}return t}return t instanceof we?t=0!==t.size?t.W(Me):void 0:void 0}return t}function Pe(t){return Oe(t=t.v,0|t[et],De)}function $e(t,e){return Ue(t,e[0],e[1])}function Ue(t,e,r,n=0){if(null==t){var i=32;r?(t=[r],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[et],f&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&function(){if(f)throw Error("carr");$(q,5)}(),256&i)throw Error("farr");if(64&i)return(i|n)!==i&&it(t,i|n),t;if(r&&(i|=128,r!==t[0]))throw Error("mid");t:{i|=64;var s=(r=t).length;if(s){var o=s-1;let t=r[o];if(null!=t&&"object"==typeof t&&t.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in t)(s=+a)<o&&(r[s+e]=t[a],delete t[a]);i=-16760833&i|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return it(t,64|i|n),t}function Be(t,e){if("object"!=typeof t)return t;if(Array.isArray(t)){var r=0|t[et];return 0===t.length&&1&r?void 0:Ge(t,r,e)}if(null!=t&&t[J]===at)return Ve(t);if(t instanceof we){if(2&(e=t.J))return t;if(!t.size)return;if(r=st(t.W()),t.K)for(t=0;t<r.length;t++){let n=r[t],i=n[1];i=null==i||"object"!=typeof i?void 0:null!=i&&i[J]===at?Ve(i):Array.isArray(i)?Ge(i,0|i[et],!!(32&e)):void 0,n[1]=i}return r}return t instanceof N?t:void 0}function Ge(t,e,r){return 2&e||(!r||4096&e||16&e?t=He(t,e,!1,r&&!(16&e)):(nt(t,34),4&e&&Object.freeze(t))),t}function je(t,e,r){return t=new t.constructor(e),r&&(t.h=ut),t.m=ut,t}function Ve(t){var e=t.v,r=0|e[et];return ht(t,r)?t:Ye(t,e,r)?je(t,e):He(e,r)}function He(t,e,r,n){return n??=!!(34&e),t=Oe(t,e,Be,n),n=32,r&&(n|=2),it(t,e=16769217&e|n),t}function Ke(t){var e=t.v,r=0|e[et];return ht(t,r)?Ye(t,e,r)?je(t,e,!0):new t.constructor(He(e,r,!1)):t}function Xe(t){if(t.h!==ut)return!1;var e=t.v;return nt(e=He(e,0|e[et]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function We(t){if(!Xe(t)&&ht(t,0|t.v[et]))throw Error()}function ze(t,e){void 0===e&&(e=0|t[et]),32&e&&!(4096&e)&&it(t,4096|e)}function Ye(t,e,r){return!!(2&r)||!(!(32&r)||4096&r)&&(it(e,2|r),t.h=ut,!0)}var qe=At(0),Je={};function Ze(t,e,r,n){if(null!==(e=Qe(t.v,e,void 0,n))||r&&t.m!==ut)return e}function Qe(t,e,r,n){if(-1===e)return null;var i=e+(r?0:-1),s=t.length-1;if(!(s<1+(r?0:-1))){if(i>=s){var o=t[s];if(null!=o&&"object"==typeof o&&o.constructor===Object){r=o[e];var a=!0}else{if(i!==s)return;r=o}}else r=t[i];if(n&&null!=r){if(null==(n=n(r)))return n;if(!Object.is(n,r))return a?o[e]=n:t[i]=n,n}return r}}function tr(t,e,r,n){We(t),er(t=t.v,0|t[et],e,r,n)}function er(t,e,r,n,i){var s=r+(i?0:-1),o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){let i=t[o];if(null!=i&&"object"==typeof i&&i.constructor===Object)return i[r]=n,e}return s<=o?(t[s]=n,e):(void 0!==n&&(r>=(o=(e??=0|t[et])>>14&1023||536870912)?null!=n&&(t[o+(i?0:-1)]={[r]:n}):t[s]=n),e)}function rr(t,e,r,n){var i=t.v;return void 0!==vr(i,0|i[et],e,t=fr(t,n)===r?r:-1)}function nr(){return void 0===dt?2:4}function ir(t,e,r,n,i){var s=t.v,o=0|s[et];n=ht(t,o)?1:n,i=!!i||3===n,2===n&&Xe(t)&&(o=0|(s=t.v)[et]);var a=(t=or(s,e))===j?7:0|t[et],h=ar(a,o),u=!(4&h);if(u){4&h&&(t=Vt(t),a=0,h=Sr(h,o),o=er(s,o,e,t));let n=0,i=0;for(;n<t.length;n++){let e=r(t[n]);null!=e&&(t[i++]=e)}i<n&&(t.length=i),r=-513&h|4,h=r&=-1025,h&=-4097}return h!==a&&(it(t,h),2&h&&Object.freeze(t)),sr(t,h,s,o,e,n,u,i)}function sr(t,e,r,n,i,s,o,a){var h=e;return 1===s||4===s&&(2&e||!(16&e)&&32&n)?hr(e)||((e|=!t.length||o&&!(4096&e)||32&n&&!(4096&e||16&e)?2:256)!==h&&it(t,e),Object.freeze(t)):(2===s&&hr(e)&&(t=Vt(t),h=0,e=Sr(e,n),n=er(r,n,i,t)),hr(e)||(a||(e|=16),e!==h&&it(t,e))),2&e||!(4096&e||16&e)||ze(r,n),t}function or(t,e,r){return t=Qe(t,e,r),Array.isArray(t)?t:j}function ar(t,e){return 2&e&&(t|=2),1|t}function hr(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function ur(t){return ct(t,!0)}function cr(t){t=Vt(t);for(let e=0;e<t.length;e++){let r=t[e]=Vt(t[e]);Array.isArray(r[1])&&(r[1]=st(r[1]))}return ot(t)}function lr(t,e,r,n){We(t),er(t=t.v,0|t[et],e,("0"===n?0===Number(r):r===n)?void 0:r)}function dr(t,e,r){if(2&e)throw Error();var n=gt(e),i=or(t,r,n),s=i===j?7:0|i[et],o=ar(s,e);return(2&o||hr(o)||16&o)&&(o===s||hr(o)||it(i,o),i=Vt(i),s=0,o=Sr(o,e),er(t,e,r,i,n)),(o&=-13)!==s&&it(i,o),i}function fr(t,e){return mr(pr(t=t.v),t,void 0,e)}function pr(t){if(B)return t[K]??(t[K]=new Map);if(K in t)return t[K];var e=new Map;return Object.defineProperty(t,K,{value:e}),e}function gr(t,e,r,n,i){var s=pr(t),o=mr(s,t,e,r,i);return o!==n&&(o&&(e=er(t,e,o,void 0,i)),s.set(r,n)),e}function mr(t,e,r,n,i){var s=t.get(n);if(null!=s)return s;s=0;for(let t=0;t<n.length;t++){let o=n[t];null!=Qe(e,o,i)&&(0!==s&&(r=er(e,r,s,void 0,i)),s=o)}return t.set(n,s),s}function _r(t,e,r){var n=0|t[et],i=gt(n),s=Qe(t,r,i);if(null!=s&&s[J]===at){if(!ht(s))return Xe(s),s.v;var o=s.v}else Array.isArray(s)&&(o=s);if(o){let t=0|o[et];2&t&&(o=He(o,t))}return(o=$e(o,e))!==s&&er(t,n,r,o,i),o}function vr(t,e,r,n,i){var s=!1;if(null!=(n=Qe(t,n,i,t=>{var n=de(t,r,!1,e);return s=n!==t&&null!=n,n})))return s&&!ht(n)&&ze(t,e),n}function yr(t,e,r,n){var i=t.v,s=0|i[et];if(null==(e=vr(i,s,e,r,n)))return e;if(!ht(t,s=0|i[et])){let o=Ke(e);o!==e&&(Xe(t)&&(s=0|(i=t.v)[et]),ze(i,s=er(i,s,r,e=o,n)))}return e}function Er(t,e,r,n,i,s,o,a){var h=ht(t,r);s=h?1:s,o=!!o||3===s,h=a&&!h,(2===s||h)&&Xe(t)&&(r=0|(e=t.v)[et]);var u=(t=or(e,i))===j?7:0|t[et],c=ar(u,r);if(a=!(4&c)){var l=t,d=r;let e=!!(2&c);e&&(d|=2);let i=!e,s=!0,o=0,a=0;for(;o<l.length;o++){let t=de(l[o],n,!1,d);if(t instanceof n){if(!e){let e=ht(t);i&&=!e,s&&=e}l[a++]=t}}a<o&&(l.length=a),c|=4,c=s?-4097&c:4096|c,c=i?8|c:-9&c}if(c!==u&&(it(t,c),2&c&&Object.freeze(t)),h&&!(8&c||!t.length&&(1===s||4===s&&(2&c||!(16&c)&&32&r)))){for(hr(c)&&(t=Vt(t),c=Sr(c,r),r=er(e,r,i,t)),n=t,h=c,u=0;u<n.length;u++)(l=n[u])!==(c=Ke(l))&&(n[u]=c);h|=8,it(t,c=h=n.length?4096|h:-4097&h)}return sr(t,c,e,r,i,s,a,o)}function Ar(t,e,r){var n=t.v;return Er(t,n,0|n[et],e,r,nr(),!1,!0)}function wr(t){return null==t&&(t=void 0),t}function Tr(t,e,r,n,i){return tr(t,r,n=wr(n),i),n&&!ht(n)&&ze(t.v),t}function br(t,e,r,n){t:{var i=n=wr(n);We(t);let s=t.v,o=0|s[et];if(null==i){let t=pr(s);if(mr(t,s,o,r)!==e)break t;t.set(r,0)}else o=gr(s,o,r,e);er(s,o,e,i)}n&&!ht(n)&&ze(t.v)}function kr(t,e,r){We(t);var n=0|(t=t.v)[et];if(null==r)er(t,n,e);else{var i=r===j?7:0|r[et],s=i,o=hr(i),a=o||Object.isFrozen(r),h=!0,u=!0;for(let t=0;t<r.length;t++){var c=r[t];o||(c=ht(c),h&&=!c,u&&=c)}o||(i=h?13:5,i=u?-4097&i:4096|i),a&&i===s||(r=Vt(r),s=0,i=Sr(i,n)),i!==s&&it(r,i),n=er(t,n,e,r),2&i||!(4096&i||16&i)||ze(t,n)}}function Sr(t,e){return-273&(2&e?2|t:-3&t)}function Lr(t,e,r,n){var i=n;We(t),t=Er(t,n=t.v,0|n[et],r,e,2,!0),i=null!=i?i:new r,t.push(i),e=r=t===j?7:0|t[et],(i=ht(i))?(r&=-9,1===t.length&&(r&=-4097)):r|=4096,r!==e&&it(t,r),i||ze(n)}function xr(t,e,r){return ee(Ze(t,e,r))}function Rr(t,e){return Ze(t,e,void 0,Jt)??0}function Fr(t,e,r){return yr(t,e,r=fr(t,uo)===r?r:-1,void 0)}function Ir(t,e){lr(t,3,null==e?e:Zt(e),!1)}function Cr(t,e,r){if(null!=r){if("number"!=typeof r)throw P("int32");if(!Wt(r))throw P("int32");r|=0}tr(t,e,r)}function Nr(t,e,r){tr(t,e,null==r?r:qt(r))}function Or(t,e,r){lr(t,e,null==r?r:qt(r),0)}function Mr(t,e,r){lr(t,e,ce(r),"")}function Dr(t,e,r){{We(t);let o=t.v,a=0|o[et];if(null==r)er(o,a,e);else{var n=t=r===j?7:0|r[et],i=hr(t),s=i||Object.isFrozen(r);for(i||(t=0),s||(r=Vt(r),n=0,t=Sr(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,i=0;i<r.length;i++){let e=r[i],o=ue(e);Object.is(e,o)||(s&&(r=Vt(r),n=0,t=Sr(t,a),s=!1),r[i]=o)}t!==n&&(s&&(r=Vt(r),t=Sr(t,a)),it(r,t)),er(o,a,e,r)}}}function Pr(t,e,r){We(t),ir(t,e,le,2,!0).push(ue(r))}var $r=class{constructor(t,e,r){if(this.buffer=t,r&&!e)throw Error();this.g=e}};function Ur(t,e){if("string"==typeof t)return new $r(L(t),e);if(Array.isArray(t))return new $r(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new $r(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new $r(t,!1);if(t.constructor===N)return e=I(t)||new Uint8Array(0),new $r(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new $r(t,!1);throw Error()}function Br(t,e){var r=0,n=0,i=0,s=t.h,o=t.g;do{var a=s[o++];r|=(127&a)<<i,i+=7}while(i<32&&128&a);if(i>32)for(n|=(127&a)>>4,i=3;i<32&&128&a;i+=7)n|=(127&(a=s[o++]))<<i;if(Xr(t,o),!(128&a))return e(r>>>0,n>>>0);throw Error()}function Gr(t){for(var e=0,r=t.g,n=r+10,i=t.h;r<n;){let n=i[r++];if(e|=n,!(128&n))return Xr(t,r),!!(127&e)}throw Error()}function jr(t){var e=t.h,r=t.g,n=e[r++],i=127&n;if(128&n&&(i|=(127&(n=e[r++]))<<7,128&n&&(i|=(127&(n=e[r++]))<<14,128&n&&(i|=(127&(n=e[r++]))<<21,128&n&&(i|=(n=e[r++])<<28,128&n&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++]&&128&e[r++])))))throw Error();return Xr(t,r),i}function Vr(t){return jr(t)>>>0}function Hr(t){var e=t.h,r=t.g,n=e[r],i=e[r+1],s=e[r+2];return e=e[r+3],Xr(t,t.g+4),t=2*((i=(n|i<<8|s<<16|e<<24)>>>0)>>31)+1,n=i>>>23&255,i&=8388607,255==n?i?NaN:t*(1/0):0==n?1401298464324817e-60*t*i:t*Math.pow(2,n-150)*(i+8388608)}function Kr(t){return jr(t)}function Xr(t,e){if(t.g=e,e>t.l)throw Error()}function Wr(t,e){if(e<0)throw Error();var r=t.g;if((e=r+e)>t.l)throw Error();return t.g=e,r}function zr(t,e){if(0==e)return F();var r=Wr(t,e);return t.Y&&t.j?r=t.h.subarray(r,r+e):(t=t.h,r=r===(e=r+e)?new Uint8Array(0):Rt?t.slice(r,e):new Uint8Array(t.subarray(r,e))),0==r.length?F():new N(r,R)}var Yr=class{constructor(t,e,r,n){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(t,e,r,n)}init(t,e,r,{Y:n=!1,ea:i=!1}={}){this.Y=n,this.ea=i,t&&(t=Ur(t,this.ea),this.h=t.buffer,this.j=t.g,this.m=e||0,this.l=void 0!==r?this.m+r:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}},qr=[],Jr=0;function Zr(t,e,r,n){if(un.length){let i=un.pop();return i.u(n),i.g.init(t,e,r,n),i}return new hn(t,e,r,n)}function Qr(t){t.g.clear(),t.l=-1,t.h=-1,un.length<100&&un.push(t)}function tn(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var r=Vr(t.g);if(e=r>>>3,!((r&=7)>=0&&r<=5))throw Error();if(e<1)throw Error();return t.l=e,t.h=r,!0}function en(t){try{switch(t.h){case 0:0!=t.h?en(t):Gr(t.g);break;case 1:var e=t.g;Xr(e,e.g+8);break;case 2:if(2!=t.h)en(t);else{var r=Vr(t.g),n=t.g;Xr(n,n.g+r)}break;case 5:var i=t.g;Xr(i,i.g+4);break;case 3:rn();let s=t.l;try{for(;;){if(!tn(t))throw Error();if(4==t.h){if(t.l!=s)throw Error();break}en(t)}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Jr>0&&Jr--}break;default:throw Error()}}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}}function rn(){if(Jr>=100)throw new SyntaxError;Jr++}function nn(t,e,r){var n=t.g.l,i=Vr(t.g),s=(i=t.g.g+i)-n;if(s<=0&&(t.g.l=i,r(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=n,e}function sn(t){var e=Vr(t.g),r=Wr(t=t.g,e);if(t=t.h,h){var o,u=t;(o=s)||(o=s=new TextDecoder("utf-8",{fatal:!0})),e=r+e,u=0===r&&e===u.length?u:u.subarray(r,e);try{var c=o.decode(u)}catch(t){if(void 0===a){try{o.decode(new Uint8Array([128]))}catch(t){}try{o.decode(new Uint8Array([97])),a=!0}catch(t){a=!1}}throw!a&&(s=void 0),t}}else{e=(c=r)+e,r=[];let s,a=null;for(;c<e;){var l=t[c++];l<128?r.push(l):l<224?c>=e?n():(s=t[c++],l<194||128!=(192&s)?(c--,n()):r.push((31&l)<<6|63&s)):l<240?c>=e-1?n():(s=t[c++],128!=(192&s)||224===l&&s<160||237===l&&s>=160||128!=(192&(o=t[c++]))?(c--,n()):r.push((15&l)<<12|(63&s)<<6|63&o)):l<=244?c>=e-2?n():(s=t[c++],128!=(192&s)||s-144+(l<<28)>>30||128!=(192&(o=t[c++]))||128!=(192&(u=t[c++]))?(c--,n()):(l=(7&l)<<18|(63&s)<<12|(63&o)<<6|63&u,l-=65536,r.push(55296+(l>>10&1023),56320+(1023&l)))):n(),r.length>=8192&&(a=i(a,r),r.length=0)}c=i(a,r)}return c}function on(t){var e=Vr(t.g);return zr(t.g,e)}function an(t,e,r){var n=Vr(t.g);for(n=t.g.g+n;t.g.g<n;)r.push(e(t.g))}var hn=class{constructor(t,e,r,n){if(qr.length){let i=qr.pop();i.init(t,e,r,n),t=i}else t=new Yr(t,e,r,n);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.u(n)}u({ha:t=!1}={}){this.ha=t}},un=[];function cn(t){return new fn(4294967295&t,Math.floor(t/4294967296))}function ln(t){return t?/^\d+$/.test(t)?(Gt(t),new fn(Ft,It)):null:dn||=new fn(0,0)}var dn,fn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function pn(t){return new bn(4294967295&t,Math.floor(t/4294967296))}function gn(t){return t?/^-?\d+$/.test(t)?(Gt(t),new bn(Ft,It)):null:mn||=new bn(0,0)}var mn,_n,vn,yn,En,An,wn,Tn,bn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};function kn(t,e,r){return"undefined"!=typeof BigInt64Array?(wn||(wn=new BigInt64Array(1),Tn=new Uint32Array(wn.buffer),wn[0]=BigInt(1),An=1===Tn[0]),wn[0]=t,new e(Tn[t=An?0:1],Tn[1-t])):(En||(_n=BigInt(Number.MIN_SAFE_INTEGER),vn=BigInt(Number.MAX_SAFE_INTEGER),yn=BigInt(4294967295),En=BigInt(32)),t>=_n&&t<=vn?r(Number(t)):(t=BigInt.asUintN(64,t),new e(Number(t&yn),Number(t>>En))))}function Sn(t,e,r){for(;r>0||e>127;)t.g.push(127&e|128),e=(e>>>7|r<<25)>>>0,r>>>=7;t.g.push(e)}function Ln(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function xn(t,e){if(e>=0)Ln(t,e);else{for(let r=0;r<9;r++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function Rn(t){var e=Ft;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}var Fn=class{constructor(){this.g=[]}length(){return this.g.length}end(){var t=this.g;return this.g=[],t}};function In(t,e){0!==e.length&&(t.l.push(e),t.h+=e.length)}function Cn(t,e,r){Ln(t.g,8*e+r)}function Nn(t,e){return Cn(t,e,2),e=t.g.end(),In(t,e),e.push(t.h),e}function On(t,e){var r=e.pop();for(r=t.h+t.g.length()-r;r>127;)e.push(127&r|128),r>>>=7,t.h++;e.push(r),t.h++}function Mn(t,e,r){Cn(t,e,2),Ln(t.g,r.length),In(t,t.g.end()),In(t,r)}function Dn(t,e,r,n){null!=r&&(e=Nn(t,e),n(r,t),On(t,e))}var Pn=class{constructor(){this.l=[],this.h=0,this.g=new Fn}};function $n(){var t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Un=$n(),Bn=$n(),Gn=$n(),jn=$n(),Vn=$n(),Hn=$n(),Kn=$n(),Xn=$n(),Wn=$n(),zn=$n();function Yn(t,e,r){var n=t.v;X&&X in n&&(n=n[X])&&delete n[e.g],e.h?e.j(t,e.h,e.g,r,e.l):e.j(t,e.g,r,e.l)}var qn=class{constructor(t,e){this.v=Ue(t,e,void 0,2048)}toJSON(){return Pe(this)}j(){var t=na,e=this.v,r=t.g,n=X;if(B&&n&&null!=e[n]?.[r]&&$(W,3),e=t.g,Z&&X&&void 0===Z&&(n=(r=this.v)[X])&&(n=n.da))try{n(r,e,Ce)}catch(t){l(t)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){var t=this.v,e=0|t[et];return Ye(this,t,e)?je(this,t,!0):new this.constructor(He(t,e,!1))}};qn.prototype[J]=at,qn.prototype.toString=function(){return this.v.toString()};var Jn=class{constructor(t,e,r){this.g=t,this.h=e,t=Un,this.l=!!t&&r===t||!1}};function Zn(t,e){return new Jn(t,e,Un)}function Qn(t,e,r,n,i){Dn(t,r,li(e,n),i)}var ti,ei,ri=Zn(function(t,e,r,n,i){return 2===t.h&&(nn(t,_r(e,n,r),i),!0)},Qn),ni=Zn(function(t,e,r,n,i){return 2===t.h&&(nn(t,_r(e,n,r),i),!0)},Qn),ii=Symbol(),si=Symbol(),oi=Symbol(),ai=Symbol(),hi=Symbol();function ui(t,e,r,n){var i=n[t];if(i)return i;(i={}).ra=n,i.T=function(t){switch(typeof t){case"boolean":return Re||=[0,void 0,!0];case"number":return t>0?void 0:0===t?Fe||=[0,void 0]:[-t,void 0];case"string":return[0,t];case"object":return t}}(n[0]);var s=n[1],o=1;s&&s.constructor===Object&&(i.ba=s,"function"==typeof(s=n[++o])&&(i.ma=!0,ti??=s,ei??=n[o+1],s=n[o+=2]));for(var a={};s&&Array.isArray(s)&&s.length&&"number"==typeof s[0]&&s[0]>0;){for(var h=0;h<s.length;h++)a[s[h]]=s;s=n[++o]}for(h=1;void 0!==s;){let t;"number"==typeof s&&(h+=s,s=n[++o]);var u=void 0;if(s instanceof Jn?t=s:(t=ri,o--),t?.l){s=n[++o],u=n;var c=o;"function"==typeof s&&(s=s(),u[c]=s),u=s}for(c=h+1,"number"==typeof(s=n[++o])&&s<0&&(c-=s,s=n[++o]);h<c;h++){let n=a[h];u?r(i,h,t,u,n):e(i,h,t,n)}}return n[t]=i}function ci(t){return Array.isArray(t)?t[0]instanceof Jn?t:[ni,t]:[t,void 0]}function li(t,e){return t instanceof qn?t.v:Array.isArray(t)?$e(t,e):void 0}function di(t,e,r,n){var i=r.g;t[e]=n?(t,e,r)=>i(t,e,r,n):i}function fi(t,e,r,n,i){var s,o,a=r.g;t[e]=(t,e,r)=>a(t,e,r,o||=ui(si,di,fi,n).T,s||=pi(n),i)}function pi(t){var e=t[oi];if(null!=e)return e;var r=ui(si,di,fi,t);return e=r.ma?(t,e)=>ti(t,e,r):(t,e)=>{t:{rn();try{for(;tn(e)&&4!=e.h;){let h=e.l,u=r[h];if(null==u){let t=r.ba;if(t){let e=t[h];if(e){let t=mi(e);null!=t&&(u=r[h]=t)}}}if(null==u||!u(e,t,h)){var n=e;let r=n.m;if(en(n),n.ha)var i=void 0;else{let t=n.g.g-r;n.g.g=r,i=zr(n.g,t)}n=void 0;var s=t,o=h,a=i;a&&((n=s[X]??(s[X]=new Ie))[o]??(n[o]=[])).push(a)}}let u=Se(t);u&&(u.da=r.ra[hi]);var h=!0;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Jr>0&&Jr--}h=void 0}return h},t[oi]=e,t[hi]=gi.bind(t),e}function gi(t,e,r,n){var i=this[si],s=this[oi],o=$e(void 0,i.T),a=Se(t);if(a){var h=!1,u=i.ba;if(u){if(i=(e,r,i)=>{if(0!==i.length)if(u[r])for(let t of i){e=Zr(t);try{h=!0,s(o,e)}finally{Qr(e)}}else n?.(t,r,i)},null==e)Le(a,i);else if(null!=a){let t=a[e];t&&i(a,e,t)}if(h){let n=0|t[et];if(2&n&&2048&n&&!r?.Ma)throw Error();let i=gt(n),s=(e,s)=>{if(null!=Qe(t,e,i)){if(1===r?.Ta)return;throw Error()}null!=s&&(n=er(t,n,e,s,i)),delete a[e]};null==e?ft(o,0|o[et],(t,e)=>{s(t,e)}):s(e,Qe(o,e,i))}}}}function mi(t){var e=(t=ci(t))[0].g;if(t=t[1]){let r=pi(t),n=ui(si,di,fi,t).T;return(t,i,s)=>e(t,i,s,n,r)}return e}function _i(t,e,r){t[e]=r.h}function vi(t,e,r,n){var i,s,o=r.h;t[e]=(t,e,r)=>o(t,e,r,s||=ui(ii,_i,vi,n).T,i||=yi(n))}function yi(t){var e=t[ai];if(!e){let r=ui(ii,_i,vi,t);e=(t,e)=>Ei(t,e,r),t[ai]=e}return e}function Ei(t,e,r){ft(t,0|t[et],(t,n)=>{if(null!=n){var i=function(t,e){var r=t[e];if(r)return r;if((r=t.ba)&&(r=r[e])){var n=(r=ci(r))[0].h;if(r=r[1]){let e=yi(r),i=ui(ii,_i,vi,r).T;r=t.ma?ei(i,e):(t,r,s)=>n(t,r,s,i,e)}else r=n;return t[e]=r}}(r,t);i?i(e,n,t):t<500||$(Y,3)}}),(t=Se(t))&&Le(t,(t,r,n)=>{for(In(e,e.g.end()),t=0;t<n.length;t++)In(e,I(n[t])||new Uint8Array(0))})}var Ai=At(0);function wi(t,e){if(Array.isArray(e)){var r=0|e[et];if(4&r)return e;for(var n=0,i=0;n<e.length;n++){let r=t(e[n]);null!=r&&(e[i++]=r)}return i<n&&(e.length=i),(t=-1537&r|5)!==r&&it(e,t),2&t&&Object.freeze(e),e}}var Ti=(t,e)=>{var r=new Pn;Ei(t.v,r,ui(ii,_i,vi,e)),In(r,r.g.end()),t=new Uint8Array(r.h);var n=(e=r.l).length,i=0;for(let r=0;r<n;r++){let n=e[r];t.set(n,i),i+=n.length}return r.l=[t],t};function bi(t,e,r){return new Jn(t,e,r)}function ki(t,e,r){return new Jn(t,e,r)}function Si(t,e,r){er(t,0|t[et],e,r,gt(0|t[et]))}var Li=Zn(function(t,e,r,n,i){if(2!==t.h)return!1;if(t=Vt(t=nn(t,$e([void 0,void 0],n),i)),i=gt(n=0|e[et]),2&n)throw Error();var s=Qe(e,r,i);if(s instanceof we)2&s.J?((s=s.W()).push(t),er(e,n,r,s,i)):s.Pa(t);else if(Array.isArray(s)){var o=0|s[et];8192&o||it(s,o|=8192),2&o&&er(e,n,r,s=cr(s),i),s.push(t)}else er(e,n,r,ot([t]),i);return!0},function(t,e,r,n,i){if(e instanceof we)e.forEach((e,s)=>{Dn(t,r,$e([s,e],n),i)});else if(Array.isArray(e)){for(let s=0;s<e.length;s++){let o=e[s];Array.isArray(o)&&Dn(t,r,$e(o,n),i)}ot(e)}});function xi(t,e,r){null!=(e=Jt(e))&&(Cn(t,r,5),t=t.g,Ot(e),Rn(t))}function Ri(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Ht(64,t));if(te(t)){if("string"===e)return se(t);if("number"===e)return ie(t)}}(e),null!=e){if("string"==typeof e)gn(e);if(null!=e)switch(Cn(t,r,0),typeof e){case"number":t=t.g,Nt(e),Sn(t,Ft,It);break;case"bigint":r=kn(e,bn,pn),Sn(t.g,r.h,r.g);break;default:r=gn(e),Sn(t.g,r.h,r.g)}}}function Fi(t,e,r){null!=(e=ee(e))&&null!=e&&(Cn(t,r,0),xn(t.g,e))}function Ii(t,e,r){null!=(e=null==e||"boolean"==typeof e?e:"number"==typeof e?!!e:void 0)&&(Cn(t,r,0),t.g.g.push(e?1:0))}function Ci(t,e,r){null!=(e=le(e))&&Mn(t,r,c(e))}function Ni(t,e,r,n,i){Dn(t,r,li(e,n),i)}function Oi(t,e,r){null!=(e=null==e||"string"==typeof e||e instanceof N?e:void 0)&&Mn(t,r,Ur(e,!0).buffer)}function Mi(t,e,r){null!=(e=re(e))&&null!=e&&(Cn(t,r,0),Ln(t.g,e))}function Di(t,e,r){null!=(e=ee(e))&&(e=parseInt(e,10),Cn(t,r,0),xn(t.g,e))}function Pi(t,e,r){return(5===t.h||2===t.h)&&(e=dr(e,0|e[et],r),2==t.h?an(t,Hr,e):e.push(Hr(t.g)),!0)}var $i=bi(function(t,e,r){return 5===t.h&&(Si(e,r,Hr(t.g)),!0)},xi,Xn),Ui=ki(Pi,function(t,e,r){if(null!=(e=wi(Jt,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Cn(n,i,5),n=n.g,Ot(s),Rn(n))}},Xn),Bi=ki(Pi,function(t,e,r){if(null!=(e=wi(Jt,e))&&e.length){Cn(t,r,2),Ln(t.g,4*e.length);for(let n=0;n<e.length;n++)r=t.g,Ot(e[n]),Rn(r)}},Xn),Gi=bi(function(t,e,r){return 5===t.h&&(Si(e,r,0===(t=Hr(t.g))?void 0:t),!0)},xi,Xn),ji=bi(function(t,e,r){return 0!==t.h?t=!1:(Si(e,r,Br(t.g,Pt)),t=!0),t},Ri,Hn),Vi=bi(function(t,e,r){return 0!==t.h?e=!1:(Si(e,r,(t=Br(t.g,Pt))===Ai?void 0:t),e=!0),e},Ri,Hn),Hi=bi(function(t,e,r){return 0!==t.h?t=!1:(Si(e,r,Br(t.g,Dt)),t=!0),t},function(t,e,r){if(e=function(t){if(null==t)return t;var e=typeof t;if("bigint"===e)return String(Kt(64,t));if(te(t)){if("string"===e)return e=zt(Number(t)),Xt(e)&&e>=0?t=String(e):(-1!==(e=t.indexOf("."))&&(t=t.substring(0,e)),(e="-"!==t[0]&&((e=t.length)<20||20===e&&t<="18446744073709551615"))||(Gt(t),t=$t(Ft,It))),t;if("number"===e)return(t=zt(t))>=0&&Xt(t)||(Nt(t),t=Mt(Ft,It)),t}}(e),null!=e){if("string"==typeof e)ln(e);if(null!=e)switch(Cn(t,r,0),typeof e){case"number":t=t.g,Nt(e),Sn(t,Ft,It);break;case"bigint":r=kn(e,fn,cn),Sn(t.g,r.h,r.g);break;default:r=ln(e),Sn(t.g,r.h,r.g)}}},Kn),Ki=bi(function(t,e,r){return 0===t.h&&(Si(e,r,jr(t.g)),!0)},Fi,jn),Xi=ki(function(t,e,r){return(0===t.h||2===t.h)&&(e=dr(e,0|e[et],r),2==t.h?an(t,jr,e):e.push(jr(t.g)),!0)},function(t,e,r){if(null!=(e=wi(ee,e))&&e.length){r=Nn(t,r);for(let r=0;r<e.length;r++)xn(t.g,e[r]);On(t,r)}},jn),Wi=bi(function(t,e,r){return 0===t.h&&(Si(e,r,0===(t=jr(t.g))?void 0:t),!0)},Fi,jn),zi=bi(function(t,e,r){return 0===t.h&&(Si(e,r,Gr(t.g)),!0)},Ii,Bn),Yi=bi(function(t,e,r){return 0===t.h&&(Si(e,r,!1===(t=Gr(t.g))?void 0:t),!0)},Ii,Bn),qi=ki(function(t,e,r){return 2===t.h&&(t=sn(t),dr(e,0|e[et],r).push(t),!0)},function(t,e,r){if(null!=(e=wi(le,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&Mn(n,i,c(s))}},Gn),Ji=bi(function(t,e,r){return 2===t.h&&(Si(e,r,""===(t=sn(t))?void 0:t),!0)},Ci,Gn),Zi=bi(function(t,e,r){return 2===t.h&&(Si(e,r,sn(t)),!0)},Ci,Gn),Qi=function(t,e,r=Un){return new Jn(t,e,r)}(function(t,e,r,n,i){return 2===t.h&&(n=$e(void 0,n),dr(e,0|e[et],r).push(n),nn(t,n,i),!0)},function(t,e,r,n,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)Ni(t,e[s],r,n,i);1&(t=0|e[et])||it(e,1|t)}}),ts=Zn(function(t,e,r,n,i,s){if(2!==t.h)return!1;var o=0|e[et];return gr(e,o,s,r,gt(o)),nn(t,e=_r(e,n,r),i),!0},Ni),es=bi(function(t,e,r){return 2===t.h&&(Si(e,r,on(t)),!0)},Oi,Wn),rs=ki(function(t,e,r){return(0===t.h||2===t.h)&&(e=dr(e,0|e[et],r),2==t.h?an(t,Vr,e):e.push(Vr(t.g)),!0)},function(t,e,r){if(null!=(e=wi(re,e)))for(let o=0;o<e.length;o++){var n=t,i=r,s=e[o];null!=s&&(Cn(n,i,0),Ln(n.g,s))}},Vn),ns=bi(function(t,e,r){return 0===t.h&&(Si(e,r,0===(t=Vr(t.g))?void 0:t),!0)},Mi,Vn),is=bi(function(t,e,r){return 0===t.h&&(Si(e,r,jr(t.g)),!0)},Di,zn),ss=bi(function(t,e,r){return 0===t.h&&(Si(e,r,0===(t=jr(t.g))?void 0:t),!0)},Di,zn);class os{constructor(t,e){var r=xs;this.g=t,this.h=e,this.m=yr,this.j=Tr,this.defaultValue=void 0,this.l=null!=r.Ra?pt:void 0}register(){_(this)}}function as(t,e){return new os(t,e)}function hs(t,e){return(r,n)=>{t:{let s={ea:!0};n&&Object.assign(s,n),r=Zr(r,void 0,void 0,s);try{let n=new t,s=n.v;pi(e)(s,r);var i=n;break t}catch(t){if(t instanceof RangeError)throw new SyntaxError;throw t}finally{Qr(r)}i=void 0}return i}}function us(t){return e=>Ti(e,t)}function cs(t){return function(){return Ti(this,t)}}var ls,ds=class extends qn{constructor(t){super(t)}},fs=[0,Ji,bi(function(t,e,r){return 2===t.h&&(Si(e,r,(t=on(t))===F()?void 0:t),!0)},function(t,e,r){if(null!=e){if(e instanceof qn){let n=e.Ua;return void(n?(e=n(e),null!=e&&Mn(t,r,Ur(e,!0).buffer)):$(Y,3))}if(Array.isArray(e))return void $(Y,3)}Oi(t,e,r)},Wn)],ps=globalThis.trustedTypes;var gs=class{constructor(t){this.g=t}toString(){return this.g+""}};function ms(t){var e;return void 0===ls&&(ls=function(){var t=null;if(!ps)return t;try{let e=t=>t;t=ps.createPolicy("goog#html",{createHTML:e,createScript:e,createScriptURL:e})}catch(t){}return t}()),t=(e=ls)?e.createScriptURL(t):t,new gs(t)}function _s(t,...e){if(0===e.length)return ms(t[0]);var r=t[0];for(let n=0;n<e.length;n++)r+=encodeURIComponent(e[n])+t[n+1];return ms(r)}var vs=[0,Ki,is,zi,-1,Xi,is,-1,zi,-1],ys=[0,is,-1,zi],Es=class extends qn{constructor(t){super(t)}},As=[0,zi,Zi,zi,is,-1,ki(function(t,e,r){return(0===t.h||2===t.h)&&(e=dr(e,0|e[et],r),2==t.h?an(t,Kr,e):e.push(jr(t.g)),!0)},function(t,e,r){if(null!=(e=wi(ee,e))&&e.length){r=Nn(t,r);for(let r=0;r<e.length;r++)xn(t.g,e[r]);On(t,r)}},zn),Zi,-1,[0,zi,-1],is,zi,-1,ys],ws=[0,3,zi,-1,2,[0,[2],Ki,ts,[0,bi(function(t,e,r){return 0===t.h&&(Si(e,r,Vr(t.g)),!0)},Mi,Vn)]],[0,is,zi,is,zi,is,zi,Zi,-1],[0,[3,4],Zi,-1,ts,[0,Ki],ts,[0,is]],[0]],Ts=[0,Zi,-2],bs=class extends qn{constructor(t){super(t)}},ks=[0],Ss=class extends qn{constructor(t){super(t)}},Ls=[0,Ki,zi,1,zi,-4],xs=class extends qn{constructor(t){super(t,2)}},Rs={};Rs[336783863]=[0,Zi,zi,-1,Ki,[0,[1,2,3,4,5,6,7,8,9],ts,ks,ts,As,ts,Ts,ts,Ls,ts,vs,ts,[0,Zi,-2],ts,[0,Zi,is],ts,ws,ts,ys],[0,Zi],zi,[0,[1,3],[2,4],ts,[0,Xi],-1,ts,[0,qi],-1,Qi,[0,Zi,-1]],Zi];var Fs=[0,Vi,-1,Yi,-3,Vi,Xi,Ji,Wi,Vi,-1,Yi,Wi,Yi,-2,Ji];function Is(t,e){Pr(t,3,e)}function Cs(t,e){Pr(t,4,e)}var Ns=class extends qn{constructor(t){super(t,500)}u(t){return Tr(this,0,7,t)}},Os=[-1,{}],Ms=[0,Zi,1,Os],Ds=[0,Zi,qi,Os];function Ps(t,e){Lr(t,1,Ns,e)}function $s(t,e){Pr(t,10,e)}function Us(t,e){Pr(t,15,e)}var Bs=class extends qn{constructor(t){super(t,500)}u(t){return Tr(this,0,1001,t)}},Gs=[-500,Qi,[-500,Ji,-1,qi,-3,[-2,Rs,zi],Qi,fs,Wi,-1,Ms,Ds,Qi,[0,Ji,Yi],Ji,Fs,Wi,qi,987,qi],4,Qi,[-500,Zi,-1,[-1,{}],998,Zi],Qi,[-500,Zi,qi,-1,[-2,{},zi],997,qi,-1],Wi,Qi,[-500,Zi,qi,Os,998,qi],qi,Wi,Ms,Ds,Qi,[0,Ji,-1,Os],qi,-2,Fs,Ji,-1,Yi,[0,Yi,ns],978,Os,Qi,fs];Bs.prototype.g=cs(Gs);var js=hs(Bs,Gs),Vs=class extends qn{constructor(t){super(t)}},Hs=class extends qn{constructor(t){super(t)}g(){return Ar(this,Vs,1)}},Ks=[0,Qi,[0,Ki,$i,Zi,-1]],Xs=hs(Hs,Ks),Ws=class extends qn{constructor(t){super(t)}},zs=class extends qn{constructor(t){super(t)}},Ys=class extends qn{constructor(t){super(t)}l(){return yr(this,Ws,2)}g(){return Ar(this,zs,5)}},qs=hs(class extends qn{constructor(t){super(t)}},[0,qi,Xi,Bi,[0,is,[0,Ki,-3],[0,$i,-3],[0,Ki,-1,[0,Qi,[0,Ki,-2]]],Qi,[0,$i,-1,Zi,$i]],Zi,-1,ji,Qi,[0,Ki,$i],qi,ji]),Js=class extends qn{constructor(t){super(t)}},Zs=hs(class extends qn{constructor(t){super(t)}},[0,Qi,[0,$i,-4]]),Qs=class extends qn{constructor(t){super(t)}},to=hs(class extends qn{constructor(t){super(t)}},[0,Qi,[0,$i,-4]]),eo=class extends qn{constructor(t){super(t)}},ro=[0,Ki,-1,Bi,is],no=class extends qn{constructor(t){super(t)}};no.prototype.g=cs([0,$i,-4,ji]);var io=class extends qn{constructor(t){super(t)}},so=hs(class extends qn{constructor(t){super(t)}},[0,Qi,[0,1,Ki,Zi,Ks],ji]),oo=class extends qn{constructor(t){super(t)}},ao=class extends qn{constructor(t){super(t)}g(){var t=Ze(this,1,void 0,ur);return null==t?F():t}},ho=class extends qn{constructor(t){super(t)}},uo=[1,2],co=hs(class extends qn{constructor(t){super(t)}},[0,Qi,[0,uo,ts,[0,Bi],ts,[0,es],Ki,Zi],ji]),lo=class extends qn{constructor(t){super(t)}},fo=[0,Zi,Ki,$i,qi,-1],po=class extends qn{constructor(t){super(t)}},go=[0,zi,-1],mo=class extends qn{constructor(t){super(t)}g(){rr(this,Es,2,_o)}},_o=[1,2,3,4,5,6],vo=class extends qn{constructor(t){super(t)}g(){return null!=Ze(this,1,void 0,ur)}l(){return null!=le(Ze(this,2))}},yo=class extends qn{constructor(t){super(t)}},Eo=[0,es,Zi,[0,Ki,ji,-1],[0,Hi,ji]],Ao=[0,Eo,zi,[0,_o,ts,Ls,ts,As,ts,vs,ts,ks,ts,Ts,ts,ws],is],wo=us(Ao),To=class extends qn{constructor(t){super(t)}},bo=[0,Ao,$i,-1,Ki],ko=as(502141897,To);Rs[502141897]=bo;var So=hs(class extends qn{constructor(t){super(t)}},[0,[0,is,-1,Ui,rs],ro]),Lo=class extends qn{constructor(t){super(t)}},xo=class extends qn{constructor(t){super(t)}},Ro=[0,Ao,$i,[0,Ao],zi],Fo=as(508968150,xo);Rs[508968150]=[0,Ao,bo,Ro,$i,[0,[0,Eo]]],Rs[508968149]=Ro;var Io=class extends qn{constructor(t){super(t)}l(){return yr(this,lo,2)}g(){tr(this,2)}},Co=[0,Ao,fo];Rs[478825465]=Co;var No=class extends qn{constructor(t){super(t)}},Oo=class extends qn{constructor(t){super(t)}},Mo=class extends qn{constructor(t){super(t)}},Do=class extends qn{constructor(t){super(t)}},Po=class extends qn{constructor(t){super(t)}},$o=[0,Ao,[0,Ao],Co,-1],Uo=[0,Ao,$i,Ki],Bo=[0,Ao,$i],Go=[0,Ao,Uo,Bo,$i],jo=as(479097054,Po);Rs[479097054]=[0,Ao,Go,$o],Rs[463370452]=$o,Rs[464864288]=Uo;var Vo=as(462713202,Do);Rs[462713202]=Go,Rs[474472470]=Bo;var Ho=class extends qn{constructor(t){super(t)}},Ko=class extends qn{constructor(t){super(t)}},Xo=class extends qn{constructor(t){super(t)}},Wo=class extends qn{constructor(t){super(t)}},zo=[0,Ao,$i,-1,Ki],Yo=[0,Ao,$i,zi];Wo.prototype.g=cs([0,Ao,Bo,[0,Ao],bo,Ro,zo,Yo]);var qo=class extends qn{constructor(t){super(t)}},Jo=as(456383383,qo);Rs[456383383]=[0,Ao,fo];var Zo=class extends qn{constructor(t){super(t)}},Qo=as(476348187,Zo);Rs[476348187]=[0,Ao,go];var ta=class extends qn{constructor(t){super(t)}},ea=class extends qn{constructor(t){super(t)}},ra=[0,is,-1],na=as(458105876,class extends qn{constructor(t){super(t)}g(){var t=this.v,e=0|t[et],r=ht(this,e);return t=function(t,e,r,n){var i=ea;!n&&Xe(t)&&(r=0|(e=t.v)[et]);var s=Qe(e,2);if(t=!1,null==s){if(n)return ke();s=[]}else if(s.constructor===we){if(!(2&s.J)||n)return s;s=s.W()}else Array.isArray(s)?t=!!(2&s[et]):s=[];if(n){if(!s.length)return ke();t||(t=!0,st(s))}else t&&(t=!1,ot(s),s=cr(s));return!t&&32&r&&nt(s,32),r=er(e,r,2,n=new we(s,i,fe,void 0)),t||ze(e,r),n}(this,t,e,r),!r&&ea&&(t.sa=!0),t}});Rs[458105876]=[0,ra,Li,[!0,ji,[0,Zi,-1,qi]],[0,Xi,zi,is],zi];var ia=class extends qn{constructor(t){super(t)}},sa=as(458105758,ia);Rs[458105758]=[0,Ao,Zi,ra];var oa=class extends qn{constructor(t){super(t)}},aa=class extends qn{constructor(t){super(t)}},ha=class extends qn{constructor(t){super(t)}},ua=us([0,Qi,[0,ss,Qi,[0,Gi,-1],Yi]]),ca=class extends qn{constructor(t){super(t)}},la=[0,Gi,-1,Yi],da=class extends qn{constructor(t){super(t)}},fa=class extends qn{constructor(t){super(t)}},pa=[1,2];fa.prototype.g=cs([0,pa,ts,la,ts,[0,Qi,la]]);var ga=class extends qn{constructor(t){super(t)}},ma=as(443442058,ga);Rs[443442058]=[0,Ao,Zi,Ki,$i,qi,-1,zi,$i],Rs[514774813]=zo;var _a=class extends qn{constructor(t){super(t)}},va=as(516587230,_a);function ya(t,e){return e=e?e.clone():new lo,void 0!==t.displayNamesLocale?tr(e,1,ce(t.displayNamesLocale)):void 0===t.displayNamesLocale&&tr(e,1),void 0!==t.maxResults?Cr(e,2,t.maxResults):"maxResults"in t&&tr(e,2),void 0!==t.scoreThreshold?Nr(e,3,t.scoreThreshold):"scoreThreshold"in t&&tr(e,3),void 0!==t.categoryAllowlist?Dr(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&tr(e,4),void 0!==t.categoryDenylist?Dr(e,5,t.categoryDenylist):"categoryDenylist"in t&&tr(e,5),e}function Ea(t){var e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Aa(t,e=-1,r=""){return{categories:t.map(t=>({index:xr(t,1)??0??-1,score:Rr(t,2)??0,categoryName:le(Ze(t,3))??""??"",displayName:le(Ze(t,4))??""??""})),headIndex:e,headName:r}}function wa(t){var e={classifications:Ar(t,io,1).map(t=>Aa(yr(t,Hs,4)?.g()??[],xr(t,2)??0,le(Ze(t,3))??""))};return null!=function(t){return null==t?t:"bigint"==typeof t?(wt(t)?t=Number(t):(t=Ht(64,t),t=wt(t)?Number(t):String(t)),t):te(t)?"number"==typeof t?ie(t):se(t):void 0}(Ze(t,2,void 0,he))&&(e.timestampMs=Ea(Ze(t,2,void 0,he)??qe)),e}function Ta(t){var e=ir(t,3,Jt,nr()),r=ir(t,2,ee,nr()),n=ir(t,1,le,nr()),i=ir(t,9,le,nr()),s={categories:[],keypoints:[]};for(let t=0;t<e.length;t++)s.categories.push({score:e[t],index:r[t]??-1,categoryName:n[t]??"",displayName:i[t]??""});if((e=yr(t,Ys,4)?.l())&&(s.boundingBox={originX:xr(e,1,Je)??0,originY:xr(e,2,Je)??0,width:xr(e,3,Je)??0,height:xr(e,4,Je)??0,angle:0}),yr(t,Ys,4)?.g().length)for(let e of yr(t,Ys,4).g())s.keypoints.push({x:Ze(e,1,Je,Jt)??0,y:Ze(e,2,Je,Jt)??0,score:Ze(e,4,Je,Jt)??0,label:le(Ze(e,3,Je))??""});return s}function ba(t){var e=[];for(let r of Ar(t,Qs,1))e.push({x:Rr(r,1)??0,y:Rr(r,2)??0,z:Rr(r,3)??0,visibility:Rr(r,4)??0});return e}function ka(t){var e=[];for(let r of Ar(t,Js,1))e.push({x:Rr(r,1)??0,y:Rr(r,2)??0,z:Rr(r,3)??0,visibility:Rr(r,4)??0});return e}function Sa(t){return Array.from(t,t=>t>127?t-256:t)}function La(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);var r=0,n=0,i=0;for(let s=0;s<t.length;s++)r+=t[s]*e[s],n+=t[s]*t[s],i+=e[s]*e[s];if(n<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*i)}Rs[516587230]=[0,Ao,zo,Yo,$i],Rs[518928384]=Yo;var xa,Ra=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 Fa(t){if(t)return!0;if(void 0===xa)try{await WebAssembly.instantiate(Ra),xa=!0}catch{xa=!1}return xa}async function Ia(t,e,r){return{wasmLoaderPath:`${e}/${t}_${r=`wasm${r?"_module":""}${await Fa(r)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${r}.wasm`}}var Ca=class{};Ca.forVisionTasks=function(t,e=!1){return Ia("vision",t??_s``,e)},Ca.forTextTasks=function(t,e=!1){return Ia("text",t??_s``,e)},Ca.forGenAiTasks=function(t,e=!1){return Ia("genai",t??_s``,e)},Ca.forAudioTasks=function(t,e=!1){return Ia("audio",t??_s``,e)},Ca.isSimdSupported=function(t=!1){return Fa(t)};var Na=class{close(){}};function Oa(){var t=navigator;return"undefined"!=typeof OffscreenCanvas&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function Ma(t){if("function"!=typeof importScripts){let e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((t,r)=>{e.addEventListener("load",()=>{t()},!1),e.addEventListener("error",t=>{r(t)},!1),document.body.appendChild(e)})}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{let e=self.import;e?await e(t.toString()):await import(t.toString())}}}function Da(t){return 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]}function Pa(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function $a(t,e,r){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(r?t.i._bindTextureToStream(r):t.i._bindTextureToCanvas(),!(r=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);var[n,i]=Da(e);return!t.l||n===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=n,t.i.canvas.height=i),[n,i]}function Ua(t,e,r){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");var n=new Uint32Array(e.length);for(let r=0;r<e.length;r++)n[r]=t.i.stringToNewUTF8(e[r]);e=t.i._malloc(4*n.length),t.i.HEAPU32.set(n,e>>2),r(e);for(let e of n)t.i._free(e);t.i._free(e)}function Ba(t,e,r){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=r}function Ga(t,e,r){var n=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(t,e,i)=>{e?(r(n,i),n=[]):n.push(t)}}var ja=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m="function"==typeof this.i._addIntToInputStream,void 0!==e?this.i.canvas=e:Oa()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){var e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph((new TextEncoder).encode(t),!1)}setGraph(t,e){var r=t.length,n=this.i._malloc(r);this.i.HEAPU8.set(t,n),e?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(t,e,r,n,i){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),Pa(this,n||"input_audio",n=>{Pa(this,i=i||"audio_header",i=>{this.i._configureAudio(n,i,t,e??0,r)})})}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){Ba(this,"__graph_config__",e=>{t(e)}),Pa(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,r){this.addAudioToStreamWithShape(t,0,0,e,r)}addAudioToStreamWithShape(t,e,r,n,i){var s=4*t.length;this.h!==s&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(s),this.h=s),this.i.HEAPF32.set(t,this.g/4),Pa(this,n,t=>{this.i._addAudioToInputStream(this.g,e,r,t,i)})}addGpuBufferToStream(t,e,r){Pa(this,e,e=>{var[n,i]=$a(this,t,e);this.i._addBoundTextureToStream(e,n,i,r)})}addBoolToStream(t,e,r){Pa(this,e,e=>{this.i._addBoolToInputStream(t,e,r)})}addDoubleToStream(t,e,r){Pa(this,e,e=>{this.i._addDoubleToInputStream(t,e,r)})}addFloatToStream(t,e,r){Pa(this,e,e=>{this.i._addFloatToInputStream(t,e,r)})}addIntToStream(t,e,r){Pa(this,e,e=>{this.i._addIntToInputStream(t,e,r)})}addUintToStream(t,e,r){Pa(this,e,e=>{this.i._addUintToInputStream(t,e,r)})}addStringToStream(t,e,r){Pa(this,e,e=>{Pa(this,t,t=>{this.i._addStringToInputStream(t,e,r)})})}addStringRecordToStream(t,e,r){Pa(this,e,e=>{Ua(this,Object.keys(t),n=>{Ua(this,Object.values(t),i=>{this.i._addFlatHashMapToInputStream(n,i,Object.keys(t).length,e,r)})})})}addProtoToStream(t,e,r,n){Pa(this,r,r=>{Pa(this,e,e=>{var i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputStream(i,t.length,e,r,n),this.i._free(i)})})}addEmptyPacketToStream(t,e){Pa(this,t,t=>{this.i._addEmptyPacketToInputStream(t,e)})}addBoolVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateBoolVector(t.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(n,e);this.i._addBoolVectorToInputStream(n,e,r)})}addDoubleVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateDoubleVector(t.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(n,e);this.i._addDoubleVectorToInputStream(n,e,r)})}addFloatVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateFloatVector(t.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(n,e);this.i._addFloatVectorToInputStream(n,e,r)})}addIntVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateIntVector(t.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(n,e);this.i._addIntVectorToInputStream(n,e,r)})}addUintVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateUintVector(t.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(n,e);this.i._addUintVectorToInputStream(n,e,r)})}addStringVectorToStream(t,e,r){Pa(this,e,e=>{var n=this.i._allocateStringVector(t.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Pa(this,e,t=>{this.i._addStringVectorEntry(n,t)});this.i._addStringVectorToInputStream(n,e,r)})}addBoolToInputSidePacket(t,e){Pa(this,e,e=>{this.i._addBoolToInputSidePacket(t,e)})}addDoubleToInputSidePacket(t,e){Pa(this,e,e=>{this.i._addDoubleToInputSidePacket(t,e)})}addFloatToInputSidePacket(t,e){Pa(this,e,e=>{this.i._addFloatToInputSidePacket(t,e)})}addIntToInputSidePacket(t,e){Pa(this,e,e=>{this.i._addIntToInputSidePacket(t,e)})}addUintToInputSidePacket(t,e){Pa(this,e,e=>{this.i._addUintToInputSidePacket(t,e)})}addStringToInputSidePacket(t,e){Pa(this,e,e=>{Pa(this,t,t=>{this.i._addStringToInputSidePacket(t,e)})})}addProtoToInputSidePacket(t,e,r){Pa(this,r,r=>{Pa(this,e,e=>{var n=this.i._malloc(t.length);this.i.HEAPU8.set(t,n),this.i._addProtoToInputSidePacket(n,t.length,e,r),this.i._free(n)})})}addBoolVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(let e of t)this.i._addBoolVectorEntry(r,e);this.i._addBoolVectorToInputSidePacket(r,e)})}addDoubleVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(let e of t)this.i._addDoubleVectorEntry(r,e);this.i._addDoubleVectorToInputSidePacket(r,e)})}addFloatVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(let e of t)this.i._addFloatVectorEntry(r,e);this.i._addFloatVectorToInputSidePacket(r,e)})}addIntVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(let e of t)this.i._addIntVectorEntry(r,e);this.i._addIntVectorToInputSidePacket(r,e)})}addUintVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(let e of t)this.i._addUintVectorEntry(r,e);this.i._addUintVectorToInputSidePacket(r,e)})}addStringVectorToInputSidePacket(t,e){Pa(this,e,e=>{var r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(let e of t)Pa(this,e,t=>{this.i._addStringVectorEntry(r,t)});this.i._addStringVectorToInputSidePacket(r,e)})}attachBoolListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachBoolListener(t)})}attachBoolVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachBoolVectorListener(t)})}attachIntListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachIntListener(t)})}attachIntVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachIntVectorListener(t)})}attachUintListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachUintListener(t)})}attachUintVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachUintVectorListener(t)})}attachDoubleListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachDoubleListener(t)})}attachDoubleVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachDoubleVectorListener(t)})}attachFloatListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachFloatListener(t)})}attachFloatVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachFloatVectorListener(t)})}attachStringListener(t,e){Ba(this,t,e),Pa(this,t,t=>{this.i._attachStringListener(t)})}attachStringVectorListener(t,e){Ga(this,t,e),Pa(this,t,t=>{this.i._attachStringVectorListener(t)})}attachProtoListener(t,e,r){Ba(this,t,e),Pa(this,t,t=>{this.i._attachProtoListener(t,r||!1)})}attachProtoVectorListener(t,e,r){Ga(this,t,e),Pa(this,t,t=>{this.i._attachProtoVectorListener(t,r||!1)})}attachAudioListener(t,e,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),Ba(this,t,(t,r)=>{t=new Float32Array(t.buffer,t.byteOffset,t.length/4),e(t,r)}),Pa(this,t,t=>{this.i._attachAudioListener(t,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}};function Va(t){return class extends t{La(){this.i._registerModelResourcesGraphService()}}}var Ha=Va(ja),Ka=class extends Ha{};async function Xa(t,e,r,n){return t=await(async(t,e,r,n,i)=>{if(e&&await Ma(e),!self.ModuleFactory)throw Error("ModuleFactory not set.");if(r&&(await Ma(r),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&i&&((e=self.Module).locateFile=i.locateFile,i.mainScriptUrlOrBlob&&(e.mainScriptUrlOrBlob=i.mainScriptUrlOrBlob)),i=await self.ModuleFactory(self.Module||i),self.ModuleFactory=self.Module=void 0,new t(i,n)})(t,r.wasmLoaderPath,r.assetLoaderPath,e,{locateFile:t=>t.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&t.endsWith(".data")?r.assetBinaryPath.toString():t}),t.na=new Na,await t.u(n),t}async function Wa(t,e,r,n){return Xa(t,e,r,n)}function za(t,e){var r=yr(t.baseOptions,vo,1)||new vo;"string"==typeof e?(tr(r,2,ce(e)),tr(r,1)):e instanceof Uint8Array&&(tr(r,1,ct(e,!1)),tr(r,2)),Tr(t.baseOptions,0,1,r)}function Ya(t){try{let e=t.H.length;if(1===e)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map(t=>t.message).join(", "))}finally{t.H=[]}}function qa(t,e){t.C=Math.max(t.C,e)}function Ja(t,e){t.B=new Ns,Mr(t.B,2,"PassThroughCalculator"),Is(t.B,"free_memory"),Cs(t.B,"free_memory_unused_out"),$s(e,"free_memory"),Ps(e,t.B)}function Za(t,e){Is(t.B,e),Cs(t.B,e+"_unused_out")}function Qa(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var th=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){let e=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(yr(this.baseOptions,vo,1)?.g()||yr(this.baseOptions,vo,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(t,e){var r=yr(t.baseOptions,mo,3);if(!r){var n=r=new mo,i=new bs;br(n,4,_o,i)}"delegate"in e&&("GPU"===e.delegate?(e=r,n=new Es,br(e,2,_o,n)):(e=r,n=new bs,br(e,4,_o,n))),Tr(t.baseOptions,0,3,r)}(this,e),e.modelAssetPath)return fetch(e.modelAssetPath.toString()).then(t=>{if(t.ok)return t.arrayBuffer();throw Error(`Failed to fetch model: ${e.modelAssetPath} (${t.status})`)}).then(t=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(t),!0,!1,!1),za(this,"/model.dat"),this.m(),this.M()});if(e.modelAssetBuffer instanceof Uint8Array)za(this,e.modelAssetBuffer);else if(e.modelAssetBuffer)return async function(t){for(var e=[],r=0;;){let{done:n,value:i}=await t.read();if(n)break;e.push(i),r+=i.length}if(0===e.length)return new Uint8Array(0);if(1===e.length)return e[0];t=new Uint8Array(r),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}(e.modelAssetBuffer).then(t=>{za(this,t),this.m(),this.M()})}return this.m(),this.M(),Promise.resolve()}M(){}ca(){var t;if(this.g.ca(e=>{t=js(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((t,e)=>{this.H.push(Error(e))}),this.g.La(),this.g.setGraph(t,e),this.B=void 0,Ya(this)}finishProcessing(){this.g.finishProcessing(),Ya(this)}close(){this.B=void 0,this.na?.close(),this.g.closeGraph()}};function eh(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}th.prototype.close=th.prototype.close;class rh{constructor(t,e,r,n){this.g=t,this.h=e,this.m=r,this.l=n}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function nh(t,e,r){var n=t.g;if(r=eh(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,e),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(t.h,r),r}function ih(t,e){var r=t.g,n=eh(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);var i=eh(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(t.M),r.vertexAttribPointer(t.M,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),r.STATIC_DRAW);var s=eh(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(t.L),r.vertexAttribPointer(t.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),r.STATIC_DRAW),r.bindBuffer(r.ARRAY_BUFFER,null),r.bindVertexArray(null),new rh(r,n,i,s)}function sh(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function oh(t,e,r,n){return sh(t,e),t.h||(t.m(),t.D()),r?(t.o||(t.o=ih(t,!0)),r=t.o):(t.A||(t.A=ih(t,!1)),r=t.A),e.useProgram(t.h),r.bind(),t.l(),t=n(),r.g.bindVertexArray(null),t}function ah(t,e,r){return sh(t,e),t=eh(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function hh(t,e,r){sh(t,e),t.B||(t.B=eh(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,r,0)}function uh(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var ch=class{H(){return"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D inputTexture;\n void main() {\n gl_FragColor = texture2D(inputTexture, vTex);\n }\n "}m(){var t=this.g;if(this.h=eh(t.createProgram(),"Failed to create WebGL program"),this.X=nh(this,"\n attribute vec2 aVertex;\n attribute vec2 aTex;\n varying vec2 vTex;\n void main(void) {\n gl_Position = vec4(aVertex, 0.0, 1.0);\n vTex = aTex;\n }",t.VERTEX_SHADER),this.V=nh(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.M=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){let t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.V)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.o&&this.o.close()}};var lh=class extends ch{H(){return"\n precision mediump float;\n uniform sampler2D backgroundTexture;\n uniform sampler2D maskTexture;\n uniform sampler2D colorMappingTexture;\n varying vec2 vTex;\n void main() {\n vec4 backgroundColor = texture2D(backgroundTexture, vTex);\n float category = texture2D(maskTexture, vTex).r;\n vec4 categoryColor = texture2D(colorMappingTexture, vec2(category, 0.0));\n gl_FragColor = mix(backgroundColor, categoryColor, categoryColor.a);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.C=ah(this,t,t.LINEAR),t.activeTexture(t.TEXTURE2),this.j=ah(this,t,t.NEAREST)}m(){super.m();var t=this.g;this.O=eh(t.getUniformLocation(this.h,"backgroundTexture"),"Uniform location"),this.U=eh(t.getUniformLocation(this.h,"colorMappingTexture"),"Uniform location"),this.N=eh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.N,0),t.uniform1i(this.O,1),t.uniform1i(this.U,2)}close(){this.C&&this.g.deleteTexture(this.C),this.j&&this.g.deleteTexture(this.j),super.close()}},dh=class extends ch{H(){return"\n precision mediump float;\n uniform sampler2D maskTexture;\n uniform sampler2D defaultTexture;\n uniform sampler2D overlayTexture;\n varying vec2 vTex;\n void main() {\n float confidence = texture2D(maskTexture, vTex).r;\n vec4 defaultColor = texture2D(defaultTexture, vTex);\n vec4 overlayColor = texture2D(overlayTexture, vTex);\n // Apply the alpha from the overlay and merge in the default color\n overlayColor = mix(defaultColor, overlayColor, overlayColor.a);\n gl_FragColor = mix(defaultColor, overlayColor, confidence);\n }\n "}D(){var t=this.g;t.activeTexture(t.TEXTURE1),this.j=ah(this,t),t.activeTexture(t.TEXTURE2),this.C=ah(this,t)}m(){super.m();var t=this.g;this.N=eh(t.getUniformLocation(this.h,"defaultTexture"),"Uniform location"),this.O=eh(t.getUniformLocation(this.h,"overlayTexture"),"Uniform location"),this.I=eh(t.getUniformLocation(this.h,"maskTexture"),"Uniform location")}l(){super.l();var t=this.g;t.uniform1i(this.I,0),t.uniform1i(this.N,1),t.uniform1i(this.O,2)}close(){this.j&&this.g.deleteTexture(this.j),this.C&&this.g.deleteTexture(this.C),super.close()}};function fh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof Uint8Array);case 1:return t.g.find(t=>t instanceof Float32Array);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function ph(t){var e=fh(t,1);if(!e){if(e=fh(t,0))e=new Float32Array(e).map(t=>t/255);else{e=new Float32Array(t.width*t.height);let n=mh(t);var r=vh(t);if(hh(r,n,gh(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){r=new Float32Array(t.width*t.height*4),n.readPixels(0,0,t.width,t.height,n.RGBA,n.FLOAT,r);for(let t=0,n=0;t<e.length;++t,n+=4)e[t]=r[n]}else n.readPixels(0,0,t.width,t.height,n.RED,n.FLOAT,e)}t.g.push(e)}return e}function gh(t){var e=fh(t,2);if(!e){let r=mh(t);e=yh(t);let n=ph(t),i=_h(t);r.texImage2D(r.TEXTURE_2D,0,i,t.width,t.height,0,r.RED,r.FLOAT,n),Eh(t)}return e}function mh(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=eh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function _h(t){if(t=mh(t),!Ah)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))Ah=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Ah=t.R16F}return Ah}function vh(t){return t.l||(t.l=new ch),t.l}function yh(t){var e=mh(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=fh(t,2);return r||(r=ah(vh(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(r),t.j=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Eh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var Ah,wh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.m=e,this.j=r,this.canvas=n,this.l=i,this.width=s,this.height=o,this.j&&(0===--Th&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources."))}Ga(){return!!fh(this,0)}ka(){return!!fh(this,1)}R(){return!!fh(this,2)}ja(){return(e=fh(t=this,0))||(e=ph(t),e=new Uint8Array(e.map(t=>Math.round(255*t))),t.g.push(e)),e;var t,e}ia(){return ph(this)}P(){return gh(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof Uint8Array)r=new Uint8Array(e);else if(e instanceof Float32Array)r=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{let t=mh(this),e=vh(this);t.activeTexture(t.TEXTURE1),r=ah(e,t,this.m?t.LINEAR:t.NEAREST),t.bindTexture(t.TEXTURE_2D,r);let n=_h(this);t.texImage2D(t.TEXTURE_2D,0,n,this.width,this.height,0,t.RED,t.FLOAT,null),t.bindTexture(t.TEXTURE_2D,null),hh(e,t,r),oh(e,t,!1,()=>{yh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Eh(this)}),uh(e),Eh(this)}}t.push(r)}return new wh(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&mh(this).deleteTexture(fh(this,2)),Th=-1}};wh.prototype.close=wh.prototype.close,wh.prototype.clone=wh.prototype.clone,wh.prototype.getAsWebGLTexture=wh.prototype.P,wh.prototype.getAsFloat32Array=wh.prototype.ia,wh.prototype.getAsUint8Array=wh.prototype.ja,wh.prototype.hasWebGLTexture=wh.prototype.R,wh.prototype.hasFloat32Array=wh.prototype.ka,wh.prototype.hasUint8Array=wh.prototype.Ga;var Th=250,bh={color:"white",lineWidth:4,radius:6};function kh(t){return{...bh,fillColor:(t=t||{}).color,...t}}function Sh(t,e){return t instanceof Function?t(e):t}function Lh(t,e,r){return Math.max(Math.min(e,r),Math.min(Math.max(e,r),t))}function xh(t){if(!t.l)throw Error("CPU rendering requested but CanvasRenderingContext2D not provided.");return t.l}function Rh(t){if(!t.j)throw Error("GPU rendering requested but WebGL2RenderingContext not provided.");return t.j}function Fh(t,e,r){if(e.R())r(e.P());else{let n=e.ka()?e.ia():e.ja();t.m=t.m??new ch;let i=Rh(t);r((t=new wh([n],e.m,!1,i.canvas,t.m,e.width,e.height)).P()),t.close()}}function Ih(t,e,r,n){var i=function(t){return t.g||(t.g=new lh),t.g}(t),s=Rh(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r;oh(i,s,!0,()=>{!function(t,e,r,n){var i=t.g;if(i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,e),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.C),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,r),t.I&&function(t,e){if(t!==e)return!1;t=t.entries(),e=e.entries();for(let[r,n]of t){t=r;let i=n,s=e.next();if(s.done)return!1;let[o,a]=s.value;if(t!==o||i[0]!==a[0]||i[1]!==a[1]||i[2]!==a[2]||i[3]!==a[3])return!1}return!!e.next().done}(t.I,n))i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j);else{t.I=n;let e=Array(1024).fill(0);n.forEach((t,r)=>{if(4!==t.length)throw Error(`Color at index ${r} is not a four-channel value.`);e[4*r]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]}),i.activeTexture(i.TEXTURE2),i.bindTexture(i.TEXTURE_2D,t.j),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,256,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array(e))}}(i,e,o,n),s.clearColor(0,0,0,0),s.clear(s.COLOR_BUFFER_BIT),s.drawArrays(s.TRIANGLE_FAN,0,4);var t=i.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}function Ch(t,e,r,n){var i=Rh(t),s=function(t){return t.h||(t.h=new dh),t.h}(t),o=Array.isArray(r)?new ImageData(new Uint8ClampedArray(r),1,1):r,a=Array.isArray(n)?new ImageData(new Uint8ClampedArray(n),1,1):n;oh(s,i,!0,()=>{var t=s.g;t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s.j),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,s.C),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.drawArrays(i.TRIANGLE_FAN,0,4),i.bindTexture(i.TEXTURE_2D,null),(t=s.g).activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,null)})}var Nh=class{constructor(t,e){"undefined"!=typeof CanvasRenderingContext2D&&t instanceof CanvasRenderingContext2D||t instanceof OffscreenCanvasRenderingContext2D?(this.l=t,this.j=e):this.j=t}za(t,e){if(t){var r=xh(this);e=kh(e),r.save();var n=r.canvas,i=0;for(let s of t)r.fillStyle=Sh(e.fillColor,{index:i,from:s}),r.strokeStyle=Sh(e.color,{index:i,from:s}),r.lineWidth=Sh(e.lineWidth,{index:i,from:s}),(t=new Path2D).arc(s.x*n.width,s.y*n.height,Sh(e.radius,{index:i,from:s}),0,2*Math.PI),r.fill(t),r.stroke(t),++i;r.restore()}}ya(t,e,r){if(t&&e){var n=xh(this);r=kh(r),n.save();var i=n.canvas,s=0;for(let o of e){n.beginPath(),e=t[o.start];let a=t[o.end];e&&a&&(n.strokeStyle=Sh(r.color,{index:s,from:e,to:a}),n.lineWidth=Sh(r.lineWidth,{index:s,from:e,to:a}),n.moveTo(e.x*i.width,e.y*i.height),n.lineTo(a.x*i.width,a.y*i.height)),++s,n.stroke()}n.restore()}}va(t,e){var r=xh(this);e=kh(e),r.save(),r.beginPath(),r.lineWidth=Sh(e.lineWidth,{}),r.strokeStyle=Sh(e.color,{}),r.fillStyle=Sh(e.fillColor,{}),r.moveTo(t.originX,t.originY),r.lineTo(t.originX+t.width,t.originY),r.lineTo(t.originX+t.width,t.originY+t.height),r.lineTo(t.originX,t.originY+t.height),r.lineTo(t.originX,t.originY),r.stroke(),r.fill(),r.restore()}wa(t,e,r=[0,0,0,255]){this.l?function(t,e,r,n){var i=Rh(t);Fh(t,e,e=>{Ih(t,e,r,n),(e=xh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,r,e):Ih(this,t.P(),r,e)}xa(t,e,r){this.l?function(t,e,r,n){var i=Rh(t);Fh(t,e,e=>{Ch(t,e,r,n),(e=xh(t)).drawImage(i.canvas,0,0,e.canvas.width,e.canvas.height)})}(this,t,e,r):Ch(this,t.P(),e,r)}close(){this.g?.close(),this.g=void 0,this.h?.close(),this.h=void 0,this.m?.close(),this.m=void 0}};function Oh(t,e){switch(e){case 0:return t.g.find(t=>t instanceof ImageData);case 1:return t.g.find(t=>"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap);case 2:return t.g.find(t=>"undefined"!=typeof WebGLTexture&&t instanceof WebGLTexture);default:throw Error(`Type is not supported: ${e}`)}}function Mh(t){var e=Oh(t,0);if(!e){e=Ph(t);let r=$h(t),n=new Uint8Array(t.width*t.height*4);hh(r,e,Dh(t)),e.readPixels(0,0,t.width,t.height,e.RGBA,e.UNSIGNED_BYTE,n),uh(r),e=new ImageData(new Uint8ClampedArray(n.buffer),t.width,t.height),t.g.push(e)}return e}function Dh(t){var e=Oh(t,2);if(!e){let r=Ph(t);e=Uh(t);let n=Oh(t,1)||Mh(t);r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),Bh(t)}return e}function Ph(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=eh(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function $h(t){return t.l||(t.l=new ch),t.l}function Uh(t){var e=Ph(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);var r=Oh(t,2);return r||(r=ah($h(t),e),t.g.push(r),t.m=!0),e.bindTexture(e.TEXTURE_2D,r),r}function Bh(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}function Gh(t){var e=Ph(t);return oh($h(t),e,!0,()=>function(t,e){var r=t.canvas;if(r.width===t.width&&r.height===t.height)return e();var n=r.width,i=r.height;return r.width=t.width,r.height=t.height,t=e(),r.width=n,r.height=i,t}(t,()=>{if(e.bindFramebuffer(e.FRAMEBUFFER,null),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLE_FAN,0,4),!(t.canvas instanceof OffscreenCanvas))throw Error("Conversion to ImageBitmap requires that the MediaPipe Tasks is initialized with an OffscreenCanvas");return t.canvas.transferToImageBitmap()}))}Nh.prototype.close=Nh.prototype.close,Nh.prototype.drawConfidenceMask=Nh.prototype.xa,Nh.prototype.drawCategoryMask=Nh.prototype.wa,Nh.prototype.drawBoundingBox=Nh.prototype.va,Nh.prototype.drawConnectors=Nh.prototype.ya,Nh.prototype.drawLandmarks=Nh.prototype.za,Nh.lerp=function(t,e,r,n,i){return Lh(n*(1-(t-e)/(r-e))+i*(1-(r-t)/(r-e)),n,i)},Nh.clamp=Lh;var jh=class{constructor(t,e,r,n,i,s,o){this.g=t,this.j=e,this.m=r,this.canvas=n,this.l=i,this.width=s,this.height=o,(this.j||this.m)&&(0===--Vh&&console.error("You seem to be creating MPImage instances without invoking .close(). This leaks resources."))}Fa(){return!!Oh(this,0)}la(){return!!Oh(this,1)}R(){return!!Oh(this,2)}Da(){return Mh(this)}Ca(){var t=Oh(this,1);return t||(Dh(this),Uh(this),t=Gh(this),Bh(this),this.g.push(t),this.j=!0),t}P(){return Dh(this)}clone(){var t=[];for(let e of this.g){let r;if(e instanceof ImageData)r=new ImageData(e.data,this.width,this.height);else if(e instanceof WebGLTexture){let t=Ph(this),e=$h(this);t.activeTexture(t.TEXTURE1),r=ah(e,t),t.bindTexture(t.TEXTURE_2D,r),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.width,this.height,0,t.RGBA,t.UNSIGNED_BYTE,null),t.bindTexture(t.TEXTURE_2D,null),hh(e,t,r),oh(e,t,!1,()=>{Uh(this),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4),Bh(this)}),uh(e),Bh(this)}else{if(!(e instanceof ImageBitmap))throw Error(`Type is not supported: ${e}`);Dh(this),Uh(this),r=Gh(this),Bh(this)}t.push(r)}return new jh(t,this.la(),this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&Oh(this,1).close(),this.m&&Ph(this).deleteTexture(Oh(this,2)),Vh=-1}};jh.prototype.close=jh.prototype.close,jh.prototype.clone=jh.prototype.clone,jh.prototype.getAsWebGLTexture=jh.prototype.P,jh.prototype.getAsImageBitmap=jh.prototype.Ca,jh.prototype.getAsImageData=jh.prototype.Da,jh.prototype.hasWebGLTexture=jh.prototype.R,jh.prototype.hasImageBitmap=jh.prototype.la,jh.prototype.hasImageData=jh.prototype.Fa;var Vh=250;function Hh(...t){return t.map(([t,e])=>({start:t,end:e}))}var Kh,Xh=Va((Kh=ja,class extends Kh{get ga(){return this.i}qa(t,e,r){Pa(this,e,e=>{var[n,i]=$a(this,t,e);this.ga._addBoundTextureAsImageToStream(e,n,i,r)})}Z(t,e){Ba(this,t,e),Pa(this,t,t=>{this.ga._attachImageListener(t)})}aa(t,e){Ga(this,t,e),Pa(this,t,t=>{this.ga._attachImageVectorListener(t)})}})),Wh=class extends Xh{};async function zh(t,e,r){return Wa(t,r.canvas??(Oa()?void 0:document.createElement("canvas")),e,r)}function Yh(t,e,r,n){if(t.na&&void 0!==n&&yr(t.baseOptions,mo,3)?.g(),t.V){let s=new no;if(r?.regionOfInterest){if(!t.pa)throw Error("This task doesn't support region-of-interest.");var i=r.regionOfInterest;if(i.left>=i.right||i.top>=i.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(i.left<0||i.top<0||i.right>1||i.bottom>1)throw Error("Expected RectF values to be in [0,1].");Nr(s,1,(i.left+i.right)/2),Nr(s,2,(i.top+i.bottom)/2),Nr(s,4,i.right-i.left),Nr(s,3,i.bottom-i.top)}else Nr(s,1,.5),Nr(s,2,.5),Nr(s,4,1),Nr(s,3,1);if(r?.rotationDegrees){if(r?.rotationDegrees%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(Nr(s,5,-Math.PI*r.rotationDegrees/180),r?.rotationDegrees%180!=0){let[t,n]=Da(e);r=Rr(s,3)*n/t,i=Rr(s,4)*t/n,Nr(s,4,r),Nr(s,3,i)}}t.g.addProtoToStream(s.g(),"mediapipe.NormalizedRect",t.V,n)}t.g.qa(e,t.oa,n??performance.now()),t.finishProcessing(n)}function qh(t,e,r){if(t.L)throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");Yh(t,e,r,t.C+1)}function Jh(t,e,r,n){if(!t.L)throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");Yh(t,e,r,n)}function Zh(t,e,r,n){var i=e.data,s=e.width,o=s*(e=e.height);if((i instanceof Uint8Array||i instanceof Float32Array)&&i.length!==o)throw Error("Unsupported channel count: "+i.length/o);return t=new wh([i],r,!1,t.g.i.canvas,t.U,s,e),n?t.clone():t}var Qh=class extends th{constructor(t,e,r,n){super(t),this.g=t,this.oa=e,this.V=r,this.pa=n,this.U=new ch,this.L=!1}l(t,e=!0){if("runningMode"in t){var r=this.L=!!t.runningMode&&"IMAGE"!==t.runningMode;tr(this.baseOptions,2,null==r?r:Zt(r))}if(void 0!==t.canvas&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.U.close(),super.close()}};Qh.prototype.close=Qh.prototype.close;var tu=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},Tr(t=this.h=new To,0,1,e=new yo),Nr(this.h,2,.5),Nr(this.h,3,.3)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return"minDetectionConfidence"in t&&Nr(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&Nr(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},qh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Jh(this,t,r,e),this.j}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect_in"),Us(t,"detections");var e=new xs;Yn(e,ko,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect_in"),Cs(r,"DETECTIONS:detections"),r.u(e),Ps(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=qs(e),this.j.detections.push(Ta(t));qa(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};tu.prototype.detectForVideo=tu.prototype.G,tu.prototype.detect=tu.prototype.F,tu.prototype.setOptions=tu.prototype.u,tu.createFromModelPath=async function(t,e){return zh(tu,t,{baseOptions:{modelAssetPath:e}})},tu.createFromModelBuffer=function(t,e){return zh(tu,t,{baseOptions:{modelAssetBuffer:e}})},tu.createFromOptions=function(t,e){return zh(tu,t,e)};var eu=Hh([61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]),ru=Hh([263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]),nu=Hh([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),iu=Hh([474,475],[475,476],[476,477],[477,474]),su=Hh([33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]),ou=Hh([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),au=Hh([469,470],[470,471],[471,472],[472,469]),hu=Hh([10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]),uu=[...eu,...ru,...nu,...su,...ou,...hu],cu=Hh([127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266,425],[425,330],[426,423],[423,391],[391,426],[429,355],[355,437],[437,429],[391,327],[327,326],[326,391],[440,457],[457,438],[438,440],[341,382],[382,362],[362,341],[459,457],[457,461],[461,459],[434,430],[430,394],[394,434],[414,463],[463,362],[362,414],[396,369],[369,262],[262,396],[354,461],[461,457],[457,354],[316,403],[403,402],[402,316],[315,404],[404,403],[403,315],[314,405],[405,404],[404,314],[313,406],[406,405],[405,313],[421,418],[418,406],[406,421],[366,401],[401,361],[361,366],[306,408],[408,407],[407,306],[291,409],[409,408],[408,291],[287,410],[410,409],[409,287],[432,436],[436,410],[410,432],[434,416],[416,411],[411,434],[264,368],[368,383],[383,264],[309,438],[438,457],[457,309],[352,376],[376,401],[401,352],[274,275],[275,4],[4,274],[421,428],[428,262],[262,421],[294,327],[327,358],[358,294],[433,416],[416,367],[367,433],[289,455],[455,439],[439,289],[462,370],[370,326],[326,462],[2,326],[326,370],[370,2],[305,460],[460,455],[455,305],[254,449],[449,448],[448,254],[255,261],[261,446],[446,255],[253,450],[450,449],[449,253],[252,451],[451,450],[450,252],[256,452],[452,451],[451,256],[341,453],[453,452],[452,341],[413,464],[464,463],[463,413],[441,413],[413,414],[414,441],[258,442],[442,441],[441,258],[257,443],[443,442],[442,257],[259,444],[444,443],[443,259],[260,445],[445,444],[444,260],[467,342],[342,445],[445,467],[459,458],[458,250],[250,459],[289,392],[392,290],[290,289],[290,328],[328,460],[460,290],[376,433],[433,435],[435,376],[250,290],[290,392],[392,250],[411,416],[416,433],[433,411],[341,463],[463,464],[464,341],[453,464],[464,465],[465,453],[357,465],[465,412],[412,357],[343,412],[412,399],[399,343],[360,363],[363,440],[440,360],[437,399],[399,456],[456,437],[420,456],[456,363],[363,420],[401,435],[435,288],[288,401],[372,383],[383,353],[353,372],[339,255],[255,249],[249,339],[448,261],[261,255],[255,448],[133,243],[243,190],[190,133],[133,155],[155,112],[112,133],[33,246],[246,247],[247,33],[33,130],[130,25],[25,33],[398,384],[384,286],[286,398],[362,398],[398,414],[414,362],[362,463],[463,341],[341,362],[263,359],[359,467],[467,263],[263,249],[249,255],[255,263],[466,467],[467,260],[260,466],[75,60],[60,166],[166,75],[238,239],[239,79],[79,238],[162,127],[127,139],[139,162],[72,11],[11,37],[37,72],[121,232],[232,120],[120,121],[73,72],[72,39],[39,73],[114,128],[128,47],[47,114],[233,232],[232,128],[128,233],[103,104],[104,67],[67,103],[152,175],[175,148],[148,152],[119,118],[118,101],[101,119],[74,73],[73,40],[40,74],[107,9],[9,108],[108,107],[49,48],[48,131],[131,49],[32,194],[194,211],[211,32],[184,74],[74,185],[185,184],[191,80],[80,183],[183,191],[185,40],[40,186],[186,185],[119,230],[230,118],[118,119],[210,202],[202,214],[214,210],[84,83],[83,17],[17,84],[77,76],[76,146],[146,77],[161,160],[160,30],[30,161],[190,56],[56,173],[173,190],[182,106],[106,194],[194,182],[138,135],[135,192],[192,138],[129,203],[203,98],[98,129],[54,21],[21,68],[68,54],[5,51],[51,4],[4,5],[145,144],[144,23],[23,145],[90,77],[77,91],[91,90],[207,205],[205,187],[187,207],[83,201],[201,18],[18,83],[181,91],[91,182],[182,181],[180,90],[90,181],[181,180],[16,85],[85,17],[17,16],[205,206],[206,36],[36,205],[176,148],[148,140],[140,176],[165,92],[92,39],[39,165],[245,193],[193,244],[244,245],[27,159],[159,28],[28,27],[30,247],[247,161],[161,30],[174,236],[236,196],[196,174],[103,54],[54,104],[104,103],[55,193],[193,8],[8,55],[111,117],[117,31],[31,111],[221,189],[189,55],[55,221],[240,98],[98,99],[99,240],[142,126],[126,100],[100,142],[219,166],[166,218],[218,219],[112,155],[155,26],[26,112],[198,209],[209,131],[131,198],[169,135],[135,150],[150,169],[114,47],[47,217],[217,114],[224,223],[223,53],[53,224],[220,45],[45,134],[134,220],[32,211],[211,140],[140,32],[109,67],[67,108],[108,109],[146,43],[43,91],[91,146],[231,230],[230,120],[120,231],[113,226],[226,247],[247,113],[105,63],[63,52],[52,105],[241,238],[238,242],[242,241],[124,46],[46,156],[156,124],[95,78],[78,96],[96,95],[70,46],[46,63],[63,70],[116,143],[143,227],[227,116],[116,123],[123,111],[111,116],[1,44],[44,19],[19,1],[3,236],[236,51],[51,3],[207,216],[216,205],[205,207],[26,154],[154,22],[22,26],[165,39],[39,167],[167,165],[199,200],[200,208],[208,199],[101,36],[36,100],[100,101],[43,57],[57,202],[202,43],[242,20],[20,99],[99,242],[56,28],[28,157],[157,56],[124,35],[35,113],[113,124],[29,160],[160,27],[27,29],[211,204],[204,210],[210,211],[124,113],[113,46],[46,124],[106,43],[43,204],[204,106],[96,62],[62,77],[77,96],[227,137],[137,116],[116,227],[73,41],[41,72],[72,73],[36,203],[203,142],[142,36],[235,64],[64,240],[240,235],[48,49],[49,64],[64,48],[42,41],[41,74],[74,42],[214,212],[212,207],[207,214],[183,42],[42,184],[184,183],[210,169],[169,211],[211,210],[140,170],[170,176],[176,140],[104,105],[105,69],[69,104],[193,122],[122,168],[168,193],[50,123],[123,187],[187,50],[89,96],[96,90],[90,89],[66,65],[65,107],[107,66],[179,89],[89,180],[180,179],[119,101],[101,120],[120,119],[68,63],[63,104],[104,68],[234,93],[93,227],[227,234],[16,15],[15,85],[85,16],[209,129],[129,49],[49,209],[15,14],[14,86],[86,15],[107,55],[55,9],[9,107],[120,100],[100,121],[121,120],[153,145],[145,22],[22,153],[178,88],[88,179],[179,178],[197,6],[6,196],[196,197],[89,88],[88,96],[96,89],[135,138],[138,136],[136,135],[138,215],[215,172],[172,138],[218,115],[115,219],[219,218],[41,42],[42,81],[81,41],[5,195],[195,51],[51,5],[57,43],[43,61],[61,57],[208,171],[171,199],[199,208],[41,81],[81,38],[38,41],[224,53],[53,225],[225,224],[24,144],[144,110],[110,24],[105,52],[52,66],[66,105],[118,229],[229,117],[117,118],[227,34],[34,234],[234,227],[66,107],[107,69],[69,66],[10,109],[109,151],[151,10],[219,48],[48,235],[235,219],[183,62],[62,191],[191,183],[142,129],[129,126],[126,142],[116,111],[111,143],[143,116],[118,117],[117,50],[50,118],[223,222],[222,52],[52,223],[94,19],[19,141],[141,94],[222,221],[221,65],[65,222],[196,3],[3,197],[197,196],[45,220],[220,44],[44,45],[156,70],[70,139],[139,156],[188,122],[122,245],[245,188],[139,71],[71,162],[162,139],[149,170],[170,150],[150,149],[122,188],[188,196],[196,122],[206,216],[216,92],[92,206],[164,2],[2,167],[167,164],[242,141],[141,241],[241,242],[0,164],[164,37],[37,0],[11,72],[72,12],[12,11],[12,38],[38,13],[13,12],[70,63],[63,71],[71,70],[31,226],[226,111],[111,31],[36,101],[101,205],[205,36],[203,206],[206,165],[165,203],[126,209],[209,217],[217,126],[98,165],[165,97],[97,98],[237,220],[220,218],[218,237],[237,239],[239,241],[241,237],[210,214],[214,169],[169,210],[140,171],[171,32],[32,140],[241,125],[125,237],[237,241],[179,86],[86,178],[178,179],[180,85],[85,179],[179,180],[181,84],[84,180],[180,181],[182,83],[83,181],[181,182],[194,201],[201,182],[182,194],[177,137],[137,132],[132,177],[184,76],[76,183],[183,184],[185,61],[61,184],[184,185],[186,57],[57,185],[185,186],[216,212],[212,186],[186,216],[192,214],[214,187],[187,192],[139,34],[34,156],[156,139],[218,79],[79,237],[237,218],[147,123],[123,177],[177,147],[45,44],[44,4],[4,45],[208,201],[201,32],[32,208],[98,64],[64,129],[129,98],[192,213],[213,138],[138,192],[235,59],[59,219],[219,235],[141,242],[242,97],[97,141],[97,2],[2,141],[141,97],[240,75],[75,235],[235,240],[229,24],[24,228],[228,229],[31,25],[25,226],[226,31],[230,23],[23,229],[229,230],[231,22],[22,230],[230,231],[232,26],[26,231],[231,232],[233,112],[112,232],[232,233],[244,189],[189,243],[243,244],[189,221],[221,190],[190,189],[222,28],[28,221],[221,222],[223,27],[27,222],[222,223],[224,29],[29,223],[223,224],[225,30],[30,224],[224,225],[113,247],[247,225],[225,113],[99,60],[60,240],[240,99],[213,147],[147,215],[215,213],[60,20],[20,166],[166,60],[192,187],[187,213],[213,192],[243,112],[112,244],[244,243],[244,233],[233,245],[245,244],[245,128],[128,188],[188,245],[188,114],[114,174],[174,188],[134,131],[131,220],[220,134],[174,217],[217,236],[236,174],[236,198],[198,134],[134,236],[215,177],[177,58],[58,215],[156,143],[143,124],[124,156],[25,110],[110,7],[7,25],[31,228],[228,25],[25,31],[264,356],[356,368],[368,264],[0,11],[11,267],[267,0],[451,452],[452,349],[349,451],[267,302],[302,269],[269,267],[350,357],[357,277],[277,350],[350,452],[452,357],[357,350],[299,333],[333,297],[297,299],[396,175],[175,377],[377,396],[280,347],[347,330],[330,280],[269,303],[303,270],[270,269],[151,9],[9,337],[337,151],[344,278],[278,360],[360,344],[424,418],[418,431],[431,424],[270,304],[304,409],[409,270],[272,310],[310,407],[407,272],[322,270],[270,410],[410,322],[449,450],[450,347],[347,449],[432,422],[422,434],[434,432],[18,313],[313,17],[17,18],[291,306],[306,375],[375,291],[259,387],[387,260],[260,259],[424,335],[335,418],[418,424],[434,364],[364,416],[416,434],[391,423],[423,327],[327,391],[301,251],[251,298],[298,301],[275,281],[281,4],[4,275],[254,373],[373,253],[253,254],[375,307],[307,321],[321,375],[280,425],[425,411],[411,280],[200,421],[421,18],[18,200],[335,321],[321,406],[406,335],[321,320],[320,405],[405,321],[314,315],[315,17],[17,314],[423,426],[426,266],[266,423],[396,377],[377,369],[369,396],[270,322],[322,269],[269,270],[413,417],[417,464],[464,413],[385,386],[386,258],[258,385],[248,456],[456,419],[419,248],[298,284],[284,333],[333,298],[168,417],[417,8],[8,168],[448,346],[346,261],[261,448],[417,413],[413,285],[285,417],[326,327],[327,328],[328,326],[277,355],[355,329],[329,277],[309,392],[392,438],[438,309],[381,382],[382,256],[256,381],[279,429],[429,360],[360,279],[365,364],[364,379],[379,365],[355,277],[277,437],[437,355],[282,443],[443,283],[283,282],[281,275],[275,363],[363,281],[395,431],[431,369],[369,395],[299,297],[297,337],[337,299],[335,273],[273,321],[321,335],[348,450],[450,349],[349,348],[359,446],[446,467],[467,359],[283,293],[293,282],[282,283],[250,458],[458,462],[462,250],[300,276],[276,383],[383,300],[292,308],[308,325],[325,292],[283,276],[276,293],[293,283],[264,372],[372,447],[447,264],[346,352],[352,340],[340,346],[354,274],[274,19],[19,354],[363,456],[456,281],[281,363],[426,436],[436,425],[425,426],[380,381],[381,252],[252,380],[267,269],[269,393],[393,267],[421,200],[200,428],[428,421],[371,266],[266,329],[329,371],[432,287],[287,422],[422,432],[290,250],[250,328],[328,290],[385,258],[258,384],[384,385],[446,265],[265,342],[342,446],[386,387],[387,257],[257,386],[422,424],[424,430],[430,422],[445,342],[342,276],[276,445],[422,273],[273,424],[424,422],[306,292],[292,307],[307,306],[352,366],[366,345],[345,352],[268,271],[271,302],[302,268],[358,423],[423,371],[371,358],[327,294],[294,460],[460,327],[331,279],[279,294],[294,331],[303,271],[271,304],[304,303],[436,432],[432,427],[427,436],[304,272],[272,408],[408,304],[395,394],[394,431],[431,395],[378,395],[395,400],[400,378],[296,334],[334,299],[299,296],[6,351],[351,168],[168,6],[376,352],[352,411],[411,376],[307,325],[325,320],[320,307],[285,295],[295,336],[336,285],[320,319],[319,404],[404,320],[329,330],[330,349],[349,329],[334,293],[293,333],[333,334],[366,323],[323,447],[447,366],[316,15],[15,315],[315,316],[331,358],[358,279],[279,331],[317,14],[14,316],[316,317],[8,285],[285,9],[9,8],[277,329],[329,350],[350,277],[253,374],[374,252],[252,253],[319,318],[318,403],[403,319],[351,6],[6,419],[419,351],[324,318],[318,325],[325,324],[397,367],[367,365],[365,397],[288,435],[435,397],[397,288],[278,344],[344,439],[439,278],[310,272],[272,311],[311,310],[248,195],[195,281],[281,248],[375,273],[273,291],[291,375],[175,396],[396,199],[199,175],[312,311],[311,268],[268,312],[276,283],[283,445],[445,276],[390,373],[373,339],[339,390],[295,282],[282,296],[296,295],[448,449],[449,346],[346,448],[356,264],[264,454],[454,356],[337,336],[336,299],[299,337],[337,338],[338,151],[151,337],[294,278],[278,455],[455,294],[308,292],[292,415],[415,308],[429,358],[358,355],[355,429],[265,340],[340,372],[372,265],[352,346],[346,280],[280,352],[295,442],[442,282],[282,295],[354,19],[19,370],[370,354],[285,441],[441,295],[295,285],[195,248],[248,197],[197,195],[457,440],[440,274],[274,457],[301,300],[300,368],[368,301],[417,351],[351,465],[465,417],[251,301],[301,389],[389,251],[394,395],[395,379],[379,394],[399,412],[412,419],[419,399],[410,436],[436,322],[322,410],[326,2],[2,393],[393,326],[354,370],[370,461],[461,354],[393,164],[164,267],[267,393],[268,302],[302,12],[12,268],[312,268],[268,13],[13,312],[298,293],[293,301],[301,298],[265,446],[446,340],[340,265],[280,330],[330,425],[425,280],[322,426],[426,391],[391,322],[420,429],[429,437],[437,420],[393,391],[391,326],[326,393],[344,440],[440,438],[438,344],[458,459],[459,461],[461,458],[364,434],[434,394],[394,364],[428,396],[396,262],[262,428],[274,354],[354,457],[457,274],[317,316],[316,402],[402,317],[316,315],[315,403],[403,316],[315,314],[314,404],[404,315],[314,313],[313,405],[405,314],[313,421],[421,406],[406,313],[323,366],[366,361],[361,323],[292,306],[306,407],[407,292],[306,291],[291,408],[408,306],[291,287],[287,409],[409,291],[287,432],[432,410],[410,287],[427,434],[434,411],[411,427],[372,264],[264,383],[383,372],[459,309],[309,457],[457,459],[366,352],[352,401],[401,366],[1,274],[274,4],[4,1],[418,421],[421,262],[262,418],[331,294],[294,358],[358,331],[435,433],[433,367],[367,435],[392,289],[289,439],[439,392],[328,462],[462,326],[326,328],[94,2],[2,370],[370,94],[289,305],[305,455],[455,289],[339,254],[254,448],[448,339],[359,255],[255,446],[446,359],[254,253],[253,449],[449,254],[253,252],[252,450],[450,253],[252,256],[256,451],[451,252],[256,341],[341,452],[452,256],[414,413],[413,463],[463,414],[286,441],[441,414],[414,286],[286,258],[258,441],[441,286],[258,257],[257,442],[442,258],[257,259],[259,443],[443,257],[259,260],[260,444],[444,259],[260,467],[467,445],[445,260],[309,459],[459,250],[250,309],[305,289],[289,290],[290,305],[305,290],[290,460],[460,305],[401,376],[376,435],[435,401],[309,250],[250,392],[392,309],[376,411],[411,433],[433,376],[453,341],[341,464],[464,453],[357,453],[453,465],[465,357],[343,357],[357,412],[412,343],[437,343],[343,399],[399,437],[344,360],[360,440],[440,344],[420,437],[437,456],[456,420],[360,420],[420,363],[363,360],[361,401],[401,288],[288,361],[265,372],[372,353],[353,265],[390,339],[339,249],[249,390],[339,448],[448,255],[255,339]);function lu(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var du=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,Tr(t=this.h=new xo,0,1,e=new yo),this.A=new Lo,Tr(this.h,0,3,this.A),this.o=new To,Tr(this.h,0,2,this.o),Cr(this.o,4,1),Nr(this.o,2,.5),Nr(this.A,2,.5),Nr(this.h,4,.5)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return"numFaces"in t&&Cr(this.o,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&Nr(this.o,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&Nr(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&Nr(this.A,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return lu(this),qh(this,t,e),this.j}G(t,e,r){return lu(this),Jh(this,t,r,e),this.j}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect"),Us(t,"face_landmarks");var e=new xs;Yn(e,Fo,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"NORM_LANDMARKS:face_landmarks"),r.u(e),Ps(t,r),this.g.attachProtoVectorListener("face_landmarks",(t,e)=>{for(let e of t)t=to(e),this.j.faceLandmarks.push(ba(t));qa(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{qa(this,t)}),this.outputFaceBlendshapes&&(Us(t,"blendshapes"),Cs(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(t,e)=>{if(this.outputFaceBlendshapes)for(let e of t)t=Xs(e),this.j.faceBlendshapes.push(Aa(t.g()??[]));qa(this,e)}),this.g.attachEmptyPacketListener("blendshapes",t=>{qa(this,t)})),this.outputFacialTransformationMatrixes&&(Us(t,"face_geometry"),Cs(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(t,e)=>{if(this.outputFacialTransformationMatrixes)for(let e of t)(t=yr(t=So(e),eo,2))&&this.j.facialTransformationMatrixes.push({rows:xr(t,1)??0??0,columns:xr(t,2)??0??0,data:ir(t,3,Jt,nr()).slice()??[]});qa(this,e)}),this.g.attachEmptyPacketListener("face_geometry",t=>{qa(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};du.prototype.detectForVideo=du.prototype.G,du.prototype.detect=du.prototype.F,du.prototype.setOptions=du.prototype.u,du.createFromModelPath=function(t,e){return zh(du,t,{baseOptions:{modelAssetPath:e}})},du.createFromModelBuffer=function(t,e){return zh(du,t,{baseOptions:{modelAssetBuffer:e}})},du.createFromOptions=function(t,e){return zh(du,t,e)},du.FACE_LANDMARKS_LIPS=eu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LIPS",du.FACE_LANDMARKS_LIPS),du.FACE_LANDMARKS_LEFT_EYE=ru,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYE",du.FACE_LANDMARKS_LEFT_EYE),du.FACE_LANDMARKS_LEFT_EYEBROW=nu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",du.FACE_LANDMARKS_LEFT_EYEBROW),du.FACE_LANDMARKS_LEFT_IRIS=iu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_LEFT_IRIS",du.FACE_LANDMARKS_LEFT_IRIS),du.FACE_LANDMARKS_RIGHT_EYE=su,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYE",du.FACE_LANDMARKS_RIGHT_EYE),du.FACE_LANDMARKS_RIGHT_EYEBROW=ou,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",du.FACE_LANDMARKS_RIGHT_EYEBROW),du.FACE_LANDMARKS_RIGHT_IRIS=au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_RIGHT_IRIS",du.FACE_LANDMARKS_RIGHT_IRIS),du.FACE_LANDMARKS_FACE_OVAL=hu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_FACE_OVAL",du.FACE_LANDMARKS_FACE_OVAL),du.FACE_LANDMARKS_CONTOURS=uu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_CONTOURS",du.FACE_LANDMARKS_CONTOURS),du.FACE_LANDMARKS_TESSELATION=cu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$face_landmarker$face_landmarker.FaceLandmarker.FACE_LANDMARKS_TESSELATION",du.FACE_LANDMARKS_TESSELATION);var fu=Hh([0,1],[1,2],[2,3],[3,4],[0,5],[5,6],[6,7],[7,8],[5,9],[9,10],[10,11],[11,12],[9,13],[13,14],[14,15],[15,16],[13,17],[0,17],[17,18],[18,19],[19,20]);function pu(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function gu(t){return 0===t.gestures.length?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function mu(t,e=!0){var r=[];for(let i of t){var n=Xs(i);t=[];for(let r of n.g())n=e&&null!=xr(r,1)?xr(r,1)??0:-1,t.push({score:Rr(r,2)??0,index:n,categoryName:le(Ze(r,3))??""??"",displayName:le(Ze(r,4))??""??""});r.push(t)}return r}var _u=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Tr(t=this.j=new Po,0,1,e=new yo),this.o=new Do,Tr(this.j,0,2,this.o),this.D=new Mo,Tr(this.o,0,3,this.D),this.A=new Oo,Tr(this.o,0,2,this.A),this.h=new No,Tr(this.j,0,3,this.h),Nr(this.A,2,.5),Nr(this.o,4,.5),Nr(this.D,2,.5)}get baseOptions(){return yr(this.j,yo,1)}set baseOptions(t){Tr(this.j,0,1,t)}u(t){if(Cr(this.A,3,t.numHands??1),"minHandDetectionConfidence"in t&&Nr(this.A,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Nr(this.o,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Nr(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new Io,r=e,n=ya(t.cannedGesturesClassifierOptions,yr(this.h,Io,3)?.l());Tr(r,0,2,n),Tr(this.h,0,3,e)}else void 0===t.cannedGesturesClassifierOptions&&yr(this.h,Io,3)?.g();return t.customGesturesClassifierOptions?(Tr(r=e=new Io,0,2,n=ya(t.customGesturesClassifierOptions,yr(this.h,Io,4)?.l())),Tr(this.h,0,4,e)):void 0===t.customGesturesClassifierOptions&&yr(this.h,Io,4)?.g(),this.l(t)}Ja(t,e){return pu(this),qh(this,t,e),gu(this)}Ka(t,e,r){return pu(this),Jh(this,t,r,e),gu(this)}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect"),Us(t,"hand_gestures"),Us(t,"hand_landmarks"),Us(t,"world_hand_landmarks"),Us(t,"handedness");var e=new xs;Yn(e,jo,this.j);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"HAND_GESTURES:hand_gestures"),Cs(r,"LANDMARKS:hand_landmarks"),Cs(r,"WORLD_LANDMARKS:world_hand_landmarks"),Cs(r,"HANDEDNESS:handedness"),r.u(e),Ps(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t){t=to(e);let r=[];for(let e of Ar(t,Qs,1))r.push({x:Rr(e,1)??0,y:Rr(e,2)??0,z:Rr(e,3)??0,visibility:Rr(e,4)??0});this.landmarks.push(r)}qa(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t){t=Zs(e);let r=[];for(let e of Ar(t,Js,1))r.push({x:Rr(e,1)??0,y:Rr(e,2)??0,z:Rr(e,3)??0,visibility:Rr(e,4)??0});this.worldLandmarks.push(r)}qa(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoVectorListener("hand_gestures",(t,e)=>{this.gestures.push(...mu(t,!1)),qa(this,e)}),this.g.attachEmptyPacketListener("hand_gestures",t=>{qa(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{this.handedness.push(...mu(t)),qa(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function vu(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}_u.prototype.recognizeForVideo=_u.prototype.Ka,_u.prototype.recognize=_u.prototype.Ja,_u.prototype.setOptions=_u.prototype.u,_u.createFromModelPath=function(t,e){return zh(_u,t,{baseOptions:{modelAssetPath:e}})},_u.createFromModelBuffer=function(t,e){return zh(_u,t,{baseOptions:{modelAssetBuffer:e}})},_u.createFromOptions=function(t,e){return zh(_u,t,e)},_u.HAND_CONNECTIONS=fu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$gesture_recognizer$gesture_recognizer.GestureRecognizer.HAND_CONNECTIONS",_u.HAND_CONNECTIONS);var yu=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Tr(t=this.h=new Do,0,1,e=new yo),this.o=new Mo,Tr(this.h,0,3,this.o),this.j=new Oo,Tr(this.h,0,2,this.j),Cr(this.j,3,1),Nr(this.j,2,.5),Nr(this.o,2,.5),Nr(this.h,4,.5)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return"numHands"in t&&Cr(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&Nr(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&Nr(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&Nr(this.o,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],qh(this,t,e),vu(this)}G(t,e,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Jh(this,t,r,e),vu(this)}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect"),Us(t,"hand_landmarks"),Us(t,"world_hand_landmarks"),Us(t,"handedness");var e=new xs;Yn(e,Vo,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"LANDMARKS:hand_landmarks"),Cs(r,"WORLD_LANDMARKS:world_hand_landmarks"),Cs(r,"HANDEDNESS:handedness"),r.u(e),Ps(t,r),this.g.attachProtoVectorListener("hand_landmarks",(t,e)=>{for(let e of t)t=to(e),this.landmarks.push(ba(t));qa(this,e)}),this.g.attachEmptyPacketListener("hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoVectorListener("world_hand_landmarks",(t,e)=>{for(let e of t)t=Zs(e),this.worldLandmarks.push(ka(t));qa(this,e)}),this.g.attachEmptyPacketListener("world_hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoVectorListener("handedness",(t,e)=>{var r=this.handedness,n=r.push,i=[];for(let e of t){t=Xs(e);let r=[];for(let e of t.g())r.push({score:Rr(e,2)??0,index:xr(e,1)??0??-1,categoryName:le(Ze(e,3))??""??"",displayName:le(Ze(e,4))??""??""});i.push(r)}n.call(r,...i),qa(this,e)}),this.g.attachEmptyPacketListener("handedness",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};yu.prototype.detectForVideo=yu.prototype.G,yu.prototype.detect=yu.prototype.F,yu.prototype.setOptions=yu.prototype.u,yu.createFromModelPath=function(t,e){return zh(yu,t,{baseOptions:{modelAssetPath:e}})},yu.createFromModelBuffer=function(t,e){return zh(yu,t,{baseOptions:{modelAssetBuffer:e}})},yu.createFromOptions=function(t,e){return zh(yu,t,e)},yu.HAND_CONNECTIONS=fu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$hand_landmarker$hand_landmarker.HandLandmarker.HAND_CONNECTIONS",yu.HAND_CONNECTIONS);var Eu=Hh([0,1],[1,2],[2,3],[3,7],[0,4],[4,5],[5,6],[6,8],[9,10],[11,12],[11,13],[13,15],[15,17],[15,19],[15,21],[17,19],[12,14],[14,16],[16,18],[16,20],[16,22],[18,20],[11,23],[12,24],[23,24],[23,25],[24,26],[25,27],[26,28],[27,29],[28,30],[29,31],[30,32],[27,31],[28,32]);function Au(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function wu(t){try{if(!t.D)return t.h;t.D(t.h)}finally{Qa(t)}}function Tu(t,e){t=to(t),e.push(ba(t))}var bu=class extends Qh{constructor(t,e){super(new Wh(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,Tr(t=this.j=new Wo,0,1,e=new yo),this.N=new Mo,Tr(this.j,0,2,this.N),this.X=new Ho,Tr(this.j,0,3,this.X),this.o=new To,Tr(this.j,0,4,this.o),this.I=new Lo,Tr(this.j,0,5,this.I),this.A=new Ko,Tr(this.j,0,6,this.A),this.O=new Xo,Tr(this.j,0,7,this.O),Nr(this.o,2,.5),Nr(this.o,3,.3),Nr(this.I,2,.5),Nr(this.A,2,.5),Nr(this.A,3,.3),Nr(this.O,2,.5),Nr(this.N,2,.5)}get baseOptions(){return yr(this.j,yo,1)}set baseOptions(t){Tr(this.j,0,1,t)}u(t){return"minFaceDetectionConfidence"in t&&Nr(this.o,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&Nr(this.o,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&Nr(this.I,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&Nr(this.A,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&Nr(this.A,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&Nr(this.O,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&Nr(this.N,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.D="function"==typeof e?e:r,Au(this),qh(this,t,n),wu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.D="function"==typeof r?r:n,Au(this),Jh(this,t,i,e),wu(this)}m(){var t=new Bs;$s(t,"input_frames_image"),Us(t,"pose_landmarks"),Us(t,"pose_world_landmarks"),Us(t,"face_landmarks"),Us(t,"left_hand_landmarks"),Us(t,"left_hand_world_landmarks"),Us(t,"right_hand_landmarks"),Us(t,"right_hand_world_landmarks");var e=new xs,r=new ds;Mr(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(t,e){if(null!=e)if(Array.isArray(e))tr(t,2,Oe(e,0,De));else{if(!("string"==typeof e||e instanceof N||x(e)))throw Error("invalid value in Any.value field: "+e+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");lr(t,2,ct(e,!1),F())}}(r,this.j.g());var n=new Ns;Mr(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Lr(n,8,ds,r),Is(n,"IMAGE:input_frames_image"),Cs(n,"POSE_LANDMARKS:pose_landmarks"),Cs(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),Cs(n,"FACE_LANDMARKS:face_landmarks"),Cs(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),Cs(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),Cs(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),Cs(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.u(e),Ps(t,n),Ja(this,t),this.g.attachProtoListener("pose_landmarks",(t,e)=>{Tu(t,this.h.poseLandmarks),qa(this,e)}),this.g.attachEmptyPacketListener("pose_landmarks",t=>{qa(this,t)}),this.g.attachProtoListener("pose_world_landmarks",(t,e)=>{var r=this.h.poseWorldLandmarks;t=Zs(t),r.push(ka(t)),qa(this,e)}),this.g.attachEmptyPacketListener("pose_world_landmarks",t=>{qa(this,t)}),this.outputPoseSegmentationMasks&&(Cs(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),Za(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(t,e)=>{this.h.poseSegmentationMasks=[Zh(this,t,!0,!this.D)],qa(this,e)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",t=>{this.h.poseSegmentationMasks=[],qa(this,t)})),this.g.attachProtoListener("face_landmarks",(t,e)=>{Tu(t,this.h.faceLandmarks),qa(this,e)}),this.g.attachEmptyPacketListener("face_landmarks",t=>{qa(this,t)}),this.outputFaceBlendshapes&&(Us(t,"extra_blendshapes"),Cs(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(t,e)=>{var r=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(t=Xs(t),r.push(Aa(t.g()??[]))),qa(this,e)}),this.g.attachEmptyPacketListener("extra_blendshapes",t=>{qa(this,t)})),this.g.attachProtoListener("left_hand_landmarks",(t,e)=>{Tu(t,this.h.leftHandLandmarks),qa(this,e)}),this.g.attachEmptyPacketListener("left_hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoListener("left_hand_world_landmarks",(t,e)=>{var r=this.h.leftHandWorldLandmarks;t=Zs(t),r.push(ka(t)),qa(this,e)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",t=>{qa(this,t)}),this.g.attachProtoListener("right_hand_landmarks",(t,e)=>{Tu(t,this.h.rightHandLandmarks),qa(this,e)}),this.g.attachEmptyPacketListener("right_hand_landmarks",t=>{qa(this,t)}),this.g.attachProtoListener("right_hand_world_landmarks",(t,e)=>{var r=this.h.rightHandWorldLandmarks;t=Zs(t),r.push(ka(t)),qa(this,e)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};bu.prototype.detectForVideo=bu.prototype.G,bu.prototype.detect=bu.prototype.F,bu.prototype.setOptions=bu.prototype.u,bu.createFromModelPath=function(t,e){return zh(bu,t,{baseOptions:{modelAssetPath:e}})},bu.createFromModelBuffer=function(t,e){return zh(bu,t,{baseOptions:{modelAssetBuffer:e}})},bu.createFromOptions=function(t,e){return zh(bu,t,e)},bu.HAND_CONNECTIONS=fu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.HAND_CONNECTIONS",bu.HAND_CONNECTIONS),bu.POSE_CONNECTIONS=Eu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.POSE_CONNECTIONS",bu.POSE_CONNECTIONS),bu.FACE_LANDMARKS_LIPS=eu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LIPS",bu.FACE_LANDMARKS_LIPS),bu.FACE_LANDMARKS_LEFT_EYE=ru,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYE",bu.FACE_LANDMARKS_LEFT_EYE),bu.FACE_LANDMARKS_LEFT_EYEBROW=nu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_EYEBROW",bu.FACE_LANDMARKS_LEFT_EYEBROW),bu.FACE_LANDMARKS_LEFT_IRIS=iu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_LEFT_IRIS",bu.FACE_LANDMARKS_LEFT_IRIS),bu.FACE_LANDMARKS_RIGHT_EYE=su,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYE",bu.FACE_LANDMARKS_RIGHT_EYE),bu.FACE_LANDMARKS_RIGHT_EYEBROW=ou,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_EYEBROW",bu.FACE_LANDMARKS_RIGHT_EYEBROW),bu.FACE_LANDMARKS_RIGHT_IRIS=au,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_RIGHT_IRIS",bu.FACE_LANDMARKS_RIGHT_IRIS),bu.FACE_LANDMARKS_FACE_OVAL=hu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_FACE_OVAL",bu.FACE_LANDMARKS_FACE_OVAL),bu.FACE_LANDMARKS_CONTOURS=uu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_CONTOURS",bu.FACE_LANDMARKS_CONTOURS),bu.FACE_LANDMARKS_TESSELATION=cu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$holistic_landmarker$holistic_landmarker.HolisticLandmarker.FACE_LANDMARKS_TESSELATION",bu.FACE_LANDMARKS_TESSELATION);var ku=class extends Qh{constructor(t,e){super(new Wh(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},Tr(t=this.h=new qo,0,1,e=new yo)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return Tr(this.h,0,2,ya(t,yr(this.h,lo,2))),this.l(t)}ta(t,e){return this.j={classifications:[]},qh(this,t,e),this.j}ua(t,e,r){return this.j={classifications:[]},Jh(this,t,r,e),this.j}m(){var t=new Bs;$s(t,"input_image"),$s(t,"norm_rect"),Us(t,"classifications");var e=new xs;Yn(e,Jo,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),Is(r,"IMAGE:input_image"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"CLASSIFICATIONS:classifications"),r.u(e),Ps(t,r),this.g.attachProtoListener("classifications",(t,e)=>{this.j=wa(so(t)),qa(this,e)}),this.g.attachEmptyPacketListener("classifications",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ku.prototype.classifyForVideo=ku.prototype.ua,ku.prototype.classify=ku.prototype.ta,ku.prototype.setOptions=ku.prototype.u,ku.createFromModelPath=function(t,e){return zh(ku,t,{baseOptions:{modelAssetPath:e}})},ku.createFromModelBuffer=function(t,e){return zh(ku,t,{baseOptions:{modelAssetBuffer:e}})},ku.createFromOptions=function(t,e){return zh(ku,t,e)};var Su=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!0),this.h=new Zo,this.embeddings={embeddings:[]},Tr(t=this.h,0,1,e=new yo)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){var e=this.h,r=yr(this.h,po,2);if(r=r?r.clone():new po,void 0!==t.l2Normalize){var n=t.l2Normalize;tr(r,1,null==n?n:Zt(n))}else"l2Normalize"in t&&tr(r,1);return void 0!==t.quantize?tr(r,2,null==(n=t.quantize)?n:Zt(n)):"quantize"in t&&tr(r,2),Tr(e,0,2,r),this.l(t)}Aa(t,e){return qh(this,t,e),this.embeddings}Ba(t,e,r){return Jh(this,t,r,e),this.embeddings}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect"),Us(t,"embeddings_out");var e=new xs;Yn(e,Qo,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"EMBEDDINGS:embeddings_out"),r.u(e),Ps(t,r),this.g.attachProtoListener("embeddings_out",(t,e)=>{t=co(t),this.embeddings=function(t){return{embeddings:Ar(t,ho,1).map(t=>{var e={headIndex:xr(t,3)??0??-1,headName:le(Ze(t,4))??""??""};if(rr(t,oo,1,uo))t=ir(t=Fr(t,oo,1),1,Jt,nr()),e.floatEmbedding=t.slice();else{let r=new Uint8Array(0);e.quantizedEmbedding=Fr(t,ao,2)?.g()?.h()??r}return e}),timestampMs:Ea(Ze(t,2,void 0,he)??qe)}}(t),qa(this,e)}),this.g.attachEmptyPacketListener("embeddings_out",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Su.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=La(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=La(Sa(t.quantizedEmbedding),Sa(e.quantizedEmbedding))}return t},Su.prototype.embedForVideo=Su.prototype.Ba,Su.prototype.embed=Su.prototype.Aa,Su.prototype.setOptions=Su.prototype.u,Su.createFromModelPath=function(t,e){return zh(Su,t,{baseOptions:{modelAssetPath:e}})},Su.createFromModelBuffer=function(t,e){return zh(Su,t,{baseOptions:{modelAssetBuffer:e}})},Su.createFromOptions=function(t,e){return zh(Su,t,e)};var Lu=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};function xu(t){var e=function(t){return Ar(t,Ns,1)}(t.ca()).filter(t=>(le(Ze(t,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(t.o=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");1===e.length&&(yr(e[0],xs,7)?.j()?.g()??new Map).forEach((e,r)=>{t.o[Number(r)]=le(Ze(e,1))??""})}function Ru(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function Fu(t){try{let e=new Lu(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Qa(t)}}Lu.prototype.close=Lu.prototype.close;var Iu=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!1),this.o=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ia,this.A=new ta,Tr(this.h,0,3,this.A),Tr(t=this.h,0,1,e=new yo)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?tr(this.h,2,ce(t.displayNamesLocale)):"displayNamesLocale"in t&&tr(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}M(){xu(this)}segment(t,e,r){var n="function"!=typeof e?e:{};return this.j="function"==typeof e?e:r,Ru(this),qh(this,t,n),Fu(this)}Na(t,e,r,n){var i="function"!=typeof r?r:{};return this.j="function"==typeof r?r:n,Ru(this),Jh(this,t,i,e),Fu(this)}Ea(){return this.o}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect");var e=new xs;Yn(e,sa,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),r.u(e),Ps(t,r),Ja(this,t),this.outputConfidenceMasks&&(Us(t,"confidence_masks"),Cs(r,"CONFIDENCE_MASKS:confidence_masks"),Za(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Zh(this,t,!0,!this.j)),qa(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],qa(this,t)})),this.outputCategoryMask&&(Us(t,"category_mask"),Cs(r,"CATEGORY_MASK:category_mask"),Za(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Zh(this,t,!1,!this.j),qa(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,qa(this,t)})),Us(t,"quality_scores"),Cs(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,qa(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Iu.prototype.getLabels=Iu.prototype.Ea,Iu.prototype.segmentForVideo=Iu.prototype.Na,Iu.prototype.segment=Iu.prototype.segment,Iu.prototype.setOptions=Iu.prototype.u,Iu.createFromModelPath=function(t,e){return zh(Iu,t,{baseOptions:{modelAssetPath:e}})},Iu.createFromModelBuffer=function(t,e){return zh(Iu,t,{baseOptions:{modelAssetBuffer:e}})},Iu.createFromOptions=function(t,e){return zh(Iu,t,e)};var Cu={0:0,1:1,2:2,3:3};function Nu(){return Oa()?void 0:document.createElement("canvas")}var Ou=class extends th{constructor(t,e){super(new Ka(t,e)),this.o=new ch,this.delegate="CPU",this.h=0,this.baseOptions=new yo,this.j=0}get i(){return this.g.i}u(t){return this.delegate=t.baseOptions?.delegate??"CPU",super.l(t)}Oa(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e;if(0!==this.j&&(this.i._free(this.j),this.j=0),!(e="undefined"!=typeof ImageData&&t instanceof ImageData))if("object"!=typeof t||null===t)e=!1;else{e=t.data;var r=t.width,n=t.height;e=Number.isInteger(r)&&r>0&&Number.isInteger(n)&&n>0&&(e instanceof Uint8ClampedArray||e instanceof Uint8Array)}if(e)e=t.width,r=t.height,t=t.data;else{if([e,r]=Da(t),"undefined"!=typeof OffscreenCanvas)n=new OffscreenCanvas(e,r);else{if("undefined"==typeof document)throw Error("Canvas is not supported in this environment.");n=document.createElement("canvas")}if(n.width=e,n.height=r,!(n=n.getContext("2d")))throw Error("Canvas 2D context is not supported in this environment.");n.drawImage(t,0,0),t=n.getImageData(0,0,e,r).data}if(!t)throw Error("Unsupported image source or failed to extract image pixels.");n=function({Ia:t,width:e,height:r}){if(e<=0||r<=0)throw Error(`Invalid image dimensions: ${e}x${r}. Dimensions must be positive.`);if(t%(e*r)!==0)throw Error(`Invalid image dimensions or pixel data length. Pixel data length ${t} is not a multiple of the number of pixels (${e*r}).`);if(4!==(t/=e*r)&&3!==t&&1!==t)throw Error(`Invalid image dimensions or pixel data length. Calculated channels: ${t}. Expected 1, 3, or 4.`);return t}({Ia:t.length,width:e,height:r});var i=this.i._malloc(t.length);if(this.i.HEAPU8.set(t,i),this.j=i,!this.i._interactive_segmenter_set_image(this.h,i,e,r,n))throw Error("Failed to set image on native engine.")}segment(t){if(0===this.h)throw Error("Segmenter is not initialized.");var e=function(t){t=t.map(({isCompleted:t,brushMode:e,point:r})=>{e=Cu[e]??0,r=r.map(({x:t,y:e})=>{var r=new oa;return Or(r,1,t),Or(r,2,e),r});var n=new aa;if(Ir(n,t),null==e)t=e;else{if(!Wt(e))throw P("enum");t=0|e}return lr(n,1,t,0),kr(n,2,r),n});var e=new ha;return kr(e,1,t),ua(e)}(t);t=this.i._malloc(e.length),this.i.HEAPU8.set(e,t);var r=this.i._malloc(12),n=r+4,i=r+8,s=0;try{if(0===(s=this.i._interactive_segmenter_segment(this.h,t,e.length,r,n,i)))throw Error("Segmentation failed.");let h=this.i.HEAPU32[r/4],u=this.i.HEAPU32[n/4];var o=new Float32Array(this.i.HEAPU8.buffer,s,this.i.HEAPU32[i/4]/4),a=new Float32Array(o);if(o=h*u,(a instanceof Uint8Array||a instanceof Float32Array)&&a.length!==o)throw Error("Unsupported channel count: "+a.length/o);return new wh([a],!0,!1,this.g.i.canvas??void 0,this.o,h,u)}finally{0!==t&&this.i._free(t),0!==r&&this.i._free(r),0!==s&&this.i._free(s)}}m(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0);var t=new mo;if("GPU"===this.delegate){var e=new Es;br(t,2,_o,e)}else Cr(e=new Ss,1,4),br(t,1,_o,e);if(Tr(this.baseOptions,0,3,t),t=wo(this.baseOptions),e=this.i._malloc(t.length),this.i.HEAPU8.set(t,e),this.h=this.i._interactive_segmenter_create(e,t.length),this.i._free(e),0===this.h)throw Error("Failed to create native InteractiveSegmenter engine.")}close(){0!==this.h&&(this.i._interactive_segmenter_close(this.h),this.h=0),0!==this.j&&(this.i._free(this.j),this.j=0),this.o.close(),super.close()}};Ou.prototype.close=Ou.prototype.close,Ou.prototype.segment=Ou.prototype.segment,Ou.prototype.setImage=Ou.prototype.Oa,Ou.prototype.setOptions=Ou.prototype.u,Ou.createFromModelPath=function(t,e){return Wa(Ou,Nu(),t,{baseOptions:{modelAssetPath:e}})},Ou.createFromModelBuffer=function(t,e){return Wa(Ou,Nu(),t,{baseOptions:{modelAssetBuffer:e}})},Ou.createFromOptions=function(t,e){var r=e.canvas??Nu();return Wa(Ou,r,t,e)};var Mu=class{constructor(t,e,r){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=r}close(){this.confidenceMasks?.forEach(t=>{t.close()}),this.categoryMask?.close()}};Mu.prototype.close=Mu.prototype.close;var Du=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new ia,this.o=new ta,Tr(this.h,0,3,this.o),Tr(t=this.h,0,1,e=new yo)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,r,n){var i="function"!=typeof r?r:{};if(this.j="function"==typeof r?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new fa,e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var s=new ca;Ir(s,!0),Or(s,1,e.keypoint.x),Or(s,2,e.keypoint.y),br(n,1,pa,s)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");{let t=new da;for(s of e.scribble)Ir(e=new ca,!0),Or(e,1,s.x),Or(e,2,s.y),Lr(t,1,ca,e);br(n,2,pa,t)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter_legacy.proto.RegionOfInterest","roi_in",r),qh(this,t,i);t:{try{let t=new Mu(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=t;break t}this.j(t)}finally{Qa(this)}o=void 0}return o}m(){var t=new Bs;$s(t,"image_in"),$s(t,"roi_in"),$s(t,"norm_rect_in");var e=new xs;Yn(e,sa,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.interactive_segmenter_legacy.InteractiveSegmenterGraphV2"),Is(r,"IMAGE:image_in"),Is(r,"ROI:roi_in"),Is(r,"NORM_RECT:norm_rect_in"),r.u(e),Ps(t,r),Ja(this,t),this.outputConfidenceMasks&&(Us(t,"confidence_masks"),Cs(r,"CONFIDENCE_MASKS:confidence_masks"),Za(this,"confidence_masks"),this.g.aa("confidence_masks",(t,e)=>{this.confidenceMasks=t.map(t=>Zh(this,t,!0,!this.j)),qa(this,e)}),this.g.attachEmptyPacketListener("confidence_masks",t=>{this.confidenceMasks=[],qa(this,t)})),this.outputCategoryMask&&(Us(t,"category_mask"),Cs(r,"CATEGORY_MASK:category_mask"),Za(this,"category_mask"),this.g.Z("category_mask",(t,e)=>{this.categoryMask=Zh(this,t,!1,!this.j),qa(this,e)}),this.g.attachEmptyPacketListener("category_mask",t=>{this.categoryMask=void 0,qa(this,t)})),Us(t,"quality_scores"),Cs(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(t,e)=>{this.qualityScores=t,qa(this,e)}),this.g.attachEmptyPacketListener("quality_scores",t=>{this.categoryMask=void 0,qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Du.prototype.segment=Du.prototype.segment,Du.prototype.setOptions=Du.prototype.u,Du.createFromModelPath=function(t,e){return zh(Du,t,{baseOptions:{modelAssetPath:e}})},Du.createFromModelBuffer=function(t,e){return zh(Du,t,{baseOptions:{modelAssetBuffer:e}})},Du.createFromOptions=function(t,e){return zh(Du,t,e)};var Pu=class extends Qh{constructor(t,e){super(new Wh(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},Tr(t=this.h=new ga,0,1,e=new yo)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return void 0!==t.displayNamesLocale?tr(this.h,2,ce(t.displayNamesLocale)):"displayNamesLocale"in t&&tr(this.h,2),void 0!==t.maxResults?Cr(this.h,3,t.maxResults):"maxResults"in t&&tr(this.h,3),void 0!==t.scoreThreshold?Nr(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&tr(this.h,4),void 0!==t.categoryAllowlist?Dr(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&tr(this.h,5),void 0!==t.categoryDenylist?Dr(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&tr(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},qh(this,t,e),this.j}G(t,e,r){return this.j={detections:[]},Jh(this,t,r,e),this.j}m(){var t=new Bs;$s(t,"input_frame_gpu"),$s(t,"norm_rect"),Us(t,"detections");var e=new xs;Yn(e,ma,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),Is(r,"IMAGE:input_frame_gpu"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"DETECTIONS:detections"),r.u(e),Ps(t,r),this.g.attachProtoVectorListener("detections",(t,e)=>{for(let e of t)t=qs(e),this.j.detections.push(Ta(t));qa(this,e)}),this.g.attachEmptyPacketListener("detections",t=>{qa(this,t)}),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Pu.prototype.detectForVideo=Pu.prototype.G,Pu.prototype.detect=Pu.prototype.F,Pu.prototype.setOptions=Pu.prototype.u,Pu.createFromModelPath=async function(t,e){return zh(Pu,t,{baseOptions:{modelAssetPath:e}})},Pu.createFromModelBuffer=function(t,e){return zh(Pu,t,{baseOptions:{modelAssetBuffer:e}})},Pu.createFromOptions=function(t,e){return zh(Pu,t,e)};var $u=class{constructor(t,e,r){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=r}close(){this.segmentationMasks?.forEach(t=>{t.close()})}};function Uu(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function Bu(t){try{let e=new $u(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.o)return e;t.o(e)}finally{Qa(t)}}$u.prototype.close=$u.prototype.close;var Gu=class extends Qh{constructor(t,e){super(new Wh(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,Tr(t=this.h=new _a,0,1,e=new yo),this.A=new Xo,Tr(this.h,0,3,this.A),this.j=new Ko,Tr(this.h,0,2,this.j),Cr(this.j,4,1),Nr(this.j,2,.5),Nr(this.A,2,.5),Nr(this.h,4,.5)}get baseOptions(){return yr(this.h,yo,1)}set baseOptions(t){Tr(this.h,0,1,t)}u(t){return"numPoses"in t&&Cr(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&Nr(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&Nr(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&Nr(this.A,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,r){var n="function"!=typeof e?e:{};return this.o="function"==typeof e?e:r,Uu(this),qh(this,t,n),Bu(this)}G(t,e,r,n){var i="function"!=typeof r?r:{};return this.o="function"==typeof r?r:n,Uu(this),Jh(this,t,i,e),Bu(this)}m(){var t=new Bs;$s(t,"image_in"),$s(t,"norm_rect"),Us(t,"normalized_landmarks"),Us(t,"world_landmarks"),Us(t,"segmentation_masks");var e=new xs;Yn(e,va,this.h);var r=new Ns;Mr(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),Is(r,"IMAGE:image_in"),Is(r,"NORM_RECT:norm_rect"),Cs(r,"NORM_LANDMARKS:normalized_landmarks"),Cs(r,"WORLD_LANDMARKS:world_landmarks"),r.u(e),Ps(t,r),Ja(this,t),this.g.attachProtoVectorListener("normalized_landmarks",(t,e)=>{this.landmarks=[];for(let e of t)t=to(e),this.landmarks.push(ba(t));qa(this,e)}),this.g.attachEmptyPacketListener("normalized_landmarks",t=>{this.landmarks=[],qa(this,t)}),this.g.attachProtoVectorListener("world_landmarks",(t,e)=>{this.worldLandmarks=[];for(let e of t)t=Zs(e),this.worldLandmarks.push(ka(t));qa(this,e)}),this.g.attachEmptyPacketListener("world_landmarks",t=>{this.worldLandmarks=[],qa(this,t)}),this.outputSegmentationMasks&&(Cs(r,"SEGMENTATION_MASK:segmentation_masks"),Za(this,"segmentation_masks"),this.g.aa("segmentation_masks",(t,e)=>{this.segmentationMasks=t.map(t=>Zh(this,t,!0,!this.o)),qa(this,e)}),this.g.attachEmptyPacketListener("segmentation_masks",t=>{this.segmentationMasks=[],qa(this,t)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};Gu.prototype.detectForVideo=Gu.prototype.G,Gu.prototype.detect=Gu.prototype.F,Gu.prototype.setOptions=Gu.prototype.u,Gu.createFromModelPath=function(t,e){return zh(Gu,t,{baseOptions:{modelAssetPath:e}})},Gu.createFromModelBuffer=function(t,e){return zh(Gu,t,{baseOptions:{modelAssetBuffer:e}})},Gu.createFromOptions=function(t,e){return zh(Gu,t,e)},Gu.POSE_CONNECTIONS=Eu,r("module$exports$google3$third_party$mediapipe$tasks$web$vision$pose_landmarker$pose_landmarker.PoseLandmarker.POSE_CONNECTIONS",Gu.POSE_CONNECTIONS);export{Nh as DrawingUtils,tu as FaceDetector,du as FaceLandmarker,Ca as FilesetResolver,_u as GestureRecognizer,yu as HandLandmarker,bu as HolisticLandmarker,ku as ImageClassifier,Su as ImageEmbedder,Iu as ImageSegmenter,Lu as ImageSegmenterResult,Ou as InteractiveSegmenter,Du as InteractiveSegmenterLegacy,Mu as InteractiveSegmenterLegacyResult,jh as MPImage,wh as MPMask,Pu as ObjectDetector,Gu as PoseLandmarker,th as TaskRunner,Qh as VisionTaskRunner};
|
|
2
2
|
//# sourceMappingURL=vision_bundle_mjs.js.map
|