16 lines
123 KiB
JavaScript
16 lines
123 KiB
JavaScript
var he=typeof self<"u"?self:{};function li(t,e){t:{for(var n=["CLOSURE_FLAGS"],r=he,s=0;s<n.length;s++)if((r=r[n[s]])==null){n=null;break t}n=r}return(t=n&&n[t])!=null?t:e}function Ht(){throw Error("Invalid UTF8")}function cs(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let Ze,Un;const p2=typeof TextDecoder<"u";let g2;const m2=typeof TextEncoder<"u";function fi(t){if(m2)t=(g2||(g2=new TextEncoder)).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let s=0;s<t.length;s++){var e=t.charCodeAt(s);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&s<t.length){const i=t.charCodeAt(++s);if(i>=56320&&i<=57343){e=1024*(e-55296)+i-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}s--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}function di(t){he.setTimeout((()=>{throw t}),0)}var qn,y2=li(610401301,!1),hs=li(748402147,!0);function us(){var t=he.navigator;return t&&(t=t.userAgent)?t:""}const ls=he.navigator;function pn(t){return pn[" "](t),t}qn=ls&&ls.userAgentData||null,pn[" "]=function(){};const pi={};let Re=null;function _2(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);const r=new Uint8Array(n);let s=0;return(function(i,o){function a(u){for(;c<i.length;){const h=i.charAt(c++),f=Re[h];if(f!=null)return f;if(!/^[\s\xa0]*$/.test(h))throw Error("Unknown base64 encoding at char: "+h)}return u}gi();let c=0;for(;;){const u=a(-1),h=a(0),f=a(64),_=a(64);if(_===64&&u===-1)break;o(u<<2|h>>4),f!=64&&(o(h<<4&240|f>>2),_!=64&&o(f<<6&192|_))}})(t,(function(i){r[s++]=i})),s!==n?r.subarray(0,s):r}function gi(){if(!Re){Re={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));pi[n]=r;for(let s=0;s<r.length;s++){const i=r[s];Re[i]===void 0&&(Re[i]=s)}}}}var v2=typeof Uint8Array<"u",mi=!(!(y2&&qn&&qn.brands.length>0)&&(us().indexOf("Trident")!=-1||us().indexOf("MSIE")!=-1))&&typeof btoa=="function";const fs=/[-_.]/g,w2={"-":"+",_:"/",".":"="};function A2(t){return w2[t]||""}function yi(t){if(!mi)return _2(t);t=fs.test(t)?t.replace(fs,A2):t,t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function fr(t){return v2&&t!=null&&t instanceof Uint8Array}var ue={};function Jt(){return b2||(b2=new Et(null,ue))}function dr(t){_i(ue);var e=t.g;return(e=e==null||fr(e)?e:typeof e=="string"?yi(e):null)==null?e:t.g=e}var Et=class{h(){return new Uint8Array(dr(this)||0)}constructor(t,e){if(_i(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}};let b2,E2;function _i(t){if(t!==ue)throw Error("illegal external caller")}function vi(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function Yn(t){return vi(t=Error(t),"warning"),t}function le(t,e){if(t!=null){var n=E2??(E2={}),r=n[t]||0;r>=e||(n[t]=r+1,vi(t=Error(),"incident"),di(t))}}function we(){return typeof BigInt=="function"}var Ae=typeof Symbol=="function"&&typeof Symbol()=="symbol";function St(t,e,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var k2=St("jas",void 0,!0),ds=St(void 0,"0di"),xe=St(void 0,"1oa"),rt=St(void 0,Symbol()),S2=St(void 0,"0ub"),T2=St(void 0,"0ubs"),$n=St(void 0,"0ubsb"),L2=St(void 0,"0actk"),fe=St("m_m","Pa",!0),ps=St();const wi={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Ai=Object.defineProperties,d=Ae?k2:"Ga";var te;const gs=[];function We(t,e){Ae||d in t||Ai(t,wi),t[d]|=e}function V(t,e){Ae||d in t||Ai(t,wi),t[d]=e}function Ke(t){return We(t,34),t}function Ge(t){return We(t,8192),t}V(gs,7),te=Object.freeze(gs);var de={};function it(t,e){return e===void 0?t.h!==Zt&&!!(2&(0|t.v[d])):!!(2&e)&&t.h!==Zt}const Zt={};function pr(t,e){if(t!=null){if(typeof t=="string")t=t?new Et(t,ue):Jt();else if(t.constructor!==Et)if(fr(t))t=t.length?new Et(new Uint8Array(t),ue):Jt();else{if(!e)throw Error();t=void 0}}return t}class ms{constructor(e,n,r){this.g=e,this.h=n,this.l=r}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}var F2=Object.freeze({});function bi(t,e,n){const r=128&e?0:-1,s=t.length;var i;(i=!!s)&&(i=(i=t[s-1])!=null&&typeof i=="object"&&i.constructor===Object);const o=s+(i?-1:0);for(e=128&e?1:0;e<o;e++)n(e-r,t[e]);if(i){t=t[s-1];for(const a in t)!isNaN(a)&&n(+a,t[a])}}var Ei={};function be(t){return 128&t?Ei:void 0}function gn(t){return t.Na=!0,t}var P2=gn((t=>typeof t=="number")),ys=gn((t=>typeof t=="string")),M2=gn((t=>typeof t=="boolean")),mn=typeof he.BigInt=="function"&&typeof he.BigInt(0)=="bigint";function st(t){var e=t;if(ys(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(P2(e)&&!Number.isSafeInteger(e))throw Error(String(e));return mn?BigInt(t):t=M2(t)?t?"1":"0":ys(t)?t.trim()||"0":String(t)}var Jn=gn((t=>mn?t>=I2&&t<=N2:t[0]==="-"?_s(t,O2):_s(t,x2)));const O2=Number.MIN_SAFE_INTEGER.toString(),I2=mn?BigInt(Number.MIN_SAFE_INTEGER):void 0,x2=Number.MAX_SAFE_INTEGER.toString(),N2=mn?BigInt(Number.MAX_SAFE_INTEGER):void 0;function _s(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],s=e[n];if(r>s)return!1;if(r<s)return!0}}const R2=typeof Uint8Array.prototype.slice=="function";let C2,P=0,C=0;function vs(t){const e=t>>>0;P=e,C=(t-e)/4294967296>>>0}function pe(t){if(t<0){vs(-t);const[e,n]=yr(P,C);P=e>>>0,C=n>>>0}else vs(t)}function gr(t){const e=C2||(C2=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),C=0,P=e.getUint32(0,!0)}function ki(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:je(t,e)}function B2(t,e){return st(we()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):je(t,e))}function Si(t,e){return we()?st(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):st(mr(t,e))}function je(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else we()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+ws(n)+ws(t));return n}function ws(t){return t=String(t),"0000000".slice(t.length)+t}function mr(t,e){if(2147483648&e)if(we())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=yr(t,e);t="-"+je(n,r)}else t=je(t,e);return t}function yn(t){if(t.length<16)pe(Number(t));else if(we())t=BigInt(t),P=Number(t&BigInt(4294967295))>>>0,C=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");C=P=0;const n=t.length;for(let r=e,s=(n-e)%6+e;s<=n;r=s,s+=6){const i=Number(t.slice(r,s));C*=1e6,P=1e6*P+i,P>=4294967296&&(C+=Math.trunc(P/4294967296),C>>>=0,P>>>=0)}if(e){const[r,s]=yr(P,C);P=r,C=s}}}function yr(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function mt(t){return Array.prototype.slice.call(t)}const ze=typeof BigInt=="function"?BigInt.asIntN:void 0,D2=typeof BigInt=="function"?BigInt.asUintN:void 0,Qt=Number.isSafeInteger,_n=Number.isFinite,ge=Math.trunc,U2=st(0);function Ce(t){if(t!=null&&typeof t!="number")throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function bt(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function Ve(t){if(t!=null&&typeof t!="boolean"){var e=typeof t;throw Error(`Expected boolean but got ${e!="object"?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}function Ti(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const G2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function Xe(t){switch(typeof t){case"bigint":return!0;case"number":return _n(t);case"string":return G2.test(t);default:return!1}}function Ee(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return _n(t)?0|t:void 0}function Li(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return _n(t)?t>>>0:void 0}function Fi(t){const e=t.length;return(t[0]==="-"?e<20||e===20&&t<="-9223372036854775808":e<19||e===19&&t<="9223372036854775807")?t:(yn(t),mr(P,C))}function _r(t){if(t=ge(t),!Qt(t)){pe(t);var e=P,n=C;(t=2147483648&n)&&(n=~n>>>0,(e=1+~e>>>0)==0&&(n=n+1>>>0)),t=typeof(e=ki(e,n))=="number"?t?-e:e:t?"-"+e:e}return t}function Pi(t){var e=ge(Number(t));return Qt(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Fi(t))}function Mi(t){var e=ge(Number(t));return Qt(e)?st(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),we()?st(ze(64,BigInt(t))):st(Fi(t)))}function Oi(t){return Qt(t)?t=st(_r(t)):(t=ge(t),Qt(t)?t=String(t):(pe(t),t=mr(P,C)),t=st(t)),t}function an(t){const e=typeof t;return t==null?t:e==="bigint"?st(ze(64,t)):Xe(t)?e==="string"?Mi(t):Oi(t):void 0}function Ii(t){if(typeof t!="string")throw Error();return t}function qe(t){if(t!=null&&typeof t!="string")throw Error();return t}function z(t){return t==null||typeof t=="string"?t:void 0}function vr(t,e,n,r){return t!=null&&t[fe]===de?t:Array.isArray(t)?((r=(n=0|t[d])|32&r|2&r)!==n&&V(t,r),new e(t)):(n?2&r?((t=e[ds])||(Ke((t=new e).v),t=e[ds]=t),e=t):e=new e:e=void 0,e)}function j2(t,e,n){if(e)t:{if(!Xe(e=t))throw Yn("int64");switch(typeof e){case"string":e=Mi(e);break t;case"bigint":e=st(ze(64,e));break t;default:e=Oi(e)}}else e=an(t);return(t=e)==null?n?U2:void 0:t}const V2={};let H2=(function(){try{return pn(new class extends Map{constructor(){super()}}),!1}catch{return!0}})();class Gn{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,n){return this.g.set(e,n),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,n){return this.g.forEach(e,n)}[Symbol.iterator](){return this.entries()}}const W2=H2?(Object.setPrototypeOf(Gn.prototype,Map.prototype),Object.defineProperties(Gn.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),Gn):class extends Map{constructor(){super()}};function As(t){return t}function jn(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var Ot=class extends W2{constructor(t,e,n=As,r=As){super(),this.J=0|t[d],this.K=e,this.S=n,this.fa=this.K?K2:r;for(let s=0;s<t.length;s++){const i=t[s],o=n(i[0],!1,!0);let a=i[1];e?a===void 0&&(a=null):a=r(i[1],!1,!0,void 0,void 0,this.J),super.set(o,a)}}V(t){return Ge(Array.from(super.entries(),t))}clear(){jn(this),super.clear()}delete(t){return jn(this),super.delete(this.S(t,!0,!1))}entries(){if(this.K){var t=super.keys();t=new ms(t,z2,this)}else t=super.entries();return t}values(){if(this.K){var t=super.keys();t=new ms(t,Ot.prototype.get,this)}else t=super.values();return t}forEach(t,e){this.K?super.forEach(((n,r,s)=>{t.call(e,s.get(r),r,s)})):super.forEach(t,e)}set(t,e){return jn(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.fa(e,!0,!0,this.K,!1,this.J))}Ma(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.K?t===void 0?null:t:this.fa(t,!1,!0,void 0,!1,this.J),super.set(e,t)}has(t){return super.has(this.S(t,!1,!1))}get(t){t=this.S(t,!1,!1);const e=super.get(t);if(e!==void 0){var n=this.K;return n?((n=this.fa(e,!1,!0,n,this.ra,this.J))!==e&&super.set(t,n),n):e}}[Symbol.iterator](){return this.entries()}};function K2(t,e,n,r,s,i){return t=vr(t,r,n,i),s&&(t=Ar(t)),t}function z2(t){return[t,this.get(t)]}let X2;function bs(){return X2||(X2=new Ot(Ke([]),void 0,void 0,void 0,V2))}function vn(t){return rt?t[rt]:void 0}function cn(t,e){for(const n in t)!isNaN(n)&&e(t,+n,t[n])}Ot.prototype.toJSON=void 0;var Zn=class{};const q2={Ka:!0};function Y2(t,e){e<100||le(T2,1)}function wn(t,e,n,r){const s=r!==void 0;r=!!r;var i,o=rt;!s&&Ae&&o&&(i=t[o])&&cn(i,Y2),o=[];var a=t.length;let c;i=4294967295;let u=!1;const h=!!(64&e),f=h?128&e?0:-1:void 0;1&e||(c=a&&t[a-1],c!=null&&typeof c=="object"&&c.constructor===Object?i=--a:c=void 0,!h||128&e||s||(u=!0,i=i-f+f)),e=void 0;for(var _=0;_<a;_++){let b=t[_];if(b!=null&&(b=n(b,r))!=null)if(h&&_>=i){const H=_-f;(e??(e={}))[H]=b}else o[_]=b}if(c)for(let b in c){if((a=c[b])==null||(a=n(a,r))==null)continue;let H;_=+b,h&&!Number.isNaN(_)&&(H=_+f)<i?o[H]=a:(e??(e={}))[b]=a}return e&&(u?o.push(e):o[i]=e),s&&rt&&(t=vn(t))&&t instanceof Zn&&(o[rt]=(function(b){const H=new Zn;return cn(b,((Bn,re,Ie)=>{H[re]=mt(Ie)})),H.da=b.da,H})(t)),o}function $2(t){return t[0]=He(t[0]),t[1]=He(t[1]),t}function He(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return Jn(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[d];return t.length===0&&1&e?void 0:wn(t,e,He)}if(t!=null&&t[fe]===de)return xi(t);if(t instanceof Et){if((e=t.g)==null)t="";else if(typeof e=="string")t=e;else{if(mi){for(var n="",r=0,s=e.length-10240;r<s;)n+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));n+=String.fromCharCode.apply(null,r?e.subarray(r):e),e=btoa(n)}else{n===void 0&&(n=0),gi(),n=pi[n],r=Array(Math.floor(e.length/3)),s=n[64]||"";let u=0,h=0;for(;u<e.length-2;u+=3){var i=e[u],o=e[u+1],a=e[u+2],c=n[i>>2];i=n[(3&i)<<4|o>>4],o=n[(15&o)<<2|a>>6],a=n[63&a],r[h++]=c+i+o+a}switch(c=0,a=s,e.length-u){case 2:a=n[(15&(c=e[u+1]))<<2]||s;case 1:e=e[u],r[h]=n[e>>2]+n[(3&e)<<4|c>>4]+a+s}e=r.join("")}t=t.g=e}return t}return t instanceof Ot?t=t.size!==0?t.V($2):void 0:void 0}return t}let J2,Z2;function xi(t){return wn(t=t.v,0|t[d],He)}function zt(t,e){return Ni(t,e[0],e[1])}function Ni(t,e,n,r=0){if(t==null){var s=32;n?(t=[n],s|=128):t=[],e&&(s=-16760833&s|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(s=0|t[d],hs&&1&s)throw Error("rfarr");if(2048&s&&!(2&s)&&(function(){if(hs)throw Error("carr");le(L2,5)})(),256&s)throw Error("farr");if(64&s)return(s|r)!==s&&V(t,s|r),t;if(n&&(s|=128,n!==t[0]))throw Error("mid");t:{s|=64;var i=(n=t).length;if(i){var o=i-1;const c=n[o];if(c!=null&&typeof c=="object"&&c.constructor===Object){if((o-=e=128&s?0:-1)>=1024)throw Error("pvtlmt");for(var a in c)(i=+a)<o&&(n[i+e]=c[a],delete c[a]);s=-16760833&s|(1023&o)<<14;break t}}if(e){if((a=Math.max(e,i-(128&s?0:-1)))>1024)throw Error("spvt");s=-16760833&s|(1023&a)<<14}}}return V(t,64|s|r),t}function Q2(t,e){if(typeof t!="object")return t;if(Array.isArray(t)){var n=0|t[d];return t.length===0&&1&n?void 0:Es(t,n,e)}if(t!=null&&t[fe]===de)return ks(t);if(t instanceof Ot){if(2&(e=t.J))return t;if(!t.size)return;if(n=Ke(t.V()),t.K)for(t=0;t<n.length;t++){const r=n[t];let s=r[1];s=s==null||typeof s!="object"?void 0:s!=null&&s[fe]===de?ks(s):Array.isArray(s)?Es(s,0|s[d],!!(32&e)):void 0,r[1]=s}return n}return t instanceof Et?t:void 0}function Es(t,e,n){return 2&e||(!n||4096&e||16&e?t=ke(t,e,!1,n&&!(16&e)):(We(t,34),4&e&&Object.freeze(t))),t}function wr(t,e,n){return t=new t.constructor(e),n&&(t.h=Zt),t.m=Zt,t}function ks(t){const e=t.v,n=0|e[d];return it(t,n)?t:br(t,e,n)?wr(t,e):ke(e,n)}function ke(t,e,n,r){return r??(r=!!(34&e)),t=wn(t,e,Q2,r),r=32,n&&(r|=2),V(t,e=16769217&e|r),t}function Ar(t){const e=t.v,n=0|e[d];return it(t,n)?br(t,e,n)?wr(t,e,!0):new t.constructor(ke(e,n,!1)):t}function Se(t){if(t.h!==Zt)return!1;var e=t.v;return We(e=ke(e,0|e[d]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function Te(t){if(!Se(t)&&it(t,0|t.v[d]))throw Error()}function ee(t,e){e===void 0&&(e=0|t[d]),32&e&&!(4096&e)&&V(t,4096|e)}function br(t,e,n){return!!(2&n)||!(!(32&n)||4096&n)&&(V(e,2|n),t.h=Zt,!0)}const Ri=st(0),Rt={};function M(t,e,n,r,s){if((e=It(t.v,e,n,s))!==null||r&&t.m!==Zt)return e}function It(t,e,n,r){if(e===-1)return null;const s=e+(n?0:-1),i=t.length-1;let o,a;if(!(i<1+(n?0:-1))){if(s>=i)if(o=t[i],o!=null&&typeof o=="object"&&o.constructor===Object)n=o[e],a=!0;else{if(s!==i)return;n=o}else n=t[s];if(r&&n!=null){if((r=r(n))==null)return r;if(!Object.is(r,n))return a?o[e]=r:t[s]=r,r}return n}}function k(t,e,n,r){Te(t),G(t=t.v,0|t[d],e,n,r)}function G(t,e,n,r,s){const i=n+(s?0:-1);var o=t.length-1;if(o>=1+(s?0:-1)&&i>=o){const a=t[o];if(a!=null&&typeof a=="object"&&a.constructor===Object)return a[n]=r,e}return i<=o?(t[i]=r,e):(r!==void 0&&(n>=(o=(e??(e=0|t[d]))>>14&1023||536870912)?r!=null&&(t[o+(s?0:-1)]={[n]:r}):t[i]=r),e)}function Wt(){return F2===void 0?2:4}function Kt(t,e,n,r,s){let i=t.v,o=0|i[d];r=it(t,o)?1:r,s=!!s||r===3,r===2&&Se(t)&&(i=t.v,o=0|i[d]);let a=(t=Er(i,e))===te?7:0|t[d],c=kr(a,o);var u=!(4&c);if(u){4&c&&(t=mt(t),a=0,c=qt(c,o),o=G(i,o,e,t));let h=0,f=0;for(;h<t.length;h++){const _=n(t[h]);_!=null&&(t[f++]=_)}f<h&&(t.length=f),n=-513&(4|c),c=n&=-1025,c&=-4097}return c!==a&&(V(t,c),2&c&&Object.freeze(t)),Ci(t,c,i,o,e,r,u,s)}function Ci(t,e,n,r,s,i,o,a){let c=e;return i===1||i===4&&(2&e||!(16&e)&&32&r)?Xt(e)||((e|=!t.length||o&&!(4096&e)||32&r&&!(4096&e||16&e)?2:256)!==c&&V(t,e),Object.freeze(t)):(i===2&&Xt(e)&&(t=mt(t),c=0,e=qt(e,r),r=G(n,r,s,t)),Xt(e)||(a||(e|=16),e!==c&&V(t,e))),2&e||!(4096&e||16&e)||ee(n,r),t}function Er(t,e,n){return t=It(t,e,n),Array.isArray(t)?t:te}function kr(t,e){return 2&e&&(t|=2),1|t}function Xt(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Bi(t){return pr(t,!0)}function Di(t){t=mt(t);for(let e=0;e<t.length;e++){const n=t[e]=mt(t[e]);Array.isArray(n[1])&&(n[1]=Ke(n[1]))}return Ge(t)}function Bt(t,e,n,r){Te(t),G(t=t.v,0|t[d],e,(r==="0"?Number(n)===0:n===r)?void 0:n)}function Le(t,e,n){if(2&e)throw Error();const r=be(e);let s=Er(t,n,r),i=s===te?7:0|s[d],o=kr(i,e);return(2&o||Xt(o)||16&o)&&(o===i||Xt(o)||V(s,o),s=mt(s),i=0,o=qt(o,e),G(t,e,n,s,r)),o&=-13,o!==i&&V(s,o),s}function Vn(t,e){var n=Mo;return Tr(Sr(t=t.v),t,void 0,n)===e?e:-1}function Sr(t){if(Ae)return t[xe]??(t[xe]=new Map);if(xe in t)return t[xe];const e=new Map;return Object.defineProperty(t,xe,{value:e}),e}function Ui(t,e,n,r,s){const i=Sr(t),o=Tr(i,t,e,n,s);return o!==r&&(o&&(e=G(t,e,o,void 0,s)),i.set(n,r)),e}function Tr(t,e,n,r,s){let i=t.get(r);if(i!=null)return i;i=0;for(let o=0;o<r.length;o++){const a=r[o];It(e,a,s)!=null&&(i!==0&&(n=G(e,n,i,void 0,s)),i=a)}return t.set(r,i),i}function Lr(t,e,n){let r=0|t[d];const s=be(r),i=It(t,n,s);let o;if(i!=null&&i[fe]===de){if(!it(i))return Se(i),i.v;o=i.v}else Array.isArray(i)&&(o=i);if(o){const a=0|o[d];2&a&&(o=ke(o,a))}return o=zt(o,e),o!==i&&G(t,r,n,o,s),o}function Gi(t,e,n,r,s){let i=!1;if((r=It(t,r,s,(o=>{const a=vr(o,n,!1,e);return i=a!==o&&a!=null,a})))!=null)return i&&!it(r)&&ee(t,e),r}function A(t,e,n,r){let s=t.v,i=0|s[d];if((e=Gi(s,i,e,n,r))==null)return e;if(i=0|s[d],!it(t,i)){const o=Ar(e);o!==e&&(Se(t)&&(s=t.v,i=0|s[d]),i=G(s,i,n,e=o,r),ee(s,i))}return e}function ji(t,e,n,r,s,i,o,a){var c=it(t,n);i=c?1:i,o=!!o||i===3,c=a&&!c,(i===2||c)&&Se(t)&&(n=0|(e=t.v)[d]);var u=(t=Er(e,s))===te?7:0|t[d],h=kr(u,n);if(a=!(4&h)){var f=t,_=n;const b=!!(2&h);b&&(_|=2);let H=!b,Bn=!0,re=0,Ie=0;for(;re<f.length;re++){const Dn=vr(f[re],r,!1,_);if(Dn instanceof r){if(!b){const as=it(Dn);H&&(H=!as),Bn&&(Bn=as)}f[Ie++]=Dn}}Ie<re&&(f.length=Ie),h|=4,h=Bn?-4097&h:4096|h,h=H?8|h:-9&h}if(h!==u&&(V(t,h),2&h&&Object.freeze(t)),c&&!(8&h||!t.length&&(i===1||i===4&&(2&h||!(16&h)&&32&n)))){for(Xt(h)&&(t=mt(t),h=qt(h,n),n=G(e,n,s,t)),r=t,c=h,u=0;u<r.length;u++)(f=r[u])!==(h=Ar(f))&&(r[u]=h);c|=8,V(t,h=c=r.length?4096|c:-4097&c)}return Ci(t,h,e,n,s,i,a,o)}function xt(t,e,n){const r=t.v;return ji(t,r,0|r[d],e,n,Wt(),!1,!0)}function Vi(t){return t==null&&(t=void 0),t}function y(t,e,n,r,s){return k(t,n,r=Vi(r),s),r&&!it(r)&&ee(t.v),t}function Be(t,e,n,r){t:{var s=r=Vi(r);Te(t);const i=t.v;let o=0|i[d];if(s==null){const a=Sr(i);if(Tr(a,i,o,n)!==e)break t;a.set(n,0)}else o=Ui(i,o,n,e);G(i,o,e,s)}r&&!it(r)&&ee(t.v)}function qt(t,e){return-273&(2&e?2|t:-3&t)}function Fr(t,e,n,r){var s=r;Te(t),t=ji(t,r=t.v,0|r[d],n,e,2,!0),s=s??new n,t.push(s),e=n=t===te?7:0|t[d],(s=it(s))?(n&=-9,t.length===1&&(n&=-4097)):n|=4096,n!==e&&V(t,n),s||ee(r)}function dt(t,e,n){return Ee(M(t,e,void 0,n))}function R(t,e){return M(t,e,void 0,void 0,bt)??0}function Nt(t,e,n){if(n!=null){if(typeof n!="number"||!_n(n))throw Yn("int32");n|=0}k(t,e,n)}function m(t,e,n){k(t,e,Ce(n))}function ot(t,e,n){Bt(t,e,qe(n),"")}function hn(t,e,n){{Te(t);const o=t.v;let a=0|o[d];if(n==null)G(o,a,e);else{var r=t=n===te?7:0|n[d],s=Xt(t),i=s||Object.isFrozen(n);for(s||(t=0),i||(n=mt(n),r=0,t=qt(t,a),i=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??1024,s=0;s<n.length;s++){const c=n[s],u=Ii(c);Object.is(c,u)||(i&&(n=mt(n),r=0,t=qt(t,a),i=!1),n[s]=u)}t!==r&&(i&&(n=mt(n),t=qt(t,a)),V(n,t)),G(o,a,e,n)}}}function An(t,e,n){Te(t),Kt(t,e,z,2,!0).push(Ii(n))}var se=class{constructor(t,e,n){if(this.buffer=t,n&&!e)throw Error();this.g=e}};function Pr(t,e){if(typeof t=="string")return new se(yi(t),e);if(Array.isArray(t))return new se(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new se(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new se(t,!1);if(t.constructor===Et)return e=dr(t)||new Uint8Array(0),new se(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new se(t,!1);throw Error()}function Mr(t,e){let n,r=0,s=0,i=0;const o=t.h;let a=t.g;do n=o[a++],r|=(127&n)<<i,i+=7;while(i<32&&128&n);if(i>32)for(s|=(127&n)>>4,i=3;i<32&&128&n;i+=7)n=o[a++],s|=(127&n)<<i;if(Yt(t,a),!(128&n))return e(r>>>0,s>>>0);throw Error()}function Or(t){let e=0,n=t.g;const r=n+10,s=t.h;for(;n<r;){const i=s[n++];if(e|=i,(128&i)==0)return Yt(t,n),!!(127&e)}throw Error()}function Gt(t){const e=t.h;let n=t.g,r=e[n++],s=127&r;if(128&r&&(r=e[n++],s|=(127&r)<<7,128&r&&(r=e[n++],s|=(127&r)<<14,128&r&&(r=e[n++],s|=(127&r)<<21,128&r&&(r=e[n++],s|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Error();return Yt(t,n),s}function kt(t){return Gt(t)>>>0}function un(t){var e=t.h;const n=t.g;var r=e[n],s=e[n+1];const i=e[n+2];return e=e[n+3],Yt(t,t.g+4),t=2*((s=(r<<0|s<<8|i<<16|e<<24)>>>0)>>31)+1,r=s>>>23&255,s&=8388607,r==255?s?NaN:t*(1/0):r==0?1401298464324817e-60*t*s:t*Math.pow(2,r-150)*(s+8388608)}function ta(t){return Gt(t)}function Yt(t,e){if(t.g=e,e>t.l)throw Error()}function Hi(t,e){if(e<0)throw Error();const n=t.g;if((e=n+e)>t.l)throw Error();return t.g=e,n}function Wi(t,e){if(e==0)return Jt();var n=Hi(t,e);return t.Y&&t.j?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):R2?t.slice(n,e):new Uint8Array(t.subarray(n,e))),n.length==0?Jt():new Et(n,ue)}var Ss=[];function Ki(t,e,n,r){if(ln.length){const s=ln.pop();return s.o(r),s.g.init(t,e,n,r),s}return new ea(t,e,n,r)}function zi(t){t.g.clear(),t.l=-1,t.h=-1,ln.length<100&&ln.push(t)}function Xi(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var n=kt(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5)||e<1)throw Error();return t.l=e,t.h=n,!0}function sn(t){switch(t.h){case 0:t.h!=0?sn(t):Or(t.g);break;case 1:Yt(t=t.g,t.g+8);break;case 2:if(t.h!=2)sn(t);else{var e=kt(t.g);Yt(t=t.g,t.g+e)}break;case 5:Yt(t=t.g,t.g+4);break;case 3:for(e=t.l;;){if(!Xi(t))throw Error();if(t.h==4){if(t.l!=e)throw Error();break}sn(t)}break;default:throw Error()}}function Ye(t,e,n){const r=t.g.l;var s=kt(t.g);let i=(s=t.g.g+s)-r;if(i<=0&&(t.g.l=s,n(e,t,void 0,void 0,void 0),i=s-t.g.g),i)throw Error();return t.g.g=s,t.g.l=r,e}function Ir(t){var e=kt(t.g),n=Hi(t=t.g,e);if(t=t.h,p2){var r,s=t;(r=Un)||(r=Un=new TextDecoder("utf-8",{fatal:!0})),e=n+e,s=n===0&&e===s.length?s:s.subarray(n,e);try{var i=r.decode(s)}catch(a){if(Ze===void 0){try{r.decode(new Uint8Array([128]))}catch{}try{r.decode(new Uint8Array([97])),Ze=!0}catch{Ze=!1}}throw!Ze&&(Un=void 0),a}}else{e=(i=n)+e,n=[];let a,c=null;for(;i<e;){var o=t[i++];o<128?n.push(o):o<224?i>=e?Ht():(a=t[i++],o<194||(192&a)!=128?(i--,Ht()):n.push((31&o)<<6|63&a)):o<240?i>=e-1?Ht():(a=t[i++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(r=t[i++]))!=128?(i--,Ht()):n.push((15&o)<<12|(63&a)<<6|63&r)):o<=244?i>=e-2?Ht():(a=t[i++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(r=t[i++]))!=128||(192&(s=t[i++]))!=128?(i--,Ht()):(o=(7&o)<<18|(63&a)<<12|(63&r)<<6|63&s,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):Ht(),n.length>=8192&&(c=cs(c,n),n.length=0)}i=cs(c,n)}return i}function qi(t){const e=kt(t.g);return Wi(t.g,e)}function bn(t,e,n){var r=kt(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var ea=class{constructor(t,e,n,r){if(Ss.length){const s=Ss.pop();s.init(t,e,n,r),t=s}else t=new class{constructor(s,i,o,a){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(s,i,o,a)}init(s,i,o,{Y:a=!1,ea:c=!1}={}){this.Y=a,this.ea=c,s&&(s=Pr(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}}(t,e,n,r);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.o(r)}o({ha:t=!1}={}){this.ha=t}},ln=[];function Ts(t){return t?/^\d+$/.test(t)?(yn(t),new Qn(P,C)):null:na||(na=new Qn(0,0))}var Qn=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let na;function Ls(t){return t?/^-?\d+$/.test(t)?(yn(t),new tr(P,C)):null:ra||(ra=new tr(0,0))}var tr=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let ra;function ae(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Fe(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function En(t,e){if(e>=0)Fe(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function xr(t){var e=P;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function me(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function pt(t,e,n){Fe(t.g,8*e+n)}function Nr(t,e){return pt(t,e,2),e=t.g.end(),me(t,e),e.push(t.h),e}function Rr(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function kn(t,e,n){pt(t,e,2),Fe(t.g,n.length),me(t,t.g.end()),me(t,n)}function fn(t,e,n,r){n!=null&&(e=Nr(t,e),r(n,t),Rr(t,e))}function Tt(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var Cr=Tt(),Yi=Tt(),Br=Tt(),Dr=Tt(),Ur=Tt(),$i=Tt(),sa=Tt(),Sn=Tt(),Ji=Tt(),Zi=Tt();function Lt(t,e,n){var r=t.v;rt&&rt in r&&(r=r[rt])&&delete r[e.g],e.h?e.j(t,e.h,e.g,n,e.l):e.j(t,e.g,n,e.l)}var p=class{constructor(t,e){this.v=Ni(t,e,void 0,2048)}toJSON(){return xi(this)}j(){var s;var t=Ua,e=this.v,n=t.g,r=rt;if(Ae&&r&&((s=e[r])==null?void 0:s[n])!=null&&le(S2,3),e=t.g,ps&&rt&&ps===void 0&&(r=(n=this.v)[rt])&&(r=r.da))try{r(n,e,q2)}catch(i){di(i)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){const t=this.v,e=0|t[d];return br(this,t,e)?wr(this,t,!0):new this.constructor(ke(t,e,!1))}};p.prototype[fe]=de,p.prototype.toString=function(){return this.v.toString()};var Pe=class{constructor(t,e,n){this.g=t,this.h=e,t=Cr,this.l=!!t&&n===t||!1}};function Tn(t,e){return new Pe(t,e,Cr)}function Qi(t,e,n,r,s){fn(t,n,ro(e,r),s)}const ia=Tn((function(t,e,n,r,s){return t.h===2&&(Ye(t,Lr(e,r,n),s),!0)}),Qi),oa=Tn((function(t,e,n,r,s){return t.h===2&&(Ye(t,Lr(e,r,n),s),!0)}),Qi);var Ln=Symbol(),Fn=Symbol(),er=Symbol(),Fs=Symbol(),Ps=Symbol();let to,eo;function ne(t,e,n,r){var s=r[t];if(s)return s;(s={}).qa=r,s.T=(function(f){switch(typeof f){case"boolean":return J2||(J2=[0,void 0,!0]);case"number":return f>0?void 0:f===0?Z2||(Z2=[0,void 0]):[-f,void 0];case"string":return[0,f];case"object":return f}})(r[0]);var i=r[1];let o=1;i&&i.constructor===Object&&(s.ba=i,typeof(i=r[++o])=="function"&&(s.ma=!0,to??(to=i),eo??(eo=r[o+1]),i=r[o+=2]));const a={};for(;i&&Array.isArray(i)&&i.length&&typeof i[0]=="number"&&i[0]>0;){for(var c=0;c<i.length;c++)a[i[c]]=i;i=r[++o]}for(c=1;i!==void 0;){let f;typeof i=="number"&&(c+=i,i=r[++o]);var u=void 0;if(i instanceof Pe?f=i:(f=ia,o--),f==null?void 0:f.l){i=r[++o],u=r;var h=o;typeof i=="function"&&(i=i(),u[h]=i),u=i}for(h=c+1,typeof(i=r[++o])=="number"&&i<0&&(h-=i,i=r[++o]);c<h;c++){const _=a[c];u?n(s,c,f,u,_):e(s,c,f,_)}}return r[t]=s}function no(t){return Array.isArray(t)?t[0]instanceof Pe?t:[oa,t]:[t,void 0]}function ro(t,e){return t instanceof p?t.v:Array.isArray(t)?zt(t,e):void 0}function Gr(t,e,n,r){const s=n.g;t[e]=r?(i,o,a)=>s(i,o,a,r):s}function jr(t,e,n,r,s){const i=n.g;let o,a;t[e]=(c,u,h)=>i(c,u,h,a||(a=ne(Fn,Gr,jr,r).T),o||(o=Vr(r)),s)}function Vr(t){let e=t[er];if(e!=null)return e;const n=ne(Fn,Gr,jr,t);return e=n.ma?(r,s)=>to(r,s,n):(r,s)=>{for(;Xi(s)&&s.h!=4;){var i=s.l,o=n[i];if(o==null){var a=n.ba;a&&(a=a[i])&&(a=ca(a))!=null&&(o=n[i]=a)}if(o==null||!o(s,r,i)){if(o=(a=s).m,sn(a),a.ha)var c=void 0;else c=a.g.g-o,a.g.g=o,c=Wi(a.g,c);o=void 0,a=r,c&&((o=a[rt]??(a[rt]=new Zn))[i]??(o[i]=[])).push(c)}}return(r=vn(r))&&(r.da=n.qa[Ps]),!0},t[er]=e,t[Ps]=aa.bind(t),e}function aa(t,e,n,r){var s=this[Fn];const i=this[er],o=zt(void 0,s.T),a=vn(t);if(a){var c=!1,u=s.ba;if(u){if(s=(h,f,_)=>{if(_.length!==0)if(u[f])for(const b of _){h=Ki(b);try{c=!0,i(o,h)}finally{zi(h)}}else r==null||r(t,f,_)},e==null)cn(a,s);else if(a!=null){const h=a[e];h&&s(a,e,h)}if(c){let h=0|t[d];if(2&h&&2048&h&&!(n!=null&&n.Ka))throw Error();const f=be(h),_=(b,H)=>{if(It(t,b,f)!=null){if((n==null?void 0:n.Qa)===1)return;throw Error()}H!=null&&(h=G(t,h,b,H,f)),delete a[b]};e==null?bi(o,0|o[d],((b,H)=>{_(b,H)})):_(e,It(o,e,f))}}}}function ca(t){const e=(t=no(t))[0].g;if(t=t[1]){const n=Vr(t),r=ne(Fn,Gr,jr,t).T;return(s,i,o)=>e(s,i,o,r,n)}return e}function Pn(t,e,n){t[e]=n.h}function Mn(t,e,n,r){let s,i;const o=n.h;t[e]=(a,c,u)=>o(a,c,u,i||(i=ne(Ln,Pn,Mn,r).T),s||(s=so(r)))}function so(t){let e=t[Fs];if(!e){const n=ne(Ln,Pn,Mn,t);e=(r,s)=>io(r,s,n),t[Fs]=e}return e}function io(t,e,n){bi(t,0|t[d],((r,s)=>{if(s!=null){var i=(function(o,a){var c=o[a];if(c)return c;if((c=o.ba)&&(c=c[a])){var u=(c=no(c))[0].h;if(c=c[1]){const h=so(c),f=ne(Ln,Pn,Mn,c).T;c=o.ma?eo(f,h):(_,b,H)=>u(_,b,H,f,h)}else c=u;return o[a]=c}})(n,r);i?i(e,s,r):r<500||le($n,3)}})),(t=vn(t))&&cn(t,((r,s,i)=>{for(me(e,e.g.end()),r=0;r<i.length;r++)me(e,dr(i[r])||new Uint8Array(0))}))}const ha=st(0);function Me(t,e){if(Array.isArray(e)){var n=0|e[d];if(4&n)return e;for(var r=0,s=0;r<e.length;r++){const i=t(e[r]);i!=null&&(e[s++]=i)}return s<r&&(e.length=s),(t=-1537&(5|n))!==n&&V(e,t),2&t&&Object.freeze(e),e}}function Y(t,e,n){return new Pe(t,e,n)}function Oe(t,e,n){return new Pe(t,e,n)}function $(t,e,n){G(t,0|t[d],e,n,be(0|t[d]))}var ua=Tn((function(t,e,n,r,s){if(t.h!==2)return!1;if(t=mt(t=Ye(t,zt([void 0,void 0],r),s)),s=be(r=0|e[d]),2&r)throw Error();let i=It(e,n,s);if(i instanceof Ot)(2&i.J)!=0?(i=i.V(),i.push(t),G(e,r,n,i,s)):i.Ma(t);else if(Array.isArray(i)){var o=0|i[d];8192&o||V(i,o|=8192),2&o&&(i=Di(i),G(e,r,n,i,s)),i.push(t)}else G(e,r,n,Ge([t]),s);return!0}),(function(t,e,n,r,s){if(e instanceof Ot)e.forEach(((i,o)=>{fn(t,n,zt([o,i],r),s)}));else if(Array.isArray(e)){for(let i=0;i<e.length;i++){const o=e[i];Array.isArray(o)&&fn(t,n,zt(o,r),s)}Ge(e)}}));function oo(t,e,n){(e=bt(e))!=null&&(pt(t,n,5),t=t.g,gr(e),xr(t))}function ao(t,e,n){if(e=(function(r){if(r==null)return r;const s=typeof r;if(s==="bigint")return String(ze(64,r));if(Xe(r)){if(s==="string")return Pi(r);if(s==="number")return _r(r)}})(e),e!=null&&(typeof e=="string"&&Ls(e),e!=null))switch(pt(t,n,0),typeof e){case"number":t=t.g,pe(e),ae(t,P,C);break;case"bigint":n=BigInt.asUintN(64,e),n=new tr(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),ae(t.g,n.h,n.g);break;default:n=Ls(e),ae(t.g,n.h,n.g)}}function co(t,e,n){(e=Ee(e))!=null&&e!=null&&(pt(t,n,0),En(t.g,e))}function ho(t,e,n){(e=Ti(e))!=null&&(pt(t,n,0),t.g.g.push(e?1:0))}function uo(t,e,n){(e=z(e))!=null&&kn(t,n,fi(e))}function lo(t,e,n,r,s){fn(t,n,ro(e,r),s)}function fo(t,e,n){(e=e==null||typeof e=="string"||e instanceof Et?e:void 0)!=null&&kn(t,n,Pr(e,!0).buffer)}function po(t,e,n){(e=Li(e))!=null&&e!=null&&(pt(t,n,0),Fe(t.g,e))}function go(t,e,n){return(t.h===5||t.h===2)&&(e=Le(e,0|e[d],n),t.h==2?bn(t,un,e):e.push(un(t.g)),!0)}var B=Y((function(t,e,n){return t.h===5&&($(e,n,un(t.g)),!0)}),oo,Sn),la=Oe(go,(function(t,e,n){if((e=Me(bt,e))!=null)for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];i!=null&&(pt(r,s,5),r=r.g,gr(i),xr(r))}}),Sn),Hr=Oe(go,(function(t,e,n){if((e=Me(bt,e))!=null&&e.length){pt(t,n,2),Fe(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,gr(e[r]),xr(n)}}),Sn),fa=Y((function(t,e,n){return t.h===5&&($(e,n,(t=un(t.g))===0?void 0:t),!0)}),oo,Sn),jt=Y((function(t,e,n){return t.h!==0?t=!1:($(e,n,Mr(t.g,Si)),t=!0),t}),ao,$i),Hn=Y((function(t,e,n){return t.h!==0?e=!1:($(e,n,(t=Mr(t.g,Si))===ha?void 0:t),e=!0),e}),ao,$i),da=Y((function(t,e,n){return t.h!==0?t=!1:($(e,n,Mr(t.g,B2)),t=!0),t}),(function(t,e,n){if(e=(function(r){if(r==null)return r;var s=typeof r;if(s==="bigint")return String(D2(64,r));if(Xe(r)){if(s==="string")return s=ge(Number(r)),Qt(s)&&s>=0?r=String(s):((s=r.indexOf("."))!==-1&&(r=r.substring(0,s)),(s=r[0]!=="-"&&((s=r.length)<20||s===20&&r<="18446744073709551615"))||(yn(r),r=je(P,C))),r;if(s==="number")return(r=ge(r))>=0&&Qt(r)||(pe(r),r=ki(P,C)),r}})(e),e!=null&&(typeof e=="string"&&Ts(e),e!=null))switch(pt(t,n,0),typeof e){case"number":t=t.g,pe(e),ae(t,P,C);break;case"bigint":n=BigInt.asUintN(64,e),n=new Qn(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),ae(t.g,n.h,n.g);break;default:n=Ts(e),ae(t.g,n.h,n.g)}}),sa),U=Y((function(t,e,n){return t.h===0&&($(e,n,Gt(t.g)),!0)}),co,Dr),$e=Oe((function(t,e,n){return(t.h===0||t.h===2)&&(e=Le(e,0|e[d],n),t.h==2?bn(t,Gt,e):e.push(Gt(t.g)),!0)}),(function(t,e,n){if((e=Me(Ee,e))!=null&&e.length){n=Nr(t,n);for(let r=0;r<e.length;r++)En(t.g,e[r]);Rr(t,n)}}),Dr),oe=Y((function(t,e,n){return t.h===0&&($(e,n,(t=Gt(t.g))===0?void 0:t),!0)}),co,Dr),O=Y((function(t,e,n){return t.h===0&&($(e,n,Or(t.g)),!0)}),ho,Yi),$t=Y((function(t,e,n){return t.h===0&&($(e,n,(t=Or(t.g))===!1?void 0:t),!0)}),ho,Yi),X=Oe((function(t,e,n){return t.h===2&&(t=Ir(t),Le(e,0|e[d],n).push(t),!0)}),(function(t,e,n){if((e=Me(z,e))!=null)for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];i!=null&&kn(r,s,fi(i))}}),Br),Dt=Y((function(t,e,n){return t.h===2&&($(e,n,(t=Ir(t))===""?void 0:t),!0)}),uo,Br),S=Y((function(t,e,n){return t.h===2&&($(e,n,Ir(t)),!0)}),uo,Br),K=(function(t,e,n=Cr){return new Pe(t,e,n)})((function(t,e,n,r,s){return t.h===2&&(r=zt(void 0,r),Le(e,0|e[d],n).push(r),Ye(t,r,s),!0)}),(function(t,e,n,r,s){if(Array.isArray(e)){for(let i=0;i<e.length;i++)lo(t,e[i],n,r,s);1&(t=0|e[d])||V(e,1|t)}})),L=Tn((function(t,e,n,r,s,i){if(t.h!==2)return!1;let o=0|e[d];return Ui(e,o,i,n,be(o)),Ye(t,e=Lr(e,r,n),s),!0}),lo),mo=Y((function(t,e,n){return t.h===2&&($(e,n,qi(t)),!0)}),fo,Ji),pa=Oe((function(t,e,n){return(t.h===0||t.h===2)&&(e=Le(e,0|e[d],n),t.h==2?bn(t,kt,e):e.push(kt(t.g)),!0)}),(function(t,e,n){if((e=Me(Li,e))!=null)for(let o=0;o<e.length;o++){var r=t,s=n,i=e[o];i!=null&&(pt(r,s,0),Fe(r.g,i))}}),Ur),ga=Y((function(t,e,n){return t.h===0&&($(e,n,(t=kt(t.g))===0?void 0:t),!0)}),po,Ur),q=Y((function(t,e,n){return t.h===0&&($(e,n,Gt(t.g)),!0)}),(function(t,e,n){(e=Ee(e))!=null&&(e=parseInt(e,10),pt(t,n,0),En(t.g,e))}),Zi);class ma{constructor(e,n){var r=ct;this.g=e,this.h=n,this.m=A,this.j=y,this.defaultValue=void 0,this.l=r.Oa!=null?Ei:void 0}register(){pn(this)}}function Ft(t,e){return new ma(t,e)}function Vt(t,e){return(n,r)=>{{const i={ea:!0};r&&Object.assign(i,r),n=Ki(n,void 0,void 0,i);try{const o=new t,a=o.v;Vr(e)(a,n);var s=o}finally{zi(n)}}return s}}function On(t){return function(){const e=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}}}};io(this.v,e,ne(Ln,Pn,Mn,t)),me(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,s=r.length;let i=0;for(let o=0;o<s;o++){const a=r[o];n.set(a,i),i+=a.length}return e.l=[n],n}}var Ms=class extends p{constructor(t){super(t)}},Os=[0,Dt,Y((function(t,e,n){return t.h===2&&($(e,n,(t=qi(t))===Jt()?void 0:t),!0)}),(function(t,e,n){if(e!=null){if(e instanceof p){const r=e.Ra;return void(r?(e=r(e),e!=null&&kn(t,n,Pr(e,!0).buffer)):le($n,3))}if(Array.isArray(e))return void le($n,3)}fo(t,e,n)}),Ji)];let Wn,Is=globalThis.trustedTypes;function xs(t){var e;return Wn===void 0&&(Wn=(function(){let n=null;if(!Is)return n;try{const r=s=>s;n=Is.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch{}return n})()),t=(e=Wn)?e.createScriptURL(t):t,new class{constructor(n){this.g=n}toString(){return this.g+""}}(t)}function Qe(t,...e){if(e.length===0)return xs(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return xs(n)}var yo=[0,U,q,O,-1,$e,q,-1,O],ya=class extends p{constructor(t){super(t)}},_o=[0,O,S,O,q,-1,Oe((function(t,e,n){return(t.h===0||t.h===2)&&(e=Le(e,0|e[d],n),t.h==2?bn(t,ta,e):e.push(Gt(t.g)),!0)}),(function(t,e,n){if((e=Me(Ee,e))!=null&&e.length){n=Nr(t,n);for(let r=0;r<e.length;r++)En(t.g,e[r]);Rr(t,n)}}),Zi),S,-1,[0,O,-1],q,O,-1],vo=[0,3,O,-1,2,[0,[2],U,L,[0,Y((function(t,e,n){return t.h===0&&($(e,n,kt(t.g)),!0)}),po,Ur)]],[0,q,O,q,O,q,O,S,-1],[0,[3,4],S,-1,L,[0,U],L,[0,q]],[0]],wo=[0,S,-2],Ns=class extends p{constructor(t){super(t)}},Ao=[0],bo=[0,U,O,1,O,-4],ct=class extends p{constructor(t){super(t,2)}},j={};j[336783863]=[0,S,O,-1,U,[0,[1,2,3,4,5,6,7,8,9],L,Ao,L,_o,L,wo,L,bo,L,yo,L,[0,S,-2],L,[0,S,q],L,vo,L,[0,q,-1,O]],[0,S],O,[0,[1,3],[2,4],L,[0,$e],-1,L,[0,X],-1,K,[0,S,-1]],S];var Rs=[0,Hn,-1,$t,-3,Hn,$e,Dt,oe,Hn,-1,$t,oe,$t,-2,Dt];function F(t,e){An(t,3,e)}function v(t,e){An(t,4,e)}var Z=class extends p{constructor(t){super(t,500)}o(t){return y(this,0,7,t)}},De=[-1,{}],Cs=[0,S,1,De],Bs=[0,S,X,De];function gt(t,e){Fr(t,1,Z,e)}function I(t,e){An(t,10,e)}function E(t,e){An(t,15,e)}var ht=class extends p{constructor(t){super(t,500)}o(t){return y(this,0,1001,t)}},Eo=[-500,K,[-500,Dt,-1,X,-3,[-2,j,O],K,Os,oe,-1,Cs,Bs,K,[0,Dt,$t],Dt,Rs,oe,X,987,X],4,K,[-500,S,-1,[-1,{}],998,S],K,[-500,S,X,-1,[-2,{},O],997,X,-1],oe,K,[-500,S,X,De,998,X],X,oe,Cs,Bs,K,[0,Dt,-1,De],X,-2,Rs,Dt,-1,$t,[0,$t,ga],978,De,K,Os];ht.prototype.g=On(Eo);var _a=Vt(ht,Eo),va=class extends p{constructor(t){super(t)}},ko=class extends p{constructor(t){super(t)}g(){return xt(this,va,1)}},So=[0,K,[0,U,B,S,-1]],In=Vt(ko,So),wa=class extends p{constructor(t){super(t)}},Aa=class extends p{constructor(t){super(t)}},Kn=class extends p{constructor(t){super(t)}l(){return A(this,wa,2)}g(){return xt(this,Aa,5)}},To=Vt(class extends p{constructor(t){super(t)}},[0,X,$e,Hr,[0,q,[0,U,-3],[0,B,-3],[0,U,-1,[0,K,[0,U,-2]]],K,[0,B,-1,S,B]],S,-1,jt,K,[0,U,B],X,jt]),Lo=class extends p{constructor(t){super(t)}},ce=Vt(class extends p{constructor(t){super(t)}},[0,K,[0,B,-4]]),Fo=class extends p{constructor(t){super(t)}},Je=Vt(class extends p{constructor(t){super(t)}},[0,K,[0,B,-4]]),ba=class extends p{constructor(t){super(t)}},Ea=[0,U,-1,Hr,q],Po=class extends p{constructor(t){super(t)}};Po.prototype.g=On([0,B,-4,jt]);var ka=class extends p{constructor(t){super(t)}},Sa=Vt(class extends p{constructor(t){super(t)}},[0,K,[0,1,U,S,So],jt]),Ds=class extends p{constructor(t){super(t)}},Ta=class extends p{constructor(t){super(t)}na(){const t=M(this,1,void 0,void 0,Bi);return t??Jt()}},La=class extends p{constructor(t){super(t)}},Mo=[1,2],Fa=Vt(class extends p{constructor(t){super(t)}},[0,K,[0,Mo,L,[0,Hr],L,[0,mo],U,S],jt]),Wr=class extends p{constructor(t){super(t)}},Oo=[0,S,U,B,X,-1],Us=class extends p{constructor(t){super(t)}},Pa=[0,O,-1],Gs=class extends p{constructor(t){super(t)}},on=[1,2,3,4,5,6],dn=class extends p{constructor(t){super(t)}g(){return M(this,1,void 0,void 0,Bi)!=null}l(){return z(M(this,2))!=null}},N=class extends p{constructor(t){super(t)}g(){return Ti(M(this,2))??!1}},Io=[0,mo,S,[0,U,jt,-1],[0,da,jt]],D=[0,Io,O,[0,on,L,bo,L,_o,L,yo,L,Ao,L,wo,L,vo],q],xn=class extends p{constructor(t){super(t)}},Kr=[0,D,B,-1,U],Ma=Ft(502141897,xn);j[502141897]=Kr;var Oa=Vt(class extends p{constructor(t){super(t)}},[0,[0,q,-1,la,pa],Ea]),xo=class extends p{constructor(t){super(t)}},No=class extends p{constructor(t){super(t)}},nr=[0,D,B,[0,D],O],Ia=Ft(508968150,No);j[508968150]=[0,D,Kr,nr,B,[0,[0,Io]]],j[508968149]=nr;var ie=class extends p{constructor(t){super(t)}l(){return A(this,Wr,2)}g(){k(this,2)}},Ro=[0,D,Oo];j[478825465]=Ro;var xa=class extends p{constructor(t){super(t)}},Co=class extends p{constructor(t){super(t)}},zr=class extends p{constructor(t){super(t)}},Xr=class extends p{constructor(t){super(t)}},Bo=class extends p{constructor(t){super(t)}},js=[0,D,[0,D],Ro,-1],Do=[0,D,B,U],qr=[0,D,B],Uo=[0,D,Do,qr,B],Na=Ft(479097054,Bo);j[479097054]=[0,D,Uo,js],j[463370452]=js,j[464864288]=Do;var Ra=Ft(462713202,Xr);j[462713202]=Uo,j[474472470]=qr;var Ca=class extends p{constructor(t){super(t)}},Go=class extends p{constructor(t){super(t)}},jo=class extends p{constructor(t){super(t)}},Vo=class extends p{constructor(t){super(t)}},Yr=[0,D,B,-1,U],rr=[0,D,B,O];Vo.prototype.g=On([0,D,qr,[0,D],Kr,nr,Yr,rr]);var Ho=class extends p{constructor(t){super(t)}},Ba=Ft(456383383,Ho);j[456383383]=[0,D,Oo];var Wo=class extends p{constructor(t){super(t)}},Da=Ft(476348187,Wo);j[476348187]=[0,D,Pa];var Ko=class extends p{constructor(t){super(t)}},Vs=class extends p{constructor(t){super(t)}},zo=[0,q,-1],Ua=Ft(458105876,class extends p{constructor(t){super(t)}g(){let t;var e=this.v;const n=0|e[d];return t=it(this,n),e=(function(r,s,i,o){var a=Vs;!o&&Se(r)&&(i=0|(s=r.v)[d]);var c=It(s,2);if(r=!1,c==null){if(o)return bs();c=[]}else if(c.constructor===Ot){if(!(2&c.J)||o)return c;c=c.V()}else Array.isArray(c)?r=!!(2&(0|c[d])):c=[];if(o){if(!c.length)return bs();r||(r=!0,Ke(c))}else r&&(r=!1,Ge(c),c=Di(c));return!r&&32&i&&We(c,32),i=G(s,i,2,o=new Ot(c,a,j2,void 0)),r||ee(s,i),o})(this,e,n,t),!t&&Vs&&(e.ra=!0),e}});j[458105876]=[0,zo,ua,[!0,jt,[0,S,-1,X]],[0,$e,O,q]];var $r=class extends p{constructor(t){super(t)}},Xo=Ft(458105758,$r);j[458105758]=[0,D,S,zo];var zn=class extends p{constructor(t){super(t)}},Hs=[0,fa,-1,$t],Ga=class extends p{constructor(t){super(t)}},qo=class extends p{constructor(t){super(t)}},sr=[1,2];qo.prototype.g=On([0,sr,L,Hs,L,[0,K,Hs]]);var Yo=class extends p{constructor(t){super(t)}},ja=Ft(443442058,Yo);j[443442058]=[0,D,S,U,B,X,-1,O,B],j[514774813]=Yr;var $o=class extends p{constructor(t){super(t)}},Va=Ft(516587230,$o);function ir(t,e){return e=e?e.clone():new Wr,t.displayNamesLocale!==void 0?k(e,1,qe(t.displayNamesLocale)):t.displayNamesLocale===void 0&&k(e,1),t.maxResults!==void 0?Nt(e,2,t.maxResults):"maxResults"in t&&k(e,2),t.scoreThreshold!==void 0?m(e,3,t.scoreThreshold):"scoreThreshold"in t&&k(e,3),t.categoryAllowlist!==void 0?hn(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&k(e,4),t.categoryDenylist!==void 0?hn(e,5,t.categoryDenylist):"categoryDenylist"in t&&k(e,5),e}function Jo(t){const e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function Jr(t,e=-1,n=""){return{categories:t.map((r=>({index:dt(r,1)??0??-1,score:R(r,2)??0,categoryName:z(M(r,3))??""??"",displayName:z(M(r,4))??""??""}))),headIndex:e,headName:n}}function Ha(t){const e={classifications:xt(t,ka,1).map((n=>{var r;return Jr(((r=A(n,ko,4))==null?void 0:r.g())??[],dt(n,2)??0,z(M(n,3))??"")}))};return(function(n){return n==null?n:typeof n=="bigint"?(Jn(n)?n=Number(n):(n=ze(64,n),n=Jn(n)?Number(n):String(n)),n):Xe(n)?typeof n=="number"?_r(n):Pi(n):void 0})(M(t,2,void 0,void 0,an))!=null&&(e.timestampMs=Jo(M(t,2,void 0,void 0,an)??Ri)),e}function Zo(t){var o,a;var e=Kt(t,3,bt,Wt()),n=Kt(t,2,Ee,Wt()),r=Kt(t,1,z,Wt()),s=Kt(t,9,z,Wt());const i={categories:[],keypoints:[]};for(let c=0;c<e.length;c++)i.categories.push({score:e[c],index:n[c]??-1,categoryName:r[c]??"",displayName:s[c]??""});if((e=(o=A(t,Kn,4))==null?void 0:o.l())&&(i.boundingBox={originX:dt(e,1,Rt)??0,originY:dt(e,2,Rt)??0,width:dt(e,3,Rt)??0,height:dt(e,4,Rt)??0,angle:0}),(a=A(t,Kn,4))==null?void 0:a.g().length)for(const c of A(t,Kn,4).g())i.keypoints.push({x:M(c,1,void 0,Rt,bt)??0,y:M(c,2,void 0,Rt,bt)??0,score:M(c,4,void 0,Rt,bt)??0,label:z(M(c,3,void 0,Rt))??""});return i}function Nn(t){const e=[];for(const n of xt(t,Fo,1))e.push({x:R(n,1)??0,y:R(n,2)??0,z:R(n,3)??0,visibility:R(n,4)??0});return e}function Ue(t){const e=[];for(const n of xt(t,Lo,1))e.push({x:R(n,1)??0,y:R(n,2)??0,z:R(n,3)??0,visibility:R(n,4)??0});return e}function Ws(t){return Array.from(t,(e=>e>127?e-256:e))}function Ks(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,s=0;for(let i=0;i<t.length;i++)n+=t[i]*e[i],r+=t[i]*t[i],s+=e[i]*e[i];if(r<=0||s<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*s)}let tn;j[516587230]=[0,D,Yr,rr,B],j[518928384]=rr;const Wa=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 Qo(t){if(t)return!0;if(tn===void 0)try{await WebAssembly.instantiate(Wa),tn=!0}catch{tn=!1}return tn}async function en(t,e,n){return{wasmLoaderPath:`${e}/${t}_${n=`wasm${n?"_module":""}${await Qo(n)?"":"_nosimd"}_internal`}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Ne=class{};function t2(){var t=navigator;return typeof OffscreenCanvas<"u"&&(!(function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")})(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function zs(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((n,r)=>{e.addEventListener("load",(()=>{n()}),!1),e.addEventListener("error",(s=>{r(s)}),!1),document.body.appendChild(e)}))}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;{const n=self.import;n?await n(t.toString()):await import(t.toString())}}}function e2(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function g(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function Xs(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,s]=e2(e);return!t.l||r===t.i.canvas.width&&s===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=s),[r,s]}function qs(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let s=0;s<e.length;s++)r[s]=t.i.stringToNewUTF8(e[s]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const s of r)t.i._free(s);t.i._free(e)}function wt(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Ct(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(s,i,o)=>{i?(n(r,o),r=[]):r.push(s)}}Ne.forVisionTasks=function(t,e=!1){return en("vision",t??Qe``,e)},Ne.forTextTasks=function(t,e=!1){return en("text",t??Qe``,e)},Ne.forGenAiTasks=function(t,e=!1){return en("genai",t??Qe``,e)},Ne.forAudioTasks=function(t,e=!1){return en("audio",t??Qe``,e)},Ne.isSimdSupported=function(t=!1){return Qo(t)};async function Ka(t,e,n,r){return t=await(async(s,i,o,a,c)=>{if(i&&await zs(i),!self.ModuleFactory||o&&(await zs(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((i=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(i.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new s(c,a)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:s=>s.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&s.endsWith(".data")?n.assetBinaryPath.toString():s}),await t.o(r),t}function Xn(t,e){const n=A(t.baseOptions,dn,1)||new dn;typeof e=="string"?(k(n,2,qe(e)),k(n,1)):e instanceof Uint8Array&&(k(n,1,pr(e,!1)),k(n,2)),y(t.baseOptions,0,1,n)}function Ys(t){try{const e=t.H.length;if(e===1)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map((n=>n.message)).join(", "))}finally{t.H=[]}}function l(t,e){t.C=Math.max(t.C,e)}function Rn(t,e){t.B=new Z,ot(t.B,2,"PassThroughCalculator"),F(t.B,"free_memory"),v(t.B,"free_memory_unused_out"),I(e,"free_memory"),gt(e,t.B)}function ye(t,e){F(t.B,e),v(t.B,e+"_unused_out")}function Cn(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var or=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var n,r,s,i,o,a;if(e){const c=t.baseOptions||{};if((n=t.baseOptions)!=null&&n.modelAssetBuffer&&((r=t.baseOptions)!=null&&r.modelAssetPath))throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((s=A(this.baseOptions,dn,1))!=null&&s.g()||(i=A(this.baseOptions,dn,1))!=null&&i.l()||(o=t.baseOptions)!=null&&o.modelAssetBuffer||(a=t.baseOptions)!=null&&a.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(u,h){let f=A(u.baseOptions,Gs,3);if(!f){var _=f=new Gs,b=new Ns;Be(_,4,on,b)}"delegate"in h&&(h.delegate==="GPU"?(h=f,_=new ya,Be(h,2,on,_)):(h=f,_=new Ns,Be(h,4,on,_))),y(u.baseOptions,0,3,f)})(this,c),c.modelAssetPath)return fetch(c.modelAssetPath.toString()).then((u=>{if(u.ok)return u.arrayBuffer();throw Error(`Failed to fetch model: ${c.modelAssetPath} (${u.status})`)})).then((u=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(u),!0,!1,!1),Xn(this,"/model.dat"),this.m(),this.L()}));if(c.modelAssetBuffer instanceof Uint8Array)Xn(this,c.modelAssetBuffer);else if(c.modelAssetBuffer)return(async function(u){const h=[];for(var f=0;;){const{done:_,value:b}=await u.read();if(_)break;h.push(b),f+=b.length}if(h.length===0)return new Uint8Array(0);if(h.length===1)return h[0];u=new Uint8Array(f),f=0;for(const _ of h)u.set(_,f),f+=_.length;return u})(c.modelAssetBuffer).then((u=>{Xn(this,u),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let t;if(this.g.ca((e=>{t=_a(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((n,r)=>{this.H.push(Error(r))})),this.g.Ja(),this.g.setGraph(t,e),this.B=void 0,Ys(this)}finishProcessing(){this.g.finishProcessing(),Ys(this)}close(){this.B=void 0,this.g.closeGraph()}};function Ut(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}or.prototype.close=or.prototype.close;class za{constructor(e,n,r,s){this.g=e,this.h=n,this.m=r,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 $s(t,e,n){const r=t.g;if(n=Ut(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function Js(t,e){const n=t.g,r=Ut(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const s=Ut(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.O),n.vertexAttribPointer(t.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const i=Ut(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.L),n.vertexAttribPointer(t.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new za(n,r,s,i)}function Zr(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function Xa(t,e,n,r){return Zr(t,e),t.h||(t.m(),t.D()),n?(t.u||(t.u=Js(t,!0)),n=t.u):(t.A||(t.A=Js(t,!1)),n=t.A),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function n2(t,e,n){return Zr(t,e),t=Ut(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function r2(t,e,n){Zr(t,e),t.B||(t.B=Ut(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function qa(t){var e;(e=t.g)==null||e.bindFramebuffer(t.g.FRAMEBUFFER,null)}var s2=class{H(){return`
|
|
precision mediump float;
|
|
varying vec2 vTex;
|
|
uniform sampler2D inputTexture;
|
|
void main() {
|
|
gl_FragColor = texture2D(inputTexture, vTex);
|
|
}
|
|
`}m(){const t=this.g;if(this.h=Ut(t.createProgram(),"Failed to create WebGL program"),this.X=$s(this,`
|
|
attribute vec2 aVertex;
|
|
attribute vec2 aTex;
|
|
varying vec2 vTex;
|
|
void main(void) {
|
|
gl_Position = vec4(aVertex, 0.0, 1.0);
|
|
vTex = aTex;
|
|
}`,t.VERTEX_SHADER),this.W=$s(this,this.H(),t.FRAGMENT_SHADER),t.linkProgram(this.h),!t.getProgramParameter(this.h,t.LINK_STATUS))throw Error(`Error during program linking: ${t.getProgramInfoLog(this.h)}`);this.O=t.getAttribLocation(this.h,"aVertex"),this.L=t.getAttribLocation(this.h,"aTex")}D(){}l(){}close(){if(this.h){const t=this.g;t.deleteProgram(this.h),t.deleteShader(this.X),t.deleteShader(this.W)}this.B&&this.g.deleteFramebuffer(this.B),this.A&&this.A.close(),this.u&&this.u.close()}};function Mt(t,e){switch(e){case 0:return t.g.find((n=>n instanceof Uint8Array));case 1:return t.g.find((n=>n instanceof Float32Array));case 2:return t.g.find((n=>typeof WebGLTexture<"u"&&n instanceof WebGLTexture));default:throw Error(`Type is not supported: ${e}`)}}function ar(t){var e=Mt(t,1);if(!e){if(e=Mt(t,0))e=new Float32Array(e).map((r=>r/255));else{e=new Float32Array(t.width*t.height);const r=_e(t);var n=Qr(t);if(r2(n,r,i2(t)),"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"document"in self&&"ontouchend"in self.document){n=new Float32Array(t.width*t.height*4),r.readPixels(0,0,t.width,t.height,r.RGBA,r.FLOAT,n);for(let s=0,i=0;s<e.length;++s,i+=4)e[s]=n[i]}else r.readPixels(0,0,t.width,t.height,r.RED,r.FLOAT,e)}t.g.push(e)}return e}function i2(t){let e=Mt(t,2);if(!e){const n=_e(t);e=a2(t);const r=ar(t),s=o2(t);n.texImage2D(n.TEXTURE_2D,0,s,t.width,t.height,0,n.RED,n.FLOAT,r),cr(t)}return e}function _e(t){if(!t.canvas)throw Error("Conversion to different image formats require that a canvas is passed when initializing the image.");return t.h||(t.h=Ut(t.canvas.getContext("webgl2"),"You cannot use a canvas that is already bound to a different type of rendering context.")),t.h}function o2(t){if(t=_e(t),!nn)if(t.getExtension("EXT_color_buffer_float")&&t.getExtension("OES_texture_float_linear")&&t.getExtension("EXT_float_blend"))nn=t.R32F;else{if(!t.getExtension("EXT_color_buffer_half_float"))throw Error("GPU does not fully support 4-channel float32 or float16 formats");nn=t.R16F}return nn}function Qr(t){return t.l||(t.l=new s2),t.l}function a2(t){const e=_e(t);e.viewport(0,0,t.width,t.height),e.activeTexture(e.TEXTURE0);let n=Mt(t,2);return n||(n=n2(Qr(t),e,t.m?e.LINEAR:e.NEAREST),t.g.push(n),t.j=!0),e.bindTexture(e.TEXTURE_2D,n),n}function cr(t){t.h.bindTexture(t.h.TEXTURE_2D,null)}var nn,W=class{constructor(t,e,n,r,s,i,o){this.g=t,this.m=e,this.j=n,this.canvas=r,this.l=s,this.width=i,this.height=o,this.j&&--Zs===0&&console.error("You seem to be creating MPMask instances without invoking .close(). This leaks resources.")}Fa(){return!!Mt(this,0)}ka(){return!!Mt(this,1)}R(){return!!Mt(this,2)}ja(){return(e=Mt(t=this,0))||(e=ar(t),e=new Uint8Array(e.map((n=>Math.round(255*n)))),t.g.push(e)),e;var t,e}ia(){return ar(this)}N(){return i2(this)}clone(){const t=[];for(const e of this.g){let n;if(e instanceof Uint8Array)n=new Uint8Array(e);else if(e instanceof Float32Array)n=new Float32Array(e);else{if(!(e instanceof WebGLTexture))throw Error(`Type is not supported: ${e}`);{const r=_e(this),s=Qr(this);r.activeTexture(r.TEXTURE1),n=n2(s,r,this.m?r.LINEAR:r.NEAREST),r.bindTexture(r.TEXTURE_2D,n);const i=o2(this);r.texImage2D(r.TEXTURE_2D,0,i,this.width,this.height,0,r.RED,r.FLOAT,null),r.bindTexture(r.TEXTURE_2D,null),r2(s,r,n),Xa(s,r,!1,(()=>{a2(this),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.drawArrays(r.TRIANGLE_FAN,0,4),cr(this)})),qa(s),cr(this)}}t.push(n)}return new W(t,this.m,this.R(),this.canvas,this.l,this.width,this.height)}close(){this.j&&_e(this).deleteTexture(Mt(this,2)),Zs=-1}};W.prototype.close=W.prototype.close,W.prototype.clone=W.prototype.clone,W.prototype.getAsWebGLTexture=W.prototype.N,W.prototype.getAsFloat32Array=W.prototype.ia,W.prototype.getAsUint8Array=W.prototype.ja,W.prototype.hasWebGLTexture=W.prototype.R,W.prototype.hasFloat32Array=W.prototype.ka,W.prototype.hasUint8Array=W.prototype.Fa;var Zs=250;function yt(...t){return t.map((([e,n])=>({start:e,end:n})))}const Ya=(function(t){return class extends t{Ja(){this.i._registerModelResourcesGraphService()}}})((Qs=class{constructor(t,e){this.l=!0,this.i=t,this.g=null,this.h=0,this.m=typeof this.i._addIntToInputStream=="function",e!==void 0?this.i.canvas=e:t2()?this.i.canvas=new OffscreenCanvas(1,1):(console.warn("OffscreenCanvas not supported and GraphRunner constructor glCanvas parameter is undefined. Creating backup canvas."),this.i.canvas=document.createElement("canvas"))}async initializeGraph(t){const e=await(await fetch(t)).arrayBuffer();t=!(t.endsWith(".pbtxt")||t.endsWith(".textproto")),this.setGraph(new Uint8Array(e),t)}setGraphFromString(t){this.setGraph(new TextEncoder().encode(t),!1)}setGraph(t,e){const n=t.length,r=this.i._malloc(n);this.i.HEAPU8.set(t,r),e?this.i._changeBinaryGraph(n,r):this.i._changeTextGraph(n,r),this.i._free(r)}configureAudio(t,e,n,r,s){this.i._configureAudio||console.warn('Attempting to use configureAudio without support for input audio. Is build dep ":gl_graph_runner_audio" missing?'),g(this,r||"input_audio",(i=>{g(this,s=s||"audio_header",(o=>{this.i._configureAudio(i,o,t,e??0,n)}))}))}setAutoResizeCanvas(t){this.l=t}setAutoRenderToScreen(t){this.i._setAutoRenderToScreen(t)}setGpuBufferVerticalFlip(t){this.i.gpuOriginForWebTexturesIsBottomLeft=t}ca(t){wt(this,"__graph_config__",(e=>{t(e)})),g(this,"__graph_config__",(e=>{this.i._getGraphConfig(e,void 0)})),delete this.i.simpleListeners.__graph_config__}attachErrorListener(t){this.i.errorListener=t}attachEmptyPacketListener(t,e){this.i.emptyPacketListeners=this.i.emptyPacketListeners||{},this.i.emptyPacketListeners[t]=e}addAudioToStream(t,e,n){this.addAudioToStreamWithShape(t,0,0,e,n)}addAudioToStreamWithShape(t,e,n,r,s){const i=4*t.length;this.h!==i&&(this.g&&this.i._free(this.g),this.g=this.i._malloc(i),this.h=i),this.i.HEAPF32.set(t,this.g/4),g(this,r,(o=>{this.i._addAudioToInputStream(this.g,e,n,o,s)}))}addGpuBufferToStream(t,e,n){g(this,e,(r=>{const[s,i]=Xs(this,t,r);this.i._addBoundTextureToStream(r,s,i,n)}))}addBoolToStream(t,e,n){g(this,e,(r=>{this.i._addBoolToInputStream(t,r,n)}))}addDoubleToStream(t,e,n){g(this,e,(r=>{this.i._addDoubleToInputStream(t,r,n)}))}addFloatToStream(t,e,n){g(this,e,(r=>{this.i._addFloatToInputStream(t,r,n)}))}addIntToStream(t,e,n){g(this,e,(r=>{this.i._addIntToInputStream(t,r,n)}))}addUintToStream(t,e,n){g(this,e,(r=>{this.i._addUintToInputStream(t,r,n)}))}addStringToStream(t,e,n){g(this,e,(r=>{g(this,t,(s=>{this.i._addStringToInputStream(s,r,n)}))}))}addStringRecordToStream(t,e,n){g(this,e,(r=>{qs(this,Object.keys(t),(s=>{qs(this,Object.values(t),(i=>{this.i._addFlatHashMapToInputStream(s,i,Object.keys(t).length,r,n)}))}))}))}addProtoToStream(t,e,n,r){g(this,n,(s=>{g(this,e,(i=>{const o=this.i._malloc(t.length);this.i.HEAPU8.set(t,o),this.i._addProtoToInputStream(o,t.length,i,s,r),this.i._free(o)}))}))}addEmptyPacketToStream(t,e){g(this,t,(n=>{this.i._addEmptyPacketToInputStream(n,e)}))}addBoolVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateBoolVector(t.length);if(!s)throw Error("Unable to allocate new bool vector on heap.");for(const i of t)this.i._addBoolVectorEntry(s,i);this.i._addBoolVectorToInputStream(s,r,n)}))}addDoubleVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateDoubleVector(t.length);if(!s)throw Error("Unable to allocate new double vector on heap.");for(const i of t)this.i._addDoubleVectorEntry(s,i);this.i._addDoubleVectorToInputStream(s,r,n)}))}addFloatVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateFloatVector(t.length);if(!s)throw Error("Unable to allocate new float vector on heap.");for(const i of t)this.i._addFloatVectorEntry(s,i);this.i._addFloatVectorToInputStream(s,r,n)}))}addIntVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateIntVector(t.length);if(!s)throw Error("Unable to allocate new int vector on heap.");for(const i of t)this.i._addIntVectorEntry(s,i);this.i._addIntVectorToInputStream(s,r,n)}))}addUintVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateUintVector(t.length);if(!s)throw Error("Unable to allocate new unsigned int vector on heap.");for(const i of t)this.i._addUintVectorEntry(s,i);this.i._addUintVectorToInputStream(s,r,n)}))}addStringVectorToStream(t,e,n){g(this,e,(r=>{const s=this.i._allocateStringVector(t.length);if(!s)throw Error("Unable to allocate new string vector on heap.");for(const i of t)g(this,i,(o=>{this.i._addStringVectorEntry(s,o)}));this.i._addStringVectorToInputStream(s,r,n)}))}addBoolToInputSidePacket(t,e){g(this,e,(n=>{this.i._addBoolToInputSidePacket(t,n)}))}addDoubleToInputSidePacket(t,e){g(this,e,(n=>{this.i._addDoubleToInputSidePacket(t,n)}))}addFloatToInputSidePacket(t,e){g(this,e,(n=>{this.i._addFloatToInputSidePacket(t,n)}))}addIntToInputSidePacket(t,e){g(this,e,(n=>{this.i._addIntToInputSidePacket(t,n)}))}addUintToInputSidePacket(t,e){g(this,e,(n=>{this.i._addUintToInputSidePacket(t,n)}))}addStringToInputSidePacket(t,e){g(this,e,(n=>{g(this,t,(r=>{this.i._addStringToInputSidePacket(r,n)}))}))}addProtoToInputSidePacket(t,e,n){g(this,n,(r=>{g(this,e,(s=>{const i=this.i._malloc(t.length);this.i.HEAPU8.set(t,i),this.i._addProtoToInputSidePacket(i,t.length,s,r),this.i._free(i)}))}))}addBoolVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateBoolVector(t.length);if(!r)throw Error("Unable to allocate new bool vector on heap.");for(const s of t)this.i._addBoolVectorEntry(r,s);this.i._addBoolVectorToInputSidePacket(r,n)}))}addDoubleVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateDoubleVector(t.length);if(!r)throw Error("Unable to allocate new double vector on heap.");for(const s of t)this.i._addDoubleVectorEntry(r,s);this.i._addDoubleVectorToInputSidePacket(r,n)}))}addFloatVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateFloatVector(t.length);if(!r)throw Error("Unable to allocate new float vector on heap.");for(const s of t)this.i._addFloatVectorEntry(r,s);this.i._addFloatVectorToInputSidePacket(r,n)}))}addIntVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateIntVector(t.length);if(!r)throw Error("Unable to allocate new int vector on heap.");for(const s of t)this.i._addIntVectorEntry(r,s);this.i._addIntVectorToInputSidePacket(r,n)}))}addUintVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateUintVector(t.length);if(!r)throw Error("Unable to allocate new unsigned int vector on heap.");for(const s of t)this.i._addUintVectorEntry(r,s);this.i._addUintVectorToInputSidePacket(r,n)}))}addStringVectorToInputSidePacket(t,e){g(this,e,(n=>{const r=this.i._allocateStringVector(t.length);if(!r)throw Error("Unable to allocate new string vector on heap.");for(const s of t)g(this,s,(i=>{this.i._addStringVectorEntry(r,i)}));this.i._addStringVectorToInputSidePacket(r,n)}))}attachBoolListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachBoolListener(n)}))}attachBoolVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachBoolVectorListener(n)}))}attachIntListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachIntListener(n)}))}attachIntVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachIntVectorListener(n)}))}attachUintListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachUintListener(n)}))}attachUintVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachUintVectorListener(n)}))}attachDoubleListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachDoubleListener(n)}))}attachDoubleVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachDoubleVectorListener(n)}))}attachFloatListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachFloatListener(n)}))}attachFloatVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachFloatVectorListener(n)}))}attachStringListener(t,e){wt(this,t,e),g(this,t,(n=>{this.i._attachStringListener(n)}))}attachStringVectorListener(t,e){Ct(this,t,e),g(this,t,(n=>{this.i._attachStringVectorListener(n)}))}attachProtoListener(t,e,n){wt(this,t,e),g(this,t,(r=>{this.i._attachProtoListener(r,n||!1)}))}attachProtoVectorListener(t,e,n){Ct(this,t,e),g(this,t,(r=>{this.i._attachProtoVectorListener(r,n||!1)}))}attachAudioListener(t,e,n){this.i._attachAudioListener||console.warn('Attempting to use attachAudioListener without support for output audio. Is build dep ":gl_graph_runner_audio_out" missing?'),wt(this,t,((r,s)=>{r=new Float32Array(r.buffer,r.byteOffset,r.length/4),e(r,s)})),g(this,t,(r=>{this.i._attachAudioListener(r,n||!1)}))}finishProcessing(){this.i._waitUntilIdle()}closeGraph(){this.i._closeGraph(),this.i.simpleListeners=void 0,this.i.emptyPacketListeners=void 0}},class extends Qs{get ga(){return this.i}pa(t,e,n){g(this,e,(r=>{const[s,i]=Xs(this,t,r);this.ga._addBoundTextureAsImageToStream(r,s,i,n)}))}Z(t,e){wt(this,t,e),g(this,t,(n=>{this.ga._attachImageListener(n)}))}aa(t,e){Ct(this,t,e),g(this,t,(n=>{this.ga._attachImageVectorListener(n)}))}}));var Qs,_t=class extends Ya{};async function w(t,e,n){return(async function(r,s,i,o){return Ka(r,s,i,o)})(t,n.canvas??(t2()?void 0:document.createElement("canvas")),e,n)}function c2(t,e,n,r){if(t.U){const i=new Po;if(n!=null&&n.regionOfInterest){if(!t.oa)throw Error("This task doesn't support region-of-interest.");var s=n.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].");m(i,1,(s.left+s.right)/2),m(i,2,(s.top+s.bottom)/2),m(i,4,s.right-s.left),m(i,3,s.bottom-s.top)}else m(i,1,.5),m(i,2,.5),m(i,4,1),m(i,3,1);if(n!=null&&n.rotationDegrees){if((n==null?void 0:n.rotationDegrees)%90!=0)throw Error("Expected rotation to be a multiple of 90°.");if(m(i,5,-Math.PI*n.rotationDegrees/180),(n==null?void 0:n.rotationDegrees)%180!=0){const[o,a]=e2(e);n=R(i,3)*a/o,s=R(i,4)*o/a,m(i,4,n),m(i,3,s)}}t.g.addProtoToStream(i.g(),"mediapipe.NormalizedRect",t.U,r)}t.g.pa(e,t.X,r??performance.now()),t.finishProcessing()}function vt(t,e,n){var r;if((r=t.baseOptions)!=null&&r.g())throw Error("Task is not initialized with image mode. 'runningMode' must be set to 'IMAGE'.");c2(t,e,n,t.C+1)}function Pt(t,e,n,r){var s;if(!((s=t.baseOptions)!=null&&s.g()))throw Error("Task is not initialized with video mode. 'runningMode' must be set to 'VIDEO'.");c2(t,e,n,r)}function ve(t,e,n,r){var s=e.data;const i=e.width,o=i*(e=e.height);if((s instanceof Uint8Array||s instanceof Float32Array)&&s.length!==o)throw Error("Unsupported channel count: "+s.length/o);return t=new W([s],n,!1,t.g.i.canvas,t.P,i,e),r?t.clone():t}var at=class extends or{constructor(t,e,n,r){super(t),this.g=t,this.X=e,this.U=n,this.oa=r,this.P=new s2}l(t,e=!0){if("runningMode"in t&&k(this.baseOptions,2,Ve(!!t.runningMode&&t.runningMode!=="IMAGE")),t.canvas!==void 0&&this.g.i.canvas!==t.canvas)throw Error("You must create a new task to reset the canvas.");return super.l(t,e)}close(){this.P.close(),super.close()}};at.prototype.close=at.prototype.close;var ut=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect_in",!1),this.j={detections:[]},y(t=this.h=new xn,0,1,e=new N),m(this.h,2,.5),m(this.h,3,.3)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return"minDetectionConfidence"in t&&m(this.h,2,t.minDetectionConfidence??.5),"minSuppressionThreshold"in t&&m(this.h,3,t.minSuppressionThreshold??.3),this.l(t)}F(t,e){return this.j={detections:[]},vt(this,t,e),this.j}G(t,e,n){return this.j={detections:[]},Pt(this,t,n,e),this.j}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect_in"),E(t,"detections");const e=new ct;Lt(e,Ma,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.face_detector.FaceDetectorGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect_in"),v(n,"DETECTIONS:detections"),n.o(e),gt(t,n),this.g.attachProtoVectorListener("detections",((r,s)=>{for(const i of r)r=To(i),this.j.detections.push(Zo(r));l(this,s)})),this.g.attachEmptyPacketListener("detections",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ut.prototype.detectForVideo=ut.prototype.G,ut.prototype.detect=ut.prototype.F,ut.prototype.setOptions=ut.prototype.o,ut.createFromModelPath=async function(t,e){return w(ut,t,{baseOptions:{modelAssetPath:e}})},ut.createFromModelBuffer=function(t,e){return w(ut,t,{baseOptions:{modelAssetBuffer:e}})},ut.createFromOptions=function(t,e){return w(ut,t,e)};var ts=yt([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]),es=yt([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]),ns=yt([276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]),h2=yt([474,475],[475,476],[476,477],[477,474]),rs=yt([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]),ss=yt([46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]),u2=yt([469,470],[470,471],[471,472],[472,469]),is=yt([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]),l2=[...ts,...es,...ns,...rs,...ss,...is],f2=yt([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 ti(t){t.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]}}var x=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!1),this.j={faceLandmarks:[],faceBlendshapes:[],facialTransformationMatrixes:[]},this.outputFacialTransformationMatrixes=this.outputFaceBlendshapes=!1,y(t=this.h=new No,0,1,e=new N),this.A=new xo,y(this.h,0,3,this.A),this.u=new xn,y(this.h,0,2,this.u),Nt(this.u,4,1),m(this.u,2,.5),m(this.A,2,.5),m(this.h,4,.5)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return"numFaces"in t&&Nt(this.u,4,t.numFaces??1),"minFaceDetectionConfidence"in t&&m(this.u,2,t.minFaceDetectionConfidence??.5),"minTrackingConfidence"in t&&m(this.h,4,t.minTrackingConfidence??.5),"minFacePresenceConfidence"in t&&m(this.A,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"outputFacialTransformationMatrixes"in t&&(this.outputFacialTransformationMatrixes=!!t.outputFacialTransformationMatrixes),this.l(t)}F(t,e){return ti(this),vt(this,t,e),this.j}G(t,e,n){return ti(this),Pt(this,t,n,e),this.j}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect"),E(t,"face_landmarks");const e=new ct;Lt(e,Ia,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.face_landmarker.FaceLandmarkerGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),v(n,"NORM_LANDMARKS:face_landmarks"),n.o(e),gt(t,n),this.g.attachProtoVectorListener("face_landmarks",((r,s)=>{for(const i of r)r=Je(i),this.j.faceLandmarks.push(Nn(r));l(this,s)})),this.g.attachEmptyPacketListener("face_landmarks",(r=>{l(this,r)})),this.outputFaceBlendshapes&&(E(t,"blendshapes"),v(n,"BLENDSHAPES:blendshapes"),this.g.attachProtoVectorListener("blendshapes",((r,s)=>{if(this.outputFaceBlendshapes)for(const i of r)r=In(i),this.j.faceBlendshapes.push(Jr(r.g()??[]));l(this,s)})),this.g.attachEmptyPacketListener("blendshapes",(r=>{l(this,r)}))),this.outputFacialTransformationMatrixes&&(E(t,"face_geometry"),v(n,"FACE_GEOMETRY:face_geometry"),this.g.attachProtoVectorListener("face_geometry",((r,s)=>{if(this.outputFacialTransformationMatrixes)for(const i of r)(r=A(r=Oa(i),ba,2))&&this.j.facialTransformationMatrixes.push({rows:dt(r,1)??0??0,columns:dt(r,2)??0??0,data:Kt(r,3,bt,Wt()).slice()??[]});l(this,s)})),this.g.attachEmptyPacketListener("face_geometry",(r=>{l(this,r)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};x.prototype.detectForVideo=x.prototype.G,x.prototype.detect=x.prototype.F,x.prototype.setOptions=x.prototype.o,x.createFromModelPath=function(t,e){return w(x,t,{baseOptions:{modelAssetPath:e}})},x.createFromModelBuffer=function(t,e){return w(x,t,{baseOptions:{modelAssetBuffer:e}})},x.createFromOptions=function(t,e){return w(x,t,e)},x.FACE_LANDMARKS_LIPS=ts,x.FACE_LANDMARKS_LEFT_EYE=es,x.FACE_LANDMARKS_LEFT_EYEBROW=ns,x.FACE_LANDMARKS_LEFT_IRIS=h2,x.FACE_LANDMARKS_RIGHT_EYE=rs,x.FACE_LANDMARKS_RIGHT_EYEBROW=ss,x.FACE_LANDMARKS_RIGHT_IRIS=u2,x.FACE_LANDMARKS_FACE_OVAL=is,x.FACE_LANDMARKS_CONTOURS=l2,x.FACE_LANDMARKS_TESSELATION=f2;var os=yt([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 ei(t){t.gestures=[],t.landmarks=[],t.worldLandmarks=[],t.handedness=[]}function ni(t){return t.gestures.length===0?{gestures:[],landmarks:[],worldLandmarks:[],handedness:[],handednesses:[]}:{gestures:t.gestures,landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handedness:t.handedness,handednesses:t.handedness}}function ri(t,e=!0){const n=[];for(const s of t){var r=In(s);t=[];for(const i of r.g())r=e&&dt(i,1)!=null?dt(i,1)??0:-1,t.push({score:R(i,2)??0,index:r,categoryName:z(M(i,3))??""??"",displayName:z(M(i,4))??""??""});n.push(t)}return n}var Q=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!1),this.gestures=[],this.landmarks=[],this.worldLandmarks=[],this.handedness=[],y(t=this.j=new Bo,0,1,e=new N),this.u=new Xr,y(this.j,0,2,this.u),this.D=new zr,y(this.u,0,3,this.D),this.A=new Co,y(this.u,0,2,this.A),this.h=new xa,y(this.j,0,3,this.h),m(this.A,2,.5),m(this.u,4,.5),m(this.D,2,.5)}get baseOptions(){return A(this.j,N,1)}set baseOptions(t){y(this.j,0,1,t)}o(t){var s,i,o,a;if(Nt(this.A,3,t.numHands??1),"minHandDetectionConfidence"in t&&m(this.A,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&m(this.u,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&m(this.D,2,t.minHandPresenceConfidence??.5),t.cannedGesturesClassifierOptions){var e=new ie,n=e,r=ir(t.cannedGesturesClassifierOptions,(s=A(this.h,ie,3))==null?void 0:s.l());y(n,0,2,r),y(this.h,0,3,e)}else t.cannedGesturesClassifierOptions===void 0&&((i=A(this.h,ie,3))==null||i.g());return t.customGesturesClassifierOptions?(y(n=e=new ie,0,2,r=ir(t.customGesturesClassifierOptions,(o=A(this.h,ie,4))==null?void 0:o.l())),y(this.h,0,4,e)):t.customGesturesClassifierOptions===void 0&&((a=A(this.h,ie,4))==null||a.g()),this.l(t)}Ha(t,e){return ei(this),vt(this,t,e),ni(this)}Ia(t,e,n){return ei(this),Pt(this,t,n,e),ni(this)}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect"),E(t,"hand_gestures"),E(t,"hand_landmarks"),E(t,"world_hand_landmarks"),E(t,"handedness");const e=new ct;Lt(e,Na,this.j);const n=new Z;ot(n,2,"mediapipe.tasks.vision.gesture_recognizer.GestureRecognizerGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),v(n,"HAND_GESTURES:hand_gestures"),v(n,"LANDMARKS:hand_landmarks"),v(n,"WORLD_LANDMARKS:world_hand_landmarks"),v(n,"HANDEDNESS:handedness"),n.o(e),gt(t,n),this.g.attachProtoVectorListener("hand_landmarks",((r,s)=>{for(const i of r){r=Je(i);const o=[];for(const a of xt(r,Fo,1))o.push({x:R(a,1)??0,y:R(a,2)??0,z:R(a,3)??0,visibility:R(a,4)??0});this.landmarks.push(o)}l(this,s)})),this.g.attachEmptyPacketListener("hand_landmarks",(r=>{l(this,r)})),this.g.attachProtoVectorListener("world_hand_landmarks",((r,s)=>{for(const i of r){r=ce(i);const o=[];for(const a of xt(r,Lo,1))o.push({x:R(a,1)??0,y:R(a,2)??0,z:R(a,3)??0,visibility:R(a,4)??0});this.worldLandmarks.push(o)}l(this,s)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(r=>{l(this,r)})),this.g.attachProtoVectorListener("hand_gestures",((r,s)=>{this.gestures.push(...ri(r,!1)),l(this,s)})),this.g.attachEmptyPacketListener("hand_gestures",(r=>{l(this,r)})),this.g.attachProtoVectorListener("handedness",((r,s)=>{this.handedness.push(...ri(r)),l(this,s)})),this.g.attachEmptyPacketListener("handedness",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};function si(t){return{landmarks:t.landmarks,worldLandmarks:t.worldLandmarks,handednesses:t.handedness,handedness:t.handedness}}Q.prototype.recognizeForVideo=Q.prototype.Ia,Q.prototype.recognize=Q.prototype.Ha,Q.prototype.setOptions=Q.prototype.o,Q.createFromModelPath=function(t,e){return w(Q,t,{baseOptions:{modelAssetPath:e}})},Q.createFromModelBuffer=function(t,e){return w(Q,t,{baseOptions:{modelAssetBuffer:e}})},Q.createFromOptions=function(t,e){return w(Q,t,e)},Q.HAND_CONNECTIONS=os;var tt=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.handedness=[],y(t=this.h=new Xr,0,1,e=new N),this.u=new zr,y(this.h,0,3,this.u),this.j=new Co,y(this.h,0,2,this.j),Nt(this.j,3,1),m(this.j,2,.5),m(this.u,2,.5),m(this.h,4,.5)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return"numHands"in t&&Nt(this.j,3,t.numHands??1),"minHandDetectionConfidence"in t&&m(this.j,2,t.minHandDetectionConfidence??.5),"minTrackingConfidence"in t&&m(this.h,4,t.minTrackingConfidence??.5),"minHandPresenceConfidence"in t&&m(this.u,2,t.minHandPresenceConfidence??.5),this.l(t)}F(t,e){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],vt(this,t,e),si(this)}G(t,e,n){return this.landmarks=[],this.worldLandmarks=[],this.handedness=[],Pt(this,t,n,e),si(this)}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect"),E(t,"hand_landmarks"),E(t,"world_hand_landmarks"),E(t,"handedness");const e=new ct;Lt(e,Ra,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.hand_landmarker.HandLandmarkerGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),v(n,"LANDMARKS:hand_landmarks"),v(n,"WORLD_LANDMARKS:world_hand_landmarks"),v(n,"HANDEDNESS:handedness"),n.o(e),gt(t,n),this.g.attachProtoVectorListener("hand_landmarks",((r,s)=>{for(const i of r)r=Je(i),this.landmarks.push(Nn(r));l(this,s)})),this.g.attachEmptyPacketListener("hand_landmarks",(r=>{l(this,r)})),this.g.attachProtoVectorListener("world_hand_landmarks",((r,s)=>{for(const i of r)r=ce(i),this.worldLandmarks.push(Ue(r));l(this,s)})),this.g.attachEmptyPacketListener("world_hand_landmarks",(r=>{l(this,r)})),this.g.attachProtoVectorListener("handedness",((r,s)=>{var i=this.handedness,o=i.push;const a=[];for(const c of r){r=In(c);const u=[];for(const h of r.g())u.push({score:R(h,2)??0,index:dt(h,1)??0??-1,categoryName:z(M(h,3))??""??"",displayName:z(M(h,4))??""??""});a.push(u)}o.call(i,...a),l(this,s)})),this.g.attachEmptyPacketListener("handedness",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};tt.prototype.detectForVideo=tt.prototype.G,tt.prototype.detect=tt.prototype.F,tt.prototype.setOptions=tt.prototype.o,tt.createFromModelPath=function(t,e){return w(tt,t,{baseOptions:{modelAssetPath:e}})},tt.createFromModelBuffer=function(t,e){return w(tt,t,{baseOptions:{modelAssetBuffer:e}})},tt.createFromOptions=function(t,e){return w(tt,t,e)},tt.HAND_CONNECTIONS=os;var d2=yt([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 ii(t){t.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]}}function oi(t){try{if(!t.D)return t.h;t.D(t.h)}finally{Cn(t)}}function rn(t,e){t=Je(t),e.push(Nn(t))}var T=class extends at{constructor(t,e){super(new _t(t,e),"input_frames_image",null,!1),this.h={faceLandmarks:[],faceBlendshapes:[],poseLandmarks:[],poseWorldLandmarks:[],poseSegmentationMasks:[],leftHandLandmarks:[],leftHandWorldLandmarks:[],rightHandLandmarks:[],rightHandWorldLandmarks:[]},this.outputPoseSegmentationMasks=this.outputFaceBlendshapes=!1,y(t=this.j=new Vo,0,1,e=new N),this.I=new zr,y(this.j,0,2,this.I),this.W=new Ca,y(this.j,0,3,this.W),this.u=new xn,y(this.j,0,4,this.u),this.O=new xo,y(this.j,0,5,this.O),this.A=new Go,y(this.j,0,6,this.A),this.M=new jo,y(this.j,0,7,this.M),m(this.u,2,.5),m(this.u,3,.3),m(this.O,2,.5),m(this.A,2,.5),m(this.A,3,.3),m(this.M,2,.5),m(this.I,2,.5)}get baseOptions(){return A(this.j,N,1)}set baseOptions(t){y(this.j,0,1,t)}o(t){return"minFaceDetectionConfidence"in t&&m(this.u,2,t.minFaceDetectionConfidence??.5),"minFaceSuppressionThreshold"in t&&m(this.u,3,t.minFaceSuppressionThreshold??.3),"minFacePresenceConfidence"in t&&m(this.O,2,t.minFacePresenceConfidence??.5),"outputFaceBlendshapes"in t&&(this.outputFaceBlendshapes=!!t.outputFaceBlendshapes),"minPoseDetectionConfidence"in t&&m(this.A,2,t.minPoseDetectionConfidence??.5),"minPoseSuppressionThreshold"in t&&m(this.A,3,t.minPoseSuppressionThreshold??.3),"minPosePresenceConfidence"in t&&m(this.M,2,t.minPosePresenceConfidence??.5),"outputPoseSegmentationMasks"in t&&(this.outputPoseSegmentationMasks=!!t.outputPoseSegmentationMasks),"minHandLandmarksConfidence"in t&&m(this.I,2,t.minHandLandmarksConfidence??.5),this.l(t)}F(t,e,n){const r=typeof e!="function"?e:{};return this.D=typeof e=="function"?e:n,ii(this),vt(this,t,r),oi(this)}G(t,e,n,r){const s=typeof n!="function"?n:{};return this.D=typeof n=="function"?n:r,ii(this),Pt(this,t,s,e),oi(this)}m(){var t=new ht;I(t,"input_frames_image"),E(t,"pose_landmarks"),E(t,"pose_world_landmarks"),E(t,"face_landmarks"),E(t,"left_hand_landmarks"),E(t,"left_hand_world_landmarks"),E(t,"right_hand_landmarks"),E(t,"right_hand_world_landmarks");const e=new ct,n=new Ms;ot(n,1,"type.googleapis.com/mediapipe.tasks.vision.holistic_landmarker.proto.HolisticLandmarkerGraphOptions"),(function(s,i){if(i!=null)if(Array.isArray(i))k(s,2,wn(i,0,He));else{if(!(typeof i=="string"||i instanceof Et||fr(i)))throw Error("invalid value in Any.value field: "+i+" expected a ByteString, a base64 encoded string, a Uint8Array or a jspb array");Bt(s,2,pr(i,!1),Jt())}})(n,this.j.g());const r=new Z;ot(r,2,"mediapipe.tasks.vision.holistic_landmarker.HolisticLandmarkerGraph"),Fr(r,8,Ms,n),F(r,"IMAGE:input_frames_image"),v(r,"POSE_LANDMARKS:pose_landmarks"),v(r,"POSE_WORLD_LANDMARKS:pose_world_landmarks"),v(r,"FACE_LANDMARKS:face_landmarks"),v(r,"LEFT_HAND_LANDMARKS:left_hand_landmarks"),v(r,"LEFT_HAND_WORLD_LANDMARKS:left_hand_world_landmarks"),v(r,"RIGHT_HAND_LANDMARKS:right_hand_landmarks"),v(r,"RIGHT_HAND_WORLD_LANDMARKS:right_hand_world_landmarks"),r.o(e),gt(t,r),Rn(this,t),this.g.attachProtoListener("pose_landmarks",((s,i)=>{rn(s,this.h.poseLandmarks),l(this,i)})),this.g.attachEmptyPacketListener("pose_landmarks",(s=>{l(this,s)})),this.g.attachProtoListener("pose_world_landmarks",((s,i)=>{var o=this.h.poseWorldLandmarks;s=ce(s),o.push(Ue(s)),l(this,i)})),this.g.attachEmptyPacketListener("pose_world_landmarks",(s=>{l(this,s)})),this.outputPoseSegmentationMasks&&(v(r,"POSE_SEGMENTATION_MASK:pose_segmentation_mask"),ye(this,"pose_segmentation_mask"),this.g.Z("pose_segmentation_mask",((s,i)=>{this.h.poseSegmentationMasks=[ve(this,s,!0,!this.D)],l(this,i)})),this.g.attachEmptyPacketListener("pose_segmentation_mask",(s=>{this.h.poseSegmentationMasks=[],l(this,s)}))),this.g.attachProtoListener("face_landmarks",((s,i)=>{rn(s,this.h.faceLandmarks),l(this,i)})),this.g.attachEmptyPacketListener("face_landmarks",(s=>{l(this,s)})),this.outputFaceBlendshapes&&(E(t,"extra_blendshapes"),v(r,"FACE_BLENDSHAPES:extra_blendshapes"),this.g.attachProtoListener("extra_blendshapes",((s,i)=>{var o=this.h.faceBlendshapes;this.outputFaceBlendshapes&&(s=In(s),o.push(Jr(s.g()??[]))),l(this,i)})),this.g.attachEmptyPacketListener("extra_blendshapes",(s=>{l(this,s)}))),this.g.attachProtoListener("left_hand_landmarks",((s,i)=>{rn(s,this.h.leftHandLandmarks),l(this,i)})),this.g.attachEmptyPacketListener("left_hand_landmarks",(s=>{l(this,s)})),this.g.attachProtoListener("left_hand_world_landmarks",((s,i)=>{var o=this.h.leftHandWorldLandmarks;s=ce(s),o.push(Ue(s)),l(this,i)})),this.g.attachEmptyPacketListener("left_hand_world_landmarks",(s=>{l(this,s)})),this.g.attachProtoListener("right_hand_landmarks",((s,i)=>{rn(s,this.h.rightHandLandmarks),l(this,i)})),this.g.attachEmptyPacketListener("right_hand_landmarks",(s=>{l(this,s)})),this.g.attachProtoListener("right_hand_world_landmarks",((s,i)=>{var o=this.h.rightHandWorldLandmarks;s=ce(s),o.push(Ue(s)),l(this,i)})),this.g.attachEmptyPacketListener("right_hand_world_landmarks",(s=>{l(this,s)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};T.prototype.detectForVideo=T.prototype.G,T.prototype.detect=T.prototype.F,T.prototype.setOptions=T.prototype.o,T.createFromModelPath=function(t,e){return w(T,t,{baseOptions:{modelAssetPath:e}})},T.createFromModelBuffer=function(t,e){return w(T,t,{baseOptions:{modelAssetBuffer:e}})},T.createFromOptions=function(t,e){return w(T,t,e)},T.HAND_CONNECTIONS=os,T.POSE_CONNECTIONS=d2,T.FACE_LANDMARKS_LIPS=ts,T.FACE_LANDMARKS_LEFT_EYE=es,T.FACE_LANDMARKS_LEFT_EYEBROW=ns,T.FACE_LANDMARKS_LEFT_IRIS=h2,T.FACE_LANDMARKS_RIGHT_EYE=rs,T.FACE_LANDMARKS_RIGHT_EYEBROW=ss,T.FACE_LANDMARKS_RIGHT_IRIS=u2,T.FACE_LANDMARKS_FACE_OVAL=is,T.FACE_LANDMARKS_CONTOURS=l2,T.FACE_LANDMARKS_TESSELATION=f2;var lt=class extends at{constructor(t,e){super(new _t(t,e),"input_image","norm_rect",!0),this.j={classifications:[]},y(t=this.h=new Ho,0,1,e=new N)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return y(this.h,0,2,ir(t,A(this.h,Wr,2))),this.l(t)}sa(t,e){return this.j={classifications:[]},vt(this,t,e),this.j}ta(t,e,n){return this.j={classifications:[]},Pt(this,t,n,e),this.j}m(){var t=new ht;I(t,"input_image"),I(t,"norm_rect"),E(t,"classifications");const e=new ct;Lt(e,Ba,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.image_classifier.ImageClassifierGraph"),F(n,"IMAGE:input_image"),F(n,"NORM_RECT:norm_rect"),v(n,"CLASSIFICATIONS:classifications"),n.o(e),gt(t,n),this.g.attachProtoListener("classifications",((r,s)=>{this.j=Ha(Sa(r)),l(this,s)})),this.g.attachEmptyPacketListener("classifications",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};lt.prototype.classifyForVideo=lt.prototype.ta,lt.prototype.classify=lt.prototype.sa,lt.prototype.setOptions=lt.prototype.o,lt.createFromModelPath=function(t,e){return w(lt,t,{baseOptions:{modelAssetPath:e}})},lt.createFromModelBuffer=function(t,e){return w(lt,t,{baseOptions:{modelAssetBuffer:e}})},lt.createFromOptions=function(t,e){return w(lt,t,e)};var et=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!0),this.h=new Wo,this.embeddings={embeddings:[]},y(t=this.h,0,1,e=new N)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){var e=this.h,n=A(this.h,Us,2);return n=n?n.clone():new Us,t.l2Normalize!==void 0?k(n,1,Ve(t.l2Normalize)):"l2Normalize"in t&&k(n,1),t.quantize!==void 0?k(n,2,Ve(t.quantize)):"quantize"in t&&k(n,2),y(e,0,2,n),this.l(t)}za(t,e){return vt(this,t,e),this.embeddings}Aa(t,e,n){return Pt(this,t,n,e),this.embeddings}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect"),E(t,"embeddings_out");const e=new ct;Lt(e,Da,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.image_embedder.ImageEmbedderGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),v(n,"EMBEDDINGS:embeddings_out"),n.o(e),gt(t,n),this.g.attachProtoListener("embeddings_out",((r,s)=>{r=Fa(r),this.embeddings=(function(i){return{embeddings:xt(i,La,1).map((o=>{var u,h;const a={headIndex:dt(o,3)??0??-1,headName:z(M(o,4))??""??""};var c=o.v;return Gi(c,0|c[d],Ds,Vn(o,1))!==void 0?(o=Kt(o=A(o,Ds,Vn(o,1),void 0),1,bt,Wt()),a.floatEmbedding=o.slice()):(c=new Uint8Array(0),a.quantizedEmbedding=((h=(u=A(o,Ta,Vn(o,2),void 0))==null?void 0:u.na())==null?void 0:h.h())??c),a})),timestampMs:Jo(M(i,2,void 0,void 0,an)??Ri)}})(r),l(this,s)})),this.g.attachEmptyPacketListener("embeddings_out",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};et.cosineSimilarity=function(t,e){if(t.floatEmbedding&&e.floatEmbedding)t=Ks(t.floatEmbedding,e.floatEmbedding);else{if(!t.quantizedEmbedding||!e.quantizedEmbedding)throw Error("Cannot compute cosine similarity between quantized and float embeddings.");t=Ks(Ws(t.quantizedEmbedding),Ws(e.quantizedEmbedding))}return t},et.prototype.embedForVideo=et.prototype.Aa,et.prototype.embed=et.prototype.za,et.prototype.setOptions=et.prototype.o,et.createFromModelPath=function(t,e){return w(et,t,{baseOptions:{modelAssetPath:e}})},et.createFromModelBuffer=function(t,e){return w(et,t,{baseOptions:{modelAssetBuffer:e}})},et.createFromOptions=function(t,e){return w(et,t,e)};var hr=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach((n=>{n.close()})),(e=this.categoryMask)==null||e.close()}};function $a(t){var n,r;const e=(function(s){return xt(s,Z,1)})(t.ca()).filter((s=>(z(M(s,1))??"").includes("mediapipe.tasks.TensorsToSegmentationCalculator")));if(t.u=[],e.length>1)throw Error("The graph has more than one mediapipe.tasks.TensorsToSegmentationCalculator.");e.length===1&&(((r=(n=A(e[0],ct,7))==null?void 0:n.j())==null?void 0:r.g())??new Map).forEach(((s,i)=>{t.u[Number(i)]=z(M(s,1))??""}))}function ai(t){t.categoryMask=void 0,t.confidenceMasks=void 0,t.qualityScores=void 0}function ci(t){try{const e=new hr(t.confidenceMasks,t.categoryMask,t.qualityScores);if(!t.j)return e;t.j(e)}finally{Cn(t)}}hr.prototype.close=hr.prototype.close;var J=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!1),this.u=[],this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new $r,this.A=new Ko,y(this.h,0,3,this.A),y(t=this.h,0,1,e=new N)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?k(this.h,2,qe(t.displayNamesLocale)):"displayNamesLocale"in t&&k(this.h,2),"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}L(){$a(this)}segment(t,e,n){const r=typeof e!="function"?e:{};return this.j=typeof e=="function"?e:n,ai(this),vt(this,t,r),ci(this)}La(t,e,n,r){const s=typeof n!="function"?n:{};return this.j=typeof n=="function"?n:r,ai(this),Pt(this,t,s,e),ci(this)}Da(){return this.u}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect");const e=new ct;Lt(e,Xo,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.image_segmenter.ImageSegmenterGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),n.o(e),gt(t,n),Rn(this,t),this.outputConfidenceMasks&&(E(t,"confidence_masks"),v(n,"CONFIDENCE_MASKS:confidence_masks"),ye(this,"confidence_masks"),this.g.aa("confidence_masks",((r,s)=>{this.confidenceMasks=r.map((i=>ve(this,i,!0,!this.j))),l(this,s)})),this.g.attachEmptyPacketListener("confidence_masks",(r=>{this.confidenceMasks=[],l(this,r)}))),this.outputCategoryMask&&(E(t,"category_mask"),v(n,"CATEGORY_MASK:category_mask"),ye(this,"category_mask"),this.g.Z("category_mask",((r,s)=>{this.categoryMask=ve(this,r,!1,!this.j),l(this,s)})),this.g.attachEmptyPacketListener("category_mask",(r=>{this.categoryMask=void 0,l(this,r)}))),E(t,"quality_scores"),v(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((r,s)=>{this.qualityScores=r,l(this,s)})),this.g.attachEmptyPacketListener("quality_scores",(r=>{this.categoryMask=void 0,l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};J.prototype.getLabels=J.prototype.Da,J.prototype.segmentForVideo=J.prototype.La,J.prototype.segment=J.prototype.segment,J.prototype.setOptions=J.prototype.o,J.createFromModelPath=function(t,e){return w(J,t,{baseOptions:{modelAssetPath:e}})},J.createFromModelBuffer=function(t,e){return w(J,t,{baseOptions:{modelAssetBuffer:e}})},J.createFromOptions=function(t,e){return w(J,t,e)};var ur=class{constructor(t,e,n){this.confidenceMasks=t,this.categoryMask=e,this.qualityScores=n}close(){var t,e;(t=this.confidenceMasks)==null||t.forEach((n=>{n.close()})),(e=this.categoryMask)==null||e.close()}};ur.prototype.close=ur.prototype.close;var At=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect_in",!1),this.outputCategoryMask=!1,this.outputConfidenceMasks=!0,this.h=new $r,this.u=new Ko,y(this.h,0,3,this.u),y(t=this.h,0,1,e=new N)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return"outputCategoryMask"in t&&(this.outputCategoryMask=t.outputCategoryMask??!1),"outputConfidenceMasks"in t&&(this.outputConfidenceMasks=t.outputConfidenceMasks??!0),super.l(t)}segment(t,e,n,r){const s=typeof n!="function"?n:{};if(this.j=typeof n=="function"?n:r,this.qualityScores=this.categoryMask=this.confidenceMasks=void 0,n=this.C+1,r=new qo,e.keypoint&&e.scribble)throw Error("Cannot provide both keypoint and scribble.");if(e.keypoint){var i=new zn;Bt(i,3,Ve(!0),!1),Bt(i,1,Ce(e.keypoint.x),0),Bt(i,2,Ce(e.keypoint.y),0),Be(r,1,sr,i)}else{if(!e.scribble)throw Error("Must provide either a keypoint or a scribble.");{const a=new Ga;for(i of e.scribble)Bt(e=new zn,3,Ve(!0),!1),Bt(e,1,Ce(i.x),0),Bt(e,2,Ce(i.y),0),Fr(a,1,zn,e);Be(r,2,sr,a)}}this.g.addProtoToStream(r.g(),"mediapipe.tasks.vision.interactive_segmenter.proto.RegionOfInterest","roi_in",n),vt(this,t,s);t:{try{const a=new ur(this.confidenceMasks,this.categoryMask,this.qualityScores);if(!this.j){var o=a;break t}this.j(a)}finally{Cn(this)}o=void 0}return o}m(){var t=new ht;I(t,"image_in"),I(t,"roi_in"),I(t,"norm_rect_in");const e=new ct;Lt(e,Xo,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.interactive_segmenter.InteractiveSegmenterGraphV2"),F(n,"IMAGE:image_in"),F(n,"ROI:roi_in"),F(n,"NORM_RECT:norm_rect_in"),n.o(e),gt(t,n),Rn(this,t),this.outputConfidenceMasks&&(E(t,"confidence_masks"),v(n,"CONFIDENCE_MASKS:confidence_masks"),ye(this,"confidence_masks"),this.g.aa("confidence_masks",((r,s)=>{this.confidenceMasks=r.map((i=>ve(this,i,!0,!this.j))),l(this,s)})),this.g.attachEmptyPacketListener("confidence_masks",(r=>{this.confidenceMasks=[],l(this,r)}))),this.outputCategoryMask&&(E(t,"category_mask"),v(n,"CATEGORY_MASK:category_mask"),ye(this,"category_mask"),this.g.Z("category_mask",((r,s)=>{this.categoryMask=ve(this,r,!1,!this.j),l(this,s)})),this.g.attachEmptyPacketListener("category_mask",(r=>{this.categoryMask=void 0,l(this,r)}))),E(t,"quality_scores"),v(n,"QUALITY_SCORES:quality_scores"),this.g.attachFloatVectorListener("quality_scores",((r,s)=>{this.qualityScores=r,l(this,s)})),this.g.attachEmptyPacketListener("quality_scores",(r=>{this.categoryMask=void 0,l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};At.prototype.segment=At.prototype.segment,At.prototype.setOptions=At.prototype.o,At.createFromModelPath=function(t,e){return w(At,t,{baseOptions:{modelAssetPath:e}})},At.createFromModelBuffer=function(t,e){return w(At,t,{baseOptions:{modelAssetBuffer:e}})},At.createFromOptions=function(t,e){return w(At,t,e)};var ft=class extends at{constructor(t,e){super(new _t(t,e),"input_frame_gpu","norm_rect",!1),this.j={detections:[]},y(t=this.h=new Yo,0,1,e=new N)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return t.displayNamesLocale!==void 0?k(this.h,2,qe(t.displayNamesLocale)):"displayNamesLocale"in t&&k(this.h,2),t.maxResults!==void 0?Nt(this.h,3,t.maxResults):"maxResults"in t&&k(this.h,3),t.scoreThreshold!==void 0?m(this.h,4,t.scoreThreshold):"scoreThreshold"in t&&k(this.h,4),t.categoryAllowlist!==void 0?hn(this.h,5,t.categoryAllowlist):"categoryAllowlist"in t&&k(this.h,5),t.categoryDenylist!==void 0?hn(this.h,6,t.categoryDenylist):"categoryDenylist"in t&&k(this.h,6),this.l(t)}F(t,e){return this.j={detections:[]},vt(this,t,e),this.j}G(t,e,n){return this.j={detections:[]},Pt(this,t,n,e),this.j}m(){var t=new ht;I(t,"input_frame_gpu"),I(t,"norm_rect"),E(t,"detections");const e=new ct;Lt(e,ja,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.ObjectDetectorGraph"),F(n,"IMAGE:input_frame_gpu"),F(n,"NORM_RECT:norm_rect"),v(n,"DETECTIONS:detections"),n.o(e),gt(t,n),this.g.attachProtoVectorListener("detections",((r,s)=>{for(const i of r)r=To(i),this.j.detections.push(Zo(r));l(this,s)})),this.g.attachEmptyPacketListener("detections",(r=>{l(this,r)})),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};ft.prototype.detectForVideo=ft.prototype.G,ft.prototype.detect=ft.prototype.F,ft.prototype.setOptions=ft.prototype.o,ft.createFromModelPath=async function(t,e){return w(ft,t,{baseOptions:{modelAssetPath:e}})},ft.createFromModelBuffer=function(t,e){return w(ft,t,{baseOptions:{modelAssetBuffer:e}})},ft.createFromOptions=function(t,e){return w(ft,t,e)};var lr=class{constructor(t,e,n){this.landmarks=t,this.worldLandmarks=e,this.segmentationMasks=n}close(){var t;(t=this.segmentationMasks)==null||t.forEach((e=>{e.close()}))}};function hi(t){t.landmarks=[],t.worldLandmarks=[],t.segmentationMasks=void 0}function ui(t){try{const e=new lr(t.landmarks,t.worldLandmarks,t.segmentationMasks);if(!t.u)return e;t.u(e)}finally{Cn(t)}}lr.prototype.close=lr.prototype.close;var nt=class extends at{constructor(t,e){super(new _t(t,e),"image_in","norm_rect",!1),this.landmarks=[],this.worldLandmarks=[],this.outputSegmentationMasks=!1,y(t=this.h=new $o,0,1,e=new N),this.A=new jo,y(this.h,0,3,this.A),this.j=new Go,y(this.h,0,2,this.j),Nt(this.j,4,1),m(this.j,2,.5),m(this.A,2,.5),m(this.h,4,.5)}get baseOptions(){return A(this.h,N,1)}set baseOptions(t){y(this.h,0,1,t)}o(t){return"numPoses"in t&&Nt(this.j,4,t.numPoses??1),"minPoseDetectionConfidence"in t&&m(this.j,2,t.minPoseDetectionConfidence??.5),"minTrackingConfidence"in t&&m(this.h,4,t.minTrackingConfidence??.5),"minPosePresenceConfidence"in t&&m(this.A,2,t.minPosePresenceConfidence??.5),"outputSegmentationMasks"in t&&(this.outputSegmentationMasks=t.outputSegmentationMasks??!1),this.l(t)}F(t,e,n){const r=typeof e!="function"?e:{};return this.u=typeof e=="function"?e:n,hi(this),vt(this,t,r),ui(this)}G(t,e,n,r){const s=typeof n!="function"?n:{};return this.u=typeof n=="function"?n:r,hi(this),Pt(this,t,s,e),ui(this)}m(){var t=new ht;I(t,"image_in"),I(t,"norm_rect"),E(t,"normalized_landmarks"),E(t,"world_landmarks"),E(t,"segmentation_masks");const e=new ct;Lt(e,Va,this.h);const n=new Z;ot(n,2,"mediapipe.tasks.vision.pose_landmarker.PoseLandmarkerGraph"),F(n,"IMAGE:image_in"),F(n,"NORM_RECT:norm_rect"),v(n,"NORM_LANDMARKS:normalized_landmarks"),v(n,"WORLD_LANDMARKS:world_landmarks"),n.o(e),gt(t,n),Rn(this,t),this.g.attachProtoVectorListener("normalized_landmarks",((r,s)=>{this.landmarks=[];for(const i of r)r=Je(i),this.landmarks.push(Nn(r));l(this,s)})),this.g.attachEmptyPacketListener("normalized_landmarks",(r=>{this.landmarks=[],l(this,r)})),this.g.attachProtoVectorListener("world_landmarks",((r,s)=>{this.worldLandmarks=[];for(const i of r)r=ce(i),this.worldLandmarks.push(Ue(r));l(this,s)})),this.g.attachEmptyPacketListener("world_landmarks",(r=>{this.worldLandmarks=[],l(this,r)})),this.outputSegmentationMasks&&(v(n,"SEGMENTATION_MASK:segmentation_masks"),ye(this,"segmentation_masks"),this.g.aa("segmentation_masks",((r,s)=>{this.segmentationMasks=r.map((i=>ve(this,i,!0,!this.u))),l(this,s)})),this.g.attachEmptyPacketListener("segmentation_masks",(r=>{this.segmentationMasks=[],l(this,r)}))),t=t.g(),this.setGraph(new Uint8Array(t),!0)}};nt.prototype.detectForVideo=nt.prototype.G,nt.prototype.detect=nt.prototype.F,nt.prototype.setOptions=nt.prototype.o,nt.createFromModelPath=function(t,e){return w(nt,t,{baseOptions:{modelAssetPath:e}})},nt.createFromModelBuffer=function(t,e){return w(nt,t,{baseOptions:{modelAssetBuffer:e}})},nt.createFromOptions=function(t,e){return w(nt,t,e)},nt.POSE_CONNECTIONS=d2;export{x as S,Ne as Z};
|