@richard.fadiora/liveness-detection 2.1.0 → 3.0.1
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/README.md +114 -87
- package/dist/index.es.js +2280 -2279
- package/dist/index.umd.js +23 -23
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
(function(st,Q){typeof exports=="object"&&typeof module<"u"?Q(exports,require("react"),require("react-webcam")):typeof define=="function"&&define.amd?define(["exports","react","react-webcam"],Q):(st=typeof globalThis<"u"?globalThis:st||self,Q(st.LivenessSDK={},st.React,st.Webcam))})(this,function(st,Q,D2){"use strict";var In={exports:{}},vr={};/**
|
|
1
|
+
(function(Ye,N){typeof exports=="object"&&typeof module<"u"?N(exports,require("react"),require("react-webcam")):typeof define=="function"&&define.amd?define(["exports","react","react-webcam"],N):(Ye=typeof globalThis<"u"?globalThis:Ye||self,N(Ye.LivenessSDK={},Ye.React,Ye.Webcam))})(this,function(Ye,N,N2){"use strict";var Vt=typeof self<"u"?self:{};function br(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Vt,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function At(){throw Error("Invalid UTF8")}function pi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Hr,Mn;const D2=typeof TextDecoder<"u";let j2;const B2=typeof TextEncoder<"u";function gi(e){if(B2)e=(j2||(j2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function mi(e){Vt.setTimeout(()=>{throw e},0)}var In,U2=br(610401301,!1),vi=br(748402147,!0),Cn=br(824648567,!0),Nn=br(824656860,br(1,!0));function yi(){var e=Vt.navigator;return e&&(e=e.userAgent)?e:""}const _i=Vt.navigator;function Kr(e){return Kr[" "](e),e}In=_i&&_i.userAgentData||null,Kr[" "]=function(){};const bi={};let wr=null;function V2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(f){for(;u<i.length;){const h=i.charAt(u++),d=wr[h];if(d!=null)return d;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return f}wi();let u=0;for(;;){const f=c(-1),h=c(0),d=c(64),b=c(64);if(b===64&&f===-1)break;o(f<<2|h>>4),d!=64&&(o(h<<4&240|d>>2),b!=64&&o(d<<6&192|b))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function wi(){if(!wr){wr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));bi[r]=n;for(let s=0;s<n.length;s++){const i=n[s];wr[i]===void 0&&(wr[i]=s)}}}}var G2=typeof Uint8Array<"u",Ei=!(!(U2&&In&&In.brands.length>0)&&(yi().indexOf("Trident")!=-1||yi().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Ai=/[-_.]/g,W2={"-":"+",_:"/",".":"="};function H2(e){return W2[e]||""}function ki(e){if(!Ei)return V2(e);e=Ai.test(e)?e.replace(Ai,H2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Dn(e){return G2&&e!=null&&e instanceof Uint8Array}var Gt={};function kt(){return K2||(K2=new Xe(null,Gt))}function jn(e){Si(Gt);var t=e.g;return(t=t==null||Dn(t)?t:typeof t=="string"?ki(t):null)==null?t:e.g=t}var Xe=class{h(){return new Uint8Array(jn(this)||0)}constructor(e,t){if(Si(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let K2,z2;function Si(e){if(e!==Gt)throw Error("illegal external caller")}function Ti(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Bn(e){return Ti(e=Error(e),"warning"),e}function Wt(e,t){if(e!=null){var r=z2??(z2={}),n=r[e]||0;n>=t||(r[e]=n+1,Ti(e=Error(),"incident"),mi(e))}}function Ht(){return typeof BigInt=="function"}var Kt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function qe(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var Y2=qe("jas",void 0,!0),Li=qe(void 0,"0di"),Er=qe(void 0,"1oa"),Ee=qe(void 0,Symbol()),X2=qe(void 0,"0ub"),q2=qe(void 0,"0ubs"),Un=qe(void 0,"0ubsb"),J2=qe(void 0,"0actk"),zt=qe("m_m","Pa",!0),Oi=qe();const Pi={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Ri=Object.defineProperties,m=Kt?Y2:"Ga";var St;const Fi=[];function Ar(e,t){Kt||m in e||Ri(e,Pi),e[m]|=t}function te(e,t){Kt||m in e||Ri(e,Pi),e[m]=t}function kr(e){return Ar(e,34),e}function Sr(e){return Ar(e,8192),e}te(Fi,7),St=Object.freeze(Fi);var Yt={};function Ae(e,t){return t===void 0?e.h!==Tt&&!!(2&(0|e.v[m])):!!(2&t)&&e.h!==Tt}const Tt={};function Vn(e,t){if(e!=null){if(typeof e=="string")e=e?new Xe(e,Gt):kt();else if(e.constructor!==Xe)if(Dn(e))e=e.length?new Xe(new Uint8Array(e),Gt):kt();else{if(!t)throw Error();e=void 0}}return e}class xi{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var $2=Object.freeze({});function Mi(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ii={};function Xt(e){return 128&e?Ii:void 0}function zr(e){return e.Na=!0,e}var Z2=zr(e=>typeof e=="number"),Ci=zr(e=>typeof e=="string"),Q2=zr(e=>typeof e=="boolean"),Yr=typeof Vt.BigInt=="function"&&typeof Vt.BigInt(0)=="bigint";function ke(e){var t=e;if(Ci(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(Z2(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Yr?BigInt(e):e=Q2(e)?e?"1":"0":Ci(e)?e.trim()||"0":String(e)}var Gn=zr(e=>Yr?e>=t1&&e<=n1:e[0]==="-"?Ni(e,e1):Ni(e,r1));const e1=Number.MIN_SAFE_INTEGER.toString(),t1=Yr?BigInt(Number.MIN_SAFE_INTEGER):void 0,r1=Number.MAX_SAFE_INTEGER.toString(),n1=Yr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Ni(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const s1=typeof Uint8Array.prototype.slice=="function";let i1,U=0,$=0;function Di(e){const t=e>>>0;U=t,$=(e-t)/4294967296>>>0}function qt(e){if(e<0){Di(-e);const[t,r]=Yn(U,$);U=t>>>0,$=r>>>0}else Di(e)}function Wn(e){const t=i1||(i1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),$=0,U=t.getUint32(0,!0)}function Hn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Tr(e,t)}function o1(e,t){return ke(Ht()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Tr(e,t))}function Kn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Hn(e,t))=="number"?r?-e:e:r?"-"+e:e}function ji(e,t){return Ht()?ke(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):ke(zn(e,t))}function Tr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Ht()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Bi(r)+Bi(e));return r}function Bi(e){return e=String(e),"0000000".slice(e.length)+e}function zn(e,t){if(2147483648&t)if(Ht())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Yn(e,t);e="-"+Tr(r,n)}else e=Tr(e,t);return e}function Xr(e){if(e.length<16)qt(Number(e));else if(Ht())e=BigInt(e),U=Number(e&BigInt(4294967295))>>>0,$=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");$=U=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));$*=1e6,U=1e6*U+i,U>=4294967296&&($+=Math.trunc(U/4294967296),$>>>=0,U>>>=0)}if(t){const[n,s]=Yn(U,$);U=n,$=s}}}function Yn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Ve(e){return Array.prototype.slice.call(e)}const Lr=typeof BigInt=="function"?BigInt.asIntN:void 0,a1=typeof BigInt=="function"?BigInt.asUintN:void 0,Lt=Number.isSafeInteger,qr=Number.isFinite,Jt=Math.trunc,c1=ke(0);function Or(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function Je(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Pr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Ui(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const u1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Rr(e){switch(typeof e){case"bigint":return!0;case"number":return qr(e);case"string":return u1.test(e);default:return!1}}function $t(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?0|e:void 0}function Vi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?e>>>0:void 0}function Gi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Xr(e),zn(U,$))}function Xn(e){return e=Jt(e),Lt(e)||(qt(e),e=Kn(U,$)),e}function Wi(e){var t=Jt(Number(e));return Lt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Gi(e))}function Hi(e){var t=Jt(Number(e));return Lt(t)?ke(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Ht()?ke(Lr(64,BigInt(e))):ke(Gi(e)))}function Ki(e){return Lt(e)?e=ke(Xn(e)):(e=Jt(e),Lt(e)?e=String(e):(qt(e),e=zn(U,$)),e=ke(e)),e}function h1(e){return e==null?e:typeof e=="bigint"?(Gn(e)?e=Number(e):(e=Lr(64,e),e=Gn(e)?Number(e):String(e)),e):Rr(e)?typeof e=="number"?Xn(e):Wi(e):void 0}function Jr(e){const t=typeof e;return e==null?e:t==="bigint"?ke(Lr(64,e)):Rr(e)?t==="string"?Hi(e):Ki(e):void 0}function zi(e){if(typeof e!="string")throw Error();return e}function Fr(e){if(e!=null&&typeof e!="string")throw Error();return e}function ue(e){return e==null||typeof e=="string"?e:void 0}function qn(e,t,r,n){return e!=null&&e[zt]===Yt?e:Array.isArray(e)?((n=(r=0|e[m])|32&n|2&n)!==r&&te(e,n),new t(e)):(r?2&n?((e=t[Li])||(kr((e=new t).v),e=t[Li]=e),t=e):t=new t:t=void 0,t)}function l1(e,t,r){if(t)e:{if(!Rr(t=e))throw Bn("int64");switch(typeof t){case"string":t=Hi(t);break e;case"bigint":t=ke(Lr(64,t));break e;default:t=Ki(t)}}else t=Jr(e);return(e=t)==null?r?c1:void 0:e}const f1={};let d1=function(){try{return Kr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Jn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const p1=d1?(Object.setPrototypeOf(Jn.prototype,Map.prototype),Object.defineProperties(Jn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Jn):class extends Map{constructor(){super()}};function Yi(e){return e}function $n(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var st=class extends p1{constructor(e,t,r=Yi,n=Yi){super(),this.J=0|e[m],this.K=t,this.S=r,this.fa=this.K?g1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return Sr(Array.from(super.entries(),e))}clear(){$n(this),super.clear()}delete(e){return $n(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new xi(e,m1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new xi(e,st.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return $n(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function g1(e,t,r,n,s,i){return e=qn(e,n,r,i),s&&(e=es(e)),e}function m1(e){return[e,this.get(e)]}let v1;function Xi(){return v1||(v1=new st(kr([]),void 0,void 0,void 0,f1))}function $r(e){return Ee?e[Ee]:void 0}function Zr(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}st.prototype.toJSON=void 0;var Zn=class{};const y1={Ka:!0};function _1(e,t){t<100||Wt(q2,1)}function Qr(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=Ee;!s&&Kt&&o&&(i=e[o])&&Zr(i,_1),o=[];var c=e.length;let u;i=4294967295;let f=!1;const h=!!(64&t),d=h?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!h||128&t||s||(f=!0,i=i-d+d)),t=void 0;for(var b=0;b<c;b++){let A=e[b];if(A!=null&&(A=r(A,n))!=null)if(h&&b>=i){const W=b-d;(t??(t={}))[W]=A}else o[b]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let W;b=+A,h&&!Number.isNaN(b)&&(W=b+d)<i?o[W]=c:(t??(t={}))[A]=c}return t&&(f?o.push(t):o[i]=t),s&&Ee&&(e=$r(e))&&e instanceof Zn&&(o[Ee]=function(A){const W=new Zn;return Zr(A,(nt,Ke,he)=>{W[Ke]=Ve(he)}),W.da=A.da,W}(e)),o}function b1(e){return e[0]=xr(e[0]),e[1]=xr(e[1]),e}function xr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return Gn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[m];return e.length===0&&1&t?void 0:Qr(e,t,xr)}if(e!=null&&e[zt]===Yt)return qi(e);if(e instanceof Xe){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Ei){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),wi(),r=bi[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let f=0,h=0;for(;f<t.length-2;f+=3){var i=t[f],o=t[f+1],c=t[f+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[h++]=u+i+o+c}switch(u=0,c=s,t.length-f){case 2:c=r[(15&(u=t[f+1]))<<2]||s;case 1:t=t[f],n[h]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof st?e=e.size!==0?e.V(b1):void 0:void 0}return e}function qi(e){return Qr(e=e.v,0|e[m],xr)}let w1,E1;function Ot(e,t){return Ji(e,t[0],t[1])}function Ji(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[m],vi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(vi)throw Error("carr");Wt(J2,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&te(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return te(e,64|s|n),e}function A1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[m];return e.length===0&&1&r?void 0:$i(e,r,t)}if(e!=null&&e[zt]===Yt)return Zi(e);if(e instanceof st){if(2&(t=e.J))return e;if(!e.size)return;if(r=kr(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[zt]===Yt?Zi(s):Array.isArray(s)?$i(s,0|s[m],!!(32&t)):void 0,n[1]=s}return r}return e instanceof Xe?e:void 0}function $i(e,t,r){return 2&t||(!r||4096&t||16&t?e=Zt(e,t,!1,r&&!(16&t)):(Ar(e,34),4&t&&Object.freeze(e))),e}function Qn(e,t,r){return e=new e.constructor(t),r&&(e.h=Tt),e.m=Tt,e}function Zi(e){const t=e.v,r=0|t[m];return Ae(e,r)?e:ts(e,t,r)?Qn(e,t):Zt(t,r)}function Zt(e,t,r,n){return n??(n=!!(34&t)),e=Qr(e,t,A1,n),n=32,r&&(n|=2),te(e,t=16769217&t|n),e}function es(e){const t=e.v,r=0|t[m];return Ae(e,r)?ts(e,t,r)?Qn(e,t,!0):new e.constructor(Zt(t,r,!1)):e}function Qt(e){if(e.h!==Tt)return!1;var t=e.v;return Ar(t=Zt(t,0|t[m]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function er(e){if(!Qt(e)&&Ae(e,0|e.v[m]))throw Error()}function Pt(e,t){t===void 0&&(t=0|e[m]),32&t&&!(4096&t)&&te(e,4096|t)}function ts(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(te(t,2|r),e.h=Tt,!0)}const k1=ke(0),dt={};function D(e,t,r,n,s){if((t=it(e.v,t,r,s))!==null||n&&e.m!==Tt)return t}function it(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function F(e,t,r,n){er(e),re(e=e.v,0|e[m],t,r,n)}function re(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[m]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function Rt(){return $2===void 0?2:4}function Ft(e,t,r,n,s){let i=e.v,o=0|i[m];n=Ae(e,o)?1:n,s=!!s||n===3,n===2&&Qt(e)&&(i=e.v,o=0|i[m]);let c=(e=rs(i,t))===St?7:0|e[m],u=ns(c,o);var f=!(4&u);if(f){4&u&&(e=Ve(e),c=0,u=Mt(u,o),o=re(i,o,t,e));let h=0,d=0;for(;h<e.length;h++){const b=r(e[h]);b!=null&&(e[d++]=b)}d<h&&(e.length=d),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(te(e,u),2&u&&Object.freeze(e)),Qi(e,u,i,o,t,n,f,s)}function Qi(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?xt(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&te(e,t),Object.freeze(e)):(i===2&&xt(t)&&(e=Ve(e),u=0,t=Mt(t,n),n=re(r,n,s,e)),xt(t)||(c||(t|=16),t!==u&&te(e,t))),2&t||!(4096&t||16&t)||Pt(r,n),e}function rs(e,t,r){return e=it(e,t,r),Array.isArray(e)?e:St}function ns(e,t){return 2&t&&(e|=2),1|e}function xt(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function eo(e){return Vn(e,!0)}function to(e){e=Ve(e);for(let t=0;t<e.length;t++){const r=e[t]=Ve(e[t]);Array.isArray(r[1])&&(r[1]=kr(r[1]))}return Sr(e)}function pt(e,t,r,n){er(e),re(e=e.v,0|e[m],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function tr(e,t,r){if(2&t)throw Error();const n=Xt(t);let s=rs(e,r,n),i=s===St?7:0|s[m],o=ns(i,t);return(2&o||xt(o)||16&o)&&(o===i||xt(o)||te(s,o),s=Ve(s),i=0,o=Mt(o,t),re(e,t,r,s,n)),o&=-13,o!==i&&te(s,o),s}function ss(e,t){var r=ca;return os(is(e=e.v),e,void 0,r)===t?t:-1}function is(e){if(Kt)return e[Er]??(e[Er]=new Map);if(Er in e)return e[Er];const t=new Map;return Object.defineProperty(e,Er,{value:t}),t}function ro(e,t,r,n,s){const i=is(e),o=os(i,e,t,r,s);return o!==n&&(o&&(t=re(e,t,o,void 0,s)),i.set(r,n)),t}function os(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];it(t,c,s)!=null&&(i!==0&&(r=re(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function as(e,t,r){let n=0|e[m];const s=Xt(n),i=it(e,r,s);let o;if(i!=null&&i[zt]===Yt){if(!Ae(i))return Qt(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[m];2&c&&(o=Zt(o,c))}return o=Ot(o,t),o!==i&&re(e,n,r,o,s),o}function no(e,t,r,n,s){let i=!1;if((n=it(e,n,s,o=>{const c=qn(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ae(n)&&Pt(e,t),n}function O(e,t,r,n){let s=e.v,i=0|s[m];if((t=no(s,i,t,r,n))==null)return t;if(i=0|s[m],!Ae(e,i)){const o=es(t);o!==t&&(Qt(e)&&(s=e.v,i=0|s[m]),i=re(s,i,r,t=o,n),Pt(s,i))}return t}function so(e,t,r,n,s,i,o,c){var u=Ae(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&Qt(e)&&(r=0|(t=e.v)[m]);var f=(e=rs(t,s))===St?7:0|e[m],h=ns(f,r);if(c=!(4&h)){var d=e,b=r;const A=!!(2&h);A&&(b|=2);let W=!A,nt=!0,Ke=0,he=0;for(;Ke<d.length;Ke++){const K=qn(d[Ke],n,!1,b);if(K instanceof n){if(!A){const ht=Ae(K);W&&(W=!ht),nt&&(nt=ht)}d[he++]=K}}he<Ke&&(d.length=he),h|=4,h=nt?-4097&h:4096|h,h=W?8|h:-9&h}if(h!==f&&(te(e,h),2&h&&Object.freeze(e)),u&&!(8&h||!e.length&&(i===1||i===4&&(2&h||!(16&h)&&32&r)))){for(xt(h)&&(e=Ve(e),h=Mt(h,r),r=re(t,r,s,e)),n=e,u=h,f=0;f<n.length;f++)(d=n[f])!==(h=es(d))&&(n[f]=h);u|=8,te(e,h=u=n.length?4096|u:-4097&u)}return Qi(e,h,t,r,s,i,c,o)}function ot(e,t,r){const n=e.v;return so(e,n,0|n[m],t,r,Rt(),!1,!0)}function io(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return F(e,r,n=io(n),s),n&&!Ae(n)&&Pt(e.v),e}function Mr(e,t,r,n){e:{var s=n=io(n);er(e);const i=e.v;let o=0|i[m];if(s==null){const c=is(i);if(os(c,i,o,r)!==t)break e;c.set(r,0)}else o=ro(i,o,r,t);re(i,o,t,s)}n&&!Ae(n)&&Pt(e.v)}function Mt(e,t){return-273&(2&t?2|e:-3&e)}function cs(e,t,r,n){var s=n;er(e),e=so(e,n=e.v,0|n[m],r,t,2,!0),s=s??new r,e.push(s),t=r=e===St?7:0|e[m],(s=Ae(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&te(e,r),s||Pt(n)}function Me(e,t,r){return $t(D(e,t,void 0,r))}function oo(e){return(Nn?D(e,2,void 0,void 0,Jr):Jr(D(e,2)))??k1}function Y(e,t){return D(e,t,void 0,void 0,Je)??0}function at(e,t,r){if(r!=null){if(typeof r!="number"||!qr(r))throw Bn("int32");r|=0}F(e,t,r)}function _(e,t,r){F(e,t,Or(r))}function Se(e,t,r){pt(e,t,Fr(r),"")}function en(e,t,r){{er(e);const o=e.v;let c=0|o[m];if(r==null)re(o,c,t);else{var n=e=r===St?7:0|r[m],s=xt(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Ve(r),n=0,e=Mt(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Nn?1024:0),s=0;s<r.length;s++){const u=r[s],f=zi(u);Object.is(u,f)||(i&&(r=Ve(r),n=0,e=Mt(e,c),i=!1),r[s]=f)}e!==n&&(i&&(r=Ve(r),e=Mt(e,c)),te(r,e)),re(o,c,t,r)}}}function tn(e,t,r){er(e),Ft(e,t,ue,2,!0).push(zi(r))}var rr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function us(e,t){if(typeof e=="string")return new rr(ki(e),t);if(Array.isArray(e))return new rr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new rr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new rr(e,!1);if(e.constructor===Xe)return t=jn(e)||new Uint8Array(0),new rr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new rr(e,!1);throw Error()}function nr(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(It(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function hs(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return It(e,r),!!(127&t)}throw Error()}function gt(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return It(e,r),s}function ct(e){return gt(e)>>>0}function rn(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],It(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function S1(e){return gt(e)}function It(e,t){if(e.g=t,t>e.l)throw Error()}function ao(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function co(e,t){if(t==0)return kt();var r=ao(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):s1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?kt():new Xe(r,Gt)}var uo=[];function ho(e,t,r,n){if(on.length){const s=on.pop();return s.o(n),s.g.init(e,t,r,n),s}return new T1(e,t,r,n)}function lo(e){e.g.clear(),e.l=-1,e.h=-1,on.length<100&&on.push(e)}function fo(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=ct(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function nn(e){switch(e.h){case 0:e.h!=0?nn(e):hs(e.g);break;case 1:It(e=e.g,e.g+8);break;case 2:if(e.h!=2)nn(e);else{var t=ct(e.g);It(e=e.g,e.g+t)}break;case 5:It(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!fo(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}nn(e)}break;default:throw Error()}}function Ir(e,t,r){const n=e.g.l;var s=ct(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function ls(e){var t=ct(e.g),r=ao(e=e.g,t);if(e=e.h,D2){var n,s=e;(n=Mn)||(n=Mn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Hr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Hr=!0}catch{Hr=!1}}throw!Hr&&(Mn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?At():(c=e[i++],o<194||(192&c)!=128?(i--,At()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?At():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,At()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?At():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,At()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):At(),r.length>=8192&&(u=pi(u,r),r.length=0)}i=pi(u,r)}return i}function po(e){const t=ct(e.g);return co(e.g,t)}function sn(e,t,r){var n=ct(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var T1=class{constructor(e,t,r,n){if(uo.length){const s=uo.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=us(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},on=[];function go(e){return e?/^\d+$/.test(e)?(Xr(e),new fs(U,$)):null:L1||(L1=new fs(0,0))}var fs=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let L1;function mo(e){return e?/^-?\d+$/.test(e)?(Xr(e),new ds(U,$)):null:O1||(O1=new ds(0,0))}var ds=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let O1;function sr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ir(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function an(e,t){if(t>=0)ir(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ps(e){var t=U;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function or(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Ie(e,t,r){ir(e.g,8*t+r)}function gs(e,t){return Ie(e,t,2),t=e.g.end(),or(e,t),t.push(e.h),t}function ms(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function cn(e,t,r){Ie(e,t,2),ir(e.g,r.length),or(e,e.g.end()),or(e,r)}function un(e,t,r,n){r!=null&&(t=gs(e,t),n(r,e),ms(e,t))}function $e(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var vs=$e(),vo=$e(),ys=$e(),_s=$e(),yo=$e(),_o=$e(),P1=$e(),hn=$e(),bo=$e(),wo=$e();function Ze(e,t,r){var n=e.v;Ee&&Ee in n&&(n=n[Ee])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var v=class{constructor(e,t){this.v=Ji(e,t,void 0,2048)}toJSON(){return qi(this)}j(){var s;var e=lc,t=this.v,r=e.g,n=Ee;if(Kt&&n&&((s=t[n])==null?void 0:s[r])!=null&&Wt(X2,3),t=e.g,Oi&&Ee&&Oi===void 0&&(n=(r=this.v)[Ee])&&(n=n.da))try{n(r,t,y1)}catch(i){mi(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[m];return ts(this,e,t)?Qn(this,e,!0):new this.constructor(Zt(e,t,!1))}};v.prototype[zt]=Yt,v.prototype.toString=function(){return this.v.toString()};var ar=class{constructor(e,t,r){this.g=e,this.h=t,e=vs,this.l=!!e&&r===e||!1}};function ln(e,t){return new ar(e,t,vs)}function Eo(e,t,r,n,s){un(e,r,Oo(t,n),s)}const R1=ln(function(e,t,r,n,s){return e.h===2&&(Ir(e,as(t,n,r),s),!0)},Eo),F1=ln(function(e,t,r,n,s){return e.h===2&&(Ir(e,as(t,n,r),s),!0)},Eo);var fn=Symbol(),dn=Symbol(),bs=Symbol(),Ao=Symbol(),ko=Symbol();let So,To;function Ct(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(d){switch(typeof d){case"boolean":return w1||(w1=[0,void 0,!0]);case"number":return d>0?void 0:d===0?E1||(E1=[0,void 0]):[-d,void 0];case"string":return[0,d];case"object":return d}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,So??(So=i),To??(To=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let d;typeof i=="number"&&(u+=i,i=n[++o]);var f=void 0;if(i instanceof ar?d=i:(d=R1,o--),d==null?void 0:d.l){i=n[++o],f=n;var h=o;typeof i=="function"&&(i=i(),f[h]=i),f=i}for(h=u+1,typeof(i=n[++o])=="number"&&i<0&&(h-=i,i=n[++o]);u<h;u++){const b=c[u];f?r(s,u,d,f,b):t(s,u,d,b)}}return n[e]=s}function Lo(e){return Array.isArray(e)?e[0]instanceof ar?e:[F1,e]:[e,void 0]}function Oo(e,t){return e instanceof v?e.v:Array.isArray(e)?Ot(e,t):void 0}function ws(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function Es(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,f,h)=>i(u,f,h,c||(c=Ct(dn,ws,Es,n).T),o||(o=As(n)),s)}function As(e){let t=e[bs];if(t!=null)return t;const r=Ct(dn,ws,Es,e);return t=r.ma?(n,s)=>So(n,s,r):(n,s)=>{for(;fo(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=M1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,nn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=co(c.g,u);o=void 0,c=n,u&&((o=c[Ee]??(c[Ee]=new Zn))[i]??(o[i]=[])).push(u)}}return(n=$r(n))&&(n.da=r.qa[ko]),!0},e[bs]=t,e[ko]=x1.bind(e),t}function x1(e,t,r,n){var s=this[dn];const i=this[bs],o=Ot(void 0,s.T),c=$r(e);if(c){var u=!1,f=s.ba;if(f){if(s=(h,d,b)=>{if(b.length!==0)if(f[d])for(const A of b){h=ho(A);try{u=!0,i(o,h)}finally{lo(h)}}else n==null||n(e,d,b)},t==null)Zr(c,s);else if(c!=null){const h=c[t];h&&s(c,t,h)}if(u){let h=0|e[m];if(2&h&&2048&h&&!(r!=null&&r.Ka))throw Error();const d=Xt(h),b=(A,W)=>{if(it(e,A,d)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}W!=null&&(h=re(e,h,A,W,d)),delete c[A]};t==null?Mi(o,0|o[m],(A,W)=>{b(A,W)}):b(t,it(o,t,d))}}}}function M1(e){const t=(e=Lo(e))[0].g;if(e=e[1]){const r=As(e),n=Ct(dn,ws,Es,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function pn(e,t,r){e[t]=r.h}function gn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,f)=>o(c,u,f,i||(i=Ct(fn,pn,gn,n).T),s||(s=Po(n)))}function Po(e){let t=e[Ao];if(!t){const r=Ct(fn,pn,gn,e);t=(n,s)=>Ro(n,s,r),e[Ao]=t}return t}function Ro(e,t,r){Mi(e,0|e[m],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var f=(u=Lo(u))[0].h;if(u=u[1]){const h=Po(u),d=Ct(fn,pn,gn,u).T;u=o.ma?To(d,h):(b,A,W)=>f(b,A,W,d,h)}else u=f;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Wt(Un,3)}}),(e=$r(e))&&Zr(e,(n,s,i)=>{for(or(t,t.g.end()),n=0;n<i.length;n++)or(t,jn(i[n])||new Uint8Array(0))})}const I1=ke(0);function cr(e,t){if(Array.isArray(t)){var r=0|t[m];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&te(t,e),2&e&&Object.freeze(t),t}}function ge(e,t,r){return new ar(e,t,r)}function ur(e,t,r){return new ar(e,t,r)}function se(e,t,r){re(e,0|e[m],t,r,Xt(0|e[m]))}var C1=ln(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Ve(e=Ir(e,Ot([void 0,void 0],n),s)),s=Xt(n=0|t[m]),2&n)throw Error();let i=it(t,r,s);if(i instanceof st)2&i.J?(i=i.V(),i.push(e),re(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[m];8192&o||te(i,o|=8192),2&o&&(i=to(i),re(t,n,r,i,s)),i.push(e)}else re(t,n,r,Sr([e]),s);return!0},function(e,t,r,n,s){if(t instanceof st)t.forEach((i,o)=>{un(e,r,Ot([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&un(e,r,Ot(o,n),s)}Sr(t)}});function Fo(e,t,r){(t=Je(t))!=null&&(Ie(e,r,5),e=e.g,Wn(t),ps(e))}function xo(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(Lr(64,n));if(Rr(n)){if(s==="string")return Wi(n);if(s==="number")return Xn(n)}}(t),t!=null&&(typeof t=="string"&&mo(t),t!=null))switch(Ie(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,U,$);break;case"bigint":r=BigInt.asUintN(64,t),r=new ds(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=mo(t),sr(e.g,r.h,r.g)}}function Mo(e,t,r){(t=$t(t))!=null&&t!=null&&(Ie(e,r,0),an(e.g,t))}function Io(e,t,r){(t=Ui(t))!=null&&(Ie(e,r,0),e.g.g.push(t?1:0))}function Co(e,t,r){(t=ue(t))!=null&&cn(e,r,gi(t))}function No(e,t,r,n,s){un(e,r,Oo(t,n),s)}function Do(e,t,r){(t=t==null||typeof t=="string"||t instanceof Xe?t:void 0)!=null&&cn(e,r,us(t,!0).buffer)}function jo(e,t,r){return(e.h===5||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,rn,t):t.push(rn(e.g)),!0)}var Z=ge(function(e,t,r){return e.h===5&&(se(t,r,rn(e.g)),!0)},Fo,hn),N1=ur(jo,function(e,t,r){if((t=cr(Je,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ie(n,s,5),n=n.g,Wn(i),ps(n))}},hn),ks=ur(jo,function(e,t,r){if((t=cr(Je,t))!=null&&t.length){Ie(e,r,2),ir(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Wn(t[n]),ps(r)}},hn),D1=ge(function(e,t,r){return e.h===5&&(se(t,r,(e=rn(e.g))===0?void 0:e),!0)},Fo,hn),mt=ge(function(e,t,r){return Cn?(e.h!==0?e=!1:(se(t,r,nr(e.g,ji)),e=!0),e):e.h===0&&(se(t,r,nr(e.g,Kn)),!0)},xo,_o),Ss=ge(function(e,t,r){return Cn?(e.h!==0?t=!1:(se(t,r,(e=nr(e.g,ji))===I1?void 0:e),t=!0),t):e.h===0&&(se(t,r,(e=nr(e.g,Kn))===0?void 0:e),!0)},xo,_o),j1=ge(function(e,t,r){return Cn?(e.h!==0?e=!1:(se(t,r,nr(e.g,o1)),e=!0),e):e.h===0&&(se(t,r,nr(e.g,Hn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(a1(64,n));if(Rr(n)){if(s==="string")return s=Jt(Number(n)),Lt(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(Xr(n),n=Tr(U,$))),n;if(s==="number")return(n=Jt(n))>=0&&Lt(n)||(qt(n),n=Hn(U,$)),n}}(t),t!=null&&(typeof t=="string"&&go(t),t!=null))switch(Ie(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,U,$);break;case"bigint":r=BigInt.asUintN(64,t),r=new fs(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=go(t),sr(e.g,r.h,r.g)}},P1),ie=ge(function(e,t,r){return e.h===0&&(se(t,r,gt(e.g)),!0)},Mo,_s),Cr=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,gt,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=gs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);ms(e,r)}},_s),hr=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=gt(e.g))===0?void 0:e),!0)},Mo,_s),X=ge(function(e,t,r){return e.h===0&&(se(t,r,hs(e.g)),!0)},Io,vo),Nt=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=hs(e.g))===!1?void 0:e),!0)},Io,vo),pe=ur(function(e,t,r){return e.h===2&&(e=ls(e),tr(t,0|t[m],r).push(e),!0)},function(e,t,r){if((t=cr(ue,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&cn(n,s,gi(i))}},ys),vt=ge(function(e,t,r){return e.h===2&&(se(t,r,(e=ls(e))===""?void 0:e),!0)},Co,ys),M=ge(function(e,t,r){return e.h===2&&(se(t,r,ls(e)),!0)},Co,ys),oe=function(e,t,r=vs){return new ar(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Ot(void 0,n),tr(t,0|t[m],r).push(n),Ir(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)No(e,t[i],r,n,s);1&(e=0|t[m])||te(t,1|e)}}),q=ln(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[m];return ro(t,o,i,r,Xt(o)),Ir(e,t=as(t,n,r),s),!0},No),Bo=ge(function(e,t,r){return e.h===2&&(se(t,r,po(e)),!0)},Do,bo),B1=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,ct,t):t.push(ct(e.g)),!0)},function(e,t,r){if((t=cr(Vi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Ie(n,s,0),ir(n.g,i))}},yo),U1=ge(function(e,t,r){return e.h===0&&(se(t,r,(e=ct(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Vi(t))!=null&&t!=null&&(Ie(e,r,0),ir(e.g,t))},yo),Te=ge(function(e,t,r){return e.h===0&&(se(t,r,gt(e.g)),!0)},function(e,t,r){(t=$t(t))!=null&&(t=parseInt(t,10),Ie(e,r,0),an(e.g,t))},wo);class V1{constructor(t,r){var n=Le;this.g=t,this.h=r,this.m=O,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ii:void 0}register(){Kr(this)}}function Qe(e,t){return new V1(e,t)}function yt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=ho(r,void 0,void 0,i);try{const o=new e,c=o.v;As(t)(c,r);var s=o}finally{lo(r)}}return s}}function mn(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Ro(this.v,t,Ct(fn,pn,gn,e)),or(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Uo=class extends v{constructor(e){super(e)}},Vo=[0,vt,ge(function(e,t,r){return e.h===2&&(se(t,r,(e=po(e))===kt()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){const n=t.Ra;return void(n?(t=n(t),t!=null&&cn(e,r,us(t,!0).buffer)):Wt(Un,3))}if(Array.isArray(t))return void Wt(Un,3)}Do(e,t,r)},bo)];let Ts,Go=globalThis.trustedTypes;function Wo(e){var t;return Ts===void 0&&(Ts=function(){let r=null;if(!Go)return r;try{const n=s=>s;r=Go.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=Ts)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function G1(e,...t){if(t.length===0)return Wo(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Wo(r)}var Ho=[0,ie,Te,X,-1,Cr,Te,-1,X],W1=class extends v{constructor(e){super(e)}},Ko=[0,X,M,X,Te,-1,ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[m],r),e.h==2?sn(e,S1,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=gs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);ms(e,r)}},wo),M,-1,[0,X,-1],Te,X,-1],zo=[0,3,X,-1,2,[0,ie],[0,Te,X],[0,M,-1],[0]],Yo=[0,M,-2],Xo=class extends v{constructor(e){super(e)}},qo=[0],Jo=[0,ie,X,1,X,-4],Le=class extends v{constructor(e){super(e,2)}},ne={};ne[336783863]=[0,M,X,-1,ie,[0,[1,2,3,4,5,6,7,8,9],q,qo,q,Ko,q,Yo,q,Jo,q,Ho,q,[0,M,-2],q,[0,M,Te],q,zo,q,[0,Te,-1,X]],[0,M],X,[0,[1,3],[2,4],q,[0,Cr],-1,q,[0,pe],-1,oe,[0,M,-1]],M];var $o=[0,Ss,-1,Nt,-3,Ss,Cr,vt,hr,Ss,-1,Nt,hr,Nt,-2,vt];function j(e,t){tn(e,3,t)}function S(e,t){tn(e,4,t)}var ve=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},Nr=[-1,{}],Zo=[0,M,1,Nr],Qo=[0,M,pe,Nr];function Ce(e,t){cs(e,1,ve,t)}function V(e,t){tn(e,10,t)}function P(e,t){tn(e,15,t)}var Oe=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},ea=[-500,oe,[-500,vt,-1,pe,-3,[-2,ne,X],oe,Vo,hr,-1,Zo,Qo,oe,[0,vt,Nt],vt,$o,hr,pe,987,pe],4,oe,[-500,M,-1,[-1,{}],998,M],oe,[-500,M,pe,-1,[-2,{},X],997,pe,-1],hr,oe,[-500,M,pe,Nr,998,pe],pe,hr,Zo,Qo,oe,[0,vt,-1,Nr],pe,-2,$o,vt,-1,Nt,[0,Nt,U1],978,Nr,oe,Vo];Oe.prototype.g=mn(ea);var H1=yt(Oe,ea),K1=class extends v{constructor(e){super(e)}},ta=class extends v{constructor(e){super(e)}g(){return ot(this,K1,1)}},ra=[0,oe,[0,ie,Z,M,-1]],vn=yt(ta,ra),z1=class extends v{constructor(e){super(e)}},Y1=class extends v{constructor(e){super(e)}},Ls=class extends v{constructor(e){super(e)}l(){return O(this,z1,2)}g(){return ot(this,Y1,5)}},na=yt(class extends v{constructor(e){super(e)}},[0,pe,Cr,ks,[0,Te,[0,ie,-3],[0,Z,-3],[0,ie,-1,[0,oe,[0,ie,-2]]],oe,[0,Z,-1,M,Z]],M,-1,mt,oe,[0,ie,Z],pe,mt]),sa=class extends v{constructor(e){super(e)}},lr=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,Z,-4]]),ia=class extends v{constructor(e){super(e)}},Dr=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,Z,-4]]),X1=class extends v{constructor(e){super(e)}},q1=[0,ie,-1,ks,Te],oa=class extends v{constructor(e){super(e)}};oa.prototype.g=mn([0,Z,-4,mt]);var J1=class extends v{constructor(e){super(e)}},$1=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,1,ie,M,ra],mt]),aa=class extends v{constructor(e){super(e)}},Z1=class extends v{constructor(e){super(e)}na(){const e=D(this,1,void 0,void 0,eo);return e??kt()}},Q1=class extends v{constructor(e){super(e)}},ca=[1,2],ec=yt(class extends v{constructor(e){super(e)}},[0,oe,[0,ca,q,[0,ks],q,[0,Bo],ie,M],mt]),Os=class extends v{constructor(e){super(e)}},ua=[0,M,ie,Z,pe,-1],ha=class extends v{constructor(e){super(e)}},tc=[0,X,-1],la=class extends v{constructor(e){super(e)}},yn=[1,2,3,4,5,6],_n=class extends v{constructor(e){super(e)}g(){return D(this,1,void 0,void 0,eo)!=null}l(){return ue(D(this,2))!=null}},H=class extends v{constructor(e){super(e)}g(){return Ui(D(this,2))??!1}},fa=[0,Bo,M,[0,ie,mt,-1],[0,j1,mt]],Q=[0,fa,X,[0,yn,q,Jo,q,Ko,q,Ho,q,qo,q,Yo,q,zo],Te],bn=class extends v{constructor(e){super(e)}},Ps=[0,Q,Z,-1,ie],rc=Qe(502141897,bn);ne[502141897]=Ps;var nc=yt(class extends v{constructor(e){super(e)}},[0,[0,Te,-1,N1,B1],q1]),da=class extends v{constructor(e){super(e)}},pa=class extends v{constructor(e){super(e)}},Rs=[0,Q,Z,[0,Q],X],sc=Qe(508968150,pa);ne[508968150]=[0,Q,Ps,Rs,Z,[0,[0,fa]]],ne[508968149]=Rs;var fr=class extends v{constructor(e){super(e)}l(){return O(this,Os,2)}g(){F(this,2)}},ga=[0,Q,ua];ne[478825465]=ga;var ic=class extends v{constructor(e){super(e)}},ma=class extends v{constructor(e){super(e)}},Fs=class extends v{constructor(e){super(e)}},xs=class extends v{constructor(e){super(e)}},va=class extends v{constructor(e){super(e)}},ya=[0,Q,[0,Q],ga,-1],_a=[0,Q,Z,ie],Ms=[0,Q,Z],ba=[0,Q,_a,Ms,Z],oc=Qe(479097054,va);ne[479097054]=[0,Q,ba,ya],ne[463370452]=ya,ne[464864288]=_a;var ac=Qe(462713202,xs);ne[462713202]=ba,ne[474472470]=Ms;var cc=class extends v{constructor(e){super(e)}},wa=class extends v{constructor(e){super(e)}},Ea=class extends v{constructor(e){super(e)}},Aa=class extends v{constructor(e){super(e)}},Is=[0,Q,Z,-1,ie],Cs=[0,Q,Z,X];Aa.prototype.g=mn([0,Q,Ms,[0,Q],Ps,Rs,Is,Cs]);var ka=class extends v{constructor(e){super(e)}},uc=Qe(456383383,ka);ne[456383383]=[0,Q,ua];var Sa=class extends v{constructor(e){super(e)}},hc=Qe(476348187,Sa);ne[476348187]=[0,Q,tc];var Ta=class extends v{constructor(e){super(e)}},La=class extends v{constructor(e){super(e)}},Oa=[0,Te,-1],lc=Qe(458105876,class extends v{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[m];return e=Ae(this,r),t=function(n,s,i,o){var c=La;!o&&Qt(n)&&(i=0|(s=n.v)[m]);var u=it(s,2);if(n=!1,u==null){if(o)return Xi();u=[]}else if(u.constructor===st){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[m])):u=[];if(o){if(!u.length)return Xi();n||(n=!0,kr(u))}else n&&(n=!1,Sr(u),u=to(u));return!n&&32&i&&Ar(u,32),i=re(s,i,2,o=new st(u,c,l1,void 0)),n||Pt(s,i),o}(this,t,r,e),!e&&La&&(t.ra=!0),t}});ne[458105876]=[0,Oa,C1,[!0,mt,[0,M,-1,pe]],[0,Cr,X,Te]];var Ns=class extends v{constructor(e){super(e)}},Pa=Qe(458105758,Ns);ne[458105758]=[0,Q,M,Oa];var Ds=class extends v{constructor(e){super(e)}},Ra=[0,D1,-1,Nt],fc=class extends v{constructor(e){super(e)}},Fa=class extends v{constructor(e){super(e)}},js=[1,2];Fa.prototype.g=mn([0,js,q,Ra,q,[0,oe,Ra]]);var xa=class extends v{constructor(e){super(e)}},dc=Qe(443442058,xa);ne[443442058]=[0,Q,M,ie,Z,pe,-1,X,Z],ne[514774813]=Is;var Ma=class extends v{constructor(e){super(e)}},pc=Qe(516587230,Ma);function Bs(e,t){return t=t?t.clone():new Os,e.displayNamesLocale!==void 0?F(t,1,Fr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&F(t,1),e.maxResults!==void 0?at(t,2,e.maxResults):"maxResults"in e&&F(t,2),e.scoreThreshold!==void 0?_(t,3,e.scoreThreshold):"scoreThreshold"in e&&F(t,3),e.categoryAllowlist!==void 0?en(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&F(t,4),e.categoryDenylist!==void 0?en(t,5,e.categoryDenylist):"categoryDenylist"in e&&F(t,5),t}function Ia(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Us(e,t=-1,r=""){return{categories:e.map(n=>({index:Me(n,1)??0??-1,score:Y(n,2)??0,categoryName:ue(D(n,3))??""??"",displayName:ue(D(n,4))??""??""})),headIndex:t,headName:r}}function gc(e){const t={classifications:ot(e,J1,1).map(r=>{var n;return Us(((n=O(r,ta,4))==null?void 0:n.g())??[],Me(r,2)??0,ue(D(r,3))??"")})};return function(r){return h1(Nn?D(r,2,void 0,void 0,Jr):D(r,2))}(e)!=null&&(t.timestampMs=Ia(oo(e))),t}function Ca(e){var o,c;var t=Ft(e,3,Je,Rt()),r=Ft(e,2,$t,Rt()),n=Ft(e,1,ue,Rt()),s=Ft(e,9,ue,Rt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=O(e,Ls,4))==null?void 0:o.l())&&(i.boundingBox={originX:Me(t,1,dt)??0,originY:Me(t,2,dt)??0,width:Me(t,3,dt)??0,height:Me(t,4,dt)??0,angle:0}),(c=O(e,Ls,4))==null?void 0:c.g().length)for(const u of O(e,Ls,4).g())i.keypoints.push({x:D(u,1,void 0,dt,Je)??0,y:D(u,2,void 0,dt,Je)??0,score:D(u,4,void 0,dt,Je)??0,label:ue(D(u,3,void 0,dt))??""});return i}function wn(e){const t=[];for(const r of ot(e,ia,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function jr(e){const t=[];for(const r of ot(e,sa,1))t.push({x:Y(r,1)??0,y:Y(r,2)??0,z:Y(r,3)??0,visibility:Y(r,4)??0});return t}function Na(e){return Array.from(e,t=>t>127?t-256:t)}function Da(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let En;ne[516587230]=[0,Q,Is,Cs,Z],ne[518928384]=Cs;const mc=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 ja(){if(En===void 0)try{await WebAssembly.instantiate(mc),En=!0}catch{En=!1}return En}async function Br(e,t=G1``){const r=await ja()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Dt=class{};function Ba(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Ua(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Va(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function y(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function Ga(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Va(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Wa(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function et(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function _t(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}Dt.forVisionTasks=function(e){return Br("vision",e)},Dt.forTextTasks=function(e){return Br("text",e)},Dt.forGenAiExperimentalTasks=function(e){return Br("genai_experimental",e)},Dt.forGenAiTasks=function(e){return Br("genai",e)},Dt.forAudioTasks=function(e){return Br("audio",e)},Dt.isSimdSupported=function(){return ja()};async function vc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Ua(i),!self.ModuleFactory||o&&(await Ua(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Vs(e,t){const r=O(e.baseOptions,_n,1)||new _n;typeof t=="string"?(F(r,2,Fr(t)),F(r,1)):t instanceof Uint8Array&&(F(r,1,Vn(t,!1)),F(r,2)),w(e.baseOptions,0,1,r)}function Ha(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function An(e,t){e.B=new ve,Se(e.B,2,"PassThroughCalculator"),j(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),V(t,"free_memory"),Ce(t,e.B)}function dr(e,t){j(e.B,t),S(e.B,t+"_unused_out")}function kn(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var Gs=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=O(this.baseOptions,_n,1))!=null&&s.g()||(i=O(this.baseOptions,_n,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(f,h){let d=O(f.baseOptions,la,3);if(!d){var b=d=new la,A=new Xo;Mr(b,4,yn,A)}"delegate"in h&&(h.delegate==="GPU"?(h=d,b=new W1,Mr(h,2,yn,b)):(h=d,b=new Xo,Mr(h,4,yn,b))),w(f.baseOptions,0,3,d)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(f=>{if(f.ok)return f.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${f.status})`)}).then(f=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(f),!0,!1,!1),Vs(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Vs(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(f){const h=[];for(var d=0;;){const{done:b,value:A}=await f.read();if(b)break;h.push(A),d+=A.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];f=new Uint8Array(d),d=0;for(const b of h)f.set(b,d),d+=b.length;return f}(u.modelAssetBuffer).then(f=>{Vs(this,f),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=H1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ha(this)}finishProcessing(){this.g.finishProcessing(),Ha(this)}close(){this.B=void 0,this.g.closeGraph()}};function bt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}Gs.prototype.close=Gs.prototype.close;class yc{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Ka(e,t,r){const n=e.g;if(r=bt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function za(e,t){const r=e.g,n=bt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=bt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.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);const i=bt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[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 yc(r,n,s,i)}function Ws(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function _c(e,t,r,n){return Ws(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=za(e,!0)),r=e.u):(e.A||(e.A=za(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Ya(e,t,r){return Ws(e,t),e=bt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function Xa(e,t,r){Ws(e,t),e.B||(e.B=bt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function bc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var qa=class{H(){return`
|
|
2
|
+
precision mediump float;
|
|
3
|
+
varying vec2 vTex;
|
|
4
|
+
uniform sampler2D inputTexture;
|
|
5
|
+
void main() {
|
|
6
|
+
gl_FragColor = texture2D(inputTexture, vTex);
|
|
7
|
+
}
|
|
8
|
+
`}m(){const e=this.g;if(this.h=bt(e.createProgram(),"Failed to create WebGL program"),this.X=Ka(this,`
|
|
9
|
+
attribute vec2 aVertex;
|
|
10
|
+
attribute vec2 aTex;
|
|
11
|
+
varying vec2 vTex;
|
|
12
|
+
void main(void) {
|
|
13
|
+
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
14
|
+
vTex = aTex;
|
|
15
|
+
}`,e.VERTEX_SHADER),this.W=Ka(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function ut(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Hs(e){var t=ut(e,1);if(!t){if(t=ut(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=pr(e);var r=Ks(e);if(Xa(r,n,Ja(e)),"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(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function Ja(e){let t=ut(e,2);if(!t){const r=pr(e);t=Za(e);const n=Hs(e),s=$a(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),zs(e)}return t}function pr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=bt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function $a(e){if(e=pr(e),!Sn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sn=e.R16F}return Sn}function Ks(e){return e.l||(e.l=new qa),e.l}function Za(e){const t=pr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=ut(e,2);return r||(r=Ya(Ks(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function zs(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sn,ae=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--Qa===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!ut(this,0)}ka(){return!!ut(this,1)}R(){return!!ut(this,2)}ja(){return(t=ut(e=this,0))||(t=Hs(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return Hs(this)}N(){return Ja(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=pr(this),s=Ks(this);n.activeTexture(n.TEXTURE1),r=Ya(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=$a(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),Xa(s,n,r),_c(s,n,!1,()=>{Za(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),zs(this)}),bc(s),zs(this)}}e.push(r)}return new ae(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pr(this).deleteTexture(ut(this,2)),Qa=-1}};ae.prototype.close=ae.prototype.close,ae.prototype.clone=ae.prototype.clone,ae.prototype.getAsWebGLTexture=ae.prototype.N,ae.prototype.getAsFloat32Array=ae.prototype.ia,ae.prototype.getAsUint8Array=ae.prototype.ja,ae.prototype.hasWebGLTexture=ae.prototype.R,ae.prototype.hasFloat32Array=ae.prototype.ka,ae.prototype.hasUint8Array=ae.prototype.Fa;var Qa=250;function Ge(...e){return e.map(([t,r])=>({start:t,end:r}))}const wc=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((e2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ba()?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(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),y(this,n||"input_audio",i=>{y(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){et(this,"__graph_config__",t=>{e(t)}),y(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),y(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){y(this,t,n=>{const[s,i]=Ga(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){y(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){y(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){y(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){y(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){y(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){y(this,t,n=>{y(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){y(this,t,n=>{Wa(this,Object.keys(e),s=>{Wa(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){y(this,r,s=>{y(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){y(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){y(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)y(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){y(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){y(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){y(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){y(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){y(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){y(this,t,r=>{y(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){y(this,r,n=>{y(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){y(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)y(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){et(this,e,t),y(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){_t(this,e,t),y(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){et(this,e,t),y(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){_t(this,e,t),y(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),et(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),y(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends e2{get ga(){return this.i}pa(e,t,r){y(this,t,n=>{const[s,i]=Ga(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){et(this,e,t),y(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){_t(this,e,t),y(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var e2,We=class extends wc{};async function L(e,t,r){return async function(n,s,i,o){return vc(n,s,i,o)}(e,r.canvas??(Ba()?void 0:document.createElement("canvas")),t,r)}function t2(e,t,r,n){if(e.U){const i=new oa;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");_(i,1,(s.left+s.right)/2),_(i,2,(s.top+s.bottom)/2),_(i,4,s.right-s.left),_(i,3,s.bottom-s.top)}else _(i,1,.5),_(i,2,.5),_(i,4,1),_(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(_(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Va(t);r=Y(i,3)*c/o,s=Y(i,4)*o/c,_(i,4,r),_(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function He(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");t2(e,t,r,e.C+1)}function tt(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");t2(e,t,r,n)}function gr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new ae([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Pe=class extends Gs{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new qa}l(e,t=!0){if("runningMode"in e&&F(this.baseOptions,2,Pr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Pe.prototype.close=Pe.prototype.close;var Ne=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new bn,0,1,t=new H),_(this.h,2,.5),_(this.h,3,.3)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&_(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&_(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},He(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect_in"),P(e,"detections");const t=new Le;Ze(t,rc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=na(i),this.j.detections.push(Ca(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.detectForVideo=Ne.prototype.G,Ne.prototype.detect=Ne.prototype.F,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=async function(e,t){return L(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return L(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return L(Ne,e,t)};var Ys=Ge([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]),Xs=Ge([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]),qs=Ge([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),r2=Ge([474,475],[475,476],[476,477],[477,474]),Js=Ge([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]),$s=Ge([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),n2=Ge([469,470],[470,471],[471,472],[472,469]),Zs=Ge([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]),s2=[...Ys,...Xs,...qs,...Js,...$s,...Zs],i2=Ge([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 o2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var G=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new pa,0,1,t=new H),this.A=new da,w(this.h,0,3,this.A),this.u=new bn,w(this.h,0,2,this.u),at(this.u,4,1),_(this.u,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&at(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&_(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return o2(this),He(this,e,t),this.j}G(e,t,r){return o2(this),tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"face_landmarks");const t=new Le;Ze(t,sc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=Dr(i),this.j.faceLandmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=vn(i),this.j.faceBlendshapes.push(Us(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=O(n=nc(i),X1,2))&&this.j.facialTransformationMatrixes.push({rows:Me(n,1)??0??0,columns:Me(n,2)??0??0,data:Ft(n,3,Je,Rt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};G.prototype.detectForVideo=G.prototype.G,G.prototype.detect=G.prototype.F,G.prototype.setOptions=G.prototype.o,G.createFromModelPath=function(e,t){return L(G,e,{baseOptions:{modelAssetPath:t}})},G.createFromModelBuffer=function(e,t){return L(G,e,{baseOptions:{modelAssetBuffer:t}})},G.createFromOptions=function(e,t){return L(G,e,t)},G.FACE_LANDMARKS_LIPS=Ys,G.FACE_LANDMARKS_LEFT_EYE=Xs,G.FACE_LANDMARKS_LEFT_EYEBROW=qs,G.FACE_LANDMARKS_LEFT_IRIS=r2,G.FACE_LANDMARKS_RIGHT_EYE=Js,G.FACE_LANDMARKS_RIGHT_EYEBROW=$s,G.FACE_LANDMARKS_RIGHT_IRIS=n2,G.FACE_LANDMARKS_FACE_OVAL=Zs,G.FACE_LANDMARKS_CONTOURS=s2,G.FACE_LANDMARKS_TESSELATION=i2;var Qs=Ge([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 a2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function c2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function u2(e,t=!0){const r=[];for(const s of e){var n=vn(s);e=[];for(const i of n.g())n=t&&Me(i,1)!=null?Me(i,1)??0:-1,e.push({score:Y(i,2)??0,index:n,categoryName:ue(D(i,3))??""??"",displayName:ue(D(i,4))??""??""});r.push(e)}return r}var Re=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new va,0,1,t=new H),this.u=new xs,w(this.j,0,2,this.u),this.D=new Fs,w(this.u,0,3,this.D),this.A=new ma,w(this.u,0,2,this.A),this.h=new ic,w(this.j,0,3,this.h),_(this.A,2,.5),_(this.u,4,.5),_(this.D,2,.5)}get baseOptions(){return O(this.j,H,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(at(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new fr,r=t,n=Bs(e.cannedGesturesClassifierOptions,(s=O(this.h,fr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=O(this.h,fr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new fr,0,2,n=Bs(e.customGesturesClassifierOptions,(o=O(this.h,fr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=O(this.h,fr,4))==null||c.g()),this.l(e)}Ha(e,t){return a2(this),He(this,e,t),c2(this)}Ia(e,t,r){return a2(this),tt(this,e,r,t),c2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;Ze(t,oc,this.j);const r=new ve;Se(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=Dr(i);const o=[];for(const c of ot(n,ia,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=lr(i);const o=[];for(const c of ot(n,sa,1))o.push({x:Y(c,1)??0,y:Y(c,2)??0,z:Y(c,3)??0,visibility:Y(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...u2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...u2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function h2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Re.prototype.recognizeForVideo=Re.prototype.Ia,Re.prototype.recognize=Re.prototype.Ha,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return L(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return L(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return L(Re,e,t)},Re.HAND_CONNECTIONS=Qs;var ye=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new xs,0,1,t=new H),this.u=new Fs,w(this.h,0,3,this.u),this.j=new ma,w(this.h,0,2,this.j),at(this.j,3,1),_(this.j,2,.5),_(this.u,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&at(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&_(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&_(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],He(this,e,t),h2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],tt(this,e,r,t),h2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Le;Ze(t,ac,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=Dr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=lr(i),this.worldLandmarks.push(jr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=vn(u);const f=[];for(const h of n.g())f.push({score:Y(h,2)??0,index:Me(h,1)??0??-1,categoryName:ue(D(h,3))??""??"",displayName:ue(D(h,4))??""??""});c.push(f)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ye.prototype.detectForVideo=ye.prototype.G,ye.prototype.detect=ye.prototype.F,ye.prototype.setOptions=ye.prototype.o,ye.createFromModelPath=function(e,t){return L(ye,e,{baseOptions:{modelAssetPath:t}})},ye.createFromModelBuffer=function(e,t){return L(ye,e,{baseOptions:{modelAssetBuffer:t}})},ye.createFromOptions=function(e,t){return L(ye,e,t)},ye.HAND_CONNECTIONS=Qs;var l2=Ge([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 f2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function d2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{kn(e)}}function Tn(e,t){e=Dr(e),t.push(wn(e))}var B=class extends Pe{constructor(e,t){super(new We(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new Aa,0,1,t=new H),this.I=new Fs,w(this.j,0,2,this.I),this.W=new cc,w(this.j,0,3,this.W),this.u=new bn,w(this.j,0,4,this.u),this.O=new da,w(this.j,0,5,this.O),this.A=new wa,w(this.j,0,6,this.A),this.M=new Ea,w(this.j,0,7,this.M),_(this.u,2,.5),_(this.u,3,.3),_(this.O,2,.5),_(this.A,2,.5),_(this.A,3,.3),_(this.M,2,.5),_(this.I,2,.5)}get baseOptions(){return O(this.j,H,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&_(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&_(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&_(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&_(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&_(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&_(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&_(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,f2(this),He(this,e,n),d2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,f2(this),tt(this,e,s,t),d2(this)}m(){var e=new Oe;V(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Le,r=new Uo;Se(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))F(s,2,Qr(i,0,xr));else{if(!(typeof i=="string"||i instanceof Xe||Dn(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");pt(s,2,Vn(i,!1),kt())}}(r,this.j.g());const n=new ve;Se(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),cs(n,8,Uo,r),j(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ce(e,n),An(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{Tn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),dr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[gr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{Tn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=vn(s),o.push(Us(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{Tn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{Tn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=lr(s),o.push(jr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};B.prototype.detectForVideo=B.prototype.G,B.prototype.detect=B.prototype.F,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(e,t){return L(B,e,{baseOptions:{modelAssetPath:t}})},B.createFromModelBuffer=function(e,t){return L(B,e,{baseOptions:{modelAssetBuffer:t}})},B.createFromOptions=function(e,t){return L(B,e,t)},B.HAND_CONNECTIONS=Qs,B.POSE_CONNECTIONS=l2,B.FACE_LANDMARKS_LIPS=Ys,B.FACE_LANDMARKS_LEFT_EYE=Xs,B.FACE_LANDMARKS_LEFT_EYEBROW=qs,B.FACE_LANDMARKS_LEFT_IRIS=r2,B.FACE_LANDMARKS_RIGHT_EYE=Js,B.FACE_LANDMARKS_RIGHT_EYEBROW=$s,B.FACE_LANDMARKS_RIGHT_IRIS=n2,B.FACE_LANDMARKS_FACE_OVAL=Zs,B.FACE_LANDMARKS_CONTOURS=s2,B.FACE_LANDMARKS_TESSELATION=i2;var De=class extends Pe{constructor(e,t){super(new We(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new ka,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Bs(e,O(this.h,Os,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},He(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_image"),V(e,"norm_rect"),P(e,"classifications");const t=new Le;Ze(t,uc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),j(r,"IMAGE:input_image"),j(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ce(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=gc($1(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};De.prototype.classifyForVideo=De.prototype.ta,De.prototype.classify=De.prototype.sa,De.prototype.setOptions=De.prototype.o,De.createFromModelPath=function(e,t){return L(De,e,{baseOptions:{modelAssetPath:t}})},De.createFromModelBuffer=function(e,t){return L(De,e,{baseOptions:{modelAssetBuffer:t}})},De.createFromOptions=function(e,t){return L(De,e,t)};var Fe=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!0),this.h=new Sa,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=O(this.h,ha,2);return r=r?r.clone():new ha,e.l2Normalize!==void 0?F(r,1,Pr(e.l2Normalize)):"l2Normalize"in e&&F(r,1),e.quantize!==void 0?F(r,2,Pr(e.quantize)):"quantize"in e&&F(r,2),w(t,0,2,r),this.l(e)}za(e,t){return He(this,e,t),this.embeddings}Aa(e,t,r){return tt(this,e,r,t),this.embeddings}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"embeddings_out");const t=new Le;Ze(t,hc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ce(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=ec(n),this.embeddings=function(i){return{embeddings:ot(i,Q1,1).map(o=>{var f,h;const c={headIndex:Me(o,3)??0??-1,headName:ue(D(o,4))??""??""};var u=o.v;return no(u,0|u[m],aa,ss(o,1))!==void 0?(o=Ft(o=O(o,aa,ss(o,1),void 0),1,Je,Rt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((h=(f=O(o,Z1,ss(o,2),void 0))==null?void 0:f.na())==null?void 0:h.h())??u),c}),timestampMs:Ia(oo(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Fe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Da(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Da(Na(e.quantizedEmbedding),Na(t.quantizedEmbedding))}return e},Fe.prototype.embedForVideo=Fe.prototype.Aa,Fe.prototype.embed=Fe.prototype.za,Fe.prototype.setOptions=Fe.prototype.o,Fe.createFromModelPath=function(e,t){return L(Fe,e,{baseOptions:{modelAssetPath:t}})},Fe.createFromModelBuffer=function(e,t){return L(Fe,e,{baseOptions:{modelAssetBuffer:t}})},Fe.createFromOptions=function(e,t){return L(Fe,e,t)};var ei=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Ec(e){var r,n;const t=function(s){return ot(s,ve,1)}(e.ca()).filter(s=>(ue(D(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=O(t[0],Le,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=ue(D(s,1))??""})}function p2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function g2(e){try{const t=new ei(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kn(e)}}ei.prototype.close=ei.prototype.close;var _e=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.A=new Ta,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Fr(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Ec(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,p2(this),He(this,e,n),g2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,p2(this),tt(this,e,s,t),g2(this)}Da(){return this.u}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect");const t=new Le;Ze(t,Pa,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return L(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return L(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return L(_e,e,t)};var ti=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};ti.prototype.close=ti.prototype.close;var rt=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Ns,this.u=new Ta,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new Fa,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Ds;pt(i,3,Pr(!0),!1),pt(i,1,Or(t.keypoint.x),0),pt(i,2,Or(t.keypoint.y),0),Mr(n,1,js,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new fc;for(i of t.scribble)pt(t=new Ds,3,Pr(!0),!1),pt(t,1,Or(i.x),0),pt(t,2,Or(i.y),0),cs(c,1,Ds,t);Mr(n,2,js,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),He(this,e,s);e:{try{const c=new ti(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{kn(this)}o=void 0}return o}m(){var e=new Oe;V(e,"image_in"),V(e,"roi_in"),V(e,"norm_rect_in");const t=new Le;Ze(t,Pa,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),j(r,"IMAGE:image_in"),j(r,"ROI:roi_in"),j(r,"NORM_RECT:norm_rect_in"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};rt.prototype.segment=rt.prototype.segment,rt.prototype.setOptions=rt.prototype.o,rt.createFromModelPath=function(e,t){return L(rt,e,{baseOptions:{modelAssetPath:t}})},rt.createFromModelBuffer=function(e,t){return L(rt,e,{baseOptions:{modelAssetBuffer:t}})},rt.createFromOptions=function(e,t){return L(rt,e,t)};var je=class extends Pe{constructor(e,t){super(new We(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new xa,0,1,t=new H)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?F(this.h,2,Fr(e.displayNamesLocale)):"displayNamesLocale"in e&&F(this.h,2),e.maxResults!==void 0?at(this.h,3,e.maxResults):"maxResults"in e&&F(this.h,3),e.scoreThreshold!==void 0?_(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&F(this.h,4),e.categoryAllowlist!==void 0?en(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&F(this.h,5),e.categoryDenylist!==void 0?en(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&F(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},He(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},tt(this,e,r,t),this.j}m(){var e=new Oe;V(e,"input_frame_gpu"),V(e,"norm_rect"),P(e,"detections");const t=new Le;Ze(t,dc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),j(r,"IMAGE:input_frame_gpu"),j(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=na(i),this.j.detections.push(Ca(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.detectForVideo=je.prototype.G,je.prototype.detect=je.prototype.F,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=async function(e,t){return L(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return L(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return L(je,e,t)};var ri=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function m2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function v2(e){try{const t=new ri(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{kn(e)}}ri.prototype.close=ri.prototype.close;var xe=class extends Pe{constructor(e,t){super(new We(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new Ma,0,1,t=new H),this.A=new Ea,w(this.h,0,3,this.A),this.j=new wa,w(this.h,0,2,this.j),at(this.j,4,1),_(this.j,2,.5),_(this.A,2,.5),_(this.h,4,.5)}get baseOptions(){return O(this.h,H,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&at(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&_(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&_(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&_(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,m2(this),He(this,e,n),v2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,m2(this),tt(this,e,s,t),v2(this)}m(){var e=new Oe;V(e,"image_in"),V(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Le;Ze(t,pc,this.h);const r=new ve;Se(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),j(r,"IMAGE:image_in"),j(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ce(e,r),An(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=Dr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=lr(i),this.worldLandmarks.push(jr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),dr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>gr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};xe.prototype.detectForVideo=xe.prototype.G,xe.prototype.detect=xe.prototype.F,xe.prototype.setOptions=xe.prototype.o,xe.createFromModelPath=function(e,t){return L(xe,e,{baseOptions:{modelAssetPath:t}})},xe.createFromModelBuffer=function(e,t){return L(xe,e,{baseOptions:{modelAssetBuffer:t}})},xe.createFromOptions=function(e,t){return L(xe,e,t)},xe.POSE_CONNECTIONS=l2;const Ac=["Smile","Blink","Turn_Head","Thumbs_Up"],y2=({apiUrl:e,duration:t=60,onComplete:r,onError:n})=>{const s=N.useRef(null),i=N.useRef(),o=N.useRef(null),[c,u]=N.useState({face:null,hand:null}),[f,h]=N.useState("loading"),[d,b]=N.useState(""),[A,W]=N.useState([]),[nt,Ke]=N.useState(0),[he,K]=N.useState(t),[ht,Gr]=N.useState(!1),jt=N.useRef(nt),wt=N.useRef(ht);N.useEffect(()=>{jt.current=nt},[nt]),N.useEffect(()=>{wt.current=ht},[ht]);const Ln=()=>{W([...Ac].sort(()=>.5-Math.random()).slice(0,3))};N.useEffect(()=>{(async()=>{try{const z=await Dt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),le=await G.createFromOptions(z,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),fe=await ye.createFromOptions(z,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});u({face:le,hand:fe}),Ln(),h("ready")}catch{b("Failed to load security assets."),h("error")}})()},[]),N.useEffect(()=>(f==="capturing"&&he>0?o.current=setInterval(()=>K(I=>I-1),1e3):he===0&&f==="capturing"&&h("expired"),()=>clearInterval(o.current)),[f,he]);const si=()=>h("capturing"),On=()=>{Ke(0),jt.current=0,K(t),Gr(!1),wt.current=!1,b(""),Ln(),h("ready")},ii=(I,z)=>{const le=document.createElement("canvas"),fe=le.getContext("2d"),be=z.map(Bt=>Bt.x*I.videoWidth),C=z.map(Bt=>Bt.y*I.videoHeight),de=Math.min(...be),ce=Math.max(...be),lt=Math.min(...C),ft=Math.max(...C),vr=ce-de,ai=ft-lt,Et=vr*.25;return le.width=224,le.height=224,fe.drawImage(I,de-Et,lt-Et,vr+Et*2,ai+Et*2,0,0,224,224),le},oi=(I,z,le)=>{var fe,be;if(wt.current)return!1;if(le==="Thumbs_Up"&&((fe=z==null?void 0:z.landmarks)==null?void 0:fe.length)>0){const C=z.landmarks[0];return C[4].y<C[2].y&&[8,12,16,20].every(de=>C[de].y>C[de-2].y)}if(((be=I==null?void 0:I.faceLandmarks)==null?void 0:be.length)>0){const C=I.faceLandmarks[0];switch(le){case"Smile":return C[291].x-C[61].x>.15;case"Blink":return(Math.abs(C[159].y-C[145].y)+Math.abs(C[386].y-C[374].y))/2<.01;case"Turn_Head":const ce=(C[1].x-C[33].x)/(C[263].x-C[33].x);return ce<.25||ce>.75;default:return!1}}return!1},mr=N.useCallback(()=>{var be,C,de;if(f!=="capturing"||!((be=s.current)!=null&&be.video))return;const I=s.current.video,z=performance.now(),le=(C=c.face)==null?void 0:C.detectForVideo(I,z),fe=(de=c.hand)==null?void 0:de.detectForVideo(I,z);oi(le,fe,A[jt.current])&&(wt.current||(Gr(!0),wt.current=!0,setTimeout(()=>{jt.current<A.length-1?(Ke(ce=>(jt.current=ce+1,ce+1)),Gr(!1),wt.current=!1):ze()},1500))),i.current=requestAnimationFrame(mr)},[f,c,A]);N.useEffect(()=>(f==="capturing"&&(i.current=requestAnimationFrame(mr)),()=>cancelAnimationFrame(i.current)),[f,mr]);const ze=async()=>{var I,z;h("verifying");try{const le=s.current.video,fe=[];for(let ce=0;ce<5;ce++){const lt=performance.now(),ft=(I=c.face)==null?void 0:I.detectForVideo(le,lt);(z=ft==null?void 0:ft.faceLandmarks)!=null&&z[0]&&fe.push(ii(le,ft.faceLandmarks[0]).toDataURL("image/jpeg",.95)),await new Promise(vr=>setTimeout(vr,60))}const be=new FormData;for(let ce=0;ce<fe.length;ce++){const lt=await(await fetch(fe[ce])).blob();be.append("files",lt,`frame_${ce}.jpg`)}const de=await(await fetch(`${e}/v1/verify`,{method:"POST",body:be})).json();de.is_live?(h("success"),r==null||r({success:!0,image:fe[fe.length-1],skinConfidence:de.skin_confidence})):(b(de.reason||"Spoof detected."),h("error"),n==null||n({success:!1,reason:de.reason||"Spoof detected."}))}catch{b("Server unreachable."),h("error"),n==null||n({success:!1,reason:"Server error"})}};return{webcamRef:s,status:f,errorMsg:d,sequence:A,currentStep:nt,timeLeft:he,isStepTransitioning:ht,start:si,reset:On,sendFinalProof:ze}};var ni={exports:{}},Ur={};/**
|
|
2
16
|
* @license React
|
|
3
17
|
* react-jsx-runtime.production.min.js
|
|
4
18
|
*
|
|
@@ -6,7 +20,7 @@
|
|
|
6
20
|
*
|
|
7
21
|
* This source code is licensed under the MIT license found in the
|
|
8
22
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
23
|
+
*/var _2;function kc(){if(_2)return Ur;_2=1;var e=N,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(c,u,f){var h,d={},b=null,A=null;f!==void 0&&(b=""+f),u.key!==void 0&&(b=""+u.key),u.ref!==void 0&&(A=u.ref);for(h in u)n.call(u,h)&&!i.hasOwnProperty(h)&&(d[h]=u[h]);if(c&&c.defaultProps)for(h in u=c.defaultProps,u)d[h]===void 0&&(d[h]=u[h]);return{$$typeof:t,type:c,key:b,ref:A,props:d,_owner:s.current}}return Ur.Fragment=r,Ur.jsx=o,Ur.jsxs=o,Ur}var Vr={};/**
|
|
10
24
|
* @license React
|
|
11
25
|
* react-jsx-runtime.development.js
|
|
12
26
|
*
|
|
@@ -14,31 +28,17 @@
|
|
|
14
28
|
*
|
|
15
29
|
* This source code is licensed under the MIT license found in the
|
|
16
30
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
31
|
+
*/var b2;function Sc(){return b2||(b2=1,process.env.NODE_ENV!=="production"&&function(){var e=N,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),W=Symbol.iterator,nt="@@iterator";function Ke(a){if(a===null||typeof a!="object")return null;var l=W&&a[W]||a[nt];return typeof l=="function"?l:null}var he=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function K(a){{for(var l=arguments.length,p=new Array(l>1?l-1:0),E=1;E<l;E++)p[E-1]=arguments[E];ht("error",a,p)}}function ht(a,l,p){{var E=he.ReactDebugCurrentFrame,R=E.getStackAddendum();R!==""&&(l+="%s",p=p.concat([R]));var x=p.map(function(T){return String(T)});x.unshift("Warning: "+l),Function.prototype.apply.call(console[a],console,x)}}var Gr=!1,jt=!1,wt=!1,Ln=!1,si=!1,On;On=Symbol.for("react.module.reference");function ii(a){return!!(typeof a=="string"||typeof a=="function"||a===n||a===i||si||a===s||a===f||a===h||Ln||a===A||Gr||jt||wt||typeof a=="object"&&a!==null&&(a.$$typeof===b||a.$$typeof===d||a.$$typeof===o||a.$$typeof===c||a.$$typeof===u||a.$$typeof===On||a.getModuleId!==void 0))}function oi(a,l,p){var E=a.displayName;if(E)return E;var R=l.displayName||l.name||"";return R!==""?p+"("+R+")":p}function mr(a){return a.displayName||"Context"}function ze(a){if(a==null)return null;if(typeof a.tag=="number"&&K("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case n:return"Fragment";case r:return"Portal";case i:return"Profiler";case s:return"StrictMode";case f:return"Suspense";case h:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var l=a;return mr(l)+".Consumer";case o:var p=a;return mr(p._context)+".Provider";case u:return oi(a,a.render,"ForwardRef");case d:var E=a.displayName||null;return E!==null?E:ze(a.type)||"Memo";case b:{var R=a,x=R._payload,T=R._init;try{return ze(T(x))}catch{return null}}}return null}var I=Object.assign,z=0,le,fe,be,C,de,ce,lt;function ft(){}ft.__reactDisabledLog=!0;function vr(){{if(z===0){le=console.log,fe=console.info,be=console.warn,C=console.error,de=console.group,ce=console.groupCollapsed,lt=console.groupEnd;var a={configurable:!0,enumerable:!0,value:ft,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}z++}}function ai(){{if(z--,z===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},a,{value:le}),info:I({},a,{value:fe}),warn:I({},a,{value:be}),error:I({},a,{value:C}),group:I({},a,{value:de}),groupCollapsed:I({},a,{value:ce}),groupEnd:I({},a,{value:lt})})}z<0&&K("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Et=he.ReactCurrentDispatcher,Bt;function Pn(a,l,p){{if(Bt===void 0)try{throw Error()}catch(R){var E=R.stack.trim().match(/\n( *(at )?)/);Bt=E&&E[1]||""}return`
|
|
32
|
+
`+Bt+a}}var ci=!1,Rn;{var Oc=typeof WeakMap=="function"?WeakMap:Map;Rn=new Oc}function w2(a,l){if(!a||ci)return"";{var p=Rn.get(a);if(p!==void 0)return p}var E;ci=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=Et.current,Et.current=null,vr();try{if(l){var T=function(){throw Error()};if(Object.defineProperty(T.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(T,[])}catch(we){E=we}Reflect.construct(a,[],T)}else{try{T.call()}catch(we){E=we}a.call(T.prototype)}}else{try{throw Error()}catch(we){E=we}a()}}catch(we){if(we&&E&&typeof we.stack=="string"){for(var k=we.stack.split(`
|
|
19
33
|
`),me=E.stack.split(`
|
|
20
|
-
`),
|
|
21
|
-
`+k[
|
|
34
|
+
`),J=k.length-1,ee=me.length-1;J>=1&&ee>=0&&k[J]!==me[ee];)ee--;for(;J>=1&&ee>=0;J--,ee--)if(k[J]!==me[ee]){if(J!==1||ee!==1)do if(J--,ee--,ee<0||k[J]!==me[ee]){var Ue=`
|
|
35
|
+
`+k[J].replace(" at new "," at ");return a.displayName&&Ue.includes("<anonymous>")&&(Ue=Ue.replace("<anonymous>",a.displayName)),typeof a=="function"&&Rn.set(a,Ue),Ue}while(J>=1&&ee>=0);break}}}finally{ci=!1,Et.current=x,ai(),Error.prepareStackTrace=R}var _r=a?a.displayName||a.name:"",Ut=_r?Pn(_r):"";return typeof a=="function"&&Rn.set(a,Ut),Ut}function Pc(a,l,p){return w2(a,!1)}function Rc(a){var l=a.prototype;return!!(l&&l.isReactComponent)}function Fn(a,l,p){if(a==null)return"";if(typeof a=="function")return w2(a,Rc(a));if(typeof a=="string")return Pn(a);switch(a){case f:return Pn("Suspense");case h:return Pn("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case u:return Pc(a.render);case d:return Fn(a.type,l,p);case b:{var E=a,R=E._payload,x=E._init;try{return Fn(x(R),l,p)}catch{}}}return""}var Wr=Object.prototype.hasOwnProperty,E2={},A2=he.ReactDebugCurrentFrame;function xn(a){if(a){var l=a._owner,p=Fn(a.type,a._source,l?l.type:null);A2.setExtraStackFrame(p)}else A2.setExtraStackFrame(null)}function Fc(a,l,p,E,R){{var x=Function.call.bind(Wr);for(var T in a)if(x(a,T)){var k=void 0;try{if(typeof a[T]!="function"){var me=Error((E||"React class")+": "+p+" type `"+T+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[T]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw me.name="Invariant Violation",me}k=a[T](l,T,E,p,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){k=J}k&&!(k instanceof Error)&&(xn(R),K("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",p,T,typeof k),xn(null)),k instanceof Error&&!(k.message in E2)&&(E2[k.message]=!0,xn(R),K("Failed %s type: %s",p,k.message),xn(null))}}}var xc=Array.isArray;function ui(a){return xc(a)}function Mc(a){{var l=typeof Symbol=="function"&&Symbol.toStringTag,p=l&&a[Symbol.toStringTag]||a.constructor.name||"Object";return p}}function Ic(a){try{return k2(a),!1}catch{return!0}}function k2(a){return""+a}function S2(a){if(Ic(a))return K("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Mc(a)),k2(a)}var T2=he.ReactCurrentOwner,Cc={key:!0,ref:!0,__self:!0,__source:!0},L2,O2;function Nc(a){if(Wr.call(a,"ref")){var l=Object.getOwnPropertyDescriptor(a,"ref").get;if(l&&l.isReactWarning)return!1}return a.ref!==void 0}function Dc(a){if(Wr.call(a,"key")){var l=Object.getOwnPropertyDescriptor(a,"key").get;if(l&&l.isReactWarning)return!1}return a.key!==void 0}function jc(a,l){typeof a.ref=="string"&&T2.current}function Bc(a,l){{var p=function(){L2||(L2=!0,K("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};p.isReactWarning=!0,Object.defineProperty(a,"key",{get:p,configurable:!0})}}function Uc(a,l){{var p=function(){O2||(O2=!0,K("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",l))};p.isReactWarning=!0,Object.defineProperty(a,"ref",{get:p,configurable:!0})}}var Vc=function(a,l,p,E,R,x,T){var k={$$typeof:t,type:a,key:l,ref:p,props:T,_owner:x};return k._store={},Object.defineProperty(k._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(k,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(k,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(k.props),Object.freeze(k)),k};function Gc(a,l,p,E,R){{var x,T={},k=null,me=null;p!==void 0&&(S2(p),k=""+p),Dc(l)&&(S2(l.key),k=""+l.key),Nc(l)&&(me=l.ref,jc(l,R));for(x in l)Wr.call(l,x)&&!Cc.hasOwnProperty(x)&&(T[x]=l[x]);if(a&&a.defaultProps){var J=a.defaultProps;for(x in J)T[x]===void 0&&(T[x]=J[x])}if(k||me){var ee=typeof a=="function"?a.displayName||a.name||"Unknown":a;k&&Bc(T,ee),me&&Uc(T,ee)}return Vc(a,k,me,R,E,T2.current,T)}}var hi=he.ReactCurrentOwner,P2=he.ReactDebugCurrentFrame;function yr(a){if(a){var l=a._owner,p=Fn(a.type,a._source,l?l.type:null);P2.setExtraStackFrame(p)}else P2.setExtraStackFrame(null)}var li;li=!1;function fi(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function R2(){{if(hi.current){var a=ze(hi.current.type);if(a)return`
|
|
22
36
|
|
|
23
|
-
Check the render method of \``+a+"`."}return""}}function
|
|
37
|
+
Check the render method of \``+a+"`."}return""}}function Wc(a){return""}var F2={};function Hc(a){{var l=R2();if(!l){var p=typeof a=="string"?a:a.displayName||a.name;p&&(l=`
|
|
24
38
|
|
|
25
|
-
Check the top-level render call using <`+p+">.")}return
|
|
39
|
+
Check the top-level render call using <`+p+">.")}return l}}function x2(a,l){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var p=Hc(l);if(F2[p])return;F2[p]=!0;var E="";a&&a._owner&&a._owner!==hi.current&&(E=" It was passed a child from "+ze(a._owner.type)+"."),yr(a),K('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',p,E),yr(null)}}function M2(a,l){{if(typeof a!="object")return;if(ui(a))for(var p=0;p<a.length;p++){var E=a[p];fi(E)&&x2(E,l)}else if(fi(a))a._store&&(a._store.validated=!0);else if(a){var R=Ke(a);if(typeof R=="function"&&R!==a.entries)for(var x=R.call(a),T;!(T=x.next()).done;)fi(T.value)&&x2(T.value,l)}}}function Kc(a){{var l=a.type;if(l==null||typeof l=="string")return;var p;if(typeof l=="function")p=l.propTypes;else if(typeof l=="object"&&(l.$$typeof===u||l.$$typeof===d))p=l.propTypes;else return;if(p){var E=ze(l);Fc(p,a.props,"prop",E,a)}else if(l.PropTypes!==void 0&&!li){li=!0;var R=ze(l);K("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof l.getDefaultProps=="function"&&!l.getDefaultProps.isReactClassApproved&&K("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zc(a){{for(var l=Object.keys(a.props),p=0;p<l.length;p++){var E=l[p];if(E!=="children"&&E!=="key"){yr(a),K("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),yr(null);break}}a.ref!==null&&(yr(a),K("Invalid attribute `ref` supplied to `React.Fragment`."),yr(null))}}var I2={};function C2(a,l,p,E,R,x){{var T=ii(a);if(!T){var k="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var me=Wc();me?k+=me:k+=R2();var J;a===null?J="null":ui(a)?J="array":a!==void 0&&a.$$typeof===t?(J="<"+(ze(a.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):J=typeof a,K("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,k)}var ee=Gc(a,l,p,R,x);if(ee==null)return ee;if(T){var Ue=l.children;if(Ue!==void 0)if(E)if(ui(Ue)){for(var _r=0;_r<Ue.length;_r++)M2(Ue[_r],a);Object.freeze&&Object.freeze(Ue)}else K("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else M2(Ue,a)}if(Wr.call(l,"key")){var Ut=ze(a),we=Object.keys(l).filter(function(Zc){return Zc!=="key"}),di=we.length>0?"{key: someKey, "+we.join(": ..., ")+": ...}":"{key: someKey}";if(!I2[Ut+di]){var $c=we.length>0?"{"+we.join(": ..., ")+": ...}":"{}";K(`A props object containing a "key" prop is being spread into JSX:
|
|
26
40
|
let props = %s;
|
|
27
41
|
<%s {...props} />
|
|
28
42
|
React keys must be passed directly to JSX without using spread:
|
|
29
43
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,pi,Ut,nu,Ut),j2[Ut+pi]=!0}}return a===n?Zc(ne):$c(ne),ne}}function Qc(a,h,p){return N2(a,h,p,!0)}function eu(a,h,p){return N2(a,h,p,!1)}var tu=eu,ru=Qc;_r.Fragment=n,_r.jsx=tu,_r.jsxs=ru}()),_r}process.env.NODE_ENV==="production"?In.exports=B2():In.exports=U2();var F=In.exports,Vt=typeof self<"u"?self:{};function br(e,t){e:{for(var r=["CLOSURE_FLAGS"],n=Vt,s=0;s<r.length;s++)if((n=n[r[s]])==null){r=null;break e}r=n}return(e=r&&r[e])!=null?e:t}function kt(){throw Error("Invalid UTF8")}function yi(e,t){return t=String.fromCharCode.apply(null,t),e==null?t:e+t}let Hr,jn;const V2=typeof TextDecoder<"u";let G2;const W2=typeof TextEncoder<"u";function vi(e){if(W2)e=(G2||(G2=new TextEncoder)).encode(e);else{let r=0;const n=new Uint8Array(3*e.length);for(let s=0;s<e.length;s++){var t=e.charCodeAt(s);if(t<128)n[r++]=t;else{if(t<2048)n[r++]=t>>6|192;else{if(t>=55296&&t<=57343){if(t<=56319&&s<e.length){const i=e.charCodeAt(++s);if(i>=56320&&i<=57343){t=1024*(t-55296)+i-56320+65536,n[r++]=t>>18|240,n[r++]=t>>12&63|128,n[r++]=t>>6&63|128,n[r++]=63&t|128;continue}s--}t=65533}n[r++]=t>>12|224,n[r++]=t>>6&63|128}n[r++]=63&t|128}}e=r===n.length?n:n.subarray(0,r)}return e}function _i(e){Vt.setTimeout(()=>{throw e},0)}var Nn,H2=br(610401301,!1),bi=br(748402147,!0),Dn=br(824648567,!0),Bn=br(824656860,br(1,!0));function wi(){var e=Vt.navigator;return e&&(e=e.userAgent)?e:""}const Ei=Vt.navigator;function zr(e){return zr[" "](e),e}Nn=Ei&&Ei.userAgentData||null,zr[" "]=function(){};const Ai={};let wr=null;function z2(e){const t=e.length;let r=3*t/4;r%3?r=Math.floor(r):"=.".indexOf(e[t-1])!=-1&&(r="=.".indexOf(e[t-2])!=-1?r-2:r-1);const n=new Uint8Array(r);let s=0;return function(i,o){function c(d){for(;u<i.length;){const l=i.charAt(u++),f=wr[l];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l)}return d}ki();let u=0;for(;;){const d=c(-1),l=c(0),f=c(64),m=c(64);if(m===64&&d===-1)break;o(d<<2|l>>4),f!=64&&(o(l<<4&240|f>>2),m!=64&&o(f<<6&192|m))}}(e,function(i){n[s++]=i}),s!==r?n.subarray(0,s):n}function ki(){if(!wr){wr={};var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"];for(let r=0;r<5;r++){const n=e.concat(t[r].split(""));Ai[r]=n;for(let s=0;s<n.length;s++){const i=n[s];wr[i]===void 0&&(wr[i]=s)}}}}var K2=typeof Uint8Array<"u",Si=!(!(H2&&Nn&&Nn.brands.length>0)&&(wi().indexOf("Trident")!=-1||wi().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Ti=/[-_.]/g,Y2={"-":"+",_:"/",".":"="};function X2(e){return Y2[e]||""}function xi(e){if(!Si)return z2(e);e=Ti.test(e)?e.replace(Ti,X2):e,e=atob(e);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}function Un(e){return K2&&e!=null&&e instanceof Uint8Array}var Gt={};function St(){return q2||(q2=new ze(null,Gt))}function Vn(e){Li(Gt);var t=e.g;return(t=t==null||Un(t)?t:typeof t=="string"?xi(t):null)==null?t:e.g=t}var ze=class{h(){return new Uint8Array(Vn(this)||0)}constructor(e,t){if(Li(t),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let q2,J2;function Li(e){if(e!==Gt)throw Error("illegal external caller")}function Pi(e,t){e.__closure__error__context__984382||(e.__closure__error__context__984382={}),e.__closure__error__context__984382.severity=t}function Gn(e){return Pi(e=Error(e),"warning"),e}function Wt(e,t){if(e!=null){var r=J2??(J2={}),n=r[e]||0;n>=t||(r[e]=n+1,Pi(e=Error(),"incident"),_i(e))}}function Ht(){return typeof BigInt=="function"}var zt=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Ke(e,t,r=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?r&&Symbol.for&&e?Symbol.for(e):e!=null?Symbol(e):Symbol():t}var $2=Ke("jas",void 0,!0),Oi=Ke(void 0,"0di"),Er=Ke(void 0,"1oa"),we=Ke(void 0,Symbol()),Z2=Ke(void 0,"0ub"),Q2=Ke(void 0,"0ubs"),Wn=Ke(void 0,"0ubsb"),e1=Ke(void 0,"0actk"),Kt=Ke("m_m","Pa",!0),Ri=Ke();const Fi={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Mi=Object.defineProperties,y=zt?$2:"Ga";var Tt;const Ci=[];function Ar(e,t){zt||y in e||Mi(e,Fi),e[y]|=t}function se(e,t){zt||y in e||Mi(e,Fi),e[y]=t}function kr(e){return Ar(e,34),e}function Sr(e){return Ar(e,8192),e}se(Ci,7),Tt=Object.freeze(Ci);var Yt={};function Ee(e,t){return t===void 0?e.h!==xt&&!!(2&(0|e.v[y])):!!(2&t)&&e.h!==xt}const xt={};function Hn(e,t){if(e!=null){if(typeof e=="string")e=e?new ze(e,Gt):St();else if(e.constructor!==ze)if(Un(e))e=e.length?new ze(new Uint8Array(e),Gt):St();else{if(!t)throw Error();e=void 0}}return e}class Ii{constructor(t,r,n){this.g=t,this.h=r,this.l=n}next(){const t=this.g.next();return t.done||(t.value=this.h.call(this.l,t.value)),t}[Symbol.iterator](){return this}}var t1=Object.freeze({});function ji(e,t,r){const n=128&t?0:-1,s=e.length;var i;(i=!!s)&&(i=(i=e[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(t=128&t?1:0;t<o;t++)r(t-n,e[t]);if(i){e=e[s-1];for(const c in e)!isNaN(c)&&r(+c,e[c])}}var Ni={};function Xt(e){return 128&e?Ni:void 0}function Kr(e){return e.Na=!0,e}var r1=Kr(e=>typeof e=="number"),Di=Kr(e=>typeof e=="string"),n1=Kr(e=>typeof e=="boolean"),Yr=typeof Vt.BigInt=="function"&&typeof Vt.BigInt(0)=="bigint";function Ae(e){var t=e;if(Di(t)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(t))throw Error(String(t))}else if(r1(t)&&!Number.isSafeInteger(t))throw Error(String(t));return Yr?BigInt(e):e=n1(e)?e?"1":"0":Di(e)?e.trim()||"0":String(e)}var zn=Kr(e=>Yr?e>=i1&&e<=a1:e[0]==="-"?Bi(e,s1):Bi(e,o1));const s1=Number.MIN_SAFE_INTEGER.toString(),i1=Yr?BigInt(Number.MIN_SAFE_INTEGER):void 0,o1=Number.MAX_SAFE_INTEGER.toString(),a1=Yr?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Bi(e,t){if(e.length>t.length)return!1;if(e.length<t.length||e===t)return!0;for(let r=0;r<e.length;r++){const n=e[r],s=t[r];if(n>s)return!1;if(n<s)return!0}}const c1=typeof Uint8Array.prototype.slice=="function";let u1,V=0,ee=0;function Ui(e){const t=e>>>0;V=t,ee=(e-t)/4294967296>>>0}function qt(e){if(e<0){Ui(-e);const[t,r]=Jn(V,ee);V=t>>>0,ee=r>>>0}else Ui(e)}function Kn(e){const t=u1||(u1=new DataView(new ArrayBuffer(8)));t.setFloat32(0,+e,!0),ee=0,V=t.getUint32(0,!0)}function Yn(e,t){const r=4294967296*t+(e>>>0);return Number.isSafeInteger(r)?r:Tr(e,t)}function l1(e,t){return Ae(Ht()?BigInt.asUintN(64,(BigInt(t>>>0)<<BigInt(32))+BigInt(e>>>0)):Tr(e,t))}function Xn(e,t){const r=2147483648&t;return r&&(t=~t>>>0,(e=1+~e>>>0)==0&&(t=t+1>>>0)),typeof(e=Yn(e,t))=="number"?r?-e:e:r?"-"+e:e}function Vi(e,t){return Ht()?Ae(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(t))<<BigInt(32))+BigInt.asUintN(32,BigInt(e)))):Ae(qn(e,t))}function Tr(e,t){if(e>>>=0,(t>>>=0)<=2097151)var r=""+(4294967296*t+e);else Ht()?r=""+(BigInt(t)<<BigInt(32)|BigInt(e)):(e=(16777215&e)+6777216*(r=16777215&(e>>>24|t<<8))+6710656*(t=t>>16&65535),r+=8147497*t,t*=2,e>=1e7&&(r+=e/1e7>>>0,e%=1e7),r>=1e7&&(t+=r/1e7>>>0,r%=1e7),r=t+Gi(r)+Gi(e));return r}function Gi(e){return e=String(e),"0000000".slice(e.length)+e}function qn(e,t){if(2147483648&t)if(Ht())e=""+(BigInt(0|t)<<BigInt(32)|BigInt(e>>>0));else{const[r,n]=Jn(e,t);e="-"+Tr(r,n)}else e=Tr(e,t);return e}function Xr(e){if(e.length<16)qt(Number(e));else if(Ht())e=BigInt(e),V=Number(e&BigInt(4294967295))>>>0,ee=Number(e>>BigInt(32)&BigInt(4294967295));else{const t=+(e[0]==="-");ee=V=0;const r=e.length;for(let n=t,s=(r-t)%6+t;s<=r;n=s,s+=6){const i=Number(e.slice(n,s));ee*=1e6,V=1e6*V+i,V>=4294967296&&(ee+=Math.trunc(V/4294967296),ee>>>=0,V>>>=0)}if(t){const[n,s]=Jn(V,ee);V=n,ee=s}}}function Jn(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function Be(e){return Array.prototype.slice.call(e)}const xr=typeof BigInt=="function"?BigInt.asIntN:void 0,h1=typeof BigInt=="function"?BigInt.asUintN:void 0,Lt=Number.isSafeInteger,qr=Number.isFinite,Jt=Math.trunc,f1=Ae(0);function Lr(e){if(e!=null&&typeof e!="number")throw Error(`Value of float/double field must be a number, found ${typeof e}: ${e}`);return e}function Ye(e){return e==null||typeof e=="number"?e:e==="NaN"||e==="Infinity"||e==="-Infinity"?Number(e):void 0}function Pr(e){if(e!=null&&typeof e!="boolean"){var t=typeof e;throw Error(`Expected boolean but got ${t!="object"?t:e?Array.isArray(e)?"array":t:"null"}: ${e}`)}return e}function Wi(e){return e==null||typeof e=="boolean"?e:typeof e=="number"?!!e:void 0}const d1=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Or(e){switch(typeof e){case"bigint":return!0;case"number":return qr(e);case"string":return d1.test(e);default:return!1}}function $t(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?0|e:void 0}function Hi(e){if(e==null)return e;if(typeof e=="string"&&e)e=+e;else if(typeof e!="number")return;return qr(e)?e>>>0:void 0}function zi(e){const t=e.length;return(e[0]==="-"?t<20||t===20&&e<="-9223372036854775808":t<19||t===19&&e<="9223372036854775807")?e:(Xr(e),qn(V,ee))}function $n(e){return e=Jt(e),Lt(e)||(qt(e),e=Xn(V,ee)),e}function Ki(e){var t=Jt(Number(e));return Lt(t)?String(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),zi(e))}function Yi(e){var t=Jt(Number(e));return Lt(t)?Ae(t):((t=e.indexOf("."))!==-1&&(e=e.substring(0,t)),Ht()?Ae(xr(64,BigInt(e))):Ae(zi(e)))}function Xi(e){return Lt(e)?e=Ae($n(e)):(e=Jt(e),Lt(e)?e=String(e):(qt(e),e=qn(V,ee)),e=Ae(e)),e}function p1(e){return e==null?e:typeof e=="bigint"?(zn(e)?e=Number(e):(e=xr(64,e),e=zn(e)?Number(e):String(e)),e):Or(e)?typeof e=="number"?$n(e):Ki(e):void 0}function Jr(e){const t=typeof e;return e==null?e:t==="bigint"?Ae(xr(64,e)):Or(e)?t==="string"?Yi(e):Xi(e):void 0}function qi(e){if(typeof e!="string")throw Error();return e}function Rr(e){if(e!=null&&typeof e!="string")throw Error();return e}function he(e){return e==null||typeof e=="string"?e:void 0}function Zn(e,t,r,n){return e!=null&&e[Kt]===Yt?e:Array.isArray(e)?((n=(r=0|e[y])|32&n|2&n)!==r&&se(e,n),new t(e)):(r?2&n?((e=t[Oi])||(kr((e=new t).v),e=t[Oi]=e),t=e):t=new t:t=void 0,t)}function g1(e,t,r){if(t)e:{if(!Or(t=e))throw Gn("int64");switch(typeof t){case"string":t=Yi(t);break e;case"bigint":t=Ae(xr(64,t));break e;default:t=Xi(t)}}else t=Jr(e);return(e=t)==null?r?f1:void 0:e}const m1={};let y1=function(){try{return zr(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class Qn{constructor(){this.g=new Map}get(t){return this.g.get(t)}set(t,r){return this.g.set(t,r),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,r){return this.g.forEach(t,r)}[Symbol.iterator](){return this.entries()}}const v1=y1?(Object.setPrototypeOf(Qn.prototype,Map.prototype),Object.defineProperties(Qn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Qn):class extends Map{constructor(){super()}};function Ji(e){return e}function es(e){if(2&e.J)throw Error("Cannot mutate an immutable Map")}var it=class extends v1{constructor(e,t,r=Ji,n=Ji){super(),this.J=0|e[y],this.K=t,this.S=r,this.fa=this.K?_1:n;for(let s=0;s<e.length;s++){const i=e[s],o=r(i[0],!1,!0);let c=i[1];t?c===void 0&&(c=null):c=n(i[1],!1,!0,void 0,void 0,this.J),super.set(o,c)}}V(e){return Sr(Array.from(super.entries(),e))}clear(){es(this),super.clear()}delete(e){return es(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new Ii(e,b1,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new Ii(e,it.prototype.get,this)}else e=super.values();return e}forEach(e,t){this.K?super.forEach((r,n,s)=>{e.call(t,s.get(n),n,s)}):super.forEach(e,t)}set(e,t){return es(this),(e=this.S(e,!0,!1))==null?this:t==null?(super.delete(e),this):super.set(e,this.fa(t,!0,!0,this.K,!1,this.J))}Ma(e){const t=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(t,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const t=super.get(e);if(t!==void 0){var r=this.K;return r?((r=this.fa(t,!1,!0,r,this.ra,this.J))!==t&&super.set(e,r),r):t}}[Symbol.iterator](){return this.entries()}};function _1(e,t,r,n,s,i){return e=Zn(e,n,r,i),s&&(e=ns(e)),e}function b1(e){return[e,this.get(e)]}let w1;function $i(){return w1||(w1=new it(kr([]),void 0,void 0,void 0,m1))}function $r(e){return we?e[we]:void 0}function Zr(e,t){for(const r in e)!isNaN(r)&&t(e,+r,e[r])}it.prototype.toJSON=void 0;var ts=class{};const E1={Ka:!0};function A1(e,t){t<100||Wt(Q2,1)}function Qr(e,t,r,n){const s=n!==void 0;n=!!n;var i,o=we;!s&&zt&&o&&(i=e[o])&&Zr(i,A1),o=[];var c=e.length;let u;i=4294967295;let d=!1;const l=!!(64&t),f=l?128&t?0:-1:void 0;1&t||(u=c&&e[c-1],u!=null&&typeof u=="object"&&u.constructor===Object?i=--c:u=void 0,!l||128&t||s||(d=!0,i=i-f+f)),t=void 0;for(var m=0;m<c;m++){let A=e[m];if(A!=null&&(A=r(A,n))!=null)if(l&&m>=i){const j=m-f;(t??(t={}))[j]=A}else o[m]=A}if(u)for(let A in u){if((c=u[A])==null||(c=r(c,n))==null)continue;let j;m=+A,l&&!Number.isNaN(m)&&(j=m+f)<i?o[j]=c:(t??(t={}))[A]=c}return t&&(d?o.push(t):o[i]=t),s&&we&&(e=$r(e))&&e instanceof ts&&(o[we]=function(A){const j=new ts;return Zr(A,(ht,et,fe)=>{j[et]=Be(fe)}),j.da=A.da,j}(e)),o}function k1(e){return e[0]=Fr(e[0]),e[1]=Fr(e[1]),e}function Fr(e){switch(typeof e){case"number":return Number.isFinite(e)?e:""+e;case"bigint":return zn(e)?Number(e):""+e;case"boolean":return e?1:0;case"object":if(Array.isArray(e)){var t=0|e[y];return e.length===0&&1&t?void 0:Qr(e,t,Fr)}if(e!=null&&e[Kt]===Yt)return Zi(e);if(e instanceof ze){if((t=e.g)==null)e="";else if(typeof t=="string")e=t;else{if(Si){for(var r="",n=0,s=t.length-10240;n<s;)r+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));r+=String.fromCharCode.apply(null,n?t.subarray(n):t),t=btoa(r)}else{r===void 0&&(r=0),ki(),r=Ai[r],n=Array(Math.floor(t.length/3)),s=r[64]||"";let d=0,l=0;for(;d<t.length-2;d+=3){var i=t[d],o=t[d+1],c=t[d+2],u=r[i>>2];i=r[(3&i)<<4|o>>4],o=r[(15&o)<<2|c>>6],c=r[63&c],n[l++]=u+i+o+c}switch(u=0,c=s,t.length-d){case 2:c=r[(15&(u=t[d+1]))<<2]||s;case 1:t=t[d],n[l]=r[t>>2]+r[(3&t)<<4|u>>4]+c+s}t=n.join("")}e=e.g=t}return e}return e instanceof it?e=e.size!==0?e.V(k1):void 0:void 0}return e}function Zi(e){return Qr(e=e.v,0|e[y],Fr)}let S1,T1;function Pt(e,t){return Qi(e,t[0],t[1])}function Qi(e,t,r,n=0){if(e==null){var s=32;r?(e=[r],s|=128):e=[],t&&(s=-16760833&s|(1023&t)<<14)}else{if(!Array.isArray(e))throw Error("narr");if(s=0|e[y],bi&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&function(){if(bi)throw Error("carr");Wt(e1,5)}(),256&s)throw Error("farr");if(64&s)return(s|n)!==s&&se(e,s|n),e;if(r&&(s|=128,r!==e[0]))throw Error("mid");e:{s|=64;var i=(r=e).length;if(i){var o=i-1;const u=r[o];if(u!=null&&typeof u=="object"&&u.constructor===Object){if((o-=t=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var c in u)(i=+c)<o&&(r[i+t]=u[c],delete u[c]);s=-16760833&s|(1023&o)<<14;break e}}if(t){if((c=Math.max(t,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&c)<<14}}}return se(e,64|s|n),e}function x1(e,t){if(typeof e!="object")return e;if(Array.isArray(e)){var r=0|e[y];return e.length===0&&1&r?void 0:eo(e,r,t)}if(e!=null&&e[Kt]===Yt)return to(e);if(e instanceof it){if(2&(t=e.J))return e;if(!e.size)return;if(r=kr(e.V()),e.K)for(e=0;e<r.length;e++){const n=r[e];let s=n[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[Kt]===Yt?to(s):Array.isArray(s)?eo(s,0|s[y],!!(32&t)):void 0,n[1]=s}return r}return e instanceof ze?e:void 0}function eo(e,t,r){return 2&t||(!r||4096&t||16&t?e=Zt(e,t,!1,r&&!(16&t)):(Ar(e,34),4&t&&Object.freeze(e))),e}function rs(e,t,r){return e=new e.constructor(t),r&&(e.h=xt),e.m=xt,e}function to(e){const t=e.v,r=0|t[y];return Ee(e,r)?e:ss(e,t,r)?rs(e,t):Zt(t,r)}function Zt(e,t,r,n){return n??(n=!!(34&t)),e=Qr(e,t,x1,n),n=32,r&&(n|=2),se(e,t=16769217&t|n),e}function ns(e){const t=e.v,r=0|t[y];return Ee(e,r)?ss(e,t,r)?rs(e,t,!0):new e.constructor(Zt(t,r,!1)):e}function Qt(e){if(e.h!==xt)return!1;var t=e.v;return Ar(t=Zt(t,0|t[y]),2048),e.v=t,e.h=void 0,e.m=void 0,!0}function er(e){if(!Qt(e)&&Ee(e,0|e.v[y]))throw Error()}function Ot(e,t){t===void 0&&(t=0|e[y]),32&t&&!(4096&t)&&se(e,4096|t)}function ss(e,t,r){return!!(2&r)||!(!(32&r)||4096&r)&&(se(t,2|r),e.h=xt,!0)}const L1=Ae(0),dt={};function N(e,t,r,n,s){if((t=ot(e.v,t,r,s))!==null||n&&e.m!==xt)return t}function ot(e,t,r,n){if(t===-1)return null;const s=t+(r?0:-1),i=e.length-1;let o,c;if(!(i<1+(r?0:-1))){if(s>=i)if(o=e[i],o!=null&&typeof o=="object"&&o.constructor===Object)r=o[t],c=!0;else{if(s!==i)return;r=o}else r=e[s];if(n&&r!=null){if((n=n(r))==null)return n;if(!Object.is(n,r))return c?o[t]=n:e[s]=n,n}return r}}function R(e,t,r,n){er(e),ie(e=e.v,0|e[y],t,r,n)}function ie(e,t,r,n,s){const i=r+(s?0:-1);var o=e.length-1;if(o>=1+(s?0:-1)&&i>=o){const c=e[o];if(c!=null&&typeof c=="object"&&c.constructor===Object)return c[r]=n,t}return i<=o?(e[i]=n,t):(n!==void 0&&(r>=(o=(t??(t=0|e[y]))>>14&1023||536870912)?n!=null&&(e[o+(s?0:-1)]={[r]:n}):e[i]=n),t)}function Rt(){return t1===void 0?2:4}function Ft(e,t,r,n,s){let i=e.v,o=0|i[y];n=Ee(e,o)?1:n,s=!!s||n===3,n===2&&Qt(e)&&(i=e.v,o=0|i[y]);let c=(e=is(i,t))===Tt?7:0|e[y],u=os(c,o);var d=!(4&u);if(d){4&u&&(e=Be(e),c=0,u=Ct(u,o),o=ie(i,o,t,e));let l=0,f=0;for(;l<e.length;l++){const m=r(e[l]);m!=null&&(e[f++]=m)}f<l&&(e.length=f),r=-513&(4|u),u=r&=-1025,u&=-4097}return u!==c&&(se(e,u),2&u&&Object.freeze(e)),ro(e,u,i,o,t,n,d,s)}function ro(e,t,r,n,s,i,o,c){let u=t;return i===1||i===4&&(2&t||!(16&t)&&32&n)?Mt(t)||((t|=!e.length||o&&!(4096&t)||32&n&&!(4096&t||16&t)?2:256)!==u&&se(e,t),Object.freeze(e)):(i===2&&Mt(t)&&(e=Be(e),u=0,t=Ct(t,n),n=ie(r,n,s,e)),Mt(t)||(c||(t|=16),t!==u&&se(e,t))),2&t||!(4096&t||16&t)||Ot(r,n),e}function is(e,t,r){return e=ot(e,t,r),Array.isArray(e)?e:Tt}function os(e,t){return 2&t&&(e|=2),1|e}function Mt(e){return!!(2&e)&&!!(4&e)||!!(256&e)}function no(e){return Hn(e,!0)}function so(e){e=Be(e);for(let t=0;t<e.length;t++){const r=e[t]=Be(e[t]);Array.isArray(r[1])&&(r[1]=kr(r[1]))}return Sr(e)}function pt(e,t,r,n){er(e),ie(e=e.v,0|e[y],t,(n==="0"?Number(r)===0:r===n)?void 0:r)}function tr(e,t,r){if(2&t)throw Error();const n=Xt(t);let s=is(e,r,n),i=s===Tt?7:0|s[y],o=os(i,t);return(2&o||Mt(o)||16&o)&&(o===i||Mt(o)||se(s,o),s=Be(s),i=0,o=Ct(o,t),ie(e,t,r,s,n)),o&=-13,o!==i&&se(s,o),s}function as(e,t){var r=ha;return us(cs(e=e.v),e,void 0,r)===t?t:-1}function cs(e){if(zt)return e[Er]??(e[Er]=new Map);if(Er in e)return e[Er];const t=new Map;return Object.defineProperty(e,Er,{value:t}),t}function io(e,t,r,n,s){const i=cs(e),o=us(i,e,t,r,s);return o!==n&&(o&&(t=ie(e,t,o,void 0,s)),i.set(r,n)),t}function us(e,t,r,n,s){let i=e.get(n);if(i!=null)return i;i=0;for(let o=0;o<n.length;o++){const c=n[o];ot(t,c,s)!=null&&(i!==0&&(r=ie(t,r,i,void 0,s)),i=c)}return e.set(n,i),i}function ls(e,t,r){let n=0|e[y];const s=Xt(n),i=ot(e,r,s);let o;if(i!=null&&i[Kt]===Yt){if(!Ee(i))return Qt(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const c=0|o[y];2&c&&(o=Zt(o,c))}return o=Pt(o,t),o!==i&&ie(e,n,r,o,s),o}function oo(e,t,r,n,s){let i=!1;if((n=ot(e,n,s,o=>{const c=Zn(o,r,!1,t);return i=c!==o&&c!=null,c}))!=null)return i&&!Ee(n)&&Ot(e,t),n}function L(e,t,r,n){let s=e.v,i=0|s[y];if((t=oo(s,i,t,r,n))==null)return t;if(i=0|s[y],!Ee(e,i)){const o=ns(t);o!==t&&(Qt(e)&&(s=e.v,i=0|s[y]),i=ie(s,i,r,t=o,n),Ot(s,i))}return t}function ao(e,t,r,n,s,i,o,c){var u=Ee(e,r);i=u?1:i,o=!!o||i===3,u=c&&!u,(i===2||u)&&Qt(e)&&(r=0|(t=e.v)[y]);var d=(e=is(t,s))===Tt?7:0|e[y],l=os(d,r);if(c=!(4&l)){var f=e,m=r;const A=!!(2&l);A&&(m|=2);let j=!A,ht=!0,et=0,fe=0;for(;et<f.length;et++){const K=Zn(f[et],n,!1,m);if(K instanceof n){if(!A){const tt=Ee(K);j&&(j=!tt),ht&&(ht=tt)}f[fe++]=K}}fe<et&&(f.length=fe),l|=4,l=ht?-4097&l:4096|l,l=j?8|l:-9&l}if(l!==d&&(se(e,l),2&l&&Object.freeze(e)),u&&!(8&l||!e.length&&(i===1||i===4&&(2&l||!(16&l)&&32&r)))){for(Mt(l)&&(e=Be(e),l=Ct(l,r),r=ie(t,r,s,e)),n=e,u=l,d=0;d<n.length;d++)(f=n[d])!==(l=ns(f))&&(n[d]=l);u|=8,se(e,l=u=n.length?4096|u:-4097&u)}return ro(e,l,t,r,s,i,c,o)}function at(e,t,r){const n=e.v;return ao(e,n,0|n[y],t,r,Rt(),!1,!0)}function co(e){return e==null&&(e=void 0),e}function w(e,t,r,n,s){return R(e,r,n=co(n),s),n&&!Ee(n)&&Ot(e.v),e}function Mr(e,t,r,n){e:{var s=n=co(n);er(e);const i=e.v;let o=0|i[y];if(s==null){const c=cs(i);if(us(c,i,o,r)!==t)break e;c.set(r,0)}else o=io(i,o,r,t);ie(i,o,t,s)}n&&!Ee(n)&&Ot(e.v)}function Ct(e,t){return-273&(2&t?2|e:-3&e)}function hs(e,t,r,n){var s=n;er(e),e=ao(e,n=e.v,0|n[y],r,t,2,!0),s=s??new r,e.push(s),t=r=e===Tt?7:0|e[y],(s=Ee(s))?(r&=-9,e.length===1&&(r&=-4097)):r|=4096,r!==t&&se(e,r),s||Ot(n)}function Fe(e,t,r){return $t(N(e,t,void 0,r))}function uo(e){return(Bn?N(e,2,void 0,void 0,Jr):Jr(N(e,2)))??L1}function q(e,t){return N(e,t,void 0,void 0,Ye)??0}function ct(e,t,r){if(r!=null){if(typeof r!="number"||!qr(r))throw Gn("int32");r|=0}R(e,t,r)}function b(e,t,r){R(e,t,Lr(r))}function ke(e,t,r){pt(e,t,Rr(r),"")}function en(e,t,r){{er(e);const o=e.v;let c=0|o[y];if(r==null)ie(o,c,t);else{var n=e=r===Tt?7:0|r[y],s=Mt(e),i=s||Object.isFrozen(r);for(s||(e=0),i||(r=Be(r),n=0,e=Ct(e,c),i=!1),e|=5,e|=(4&e?512&e?512:1024&e?1024:0:void 0)??(Bn?1024:0),s=0;s<r.length;s++){const u=r[s],d=qi(u);Object.is(u,d)||(i&&(r=Be(r),n=0,e=Ct(e,c),i=!1),r[s]=d)}e!==n&&(i&&(r=Be(r),e=Ct(e,c)),se(r,e)),ie(o,c,t,r)}}}function tn(e,t,r){er(e),Ft(e,t,he,2,!0).push(qi(r))}var rr=class{constructor(e,t,r){if(this.buffer=e,r&&!t)throw Error();this.g=t}};function fs(e,t){if(typeof e=="string")return new rr(xi(e),t);if(Array.isArray(e))return new rr(new Uint8Array(e),t);if(e.constructor===Uint8Array)return new rr(e,!1);if(e.constructor===ArrayBuffer)return e=new Uint8Array(e),new rr(e,!1);if(e.constructor===ze)return t=Vn(e)||new Uint8Array(0),new rr(t,!0,e);if(e instanceof Uint8Array)return e=e.constructor===Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new rr(e,!1);throw Error()}function nr(e,t){let r,n=0,s=0,i=0;const o=e.h;let c=e.g;do r=o[c++],n|=(127&r)<<i,i+=7;while(i<32&&128&r);if(i>32)for(s|=(127&r)>>4,i=3;i<32&&128&r;i+=7)r=o[c++],s|=(127&r)<<i;if(It(e,c),!(128&r))return t(n>>>0,s>>>0);throw Error()}function ds(e){let t=0,r=e.g;const n=r+10,s=e.h;for(;r<n;){const i=s[r++];if(t|=i,(128&i)==0)return It(e,r),!!(127&t)}throw Error()}function gt(e){const t=e.h;let r=e.g,n=t[r++],s=127&n;if(128&n&&(n=t[r++],s|=(127&n)<<7,128&n&&(n=t[r++],s|=(127&n)<<14,128&n&&(n=t[r++],s|=(127&n)<<21,128&n&&(n=t[r++],s|=n<<28,128&n&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++]&&128&t[r++])))))throw Error();return It(e,r),s}function ut(e){return gt(e)>>>0}function rn(e){var t=e.h;const r=e.g;var n=t[r],s=t[r+1];const i=t[r+2];return t=t[r+3],It(e,e.g+4),e=2*((s=(n<<0|s<<8|i<<16|t<<24)>>>0)>>31)+1,n=s>>>23&255,s&=8388607,n==255?s?NaN:e*(1/0):n==0?1401298464324817e-60*e*s:e*Math.pow(2,n-150)*(s+8388608)}function P1(e){return gt(e)}function It(e,t){if(e.g=t,t>e.l)throw Error()}function lo(e,t){if(t<0)throw Error();const r=e.g;if((t=r+t)>e.l)throw Error();return e.g=t,r}function ho(e,t){if(t==0)return St();var r=lo(e,t);return e.Y&&e.j?r=e.h.subarray(r,r+t):(e=e.h,r=r===(t=r+t)?new Uint8Array(0):c1?e.slice(r,t):new Uint8Array(e.subarray(r,t))),r.length==0?St():new ze(r,Gt)}var fo=[];function po(e,t,r,n){if(on.length){const s=on.pop();return s.o(n),s.g.init(e,t,r,n),s}return new O1(e,t,r,n)}function go(e){e.g.clear(),e.l=-1,e.h=-1,on.length<100&&on.push(e)}function mo(e){var t=e.g;if(t.g==t.l)return!1;e.m=e.g.g;var r=ut(e.g);if(t=r>>>3,!((r&=7)>=0&&r<=5)||t<1)throw Error();return e.l=t,e.h=r,!0}function nn(e){switch(e.h){case 0:e.h!=0?nn(e):ds(e.g);break;case 1:It(e=e.g,e.g+8);break;case 2:if(e.h!=2)nn(e);else{var t=ut(e.g);It(e=e.g,e.g+t)}break;case 5:It(e=e.g,e.g+4);break;case 3:for(t=e.l;;){if(!mo(e))throw Error();if(e.h==4){if(e.l!=t)throw Error();break}nn(e)}break;default:throw Error()}}function Cr(e,t,r){const n=e.g.l;var s=ut(e.g);let i=(s=e.g.g+s)-n;if(i<=0&&(e.g.l=s,r(t,e,void 0,void 0,void 0),i=s-e.g.g),i)throw Error();return e.g.g=s,e.g.l=n,t}function ps(e){var t=ut(e.g),r=lo(e=e.g,t);if(e=e.h,V2){var n,s=e;(n=jn)||(n=jn=new TextDecoder("utf-8",{fatal:!0})),t=r+t,s=r===0&&t===s.length?s:s.subarray(r,t);try{var i=n.decode(s)}catch(c){if(Hr===void 0){try{n.decode(new Uint8Array([128]))}catch{}try{n.decode(new Uint8Array([97])),Hr=!0}catch{Hr=!1}}throw!Hr&&(jn=void 0),c}}else{t=(i=r)+t,r=[];let c,u=null;for(;i<t;){var o=e[i++];o<128?r.push(o):o<224?i>=t?kt():(c=e[i++],o<194||(192&c)!=128?(i--,kt()):r.push((31&o)<<6|63&c)):o<240?i>=t-1?kt():(c=e[i++],(192&c)!=128||o===224&&c<160||o===237&&c>=160||(192&(n=e[i++]))!=128?(i--,kt()):r.push((15&o)<<12|(63&c)<<6|63&n)):o<=244?i>=t-2?kt():(c=e[i++],(192&c)!=128||c-144+(o<<28)>>30||(192&(n=e[i++]))!=128||(192&(s=e[i++]))!=128?(i--,kt()):(o=(7&o)<<18|(63&c)<<12|(63&n)<<6|63&s,o-=65536,r.push(55296+(o>>10&1023),56320+(1023&o)))):kt(),r.length>=8192&&(u=yi(u,r),r.length=0)}i=yi(u,r)}return i}function yo(e){const t=ut(e.g);return ho(e.g,t)}function sn(e,t,r){var n=ut(e.g);for(n=e.g.g+n;e.g.g<n;)r.push(t(e.g))}var O1=class{constructor(e,t,r,n){if(fo.length){const s=fo.pop();s.init(e,t,r,n),e=s}else e=new class{constructor(s,i,o,c){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,c)}init(s,i,o,{Y:c=!1,ea:u=!1}={}){this.Y=c,this.ea=u,s&&(s=fs(s,this.ea),this.h=s.buffer,this.j=s.g,this.m=i||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(e,t,r,n);this.g=e,this.m=this.g.g,this.h=this.l=-1,this.o(n)}o({ha:e=!1}={}){this.ha=e}},on=[];function vo(e){return e?/^\d+$/.test(e)?(Xr(e),new gs(V,ee)):null:R1||(R1=new gs(0,0))}var gs=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let R1;function _o(e){return e?/^-?\d+$/.test(e)?(Xr(e),new ms(V,ee)):null:F1||(F1=new ms(0,0))}var ms=class{constructor(e,t){this.h=e>>>0,this.g=t>>>0}};let F1;function sr(e,t,r){for(;r>0||t>127;)e.g.push(127&t|128),t=(t>>>7|r<<25)>>>0,r>>>=7;e.g.push(t)}function ir(e,t){for(;t>127;)e.g.push(127&t|128),t>>>=7;e.g.push(t)}function an(e,t){if(t>=0)ir(e,t);else{for(let r=0;r<9;r++)e.g.push(127&t|128),t>>=7;e.g.push(1)}}function ys(e){var t=V;e.g.push(t>>>0&255),e.g.push(t>>>8&255),e.g.push(t>>>16&255),e.g.push(t>>>24&255)}function or(e,t){t.length!==0&&(e.l.push(t),e.h+=t.length)}function Me(e,t,r){ir(e.g,8*t+r)}function vs(e,t){return Me(e,t,2),t=e.g.end(),or(e,t),t.push(e.h),t}function _s(e,t){var r=t.pop();for(r=e.h+e.g.length()-r;r>127;)t.push(127&r|128),r>>>=7,e.h++;t.push(r),e.h++}function cn(e,t,r){Me(e,t,2),ir(e.g,r.length),or(e,e.g.end()),or(e,r)}function un(e,t,r,n){r!=null&&(t=vs(e,t),n(r,e),_s(e,t))}function Xe(){const e=class{constructor(){throw Error()}};return Object.setPrototypeOf(e,e.prototype),e}var bs=Xe(),bo=Xe(),ws=Xe(),Es=Xe(),wo=Xe(),Eo=Xe(),M1=Xe(),ln=Xe(),Ao=Xe(),ko=Xe();function qe(e,t,r){var n=e.v;we&&we in n&&(n=n[we])&&delete n[t.g],t.h?t.j(e,t.h,t.g,r,t.l):t.j(e,t.g,r,t.l)}var v=class{constructor(e,t){this.v=Qi(e,t,void 0,2048)}toJSON(){return Zi(this)}j(){var s;var e=gc,t=this.v,r=e.g,n=we;if(zt&&n&&((s=t[n])==null?void 0:s[r])!=null&&Wt(Z2,3),t=e.g,Ri&&we&&Ri===void 0&&(n=(r=this.v)[we])&&(n=n.da))try{n(r,t,E1)}catch(i){_i(i)}return e.h?e.m(this,e.h,e.g,e.l):e.m(this,e.g,e.defaultValue,e.l)}clone(){const e=this.v,t=0|e[y];return ss(this,e,t)?rs(this,e,!0):new this.constructor(Zt(e,t,!1))}};v.prototype[Kt]=Yt,v.prototype.toString=function(){return this.v.toString()};var ar=class{constructor(e,t,r){this.g=e,this.h=t,e=bs,this.l=!!e&&r===e||!1}};function hn(e,t){return new ar(e,t,bs)}function So(e,t,r,n,s){un(e,r,Ro(t,n),s)}const C1=hn(function(e,t,r,n,s){return e.h===2&&(Cr(e,ls(t,n,r),s),!0)},So),I1=hn(function(e,t,r,n,s){return e.h===2&&(Cr(e,ls(t,n,r),s),!0)},So);var fn=Symbol(),dn=Symbol(),As=Symbol(),To=Symbol(),xo=Symbol();let Lo,Po;function jt(e,t,r,n){var s=n[e];if(s)return s;(s={}).qa=n,s.T=function(f){switch(typeof f){case"boolean":return S1||(S1=[0,void 0,!0]);case"number":return f>0?void 0:f===0?T1||(T1=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}}(n[0]);var i=n[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=n[++o])=="function"&&(s.ma=!0,Lo??(Lo=i),Po??(Po=n[o+1]),i=n[o+=2]));const c={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var u=0;u<i.length;u++)c[i[u]]=i;i=n[++o]}for(u=1;i!==void 0;){let f;typeof i=="number"&&(u+=i,i=n[++o]);var d=void 0;if(i instanceof ar?f=i:(f=C1,o--),f==null?void 0:f.l){i=n[++o],d=n;var l=o;typeof i=="function"&&(i=i(),d[l]=i),d=i}for(l=u+1,typeof(i=n[++o])=="number"&&i<0&&(l-=i,i=n[++o]);u<l;u++){const m=c[u];d?r(s,u,f,d,m):t(s,u,f,m)}}return n[e]=s}function Oo(e){return Array.isArray(e)?e[0]instanceof ar?e:[I1,e]:[e,void 0]}function Ro(e,t){return e instanceof v?e.v:Array.isArray(e)?Pt(e,t):void 0}function ks(e,t,r,n){const s=r.g;e[t]=n?(i,o,c)=>s(i,o,c,n):s}function Ss(e,t,r,n,s){const i=r.g;let o,c;e[t]=(u,d,l)=>i(u,d,l,c||(c=jt(dn,ks,Ss,n).T),o||(o=Ts(n)),s)}function Ts(e){let t=e[As];if(t!=null)return t;const r=jt(dn,ks,Ss,e);return t=r.ma?(n,s)=>Lo(n,s,r):(n,s)=>{for(;mo(s)&&s.h!=4;){var i=s.l,o=r[i];if(o==null){var c=r.ba;c&&(c=c[i])&&(c=N1(c))!=null&&(o=r[i]=c)}if(o==null||!o(s,n,i)){if(o=(c=s).m,nn(c),c.ha)var u=void 0;else u=c.g.g-o,c.g.g=o,u=ho(c.g,u);o=void 0,c=n,u&&((o=c[we]??(c[we]=new ts))[i]??(o[i]=[])).push(u)}}return(n=$r(n))&&(n.da=r.qa[xo]),!0},e[As]=t,e[xo]=j1.bind(e),t}function j1(e,t,r,n){var s=this[dn];const i=this[As],o=Pt(void 0,s.T),c=$r(e);if(c){var u=!1,d=s.ba;if(d){if(s=(l,f,m)=>{if(m.length!==0)if(d[f])for(const A of m){l=po(A);try{u=!0,i(o,l)}finally{go(l)}}else n==null||n(e,f,m)},t==null)Zr(c,s);else if(c!=null){const l=c[t];l&&s(c,t,l)}if(u){let l=0|e[y];if(2&l&&2048&l&&!(r!=null&&r.Ka))throw Error();const f=Xt(l),m=(A,j)=>{if(ot(e,A,f)!=null){if((r==null?void 0:r.Qa)===1)return;throw Error()}j!=null&&(l=ie(e,l,A,j,f)),delete c[A]};t==null?ji(o,0|o[y],(A,j)=>{m(A,j)}):m(t,ot(o,t,f))}}}}function N1(e){const t=(e=Oo(e))[0].g;if(e=e[1]){const r=Ts(e),n=jt(dn,ks,Ss,e).T;return(s,i,o)=>t(s,i,o,n,r)}return t}function pn(e,t,r){e[t]=r.h}function gn(e,t,r,n){let s,i;const o=r.h;e[t]=(c,u,d)=>o(c,u,d,i||(i=jt(fn,pn,gn,n).T),s||(s=Fo(n)))}function Fo(e){let t=e[To];if(!t){const r=jt(fn,pn,gn,e);t=(n,s)=>Mo(n,s,r),e[To]=t}return t}function Mo(e,t,r){ji(e,0|e[y],(n,s)=>{if(s!=null){var i=function(o,c){var u=o[c];if(u)return u;if((u=o.ba)&&(u=u[c])){var d=(u=Oo(u))[0].h;if(u=u[1]){const l=Fo(u),f=jt(fn,pn,gn,u).T;u=o.ma?Po(f,l):(m,A,j)=>d(m,A,j,f,l)}else u=d;return o[c]=u}}(r,n);i?i(t,s,n):n<500||Wt(Wn,3)}}),(e=$r(e))&&Zr(e,(n,s,i)=>{for(or(t,t.g.end()),n=0;n<i.length;n++)or(t,Vn(i[n])||new Uint8Array(0))})}const D1=Ae(0);function cr(e,t){if(Array.isArray(t)){var r=0|t[y];if(4&r)return t;for(var n=0,s=0;n<t.length;n++){const i=e(t[n]);i!=null&&(t[s++]=i)}return s<n&&(t.length=s),(e=-1537&(5|r))!==r&&se(t,e),2&e&&Object.freeze(t),t}}function pe(e,t,r){return new ar(e,t,r)}function ur(e,t,r){return new ar(e,t,r)}function ae(e,t,r){ie(e,0|e[y],t,r,Xt(0|e[y]))}var B1=hn(function(e,t,r,n,s){if(e.h!==2)return!1;if(e=Be(e=Cr(e,Pt([void 0,void 0],n),s)),s=Xt(n=0|t[y]),2&n)throw Error();let i=ot(t,r,s);if(i instanceof it)2&i.J?(i=i.V(),i.push(e),ie(t,n,r,i,s)):i.Ma(e);else if(Array.isArray(i)){var o=0|i[y];8192&o||se(i,o|=8192),2&o&&(i=so(i),ie(t,n,r,i,s)),i.push(e)}else ie(t,n,r,Sr([e]),s);return!0},function(e,t,r,n,s){if(t instanceof it)t.forEach((i,o)=>{un(e,r,Pt([o,i],n),s)});else if(Array.isArray(t)){for(let i=0;i<t.length;i++){const o=t[i];Array.isArray(o)&&un(e,r,Pt(o,n),s)}Sr(t)}});function Co(e,t,r){(t=Ye(t))!=null&&(Me(e,r,5),e=e.g,Kn(t),ys(e))}function Io(e,t,r){if(t=function(n){if(n==null)return n;const s=typeof n;if(s==="bigint")return String(xr(64,n));if(Or(n)){if(s==="string")return Ki(n);if(s==="number")return $n(n)}}(t),t!=null&&(typeof t=="string"&&_o(t),t!=null))switch(Me(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,V,ee);break;case"bigint":r=BigInt.asUintN(64,t),r=new ms(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=_o(t),sr(e.g,r.h,r.g)}}function jo(e,t,r){(t=$t(t))!=null&&t!=null&&(Me(e,r,0),an(e.g,t))}function No(e,t,r){(t=Wi(t))!=null&&(Me(e,r,0),e.g.g.push(t?1:0))}function Do(e,t,r){(t=he(t))!=null&&cn(e,r,vi(t))}function Bo(e,t,r,n,s){un(e,r,Ro(t,n),s)}function Uo(e,t,r){(t=t==null||typeof t=="string"||t instanceof ze?t:void 0)!=null&&cn(e,r,fs(t,!0).buffer)}function Vo(e,t,r){return(e.h===5||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,rn,t):t.push(rn(e.g)),!0)}var te=pe(function(e,t,r){return e.h===5&&(ae(t,r,rn(e.g)),!0)},Co,ln),U1=ur(Vo,function(e,t,r){if((t=cr(Ye,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Me(n,s,5),n=n.g,Kn(i),ys(n))}},ln),xs=ur(Vo,function(e,t,r){if((t=cr(Ye,t))!=null&&t.length){Me(e,r,2),ir(e.g,4*t.length);for(let n=0;n<t.length;n++)r=e.g,Kn(t[n]),ys(r)}},ln),V1=pe(function(e,t,r){return e.h===5&&(ae(t,r,(e=rn(e.g))===0?void 0:e),!0)},Co,ln),mt=pe(function(e,t,r){return Dn?(e.h!==0?e=!1:(ae(t,r,nr(e.g,Vi)),e=!0),e):e.h===0&&(ae(t,r,nr(e.g,Xn)),!0)},Io,Eo),Ls=pe(function(e,t,r){return Dn?(e.h!==0?t=!1:(ae(t,r,(e=nr(e.g,Vi))===D1?void 0:e),t=!0),t):e.h===0&&(ae(t,r,(e=nr(e.g,Xn))===0?void 0:e),!0)},Io,Eo),G1=pe(function(e,t,r){return Dn?(e.h!==0?e=!1:(ae(t,r,nr(e.g,l1)),e=!0),e):e.h===0&&(ae(t,r,nr(e.g,Yn)),!0)},function(e,t,r){if(t=function(n){if(n==null)return n;var s=typeof n;if(s==="bigint")return String(h1(64,n));if(Or(n)){if(s==="string")return s=Jt(Number(n)),Lt(s)&&s>=0?n=String(s):((s=n.indexOf("."))!==-1&&(n=n.substring(0,s)),(s=n[0]!=="-"&&((s=n.length)<20||s===20&&n<="18446744073709551615"))||(Xr(n),n=Tr(V,ee))),n;if(s==="number")return(n=Jt(n))>=0&&Lt(n)||(qt(n),n=Yn(V,ee)),n}}(t),t!=null&&(typeof t=="string"&&vo(t),t!=null))switch(Me(e,r,0),typeof t){case"number":e=e.g,qt(t),sr(e,V,ee);break;case"bigint":r=BigInt.asUintN(64,t),r=new gs(Number(r&BigInt(4294967295)),Number(r>>BigInt(32))),sr(e.g,r.h,r.g);break;default:r=vo(t),sr(e.g,r.h,r.g)}},M1),ce=pe(function(e,t,r){return e.h===0&&(ae(t,r,gt(e.g)),!0)},jo,Es),Ir=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,gt,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=vs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);_s(e,r)}},Es),lr=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=gt(e.g))===0?void 0:e),!0)},jo,Es),J=pe(function(e,t,r){return e.h===0&&(ae(t,r,ds(e.g)),!0)},No,bo),Nt=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=ds(e.g))===!1?void 0:e),!0)},No,bo),de=ur(function(e,t,r){return e.h===2&&(e=ps(e),tr(t,0|t[y],r).push(e),!0)},function(e,t,r){if((t=cr(he,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&cn(n,s,vi(i))}},ws),yt=pe(function(e,t,r){return e.h===2&&(ae(t,r,(e=ps(e))===""?void 0:e),!0)},Do,ws),I=pe(function(e,t,r){return e.h===2&&(ae(t,r,ps(e)),!0)},Do,ws),ue=function(e,t,r=bs){return new ar(e,t,r)}(function(e,t,r,n,s){return e.h===2&&(n=Pt(void 0,n),tr(t,0|t[y],r).push(n),Cr(e,n,s),!0)},function(e,t,r,n,s){if(Array.isArray(t)){for(let i=0;i<t.length;i++)Bo(e,t[i],r,n,s);1&(e=0|t[y])||se(t,1|e)}}),$=hn(function(e,t,r,n,s,i){if(e.h!==2)return!1;let o=0|t[y];return io(t,o,i,r,Xt(o)),Cr(e,t=ls(t,n,r),s),!0},Bo),Go=pe(function(e,t,r){return e.h===2&&(ae(t,r,yo(e)),!0)},Uo,Ao),W1=ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,ut,t):t.push(ut(e.g)),!0)},function(e,t,r){if((t=cr(Hi,t))!=null)for(let o=0;o<t.length;o++){var n=e,s=r,i=t[o];i!=null&&(Me(n,s,0),ir(n.g,i))}},wo),H1=pe(function(e,t,r){return e.h===0&&(ae(t,r,(e=ut(e.g))===0?void 0:e),!0)},function(e,t,r){(t=Hi(t))!=null&&t!=null&&(Me(e,r,0),ir(e.g,t))},wo),Se=pe(function(e,t,r){return e.h===0&&(ae(t,r,gt(e.g)),!0)},function(e,t,r){(t=$t(t))!=null&&(t=parseInt(t,10),Me(e,r,0),an(e.g,t))},ko);class z1{constructor(t,r){var n=Te;this.g=t,this.h=r,this.m=L,this.j=w,this.defaultValue=void 0,this.l=n.Oa!=null?Ni:void 0}register(){zr(this)}}function Je(e,t){return new z1(e,t)}function vt(e,t){return(r,n)=>{{const i={ea:!0};n&&Object.assign(i,n),r=po(r,void 0,void 0,i);try{const o=new e,c=o.v;Ts(t)(c,r);var s=o}finally{go(r)}}return s}}function mn(e){return function(){const t=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};Mo(this.v,t,jt(fn,pn,gn,e)),or(t,t.g.end());const r=new Uint8Array(t.h),n=t.l,s=n.length;let i=0;for(let o=0;o<s;o++){const c=n[o];r.set(c,i),i+=c.length}return t.l=[r],r}}var Wo=class extends v{constructor(e){super(e)}},Ho=[0,yt,pe(function(e,t,r){return e.h===2&&(ae(t,r,(e=yo(e))===St()?void 0:e),!0)},function(e,t,r){if(t!=null){if(t instanceof v){const n=t.Ra;return void(n?(t=n(t),t!=null&&cn(e,r,fs(t,!0).buffer)):Wt(Wn,3))}if(Array.isArray(t))return void Wt(Wn,3)}Uo(e,t,r)},Ao)];let Ps,zo=globalThis.trustedTypes;function Ko(e){var t;return Ps===void 0&&(Ps=function(){let r=null;if(!zo)return r;try{const n=s=>s;r=zo.createPolicy("goog#html",{createHTML:n,createScript:n,createScriptURL:n})}catch{}return r}()),e=(t=Ps)?t.createScriptURL(e):e,new class{constructor(r){this.g=r}toString(){return this.g+""}}(e)}function K1(e,...t){if(t.length===0)return Ko(e[0]);let r=e[0];for(let n=0;n<t.length;n++)r+=encodeURIComponent(t[n])+e[n+1];return Ko(r)}var Yo=[0,ce,Se,J,-1,Ir,Se,-1,J],Y1=class extends v{constructor(e){super(e)}},Xo=[0,J,I,J,Se,-1,ur(function(e,t,r){return(e.h===0||e.h===2)&&(t=tr(t,0|t[y],r),e.h==2?sn(e,P1,t):t.push(gt(e.g)),!0)},function(e,t,r){if((t=cr($t,t))!=null&&t.length){r=vs(e,r);for(let n=0;n<t.length;n++)an(e.g,t[n]);_s(e,r)}},ko),I,-1,[0,J,-1],Se,J,-1],qo=[0,3,J,-1,2,[0,ce],[0,Se,J],[0,I,-1],[0]],Jo=[0,I,-2],$o=class extends v{constructor(e){super(e)}},Zo=[0],Qo=[0,ce,J,1,J,-4],Te=class extends v{constructor(e){super(e,2)}},oe={};oe[336783863]=[0,I,J,-1,ce,[0,[1,2,3,4,5,6,7,8,9],$,Zo,$,Xo,$,Jo,$,Qo,$,Yo,$,[0,I,-2],$,[0,I,Se],$,qo,$,[0,Se,-1,J]],[0,I],J,[0,[1,3],[2,4],$,[0,Ir],-1,$,[0,de],-1,ue,[0,I,-1]],I];var ea=[0,Ls,-1,Nt,-3,Ls,Ir,yt,lr,Ls,-1,Nt,lr,Nt,-2,yt];function D(e,t){tn(e,3,t)}function S(e,t){tn(e,4,t)}var ye=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,7,e)}},jr=[-1,{}],ta=[0,I,1,jr],ra=[0,I,de,jr];function Ce(e,t){hs(e,1,ye,t)}function G(e,t){tn(e,10,t)}function P(e,t){tn(e,15,t)}var xe=class extends v{constructor(e){super(e,500)}o(e){return w(this,0,1001,e)}},na=[-500,ue,[-500,yt,-1,de,-3,[-2,oe,J],ue,Ho,lr,-1,ta,ra,ue,[0,yt,Nt],yt,ea,lr,de,987,de],4,ue,[-500,I,-1,[-1,{}],998,I],ue,[-500,I,de,-1,[-2,{},J],997,de,-1],lr,ue,[-500,I,de,jr,998,de],de,lr,ta,ra,ue,[0,yt,-1,jr],de,-2,ea,yt,-1,Nt,[0,Nt,H1],978,jr,ue,Ho];xe.prototype.g=mn(na);var X1=vt(xe,na),q1=class extends v{constructor(e){super(e)}},sa=class extends v{constructor(e){super(e)}g(){return at(this,q1,1)}},ia=[0,ue,[0,ce,te,I,-1]],yn=vt(sa,ia),J1=class extends v{constructor(e){super(e)}},$1=class extends v{constructor(e){super(e)}},Os=class extends v{constructor(e){super(e)}l(){return L(this,J1,2)}g(){return at(this,$1,5)}},oa=vt(class extends v{constructor(e){super(e)}},[0,de,Ir,xs,[0,Se,[0,ce,-3],[0,te,-3],[0,ce,-1,[0,ue,[0,ce,-2]]],ue,[0,te,-1,I,te]],I,-1,mt,ue,[0,ce,te],de,mt]),aa=class extends v{constructor(e){super(e)}},hr=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,te,-4]]),ca=class extends v{constructor(e){super(e)}},Nr=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,te,-4]]),Z1=class extends v{constructor(e){super(e)}},Q1=[0,ce,-1,xs,Se],ua=class extends v{constructor(e){super(e)}};ua.prototype.g=mn([0,te,-4,mt]);var ec=class extends v{constructor(e){super(e)}},tc=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,1,ce,I,ia],mt]),la=class extends v{constructor(e){super(e)}},rc=class extends v{constructor(e){super(e)}na(){const e=N(this,1,void 0,void 0,no);return e??St()}},nc=class extends v{constructor(e){super(e)}},ha=[1,2],sc=vt(class extends v{constructor(e){super(e)}},[0,ue,[0,ha,$,[0,xs],$,[0,Go],ce,I],mt]),Rs=class extends v{constructor(e){super(e)}},fa=[0,I,ce,te,de,-1],da=class extends v{constructor(e){super(e)}},ic=[0,J,-1],pa=class extends v{constructor(e){super(e)}},vn=[1,2,3,4,5,6],_n=class extends v{constructor(e){super(e)}g(){return N(this,1,void 0,void 0,no)!=null}l(){return he(N(this,2))!=null}},z=class extends v{constructor(e){super(e)}g(){return Wi(N(this,2))??!1}},ga=[0,Go,I,[0,ce,mt,-1],[0,G1,mt]],re=[0,ga,J,[0,vn,$,Qo,$,Xo,$,Yo,$,Zo,$,Jo,$,qo],Se],bn=class extends v{constructor(e){super(e)}},Fs=[0,re,te,-1,ce],oc=Je(502141897,bn);oe[502141897]=Fs;var ac=vt(class extends v{constructor(e){super(e)}},[0,[0,Se,-1,U1,W1],Q1]),ma=class extends v{constructor(e){super(e)}},ya=class extends v{constructor(e){super(e)}},Ms=[0,re,te,[0,re],J],cc=Je(508968150,ya);oe[508968150]=[0,re,Fs,Ms,te,[0,[0,ga]]],oe[508968149]=Ms;var fr=class extends v{constructor(e){super(e)}l(){return L(this,Rs,2)}g(){R(this,2)}},va=[0,re,fa];oe[478825465]=va;var uc=class extends v{constructor(e){super(e)}},_a=class extends v{constructor(e){super(e)}},Cs=class extends v{constructor(e){super(e)}},Is=class extends v{constructor(e){super(e)}},ba=class extends v{constructor(e){super(e)}},wa=[0,re,[0,re],va,-1],Ea=[0,re,te,ce],js=[0,re,te],Aa=[0,re,Ea,js,te],lc=Je(479097054,ba);oe[479097054]=[0,re,Aa,wa],oe[463370452]=wa,oe[464864288]=Ea;var hc=Je(462713202,Is);oe[462713202]=Aa,oe[474472470]=js;var fc=class extends v{constructor(e){super(e)}},ka=class extends v{constructor(e){super(e)}},Sa=class extends v{constructor(e){super(e)}},Ta=class extends v{constructor(e){super(e)}},Ns=[0,re,te,-1,ce],Ds=[0,re,te,J];Ta.prototype.g=mn([0,re,js,[0,re],Fs,Ms,Ns,Ds]);var xa=class extends v{constructor(e){super(e)}},dc=Je(456383383,xa);oe[456383383]=[0,re,fa];var La=class extends v{constructor(e){super(e)}},pc=Je(476348187,La);oe[476348187]=[0,re,ic];var Pa=class extends v{constructor(e){super(e)}},Oa=class extends v{constructor(e){super(e)}},Ra=[0,Se,-1],gc=Je(458105876,class extends v{constructor(e){super(e)}g(){let e;var t=this.v;const r=0|t[y];return e=Ee(this,r),t=function(n,s,i,o){var c=Oa;!o&&Qt(n)&&(i=0|(s=n.v)[y]);var u=ot(s,2);if(n=!1,u==null){if(o)return $i();u=[]}else if(u.constructor===it){if(!(2&u.J)||o)return u;u=u.V()}else Array.isArray(u)?n=!!(2&(0|u[y])):u=[];if(o){if(!u.length)return $i();n||(n=!0,kr(u))}else n&&(n=!1,Sr(u),u=so(u));return!n&&32&i&&Ar(u,32),i=ie(s,i,2,o=new it(u,c,g1,void 0)),n||Ot(s,i),o}(this,t,r,e),!e&&Oa&&(t.ra=!0),t}});oe[458105876]=[0,Ra,B1,[!0,mt,[0,I,-1,de]],[0,Ir,J,Se]];var Bs=class extends v{constructor(e){super(e)}},Fa=Je(458105758,Bs);oe[458105758]=[0,re,I,Ra];var Us=class extends v{constructor(e){super(e)}},Ma=[0,V1,-1,Nt],mc=class extends v{constructor(e){super(e)}},Ca=class extends v{constructor(e){super(e)}},Vs=[1,2];Ca.prototype.g=mn([0,Vs,$,Ma,$,[0,ue,Ma]]);var Ia=class extends v{constructor(e){super(e)}},yc=Je(443442058,Ia);oe[443442058]=[0,re,I,ce,te,de,-1,J,te],oe[514774813]=Ns;var ja=class extends v{constructor(e){super(e)}},vc=Je(516587230,ja);function Gs(e,t){return t=t?t.clone():new Rs,e.displayNamesLocale!==void 0?R(t,1,Rr(e.displayNamesLocale)):e.displayNamesLocale===void 0&&R(t,1),e.maxResults!==void 0?ct(t,2,e.maxResults):"maxResults"in e&&R(t,2),e.scoreThreshold!==void 0?b(t,3,e.scoreThreshold):"scoreThreshold"in e&&R(t,3),e.categoryAllowlist!==void 0?en(t,4,e.categoryAllowlist):"categoryAllowlist"in e&&R(t,4),e.categoryDenylist!==void 0?en(t,5,e.categoryDenylist):"categoryDenylist"in e&&R(t,5),t}function Na(e){const t=Number(e);return Number.isSafeInteger(t)?t:String(e)}function Ws(e,t=-1,r=""){return{categories:e.map(n=>({index:Fe(n,1)??0??-1,score:q(n,2)??0,categoryName:he(N(n,3))??""??"",displayName:he(N(n,4))??""??""})),headIndex:t,headName:r}}function _c(e){const t={classifications:at(e,ec,1).map(r=>{var n;return Ws(((n=L(r,sa,4))==null?void 0:n.g())??[],Fe(r,2)??0,he(N(r,3))??"")})};return function(r){return p1(Bn?N(r,2,void 0,void 0,Jr):N(r,2))}(e)!=null&&(t.timestampMs=Na(uo(e))),t}function Da(e){var o,c;var t=Ft(e,3,Ye,Rt()),r=Ft(e,2,$t,Rt()),n=Ft(e,1,he,Rt()),s=Ft(e,9,he,Rt());const i={categories:[],keypoints:[]};for(let u=0;u<t.length;u++)i.categories.push({score:t[u],index:r[u]??-1,categoryName:n[u]??"",displayName:s[u]??""});if((t=(o=L(e,Os,4))==null?void 0:o.l())&&(i.boundingBox={originX:Fe(t,1,dt)??0,originY:Fe(t,2,dt)??0,width:Fe(t,3,dt)??0,height:Fe(t,4,dt)??0,angle:0}),(c=L(e,Os,4))==null?void 0:c.g().length)for(const u of L(e,Os,4).g())i.keypoints.push({x:N(u,1,void 0,dt,Ye)??0,y:N(u,2,void 0,dt,Ye)??0,score:N(u,4,void 0,dt,Ye)??0,label:he(N(u,3,void 0,dt))??""});return i}function wn(e){const t=[];for(const r of at(e,ca,1))t.push({x:q(r,1)??0,y:q(r,2)??0,z:q(r,3)??0,visibility:q(r,4)??0});return t}function Dr(e){const t=[];for(const r of at(e,aa,1))t.push({x:q(r,1)??0,y:q(r,2)??0,z:q(r,3)??0,visibility:q(r,4)??0});return t}function Ba(e){return Array.from(e,t=>t>127?t-256:t)}function Ua(e,t){if(e.length!==t.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${e.length} vs. ${t.length}).`);let r=0,n=0,s=0;for(let i=0;i<e.length;i++)r+=e[i]*t[i],n+=e[i]*e[i],s+=t[i]*t[i];if(n<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return r/Math.sqrt(n*s)}let En;oe[516587230]=[0,re,Ns,Ds,te],oe[518928384]=Ds;const bc=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 Va(){if(En===void 0)try{await WebAssembly.instantiate(bc),En=!0}catch{En=!1}return En}async function Br(e,t=K1``){const r=await Va()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${t}/${e}_${r}.js`,wasmBinaryPath:`${t}/${e}_${r}.wasm`}}var Dt=class{};function Ga(){var e=navigator;return typeof OffscreenCanvas<"u"&&(!function(t=navigator){return(t=t.userAgent).includes("Safari")&&!t.includes("Chrome")}(e)||!!((e=e.userAgent.match(/Version\/([\d]+).*Safari/))&&e.length>=1&&Number(e[1])>=17))}async function Wa(e){if(typeof importScripts!="function"){const t=document.createElement("script");return t.src=e.toString(),t.crossOrigin="anonymous",new Promise((r,n)=>{t.addEventListener("load",()=>{r()},!1),t.addEventListener("error",s=>{n(s)},!1),document.body.appendChild(t)})}try{importScripts(e.toString())}catch(t){if(!(t instanceof TypeError))throw t;await self.import(e.toString())}}function Ha(e){return e.videoWidth!==void 0?[e.videoWidth,e.videoHeight]:e.naturalWidth!==void 0?[e.naturalWidth,e.naturalHeight]:e.displayWidth!==void 0?[e.displayWidth,e.displayHeight]:[e.width,e.height]}function _(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),r(t=e.i.stringToNewUTF8(t)),e.i._free(t)}function za(e,t,r){if(!e.i.canvas)throw Error("No OpenGL canvas configured.");if(r?e.i._bindTextureToStream(r):e.i._bindTextureToCanvas(),!(r=e.i.canvas.getContext("webgl2")||e.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t),e.i.gpuOriginForWebTexturesIsBottomLeft&&r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,!1);const[n,s]=Ha(t);return!e.l||n===e.i.canvas.width&&s===e.i.canvas.height||(e.i.canvas.width=n,e.i.canvas.height=s),[n,s]}function Ka(e,t,r){e.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const n=new Uint32Array(t.length);for(let s=0;s<t.length;s++)n[s]=e.i.stringToNewUTF8(t[s]);t=e.i._malloc(4*n.length),e.i.HEAPU32.set(n,t>>2),r(t);for(const s of n)e.i._free(s);e.i._free(t)}function $e(e,t,r){e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=r}function _t(e,t,r){let n=[];e.i.simpleListeners=e.i.simpleListeners||{},e.i.simpleListeners[t]=(s,i,o)=>{i?(r(n,o),n=[]):n.push(s)}}Dt.forVisionTasks=function(e){return Br("vision",e)},Dt.forTextTasks=function(e){return Br("text",e)},Dt.forGenAiExperimentalTasks=function(e){return Br("genai_experimental",e)},Dt.forGenAiTasks=function(e){return Br("genai",e)},Dt.forAudioTasks=function(e){return Br("audio",e)},Dt.isSimdSupported=function(){return Va()};async function wc(e,t,r,n){return e=await(async(s,i,o,c,u)=>{if(i&&await Wa(i),!self.ModuleFactory||o&&(await Wa(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&u&&((i=self.Module).locateFile=u.locateFile,u.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=u.mainScriptUrlOrBlob)),u=await self.ModuleFactory(self.Module||u),self.ModuleFactory=self.Module=void 0,new s(u,c)})(e,r.wasmLoaderPath,r.assetLoaderPath,t,{locateFile:s=>s.endsWith(".wasm")?r.wasmBinaryPath.toString():r.assetBinaryPath&&s.endsWith(".data")?r.assetBinaryPath.toString():s}),await e.o(n),e}function Hs(e,t){const r=L(e.baseOptions,_n,1)||new _n;typeof t=="string"?(R(r,2,Rr(t)),R(r,1)):t instanceof Uint8Array&&(R(r,1,Hn(t,!1)),R(r,2)),w(e.baseOptions,0,1,r)}function Ya(e){try{const t=e.H.length;if(t===1)throw Error(e.H[0].message);if(t>1)throw Error("Encountered multiple errors: "+e.H.map(r=>r.message).join(", "))}finally{e.H=[]}}function g(e,t){e.C=Math.max(e.C,t)}function An(e,t){e.B=new ye,ke(e.B,2,"PassThroughCalculator"),D(e.B,"free_memory"),S(e.B,"free_memory_unused_out"),G(t,"free_memory"),Ce(t,e.B)}function dr(e,t){D(e.B,t),S(e.B,t+"_unused_out")}function kn(e){e.g.addBoolToStream(!0,"free_memory",e.C)}var zs=class{constructor(e){this.g=e,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(e,t=!0){var r,n,s,i,o,c;if(t){const u=e.baseOptions||{};if((r=e.baseOptions)!=null&&r.modelAssetBuffer&&((n=e.baseOptions)!=null&&n.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=L(this.baseOptions,_n,1))!=null&&s.g()||(i=L(this.baseOptions,_n,1))!=null&&i.l()||(o=e.baseOptions)!=null&&o.modelAssetBuffer||(c=e.baseOptions)!=null&&c.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if(function(d,l){let f=L(d.baseOptions,pa,3);if(!f){var m=f=new pa,A=new $o;Mr(m,4,vn,A)}"delegate"in l&&(l.delegate==="GPU"?(l=f,m=new Y1,Mr(l,2,vn,m)):(l=f,m=new $o,Mr(l,4,vn,m))),w(d.baseOptions,0,3,f)}(this,u),u.modelAssetPath)return fetch(u.modelAssetPath.toString()).then(d=>{if(d.ok)return d.arrayBuffer();throw Error(`Failed to fetch model: ${u.modelAssetPath} (${d.status})`)}).then(d=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(d),!0,!1,!1),Hs(this,"/model.dat"),this.m(),this.L()});if(u.modelAssetBuffer instanceof Uint8Array)Hs(this,u.modelAssetBuffer);else if(u.modelAssetBuffer)return async function(d){const l=[];for(var f=0;;){const{done:m,value:A}=await d.read();if(m)break;l.push(A),f+=A.length}if(l.length===0)return new Uint8Array(0);if(l.length===1)return l[0];d=new Uint8Array(f),f=0;for(const m of l)d.set(m,f),f+=m.length;return d}(u.modelAssetBuffer).then(d=>{Hs(this,d),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let e;if(this.g.ca(t=>{e=X1(t)}),!e)throw Error("Failed to retrieve CalculatorGraphConfig");return e}setGraph(e,t){this.g.attachErrorListener((r,n)=>{this.H.push(Error(n))}),this.g.Ja(),this.g.setGraph(e,t),this.B=void 0,Ya(this)}finishProcessing(){this.g.finishProcessing(),Ya(this)}close(){this.B=void 0,this.g.closeGraph()}};function bt(e,t){if(!e)throw Error(`Unable to obtain required WebGL resource: ${t}`);return e}zs.prototype.close=zs.prototype.close;class Ec{constructor(t,r,n,s){this.g=t,this.h=r,this.m=n,this.l=s}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function Xa(e,t,r){const n=e.g;if(r=bt(n.createShader(r),"Failed to create WebGL shader"),n.shaderSource(r,t),n.compileShader(r),!n.getShaderParameter(r,n.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${n.getShaderInfoLog(r)}`);return n.attachShader(e.h,r),r}function qa(e,t){const r=e.g,n=bt(r.createVertexArray(),"Failed to create vertex array");r.bindVertexArray(n);const s=bt(r.createBuffer(),"Failed to create buffer");r.bindBuffer(r.ARRAY_BUFFER,s),r.enableVertexAttribArray(e.O),r.vertexAttribPointer(e.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);const i=bt(r.createBuffer(),"Failed to create buffer");return r.bindBuffer(r.ARRAY_BUFFER,i),r.enableVertexAttribArray(e.L),r.vertexAttribPointer(e.L,2,r.FLOAT,!1,0,0),r.bufferData(r.ARRAY_BUFFER,new Float32Array(t?[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 Ec(r,n,s,i)}function Ks(e,t){if(e.g){if(t!==e.g)throw Error("Cannot change GL context once initialized")}else e.g=t}function Ac(e,t,r,n){return Ks(e,t),e.h||(e.m(),e.D()),r?(e.u||(e.u=qa(e,!0)),r=e.u):(e.A||(e.A=qa(e,!1)),r=e.A),t.useProgram(e.h),r.bind(),e.l(),e=n(),r.g.bindVertexArray(null),e}function Ja(e,t,r){return Ks(e,t),e=bt(t.createTexture(),"Failed to create texture"),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,r??t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,r??t.LINEAR),t.bindTexture(t.TEXTURE_2D,null),e}function $a(e,t,r){Ks(e,t),e.B||(e.B=bt(t.createFramebuffer(),"Failed to create framebuffe.")),t.bindFramebuffer(t.FRAMEBUFFER,e.B),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,r,0)}function kc(e){var t;(t=e.g)==null||t.bindFramebuffer(e.g.FRAMEBUFFER,null)}var Za=class{H(){return`
|
|
31
|
-
precision mediump float;
|
|
32
|
-
varying vec2 vTex;
|
|
33
|
-
uniform sampler2D inputTexture;
|
|
34
|
-
void main() {
|
|
35
|
-
gl_FragColor = texture2D(inputTexture, vTex);
|
|
36
|
-
}
|
|
37
|
-
`}m(){const e=this.g;if(this.h=bt(e.createProgram(),"Failed to create WebGL program"),this.X=Xa(this,`
|
|
38
|
-
attribute vec2 aVertex;
|
|
39
|
-
attribute vec2 aTex;
|
|
40
|
-
varying vec2 vTex;
|
|
41
|
-
void main(void) {
|
|
42
|
-
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
43
|
-
vTex = aTex;
|
|
44
|
-
}`,e.VERTEX_SHADER),this.W=Xa(this,this.H(),e.FRAGMENT_SHADER),e.linkProgram(this.h),!e.getProgramParameter(this.h,e.LINK_STATUS))throw Error(`Error during program linking: ${e.getProgramInfoLog(this.h)}`);this.O=e.getAttribLocation(this.h,"aVertex"),this.L=e.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const e=this.g;e.deleteProgram(this.h),e.deleteShader(this.X),e.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function lt(e,t){switch(t){case 0:return e.g.find(r=>r instanceof Uint8Array);case 1:return e.g.find(r=>r instanceof Float32Array);case 2:return e.g.find(r=>typeof WebGLTexture<"u"&&r instanceof WebGLTexture);default:throw Error(`Type is not supported: ${t}`)}}function Ys(e){var t=lt(e,1);if(!t){if(t=lt(e,0))t=new Float32Array(t).map(n=>n/255);else{t=new Float32Array(e.width*e.height);const n=pr(e);var r=Xs(e);if($a(r,n,Qa(e)),"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(e.width*e.height*4),n.readPixels(0,0,e.width,e.height,n.RGBA,n.FLOAT,r);for(let s=0,i=0;s<t.length;++s,i+=4)t[s]=r[i]}else n.readPixels(0,0,e.width,e.height,n.RED,n.FLOAT,t)}e.g.push(t)}return t}function Qa(e){let t=lt(e,2);if(!t){const r=pr(e);t=t2(e);const n=Ys(e),s=e2(e);r.texImage2D(r.TEXTURE_2D,0,s,e.width,e.height,0,r.RED,r.FLOAT,n),qs(e)}return t}function pr(e){if(!e.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return e.h||(e.h=bt(e.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),e.h}function e2(e){if(e=pr(e),!Sn)if(e.getExtension("EXT_color_buffer_float")&&e.getExtension("OES_texture_float_linear")&&e.getExtension("EXT_float_blend"))Sn=e.R32F;else{if(!e.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");Sn=e.R16F}return Sn}function Xs(e){return e.l||(e.l=new Za),e.l}function t2(e){const t=pr(e);t.viewport(0,0,e.width,e.height),t.activeTexture(t.TEXTURE0);let r=lt(e,2);return r||(r=Ja(Xs(e),t,e.m?t.LINEAR:t.NEAREST),e.g.push(r),e.j=!0),t.bindTexture(t.TEXTURE_2D,r),r}function qs(e){e.h.bindTexture(e.h.TEXTURE_2D,null)}var Sn,le=class{constructor(e,t,r,n,s,i,o){this.g=e,this.m=t,this.j=r,this.canvas=n,this.l=s,this.width=i,this.height=o,this.j&&--r2===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!lt(this,0)}ka(){return!!lt(this,1)}R(){return!!lt(this,2)}ja(){return(t=lt(e=this,0))||(t=Ys(e),t=new Uint8Array(t.map(r=>Math.round(255*r))),e.g.push(t)),t;var e,t}ia(){return Ys(this)}N(){return Qa(this)}clone(){const e=[];for(const t of this.g){let r;if(t instanceof Uint8Array)r=new Uint8Array(t);else if(t instanceof Float32Array)r=new Float32Array(t);else{if(!(t instanceof WebGLTexture))throw Error(`Type is not supported: ${t}`);{const n=pr(this),s=Xs(this);n.activeTexture(n.TEXTURE1),r=Ja(s,n,this.m?n.LINEAR:n.NEAREST),n.bindTexture(n.TEXTURE_2D,r);const i=e2(this);n.texImage2D(n.TEXTURE_2D,0,i,this.width,this.height,0,n.RED,n.FLOAT,null),n.bindTexture(n.TEXTURE_2D,null),$a(s,n,r),Ac(s,n,!1,()=>{t2(this),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.drawArrays(n.TRIANGLE_FAN,0,4),qs(this)}),kc(s),qs(this)}}e.push(r)}return new le(e,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&pr(this).deleteTexture(lt(this,2)),r2=-1}};le.prototype.close=le.prototype.close,le.prototype.clone=le.prototype.clone,le.prototype.getAsWebGLTexture=le.prototype.N,le.prototype.getAsFloat32Array=le.prototype.ia,le.prototype.getAsUint8Array=le.prototype.ja,le.prototype.hasWebGLTexture=le.prototype.R,le.prototype.hasFloat32Array=le.prototype.ka,le.prototype.hasUint8Array=le.prototype.Fa;var r2=250;function Ue(...e){return e.map(([t,r])=>({start:t,end:r}))}const Sc=function(e){return class extends e{Ja(){this.i._registerModelResourcesGraphService()}}}((n2=class{constructor(e,t){this.l=!0,this.i=e,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",t!==void 0?this.i.canvas=t:Ga()?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(e){const t=await(await fetch(e)).arrayBuffer();e=!(e.endsWith(".pbtxt")||e.endsWith(".textproto")),this.setGraph(new Uint8Array(t),e)}setGraphFromString(e){this.setGraph(new TextEncoder().encode(e),!1)}setGraph(e,t){const r=e.length,n=this.i._malloc(r);this.i.HEAPU8.set(e,n),t?this.i._changeBinaryGraph(r,n):this.i._changeTextGraph(r,n),this.i._free(n)}configureAudio(e,t,r,n,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),_(this,n||"input_audio",i=>{_(this,s=s||"audio_header",o=>{this.i._configureAudio(i,o,e,t??0,r)})})}setAutoResizeCanvas(e){this.l=e}setAutoRenderToScreen(e){this.i._setAutoRenderToScreen(e)}setGpuBufferVerticalFlip(e){this.i.gpuOriginForWebTexturesIsBottomLeft=e}ca(e){$e(this,"__graph_config__",t=>{e(t)}),_(this,"__graph_config__",t=>{this.i._getGraphConfig(t,void 0)}),delete this.i.simpleListeners.__graph_config__}attachErrorListener(e){this.i.errorListener=e}attachEmptyPacketListener(e,t){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[e]=t}addAudioToStream(e,t,r){this.addAudioToStreamWithShape(e,0,0,t,r)}addAudioToStreamWithShape(e,t,r,n,s){const i=4*e.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(e,this.g/4),_(this,n,o=>{this.i._addAudioToInputStream(this.g,t,r,o,s)})}addGpuBufferToStream(e,t,r){_(this,t,n=>{const[s,i]=za(this,e,n);this.i._addBoundTextureToStream(n,s,i,r)})}addBoolToStream(e,t,r){_(this,t,n=>{this.i._addBoolToInputStream(e,n,r)})}addDoubleToStream(e,t,r){_(this,t,n=>{this.i._addDoubleToInputStream(e,n,r)})}addFloatToStream(e,t,r){_(this,t,n=>{this.i._addFloatToInputStream(e,n,r)})}addIntToStream(e,t,r){_(this,t,n=>{this.i._addIntToInputStream(e,n,r)})}addUintToStream(e,t,r){_(this,t,n=>{this.i._addUintToInputStream(e,n,r)})}addStringToStream(e,t,r){_(this,t,n=>{_(this,e,s=>{this.i._addStringToInputStream(s,n,r)})})}addStringRecordToStream(e,t,r){_(this,t,n=>{Ka(this,Object.keys(e),s=>{Ka(this,Object.values(e),i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(e).length,n,r)})})})}addProtoToStream(e,t,r,n){_(this,r,s=>{_(this,t,i=>{const o=this.i._malloc(e.length);this.i.HEAPU8.set(e,o),this.i._addProtoToInputStream(o,e.length,i,s,n),this.i._free(o)})})}addEmptyPacketToStream(e,t){_(this,e,r=>{this.i._addEmptyPacketToInputStream(r,t)})}addBoolVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateBoolVector(e.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of e)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,n,r)})}addDoubleVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateDoubleVector(e.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of e)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,n,r)})}addFloatVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateFloatVector(e.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of e)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,n,r)})}addIntVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateIntVector(e.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of e)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,n,r)})}addUintVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateUintVector(e.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of e)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,n,r)})}addStringVectorToStream(e,t,r){_(this,t,n=>{const s=this.i._allocateStringVector(e.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of e)_(this,i,o=>{this.i._addStringVectorEntry(s,o)});this.i._addStringVectorToInputStream(s,n,r)})}addBoolToInputSidePacket(e,t){_(this,t,r=>{this.i._addBoolToInputSidePacket(e,r)})}addDoubleToInputSidePacket(e,t){_(this,t,r=>{this.i._addDoubleToInputSidePacket(e,r)})}addFloatToInputSidePacket(e,t){_(this,t,r=>{this.i._addFloatToInputSidePacket(e,r)})}addIntToInputSidePacket(e,t){_(this,t,r=>{this.i._addIntToInputSidePacket(e,r)})}addUintToInputSidePacket(e,t){_(this,t,r=>{this.i._addUintToInputSidePacket(e,r)})}addStringToInputSidePacket(e,t){_(this,t,r=>{_(this,e,n=>{this.i._addStringToInputSidePacket(n,r)})})}addProtoToInputSidePacket(e,t,r){_(this,r,n=>{_(this,t,s=>{const i=this.i._malloc(e.length);this.i.HEAPU8.set(e,i),this.i._addProtoToInputSidePacket(i,e.length,s,n),this.i._free(i)})})}addBoolVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateBoolVector(e.length);if(!n)throw Error("Unable to allocate new bool vector on heap.");for(const s of e)this.i._addBoolVectorEntry(n,s);this.i._addBoolVectorToInputSidePacket(n,r)})}addDoubleVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateDoubleVector(e.length);if(!n)throw Error("Unable to allocate new double vector on heap.");for(const s of e)this.i._addDoubleVectorEntry(n,s);this.i._addDoubleVectorToInputSidePacket(n,r)})}addFloatVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateFloatVector(e.length);if(!n)throw Error("Unable to allocate new float vector on heap.");for(const s of e)this.i._addFloatVectorEntry(n,s);this.i._addFloatVectorToInputSidePacket(n,r)})}addIntVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateIntVector(e.length);if(!n)throw Error("Unable to allocate new int vector on heap.");for(const s of e)this.i._addIntVectorEntry(n,s);this.i._addIntVectorToInputSidePacket(n,r)})}addUintVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateUintVector(e.length);if(!n)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of e)this.i._addUintVectorEntry(n,s);this.i._addUintVectorToInputSidePacket(n,r)})}addStringVectorToInputSidePacket(e,t){_(this,t,r=>{const n=this.i._allocateStringVector(e.length);if(!n)throw Error("Unable to allocate new string vector on heap.");for(const s of e)_(this,s,i=>{this.i._addStringVectorEntry(n,i)});this.i._addStringVectorToInputSidePacket(n,r)})}attachBoolListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachBoolListener(r)})}attachBoolVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachBoolVectorListener(r)})}attachIntListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachIntListener(r)})}attachIntVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachIntVectorListener(r)})}attachUintListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachUintListener(r)})}attachUintVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachUintVectorListener(r)})}attachDoubleListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachDoubleListener(r)})}attachDoubleVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachDoubleVectorListener(r)})}attachFloatListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachFloatListener(r)})}attachFloatVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachFloatVectorListener(r)})}attachStringListener(e,t){$e(this,e,t),_(this,e,r=>{this.i._attachStringListener(r)})}attachStringVectorListener(e,t){_t(this,e,t),_(this,e,r=>{this.i._attachStringVectorListener(r)})}attachProtoListener(e,t,r){$e(this,e,t),_(this,e,n=>{this.i._attachProtoListener(n,r||!1)})}attachProtoVectorListener(e,t,r){_t(this,e,t),_(this,e,n=>{this.i._attachProtoVectorListener(n,r||!1)})}attachAudioListener(e,t,r){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),$e(this,e,(n,s)=>{n=new Float32Array(n.buffer,n.byteOffset,n.length/4),t(n,s)}),_(this,e,n=>{this.i._attachAudioListener(n,r||!1)})}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends n2{get ga(){return this.i}pa(e,t,r){_(this,t,n=>{const[s,i]=za(this,e,n);this.ga._addBoundTextureAsImageToStream(n,s,i,r)})}Z(e,t){$e(this,e,t),_(this,e,r=>{this.ga._attachImageListener(r)})}aa(e,t){_t(this,e,t),_(this,e,r=>{this.ga._attachImageVectorListener(r)})}}));var n2,Ve=class extends Sc{};async function x(e,t,r){return async function(n,s,i,o){return wc(n,s,i,o)}(e,r.canvas??(Ga()?void 0:document.createElement("canvas")),t,r)}function s2(e,t,r,n){if(e.U){const i=new ua;if(r!=null&&r.regionOfInterest){if(!e.oa)throw Error("This task doesn't support region-of-interest.");var s=r.regionOfInterest;if(s.left>=s.right||s.top>=s.bottom)throw Error("Expected RectF with left < right and top < bottom.");if(s.left<0||s.top<0||s.right>1||s.bottom>1)throw Error("Expected RectF values to be in [0,1].");b(i,1,(s.left+s.right)/2),b(i,2,(s.top+s.bottom)/2),b(i,4,s.right-s.left),b(i,3,s.bottom-s.top)}else b(i,1,.5),b(i,2,.5),b(i,4,1),b(i,3,1);if(r!=null&&r.rotationDegrees){if((r==null?void 0:r.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(b(i,5,-Math.PI*r.rotationDegrees/180),(r==null?void 0:r.rotationDegrees)%180!=0){const[o,c]=Ha(t);r=q(i,3)*c/o,s=q(i,4)*o/c,b(i,4,r),b(i,3,s)}}e.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",e.U,n)}e.g.pa(t,e.X,n??performance.now()),e.finishProcessing()}function Ge(e,t,r){var n;if((n=e.baseOptions)!=null&&n.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");s2(e,t,r,e.C+1)}function Ze(e,t,r,n){var s;if(!((s=e.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");s2(e,t,r,n)}function gr(e,t,r,n){var s=t.data;const i=t.width,o=i*(t=t.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return e=new le([s],r,!1,e.g.i.canvas,e.P,i,t),n?e.clone():e}var Le=class extends zs{constructor(e,t,r,n){super(e),this.g=e,this.X=t,this.U=r,this.oa=n,this.P=new Za}l(e,t=!0){if("runningMode"in e&&R(this.baseOptions,2,Pr(!!e.runningMode&&e.runningMode!=="IMAGE")),e.canvas!==void 0&&this.g.i.canvas!==e.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(e,t)}close(){this.P.close(),super.close()}};Le.prototype.close=Le.prototype.close;var Ie=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.j={detections:[]},w(e=this.h=new bn,0,1,t=new z),b(this.h,2,.5),b(this.h,3,.3)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"minDetectionConfidence"in e&&b(this.h,2,e.minDetectionConfidence??.5),"minSuppressionThreshold"in e&&b(this.h,3,e.minSuppressionThreshold??.3),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect_in"),P(e,"detections");const t=new Te;qe(t,oc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect_in"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ie.prototype.detectForVideo=Ie.prototype.G,Ie.prototype.detect=Ie.prototype.F,Ie.prototype.setOptions=Ie.prototype.o,Ie.createFromModelPath=async function(e,t){return x(Ie,e,{baseOptions:{modelAssetPath:t}})},Ie.createFromModelBuffer=function(e,t){return x(Ie,e,{baseOptions:{modelAssetBuffer:t}})},Ie.createFromOptions=function(e,t){return x(Ie,e,t)};var Js=Ue([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]),$s=Ue([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]),Zs=Ue([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),i2=Ue([474,475],[475,476],[476,477],[477,474]),Qs=Ue([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]),ei=Ue([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),o2=Ue([469,470],[470,471],[471,472],[472,469]),ti=Ue([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]),a2=[...Js,...$s,...Zs,...Qs,...ei,...ti],c2=Ue([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 u2(e){e.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var W=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,w(e=this.h=new ya,0,1,t=new z),this.A=new ma,w(this.h,0,3,this.A),this.u=new bn,w(this.h,0,2,this.u),ct(this.u,4,1),b(this.u,2,.5),b(this.A,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numFaces"in e&&ct(this.u,4,e.numFaces??1),"minFaceDetectionConfidence"in e&&b(this.u,2,e.minFaceDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minFacePresenceConfidence"in e&&b(this.A,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in e&&(this.outputFacialTransformationMatrixes=!!e.outputFacialTransformationMatrixes),this.l(e)}F(e,t){return u2(this),Ge(this,e,t),this.j}G(e,t,r){return u2(this),Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"face_landmarks");const t=new Te;qe(t,cc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:face_landmarks"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("face_landmarks",(n,s)=>{for(const i of n)n=Nr(i),this.j.faceLandmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("face_landmarks",n=>{g(this,n)}),this.outputFaceBlendshapes&&(P(e,"blendshapes"),S(r,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",(n,s)=>{if(this.outputFaceBlendshapes)for(const i of n)n=yn(i),this.j.faceBlendshapes.push(Ws(n.g()??[]));g(this,s)}),this.g.attachEmptyPacketListener("blendshapes",n=>{g(this,n)})),this.outputFacialTransformationMatrixes&&(P(e,"face_geometry"),S(r,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",(n,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of n)(n=L(n=ac(i),Z1,2))&&this.j.facialTransformationMatrixes.push({rows:Fe(n,1)??0??0,columns:Fe(n,2)??0??0,data:Ft(n,3,Ye,Rt()).slice()??[]});g(this,s)}),this.g.attachEmptyPacketListener("face_geometry",n=>{g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};W.prototype.detectForVideo=W.prototype.G,W.prototype.detect=W.prototype.F,W.prototype.setOptions=W.prototype.o,W.createFromModelPath=function(e,t){return x(W,e,{baseOptions:{modelAssetPath:t}})},W.createFromModelBuffer=function(e,t){return x(W,e,{baseOptions:{modelAssetBuffer:t}})},W.createFromOptions=function(e,t){return x(W,e,t)},W.FACE_LANDMARKS_LIPS=Js,W.FACE_LANDMARKS_LEFT_EYE=$s,W.FACE_LANDMARKS_LEFT_EYEBROW=Zs,W.FACE_LANDMARKS_LEFT_IRIS=i2,W.FACE_LANDMARKS_RIGHT_EYE=Qs,W.FACE_LANDMARKS_RIGHT_EYEBROW=ei,W.FACE_LANDMARKS_RIGHT_IRIS=o2,W.FACE_LANDMARKS_FACE_OVAL=ti,W.FACE_LANDMARKS_CONTOURS=a2,W.FACE_LANDMARKS_TESSELATION=c2;var ri=Ue([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 l2(e){e.gestures=[],e.landmarks=[],e.worldLandmarks=[],e.handedness=[]}function h2(e){return e.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:e.gestures,landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handedness:e.handedness,handednesses:e.handedness}}function f2(e,t=!0){const r=[];for(const s of e){var n=yn(s);e=[];for(const i of n.g())n=t&&Fe(i,1)!=null?Fe(i,1)??0:-1,e.push({score:q(i,2)??0,index:n,categoryName:he(N(i,3))??""??"",displayName:he(N(i,4))??""??""});r.push(e)}return r}var Pe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.j=new ba,0,1,t=new z),this.u=new Is,w(this.j,0,2,this.u),this.D=new Cs,w(this.u,0,3,this.D),this.A=new _a,w(this.u,0,2,this.A),this.h=new uc,w(this.j,0,3,this.h),b(this.A,2,.5),b(this.u,4,.5),b(this.D,2,.5)}get baseOptions(){return L(this.j,z,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){var s,i,o,c;if(ct(this.A,3,e.numHands??1),"minHandDetectionConfidence"in e&&b(this.A,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.u,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&b(this.D,2,e.minHandPresenceConfidence??.5),e.cannedGesturesClassifierOptions){var t=new fr,r=t,n=Gs(e.cannedGesturesClassifierOptions,(s=L(this.h,fr,3))==null?void 0:s.l());w(r,0,2,n),w(this.h,0,3,t)}else e.cannedGesturesClassifierOptions===void 0&&((i=L(this.h,fr,3))==null||i.g());return e.customGesturesClassifierOptions?(w(r=t=new fr,0,2,n=Gs(e.customGesturesClassifierOptions,(o=L(this.h,fr,4))==null?void 0:o.l())),w(this.h,0,4,t)):e.customGesturesClassifierOptions===void 0&&((c=L(this.h,fr,4))==null||c.g()),this.l(e)}Ha(e,t){return l2(this),Ge(this,e,t),h2(this)}Ia(e,t,r){return l2(this),Ze(this,e,r,t),h2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"hand_gestures"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;qe(t,lc,this.j);const r=new ye;ke(r,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"HAND_GESTURES:hand_gestures"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n){n=Nr(i);const o=[];for(const c of at(n,ca,1))o.push({x:q(c,1)??0,y:q(c,2)??0,z:q(c,3)??0,visibility:q(c,4)??0});this.landmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n){n=hr(i);const o=[];for(const c of at(n,aa,1))o.push({x:q(c,1)??0,y:q(c,2)??0,z:q(c,3)??0,visibility:q(c,4)??0});this.worldLandmarks.push(o)}g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("hand_gestures",(n,s)=>{this.gestures.push(...f2(n,!1)),g(this,s)}),this.g.attachEmptyPacketListener("hand_gestures",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{this.handedness.push(...f2(n)),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};function d2(e){return{landmarks:e.landmarks,worldLandmarks:e.worldLandmarks,handednesses:e.handedness,handedness:e.handedness}}Pe.prototype.recognizeForVideo=Pe.prototype.Ia,Pe.prototype.recognize=Pe.prototype.Ha,Pe.prototype.setOptions=Pe.prototype.o,Pe.createFromModelPath=function(e,t){return x(Pe,e,{baseOptions:{modelAssetPath:t}})},Pe.createFromModelBuffer=function(e,t){return x(Pe,e,{baseOptions:{modelAssetBuffer:t}})},Pe.createFromOptions=function(e,t){return x(Pe,e,t)},Pe.HAND_CONNECTIONS=ri;var ve=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],w(e=this.h=new Is,0,1,t=new z),this.u=new Cs,w(this.h,0,3,this.u),this.j=new _a,w(this.h,0,2,this.j),ct(this.j,3,1),b(this.j,2,.5),b(this.u,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numHands"in e&&ct(this.j,3,e.numHands??1),"minHandDetectionConfidence"in e&&b(this.j,2,e.minHandDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minHandPresenceConfidence"in e&&b(this.u,2,e.minHandPresenceConfidence??.5),this.l(e)}F(e,t){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ge(this,e,t),d2(this)}G(e,t,r){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Ze(this,e,r,t),d2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"hand_landmarks"),P(e,"world_hand_landmarks"),P(e,"handedness");const t=new Te;qe(t,hc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"LANDMARKS:hand_landmarks"),S(r,"WORLD_LANDMARKS:world_hand_landmarks"),S(r,"HANDEDNESS:handedness"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("hand_landmarks",(n,s)=>{for(const i of n)n=Nr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("world_hand_landmarks",(n,s)=>{for(const i of n)n=hr(i),this.worldLandmarks.push(Dr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_hand_landmarks",n=>{g(this,n)}),this.g.attachProtoVectorListener("handedness",(n,s)=>{var i=this.handedness,o=i.push;const c=[];for(const u of n){n=yn(u);const d=[];for(const l of n.g())d.push({score:q(l,2)??0,index:Fe(l,1)??0??-1,categoryName:he(N(l,3))??""??"",displayName:he(N(l,4))??""??""});c.push(d)}o.call(i,...c),g(this,s)}),this.g.attachEmptyPacketListener("handedness",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};ve.prototype.detectForVideo=ve.prototype.G,ve.prototype.detect=ve.prototype.F,ve.prototype.setOptions=ve.prototype.o,ve.createFromModelPath=function(e,t){return x(ve,e,{baseOptions:{modelAssetPath:t}})},ve.createFromModelBuffer=function(e,t){return x(ve,e,{baseOptions:{modelAssetBuffer:t}})},ve.createFromOptions=function(e,t){return x(ve,e,t)},ve.HAND_CONNECTIONS=ri;var p2=Ue([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 g2(e){e.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function m2(e){try{if(!e.D)return e.h;e.D(e.h)}finally{kn(e)}}function Tn(e,t){e=Nr(e),t.push(wn(e))}var B=class extends Le{constructor(e,t){super(new Ve(e,t),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,w(e=this.j=new Ta,0,1,t=new z),this.I=new Cs,w(this.j,0,2,this.I),this.W=new fc,w(this.j,0,3,this.W),this.u=new bn,w(this.j,0,4,this.u),this.O=new ma,w(this.j,0,5,this.O),this.A=new ka,w(this.j,0,6,this.A),this.M=new Sa,w(this.j,0,7,this.M),b(this.u,2,.5),b(this.u,3,.3),b(this.O,2,.5),b(this.A,2,.5),b(this.A,3,.3),b(this.M,2,.5),b(this.I,2,.5)}get baseOptions(){return L(this.j,z,1)}set baseOptions(e){w(this.j,0,1,e)}o(e){return"minFaceDetectionConfidence"in e&&b(this.u,2,e.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in e&&b(this.u,3,e.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in e&&b(this.O,2,e.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in e&&(this.outputFaceBlendshapes=!!e.outputFaceBlendshapes),"minPoseDetectionConfidence"in e&&b(this.A,2,e.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in e&&b(this.A,3,e.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in e&&b(this.M,2,e.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in e&&(this.outputPoseSegmentationMasks=!!e.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in e&&b(this.I,2,e.minHandLandmarksConfidence??.5),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.D=typeof t=="function"?t:r,g2(this),Ge(this,e,n),m2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.D=typeof r=="function"?r:n,g2(this),Ze(this,e,s,t),m2(this)}m(){var e=new xe;G(e,"input_frames_image"),P(e,"pose_landmarks"),P(e,"pose_world_landmarks"),P(e,"face_landmarks"),P(e,"left_hand_landmarks"),P(e,"left_hand_world_landmarks"),P(e,"right_hand_landmarks"),P(e,"right_hand_world_landmarks");const t=new Te,r=new Wo;ke(r,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),function(s,i){if(i!=null)if(Array.isArray(i))R(s,2,Qr(i,0,Fr));else{if(!(typeof i=="string"||i instanceof ze||Un(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");pt(s,2,Hn(i,!1),St())}}(r,this.j.g());const n=new ye;ke(n,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),hs(n,8,Wo,r),D(n,"IMAGE:input_frames_image"),S(n,"POSE_LANDMARKS:pose_landmarks"),S(n,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),S(n,"FACE_LANDMARKS:face_landmarks"),S(n,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),S(n,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),S(n,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),S(n,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),n.o(t),Ce(e,n),An(this,e),this.g.attachProtoListener("pose_landmarks",(s,i)=>{Tn(s,this.h.poseLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("pose_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("pose_world_landmarks",(s,i)=>{var o=this.h.poseWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("pose_world_landmarks",s=>{g(this,s)}),this.outputPoseSegmentationMasks&&(S(n,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),dr(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",(s,i)=>{this.h.poseSegmentationMasks=[gr(this,s,!0,!this.D)],g(this,i)}),this.g.attachEmptyPacketListener("pose_segmentation_mask",s=>{this.h.poseSegmentationMasks=[],g(this,s)})),this.g.attachProtoListener("face_landmarks",(s,i)=>{Tn(s,this.h.faceLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("face_landmarks",s=>{g(this,s)}),this.outputFaceBlendshapes&&(P(e,"extra_blendshapes"),S(n,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",(s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=yn(s),o.push(Ws(s.g()??[]))),g(this,i)}),this.g.attachEmptyPacketListener("extra_blendshapes",s=>{g(this,s)})),this.g.attachProtoListener("left_hand_landmarks",(s,i)=>{Tn(s,this.h.leftHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("left_hand_world_landmarks",(s,i)=>{var o=this.h.leftHandWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("left_hand_world_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_landmarks",(s,i)=>{Tn(s,this.h.rightHandLandmarks),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_landmarks",s=>{g(this,s)}),this.g.attachProtoListener("right_hand_world_landmarks",(s,i)=>{var o=this.h.rightHandWorldLandmarks;s=hr(s),o.push(Dr(s)),g(this,i)}),this.g.attachEmptyPacketListener("right_hand_world_landmarks",s=>{g(this,s)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};B.prototype.detectForVideo=B.prototype.G,B.prototype.detect=B.prototype.F,B.prototype.setOptions=B.prototype.o,B.createFromModelPath=function(e,t){return x(B,e,{baseOptions:{modelAssetPath:t}})},B.createFromModelBuffer=function(e,t){return x(B,e,{baseOptions:{modelAssetBuffer:t}})},B.createFromOptions=function(e,t){return x(B,e,t)},B.HAND_CONNECTIONS=ri,B.POSE_CONNECTIONS=p2,B.FACE_LANDMARKS_LIPS=Js,B.FACE_LANDMARKS_LEFT_EYE=$s,B.FACE_LANDMARKS_LEFT_EYEBROW=Zs,B.FACE_LANDMARKS_LEFT_IRIS=i2,B.FACE_LANDMARKS_RIGHT_EYE=Qs,B.FACE_LANDMARKS_RIGHT_EYEBROW=ei,B.FACE_LANDMARKS_RIGHT_IRIS=o2,B.FACE_LANDMARKS_FACE_OVAL=ti,B.FACE_LANDMARKS_CONTOURS=a2,B.FACE_LANDMARKS_TESSELATION=c2;var je=class extends Le{constructor(e,t){super(new Ve(e,t),"input_image","norm_rect",!0),this.j={classifications:[]},w(e=this.h=new xa,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return w(this.h,0,2,Gs(e,L(this.h,Rs,2))),this.l(e)}sa(e,t){return this.j={classifications:[]},Ge(this,e,t),this.j}ta(e,t,r){return this.j={classifications:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"input_image"),G(e,"norm_rect"),P(e,"classifications");const t=new Te;qe(t,dc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),D(r,"IMAGE:input_image"),D(r,"NORM_RECT:norm_rect"),S(r,"CLASSIFICATIONS:classifications"),r.o(t),Ce(e,r),this.g.attachProtoListener("classifications",(n,s)=>{this.j=_c(tc(n)),g(this,s)}),this.g.attachEmptyPacketListener("classifications",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};je.prototype.classifyForVideo=je.prototype.ta,je.prototype.classify=je.prototype.sa,je.prototype.setOptions=je.prototype.o,je.createFromModelPath=function(e,t){return x(je,e,{baseOptions:{modelAssetPath:t}})},je.createFromModelBuffer=function(e,t){return x(je,e,{baseOptions:{modelAssetBuffer:t}})},je.createFromOptions=function(e,t){return x(je,e,t)};var Oe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!0),this.h=new La,this.embeddings={embeddings:[]},w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){var t=this.h,r=L(this.h,da,2);return r=r?r.clone():new da,e.l2Normalize!==void 0?R(r,1,Pr(e.l2Normalize)):"l2Normalize"in e&&R(r,1),e.quantize!==void 0?R(r,2,Pr(e.quantize)):"quantize"in e&&R(r,2),w(t,0,2,r),this.l(e)}za(e,t){return Ge(this,e,t),this.embeddings}Aa(e,t,r){return Ze(this,e,r,t),this.embeddings}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"embeddings_out");const t=new Te;qe(t,pc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"EMBEDDINGS:embeddings_out"),r.o(t),Ce(e,r),this.g.attachProtoListener("embeddings_out",(n,s)=>{n=sc(n),this.embeddings=function(i){return{embeddings:at(i,nc,1).map(o=>{var d,l;const c={headIndex:Fe(o,3)??0??-1,headName:he(N(o,4))??""??""};var u=o.v;return oo(u,0|u[y],la,as(o,1))!==void 0?(o=Ft(o=L(o,la,as(o,1),void 0),1,Ye,Rt()),c.floatEmbedding=o.slice()):(u=new Uint8Array(0),c.quantizedEmbedding=((l=(d=L(o,rc,as(o,2),void 0))==null?void 0:d.na())==null?void 0:l.h())??u),c}),timestampMs:Na(uo(i))}}(n),g(this,s)}),this.g.attachEmptyPacketListener("embeddings_out",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Oe.cosineSimilarity=function(e,t){if(e.floatEmbedding&&t.floatEmbedding)e=Ua(e.floatEmbedding,t.floatEmbedding);else{if(!e.quantizedEmbedding||!t.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");e=Ua(Ba(e.quantizedEmbedding),Ba(t.quantizedEmbedding))}return e},Oe.prototype.embedForVideo=Oe.prototype.Aa,Oe.prototype.embed=Oe.prototype.za,Oe.prototype.setOptions=Oe.prototype.o,Oe.createFromModelPath=function(e,t){return x(Oe,e,{baseOptions:{modelAssetPath:t}})},Oe.createFromModelBuffer=function(e,t){return x(Oe,e,{baseOptions:{modelAssetBuffer:t}})},Oe.createFromOptions=function(e,t){return x(Oe,e,t)};var ni=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};function Tc(e){var r,n;const t=function(s){return at(s,ye,1)}(e.ca()).filter(s=>(he(N(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator"));if(e.u=[],t.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");t.length===1&&(((n=(r=L(t[0],Te,7))==null?void 0:r.j())==null?void 0:n.g())??new Map).forEach((s,i)=>{e.u[Number(i)]=he(N(s,1))??""})}function y2(e){e.categoryMask=void 0,e.confidenceMasks=void 0,e.qualityScores=void 0}function v2(e){try{const t=new ni(e.confidenceMasks,e.categoryMask,e.qualityScores);if(!e.j)return t;e.j(t)}finally{kn(e)}}ni.prototype.close=ni.prototype.close;var _e=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Bs,this.A=new Pa,w(this.h,0,3,this.A),w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?R(this.h,2,Rr(e.displayNamesLocale)):"displayNamesLocale"in e&&R(this.h,2),"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}L(){Tc(this)}segment(e,t,r){const n=typeof t!="function"?t:{};return this.j=typeof t=="function"?t:r,y2(this),Ge(this,e,n),v2(this)}La(e,t,r,n){const s=typeof r!="function"?r:{};return this.j=typeof r=="function"?r:n,y2(this),Ze(this,e,s,t),v2(this)}Da(){return this.u}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect");const t=new Te;qe(t,Fa,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};_e.prototype.getLabels=_e.prototype.Da,_e.prototype.segmentForVideo=_e.prototype.La,_e.prototype.segment=_e.prototype.segment,_e.prototype.setOptions=_e.prototype.o,_e.createFromModelPath=function(e,t){return x(_e,e,{baseOptions:{modelAssetPath:t}})},_e.createFromModelBuffer=function(e,t){return x(_e,e,{baseOptions:{modelAssetBuffer:t}})},_e.createFromOptions=function(e,t){return x(_e,e,t)};var si=class{constructor(e,t,r){this.confidenceMasks=e,this.categoryMask=t,this.qualityScores=r}close(){var e,t;(e=this.confidenceMasks)==null||e.forEach(r=>{r.close()}),(t=this.categoryMask)==null||t.close()}};si.prototype.close=si.prototype.close;var Qe=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new Bs,this.u=new Pa,w(this.h,0,3,this.u),w(e=this.h,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"outputCategoryMask"in e&&(this.outputCategoryMask=e.outputCategoryMask??!1),"outputConfidenceMasks"in e&&(this.outputConfidenceMasks=e.outputConfidenceMasks??!0),super.l(e)}segment(e,t,r,n){const s=typeof r!="function"?r:{};if(this.j=typeof r=="function"?r:n,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,r=this.C+1,n=new Ca,t.keypoint&&t.scribble)throw Error("Cannot provide both keypoint and scribble.");if(t.keypoint){var i=new Us;pt(i,3,Pr(!0),!1),pt(i,1,Lr(t.keypoint.x),0),pt(i,2,Lr(t.keypoint.y),0),Mr(n,1,Vs,i)}else{if(!t.scribble)throw Error("Must provide either a keypoint or a scribble.");{const c=new mc;for(i of t.scribble)pt(t=new Us,3,Pr(!0),!1),pt(t,1,Lr(i.x),0),pt(t,2,Lr(i.y),0),hs(c,1,Us,t);Mr(n,2,Vs,c)}}this.g.addProtoToStream(n.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",r),Ge(this,e,s);e:{try{const c=new si(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=c;break e}this.j(c)}finally{kn(this)}o=void 0}return o}m(){var e=new xe;G(e,"image_in"),G(e,"roi_in"),G(e,"norm_rect_in");const t=new Te;qe(t,Fa,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),D(r,"IMAGE:image_in"),D(r,"ROI:roi_in"),D(r,"NORM_RECT:norm_rect_in"),r.o(t),Ce(e,r),An(this,e),this.outputConfidenceMasks&&(P(e,"confidence_masks"),S(r,"CONFIDENCE_MASKS:confidence_masks"),dr(this,"confidence_masks"),this.g.aa("confidence_masks",(n,s)=>{this.confidenceMasks=n.map(i=>gr(this,i,!0,!this.j)),g(this,s)}),this.g.attachEmptyPacketListener("confidence_masks",n=>{this.confidenceMasks=[],g(this,n)})),this.outputCategoryMask&&(P(e,"category_mask"),S(r,"CATEGORY_MASK:category_mask"),dr(this,"category_mask"),this.g.Z("category_mask",(n,s)=>{this.categoryMask=gr(this,n,!1,!this.j),g(this,s)}),this.g.attachEmptyPacketListener("category_mask",n=>{this.categoryMask=void 0,g(this,n)})),P(e,"quality_scores"),S(r,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",(n,s)=>{this.qualityScores=n,g(this,s)}),this.g.attachEmptyPacketListener("quality_scores",n=>{this.categoryMask=void 0,g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Qe.prototype.segment=Qe.prototype.segment,Qe.prototype.setOptions=Qe.prototype.o,Qe.createFromModelPath=function(e,t){return x(Qe,e,{baseOptions:{modelAssetPath:t}})},Qe.createFromModelBuffer=function(e,t){return x(Qe,e,{baseOptions:{modelAssetBuffer:t}})},Qe.createFromOptions=function(e,t){return x(Qe,e,t)};var Ne=class extends Le{constructor(e,t){super(new Ve(e,t),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},w(e=this.h=new Ia,0,1,t=new z)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return e.displayNamesLocale!==void 0?R(this.h,2,Rr(e.displayNamesLocale)):"displayNamesLocale"in e&&R(this.h,2),e.maxResults!==void 0?ct(this.h,3,e.maxResults):"maxResults"in e&&R(this.h,3),e.scoreThreshold!==void 0?b(this.h,4,e.scoreThreshold):"scoreThreshold"in e&&R(this.h,4),e.categoryAllowlist!==void 0?en(this.h,5,e.categoryAllowlist):"categoryAllowlist"in e&&R(this.h,5),e.categoryDenylist!==void 0?en(this.h,6,e.categoryDenylist):"categoryDenylist"in e&&R(this.h,6),this.l(e)}F(e,t){return this.j={detections:[]},Ge(this,e,t),this.j}G(e,t,r){return this.j={detections:[]},Ze(this,e,r,t),this.j}m(){var e=new xe;G(e,"input_frame_gpu"),G(e,"norm_rect"),P(e,"detections");const t=new Te;qe(t,yc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),D(r,"IMAGE:input_frame_gpu"),D(r,"NORM_RECT:norm_rect"),S(r,"DETECTIONS:detections"),r.o(t),Ce(e,r),this.g.attachProtoVectorListener("detections",(n,s)=>{for(const i of n)n=oa(i),this.j.detections.push(Da(n));g(this,s)}),this.g.attachEmptyPacketListener("detections",n=>{g(this,n)}),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Ne.prototype.detectForVideo=Ne.prototype.G,Ne.prototype.detect=Ne.prototype.F,Ne.prototype.setOptions=Ne.prototype.o,Ne.createFromModelPath=async function(e,t){return x(Ne,e,{baseOptions:{modelAssetPath:t}})},Ne.createFromModelBuffer=function(e,t){return x(Ne,e,{baseOptions:{modelAssetBuffer:t}})},Ne.createFromOptions=function(e,t){return x(Ne,e,t)};var ii=class{constructor(e,t,r){this.landmarks=e,this.worldLandmarks=t,this.segmentationMasks=r}close(){var e;(e=this.segmentationMasks)==null||e.forEach(t=>{t.close()})}};function _2(e){e.landmarks=[],e.worldLandmarks=[],e.segmentationMasks=void 0}function b2(e){try{const t=new ii(e.landmarks,e.worldLandmarks,e.segmentationMasks);if(!e.u)return t;e.u(t)}finally{kn(e)}}ii.prototype.close=ii.prototype.close;var Re=class extends Le{constructor(e,t){super(new Ve(e,t),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,w(e=this.h=new ja,0,1,t=new z),this.A=new Sa,w(this.h,0,3,this.A),this.j=new ka,w(this.h,0,2,this.j),ct(this.j,4,1),b(this.j,2,.5),b(this.A,2,.5),b(this.h,4,.5)}get baseOptions(){return L(this.h,z,1)}set baseOptions(e){w(this.h,0,1,e)}o(e){return"numPoses"in e&&ct(this.j,4,e.numPoses??1),"minPoseDetectionConfidence"in e&&b(this.j,2,e.minPoseDetectionConfidence??.5),"minTrackingConfidence"in e&&b(this.h,4,e.minTrackingConfidence??.5),"minPosePresenceConfidence"in e&&b(this.A,2,e.minPosePresenceConfidence??.5),"outputSegmentationMasks"in e&&(this.outputSegmentationMasks=e.outputSegmentationMasks??!1),this.l(e)}F(e,t,r){const n=typeof t!="function"?t:{};return this.u=typeof t=="function"?t:r,_2(this),Ge(this,e,n),b2(this)}G(e,t,r,n){const s=typeof r!="function"?r:{};return this.u=typeof r=="function"?r:n,_2(this),Ze(this,e,s,t),b2(this)}m(){var e=new xe;G(e,"image_in"),G(e,"norm_rect"),P(e,"normalized_landmarks"),P(e,"world_landmarks"),P(e,"segmentation_masks");const t=new Te;qe(t,vc,this.h);const r=new ye;ke(r,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),D(r,"IMAGE:image_in"),D(r,"NORM_RECT:norm_rect"),S(r,"NORM_LANDMARKS:normalized_landmarks"),S(r,"WORLD_LANDMARKS:world_landmarks"),r.o(t),Ce(e,r),An(this,e),this.g.attachProtoVectorListener("normalized_landmarks",(n,s)=>{this.landmarks=[];for(const i of n)n=Nr(i),this.landmarks.push(wn(n));g(this,s)}),this.g.attachEmptyPacketListener("normalized_landmarks",n=>{this.landmarks=[],g(this,n)}),this.g.attachProtoVectorListener("world_landmarks",(n,s)=>{this.worldLandmarks=[];for(const i of n)n=hr(i),this.worldLandmarks.push(Dr(n));g(this,s)}),this.g.attachEmptyPacketListener("world_landmarks",n=>{this.worldLandmarks=[],g(this,n)}),this.outputSegmentationMasks&&(S(r,"SEGMENTATION_MASK:segmentation_masks"),dr(this,"segmentation_masks"),this.g.aa("segmentation_masks",(n,s)=>{this.segmentationMasks=n.map(i=>gr(this,i,!0,!this.u)),g(this,s)}),this.g.attachEmptyPacketListener("segmentation_masks",n=>{this.segmentationMasks=[],g(this,n)})),e=e.g(),this.setGraph(new Uint8Array(e),!0)}};Re.prototype.detectForVideo=Re.prototype.G,Re.prototype.detect=Re.prototype.F,Re.prototype.setOptions=Re.prototype.o,Re.createFromModelPath=function(e,t){return x(Re,e,{baseOptions:{modelAssetPath:t}})},Re.createFromModelBuffer=function(e,t){return x(Re,e,{baseOptions:{modelAssetBuffer:t}})},Re.createFromOptions=function(e,t){return x(Re,e,t)},Re.POSE_CONNECTIONS=p2;const xc=["Smile","Blink","Turn_Head","Thumbs_Up"],Lc=({apiUrl:e,onComplete:t,onError:r,duration:n})=>{var nt;const i=n||60,o=Q.useRef(null),c=Q.useRef(),u=Q.useRef(null),[d,l]=Q.useState({face:null,hand:null}),[f,m]=Q.useState("loading"),[A,j]=Q.useState(""),[ht,et]=Q.useState([]),[fe,K]=Q.useState(0),[tt,xn]=Q.useState(i),[ft,Ur]=Q.useState(!1);Q.useEffect(()=>{(async()=>{try{const Y=await Dt.forVisionTasks("https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.3/wasm"),U=await W.createFromOptions(Y,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",delegate:"GPU"},outputFaceBlendshapes:!0,runningMode:"VIDEO"}),ge=await ve.createFromOptions(Y,{baseOptions:{modelAssetPath:"https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task",delegate:"GPU"},runningMode:"VIDEO",numHands:1});l({face:U,hand:ge}),Ln(),m("ready")}catch{j("Failed to load security assets. Please check your connection."),m("error")}})()},[]),Q.useEffect(()=>(f==="capturing"&&tt>0?u.current=setInterval(()=>xn(H=>H-1),1e3):tt===0&&f==="capturing"&&(m("expired"),clearInterval(u.current)),()=>clearInterval(u.current)),[f,tt]);const Ln=()=>{et([...xc].sort(()=>.5-Math.random()).slice(0,3))},ai=()=>{m("capturing")},Pn=()=>{K(0),xn(i),Ur(!1),j(""),Ln(),m("ready")},ci=(H,Y,U)=>{var ge,We;if(ft)return!1;if(U==="Thumbs_Up"&&((ge=Y==null?void 0:Y.landmarks)==null?void 0:ge.length)>0){const M=Y.landmarks[0];return M[4].y<M[2].y&&[8,12,16,20].every(X=>M[X].y>M[X-2].y)}if(((We=H==null?void 0:H.faceLandmarks)==null?void 0:We.length)>0){const M=H.faceLandmarks[0];switch(U){case"Smile":return M[291].x-M[61].x>.175;case"Blink":return(Math.abs(M[159].y-M[145].y)+Math.abs(M[386].y-M[374].y))/2<.01;case"Turn_Head":const He=(M[1].x-M[33].x)/(M[263].x-M[33].x);return He<.2||He>.8;default:return!1}}return!1},Vr=Q.useCallback(async()=>{var H,Y;if(f==="capturing"&&((Y=(H=o.current)==null?void 0:H.video)==null?void 0:Y.readyState)===4){const U=o.current.video,ge=performance.now(),We=d.face.detectForVideo(U,ge),M=d.hand.detectForVideo(U,ge);if(ci(We,M,ht[fe])){fe<2?(Ur(!0),setTimeout(()=>{K(X=>X+1),Ur(!1)},800)):On();return}}c.current=requestAnimationFrame(Vr)},[f,fe,d,ht,ft]);Q.useEffect(()=>(f==="capturing"&&(c.current=requestAnimationFrame(Vr)),()=>cancelAnimationFrame(c.current)),[f,Vr]);const On=async()=>{var H;clearInterval(u.current),m("verifying");try{const Y=o.current.video,U=[];for(let X=0;X<5;X++){const He=performance.now(),wt=d.face.detectForVideo(Y,He);if((H=wt.faceLandmarks)!=null&&H[0]){const Bt=rt(Y,wt.faceLandmarks[0]);U.push(Bt.toDataURL("image/jpeg",.95))}await new Promise(Bt=>setTimeout(Bt,60))}const ge=new FormData;for(let X=0;X<U.length;X++){const He=await(await fetch(U[X])).blob();ge.append("files",He,`frame_${X}.jpg`)}const M=await(await fetch(`${e}/v1/verify`,{method:"POST",body:ge})).json();if(M.is_live)m("success"),setTimeout(()=>t({success:!0,image:U[U.length-1],skinConfidence:M.skin_confidence}),2e3);else{const X=M.reason||"The system detected potential spoofing. Please ensure good lighting and try again.";j(X),setTimeout(()=>r({success:!1,reason:X,skinConfidence:null}),2e3),m("error")}}catch(Y){const U="Unable to reach verification server. Please check your connection and try again.";j(U),console.log(Y),setTimeout(()=>r({success:!1,reason:U,skinConfidence:null}),2e3),m("error")}},rt=(H,Y)=>{const U=document.createElement("canvas"),ge=U.getContext("2d"),We=Y.map(At=>At.x*H.videoWidth),M=Y.map(At=>At.y*H.videoHeight),X=Math.min(...We),He=Math.max(...We),wt=Math.min(...M),Bt=Math.max(...M),Rn=He-X,Gr=Bt-wt,Et=Rn*.25;return U.width=224,U.height=224,ge.drawImage(H,X-Et,wt-Et,Rn+Et*2,Gr+Et*2,0,0,224,224),U};return f==="loading"?F.jsx("div",{style:w2,children:"Initializing Security Assets..."}):F.jsxs("div",{style:w2,children:[f==="success"&&F.jsxs("div",{style:{padding:"40px 20px"},children:[F.jsx("div",{style:{fontSize:"50px",marginBottom:"20px"},children:"✅"}),F.jsx("h2",{style:{color:"#4CAF50"},children:"Verification Complete"}),F.jsx("p",{children:"Identity confirmed."})]}),(f==="expired"||f==="error")&&F.jsx("div",{style:oi,children:F.jsxs("div",{style:Fc,children:[F.jsx("div",{style:{fontSize:"40px"},children:f==="expired"?"⏰":"❌"}),F.jsx("h3",{style:{margin:"10px 0"},children:f==="expired"?"Time Expired":"Verification Failed"}),F.jsx("p",{style:{color:"#ccc",fontSize:"14px"},children:A||"The process was interrupted or timed out."}),F.jsx("button",{onClick:Pn,style:E2,children:"Try Again"})]})}),["ready","capturing","verifying"].includes(f)&&F.jsxs(F.Fragment,{children:[F.jsxs("div",{style:Pc,children:[F.jsxs("h2",{style:{margin:0,fontSize:"1.2rem"},children:[f==="ready"&&"Identity Verification",f==="verifying"&&"Analyzing...",f==="capturing"&&F.jsx("span",{style:{color:ft?"#4CAF50":"white"},children:ft?"Great!":`${(nt=ht[fe])==null?void 0:nt.replace("_"," ")}`})]}),f==="capturing"&&F.jsxs("div",{style:{...Oc,color:tt<=10?"#ff4d4d":"white"},children:[tt,"s"]})]}),F.jsxs("div",{style:Rc,children:[F.jsx(D2,{ref:o,mirrored:!0,screenshotFormat:"image/jpeg",style:{width:"100%",borderRadius:"12px",border:f==="capturing"?"2px solid #007bff":"2px solid #333",opacity:f==="ready"?.5:1,transition:"all 0.4s ease"}}),f==="ready"&&F.jsxs("div",{style:oi,children:[F.jsx("button",{onClick:ai,style:E2,children:"Start Challenge"}),F.jsxs("p",{style:{marginTop:"12px",fontSize:"13px",color:"#aaa"},children:["3 steps • ",n," seconds"]})]}),f==="verifying"&&F.jsx("div",{style:oi,children:F.jsx("p",{style:{marginTop:"15px",fontWeight:"bold"},children:"Securing Session..."})})]}),F.jsx("div",{style:{marginTop:"15px",minHeight:"20px"},children:F.jsxs("p",{style:{color:ft?"#4CAF50":"#888",margin:0,fontSize:"14px"},children:[f==="capturing"&&!ft&&"Please perform the action above.",ft&&"Step verified! Get ready..."]})})]})]})},w2={textAlign:"center",color:"white",background:"#121212",padding:"24px",borderRadius:"20px",width:"100%",maxWidth:"450px",margin:"0 auto",boxShadow:"0 10px 30px rgba(0,0,0,0.5)"},Pc={display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px",minHeight:"40px"},Oc={fontSize:"18px",fontWeight:"800",background:"rgba(255,255,255,0.1)",padding:"4px 12px",borderRadius:"20px"},Rc={position:"relative",overflow:"hidden",borderRadius:"12px"},oi={position:"absolute",top:0,left:0,right:0,bottom:0,background:"rgba(0,0,0,0.75)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",zIndex:10,borderRadius:"12px"},Fc={background:"#1e1e1e",padding:"30px",borderRadius:"15px",border:"1px solid #333",maxWidth:"80%",textAlign:"center"},E2={padding:"12px 30px",fontSize:"16px",fontWeight:"bold",background:"#007bff",border:"none",color:"white",borderRadius:"10px",cursor:"pointer",transition:"transform 0.2s"},Mc=async(e,t,r)=>{const n=new FormData;t.forEach((i,o)=>{n.append("files",i,`frame_${o}.jpg`)}),n.append("challenge",r);const s=await fetch(`${e}/v1/verify`,{method:"POST",body:n});if(!s.ok)throw new Error("Network response was not ok");return await s.json()};st.LivenessSDK=Lc,st.verifyLiveness=Mc,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
|
|
44
|
+
<%s key={someKey} {...props} />`,di,Ut,$c,Ut),I2[Ut+di]=!0}}return a===n?zc(ee):Kc(ee),ee}}function Yc(a,l,p){return C2(a,l,p,!0)}function Xc(a,l,p){return C2(a,l,p,!1)}var qc=Xc,Jc=Yc;Vr.Fragment=n,Vr.jsx=qc,Vr.jsxs=Jc}()),Vr}process.env.NODE_ENV==="production"?ni.exports=kc():ni.exports=Sc();var Be=ni.exports;const Tc=({apiUrl:e,duration:t,onComplete:r,onError:n,classNames:s={},render:i})=>{var c;const o=y2({apiUrl:e,duration:t,onComplete:r,onError:n});return i?i(o):Be.jsxs("div",{className:s.container,children:[o.status==="loading"&&Be.jsx("div",{children:"Initializing..."}),["ready","capturing","verifying"].includes(o.status)&&Be.jsxs(Be.Fragment,{children:[Be.jsx(N2,{ref:o.webcamRef,mirrored:!0,screenshotFormat:"image/jpeg",className:s.webcam}),o.status==="capturing"&&Be.jsx("div",{className:"liveness-challenge",children:o.isStepTransitioning?"Step verified! Get ready for the next...":`Do this: ${(c=o.sequence[o.currentStep])==null?void 0:c.replace("_"," ")}`}),["capturing","ready"].includes(o.status)&&Be.jsxs("div",{className:s.timer,children:[o.timeLeft,"s"]}),o.status==="ready"&&Be.jsx("button",{onClick:o.start,className:s.button,children:"Start Challenge"}),o.status==="verifying"&&Be.jsx("div",{children:"Analyzing..."})]}),o.status==="error"&&Be.jsxs("div",{className:s.error,children:[o.errorMsg,Be.jsx("button",{onClick:o.reset,className:s.button,children:"Retry"})]}),o.status==="success"&&Be.jsx("div",{className:s.success,children:"Verification Complete"})]})},Lc=async(e,t,r)=>{const n=new FormData;t.forEach((i,o)=>{n.append("files",i,`frame_${o}.jpg`)}),n.append("challenge",r);const s=await fetch(`${e}/v1/verify`,{method:"POST",body:n});if(!s.ok)throw new Error("Network response was not ok");return await s.json()};Ye.LivenessSDK=Tc,Ye.useLiveness=y2,Ye.verifyLiveness=Lc,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"})});
|