@needle-tools/facefilter
Version:
Needle Engine FaceFilter
1 lines • 215 kB
JavaScript
var Q0=Object.defineProperty,J0=(t,e,n)=>e in t?Q0(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,l=(t,e,n)=>J0(t,typeof e!="symbol"?e+"":e,n);import{Renderer as Z0,OneEuroFilter as t2,serializable as B,Behaviour as fe,AssetReference as ze,isDevEnvironment as An,NEEDLE_progressive as Fn,Mathf as Sn,Animator as e2,getIconElement as Mn,showBalloonMessage as Ke,showBalloonError as Ls,hasProLicense as vr,ObjectUtils as Cn,getParam as pe,setParamWithoutReload as Ye,PromiseAllWithErrors as n2,ClearFlags as s2,isMobileDevice as i2,GameObject as $e,instantiate as _r,findObjectOfType as r2,Application as yr,syncField as o2,makeIdFromRandomWords as a2,showBalloonWarning as h2,TypeStore as rt,onStart as c2}from"@needle-tools/engine";import{Matrix4 as ot,MeshBasicMaterial as Rs,DoubleSide as wr,Object3D as te,Mesh as Os,SkinnedMesh as l2,TextureLoader as Ln,PerspectiveCamera as br,Vector3 as zt,VideoTexture as xr,Texture as me,ShaderMaterial as Rn,BufferGeometry as u2,BufferAttribute as Tr,Material as d2,Vector4 as Er}from"three";var qe=typeof self<"u"?self:{};function kr(t){t:{for(var e=["CLOSURE_FLAGS"],n=qe,s=0;s<e.length;s++)if((n=n[e[s]])==null){e=null;break t}e=n}return(t=e&&e[t])!=null&&t}function ge(){throw Error("Invalid UTF8")}function Ar(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let On,Ps;const f2=typeof TextDecoder<"u";let Fr;const p2=typeof TextEncoder<"u";function Sr(t){if(p2)t=(Fr||(Fr=new TextEncoder)).encode(t);else{let n=0;const s=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(128>e)s[n++]=e;else{if(2048>e)s[n++]=e>>6|192;else{if(55296<=e&&57343>=e){if(56319>=e&&i<t.length){const r=t.charCodeAt(++i);if(56320<=r&&57343>=r){e=1024*(e-55296)+r-56320+65536,s[n++]=e>>18|240,s[n++]=e>>12&63|128,s[n++]=e>>6&63|128,s[n++]=63&e|128;continue}i--}e=65533}s[n++]=e>>12|224,s[n++]=e>>6&63|128}s[n++]=63&e|128}}t=n===s.length?s:s.subarray(0,n)}return t}var Qe,Mr=kr(610401301),m2=kr(188588736);const Cr=qe.navigator;function Ds(t){return!!Mr&&!!Qe&&Qe.brands.some(({brand:e})=>e&&e.indexOf(t)!=-1)}function _t(t){var e;return(e=qe.navigator)&&(e=e.userAgent)||(e=""),e.indexOf(t)!=-1}function ee(){return!!Mr&&!!Qe&&0<Qe.brands.length}function Us(){return ee()?Ds("Chromium"):(_t("Chrome")||_t("CriOS"))&&!(!ee()&&_t("Edge"))||_t("Silk")}function Is(t){return Is[" "](t),t}Qe=Cr&&Cr.userAgentData||null,Is[" "]=function(){};var g2=!ee()&&(_t("Trident")||_t("MSIE"));!_t("Android")||Us(),Us(),_t("Safari")&&(Us()||!ee()&&_t("Coast")||!ee()&&_t("Opera")||!ee()&&_t("Edge")||(ee()?Ds("Microsoft Edge"):_t("Edg/"))||ee()&&Ds("Opera"));var Lr={},Je=null;function v2(t){var e=t.length,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);var s=new Uint8Array(n),i=0;return function(r,o){function a(y){for(;h<r.length;){var w=r.charAt(h++),T=Je[w];if(T!=null)return T;if(!/^[\s\xa0]*$/.test(w))throw Error("Unknown base64 encoding at char: "+w)}return y}Rr();for(var h=0;;){var c=a(-1),d=a(0),u=a(64),f=a(64);if(f===64&&c===-1)break;o(c<<2|d>>4),u!=64&&(o(d<<4&240|u>>2),f!=64&&o(u<<6&192|f))}}(t,function(r){s[i++]=r}),i!==n?s.subarray(0,i):s}function Rr(){if(!Je){Je={};for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var s=t.concat(e[n].split(""));Lr[n]=s;for(var i=0;i<s.length;i++){var r=s[i];Je[r]===void 0&&(Je[r]=i)}}}}var Or=typeof Uint8Array<"u",Pr=!g2&&typeof btoa=="function";function Dr(t){if(!Pr){var e;e===void 0&&(e=0),Rr(),e=Lr[e];var n=Array(Math.floor(t.length/3)),s=e[64]||"";let h=0,c=0;for(;h<t.length-2;h+=3){var i=t[h],r=t[h+1],o=t[h+2],a=e[i>>2];i=e[(3&i)<<4|r>>4],r=e[(15&r)<<2|o>>6],o=e[63&o],n[c++]=a+i+r+o}switch(a=0,o=s,t.length-h){case 2:o=e[(15&(a=t[h+1]))<<2]||s;case 1:t=t[h],n[c]=e[t>>2]+e[(3&t)<<4|a>>4]+o+s}return n.join("")}for(e="",n=0,s=t.length-10240;n<s;)e+=String.fromCharCode.apply(null,t.subarray(n,n+=10240));return e+=String.fromCharCode.apply(null,n?t.subarray(n):t),btoa(e)}const Ur=/[-_.]/g,_2={"-":"+",_:"/",".":"="};function y2(t){return _2[t]||""}function Ir(t){if(!Pr)return v2(t);Ur.test(t)&&(t=t.replace(Ur,y2)),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 Ze(t){return Or&&t!=null&&t instanceof Uint8Array}let Br;function Pn(){return Br||(Br=new Uint8Array(0))}var Ee={};let Nr;function jr(t){if(t!==Ee)throw Error("illegal external caller")}function ve(){return Nr||(Nr=new Kt(null,Ee))}function Bs(t){jr(Ee);var e=t.g;return(e=e==null||Ze(e)?e:typeof e=="string"?Ir(e):null)==null?e:t.g=e}var Kt=class{constructor(t,e){if(jr(e),this.g=t,t!=null&&t.length===0)throw Error("ByteString should be constructed with non-empty values")}h(){const t=Bs(this);return t?new Uint8Array(t):Pn()}};function Vr(t,e){return Error(`Invalid wire type: ${t} (at position ${e})`)}function Ns(){return Error("Failed to read varint, encoding is invalid.")}function Gr(t,e){return Error(`Tried to read past the end of the data ${e} > ${t}`)}function js(t){if(typeof t=="string")return{buffer:Ir(t),P:!1};if(Array.isArray(t))return{buffer:new Uint8Array(t),P:!1};if(t.constructor===Uint8Array)return{buffer:t,P:!1};if(t.constructor===ArrayBuffer)return{buffer:new Uint8Array(t),P:!1};if(t.constructor===Kt)return{buffer:Bs(t)||Pn(),P:!0};if(t instanceof Uint8Array)return{buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),P:!1};throw Error("Type not convertible to a Uint8Array, expected a Uint8Array, an ArrayBuffer, a base64 encoded string, a ByteString or an Array of numbers")}function Vs(){return typeof BigInt=="function"}const w2=typeof Uint8Array.prototype.slice=="function";let Dn,L=0,X=0;function _e(t){const e=0>t;let n=(t=Math.abs(t))>>>0;if(t=Math.floor((t-n)/4294967296),e){const[s,i]=Xs(n,t);t=i,n=s}L=n>>>0,X=t>>>0}function Gs(t){const e=Dn||(Dn=new DataView(new ArrayBuffer(8)));e.setFloat32(0,+t,!0),X=0,L=e.getUint32(0,!0)}function Ws(t,e){return 4294967296*e+(t>>>0)}function Hs(t,e){const n=2147483648&e;return n&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),t=Ws(t,e),n?-t:t}function Un(t,e){if(t>>>=0,2097151>=(e>>>=0))var n=""+(4294967296*e+t);else Vs()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,1e7<=t&&(n+=Math.floor(t/1e7),t%=1e7),1e7<=n&&(e+=Math.floor(n/1e7),n%=1e7),n=e+Wr(n)+Wr(t));return n}function Wr(t){return t=String(t),"0000000".slice(t.length)+t}function Hr(){var t=L,e=X;if(2147483648&e)if(Vs())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,s]=Xs(t,e);t="-"+Un(n,s)}else t=Un(t,e);return t}function In(t){if(16>t.length)_e(Number(t));else if(Vs())t=BigInt(t),L=Number(t&BigInt(4294967295))>>>0,X=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");X=L=0;const n=t.length;for(let s=e,i=(n-e)%6+e;i<=n;s=i,i+=6){const r=Number(t.slice(s,i));X*=1e6,L=1e6*L+r,4294967296<=L&&(X+=Math.trunc(L/4294967296),X>>>=0,L>>>=0)}if(e){const[s,i]=Xs(L,X);L=s,X=i}}}function Xs(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function zs(t,e){let n,s=0,i=0,r=0;const o=t.h;let a=t.g;do n=o[a++],s|=(127&n)<<r,r+=7;while(32>r&&128&n);for(32<r&&(i|=(127&n)>>4),r=3;32>r&&128&n;r+=7)n=o[a++],i|=(127&n)<<r;if(ye(t,a),128>n)return e(s>>>0,i>>>0);throw Ns()}function Ks(t){let e=0,n=t.g;const s=n+10,i=t.h;for(;n<s;){const r=i[n++];if(e|=r,(128&r)==0)return ye(t,n),!!(127&e)}throw Ns()}function ne(t){const e=t.h;let n=t.g,s=e[n++],i=127&s;if(128&s&&(s=e[n++],i|=(127&s)<<7,128&s&&(s=e[n++],i|=(127&s)<<14,128&s&&(s=e[n++],i|=(127&s)<<21,128&s&&(s=e[n++],i|=s<<28,128&s&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Ns();return ye(t,n),i}function se(t){return ne(t)>>>0}function Ys(t){var e=t.h;const n=t.g,s=e[n],i=e[n+1],r=e[n+2];return e=e[n+3],ye(t,t.g+4),(s<<0|i<<8|r<<16|e<<24)>>>0}function $s(t){var e=Ys(t);t=2*(e>>31)+1;const n=e>>>23&255;return e&=8388607,n==255?e?NaN:1/0*t:n==0?t*Math.pow(2,-149)*e:t*Math.pow(2,n-150)*(e+Math.pow(2,23))}function b2(t){return ne(t)}function qs(t,e,{ca:n=!1}={}){t.ca=n,e&&(e=js(e),t.h=e.buffer,t.m=e.P,t.j=0,t.l=t.h.length,t.g=t.j)}function ye(t,e){if(t.g=e,e>t.l)throw Gr(t.l,e)}function Xr(t,e){if(0>e)throw Error(`Tried to read a negative byte length: ${e}`);const n=t.g,s=n+e;if(s>t.l)throw Gr(e,t.l-n);return t.g=s,n}function zr(t,e){if(e==0)return ve();var n=Xr(t,e);return t.ca&&t.m?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?Pn():w2?t.slice(n,e):new Uint8Array(t.subarray(n,e))),n.length==0?ve():new Kt(n,Ee)}var Kr=[];function Yr(t){var e=t.g;if(e.g==e.l)return!1;t.l=t.g.g;var n=se(t.g);if(e=n>>>3,!(0<=(n&=7)&&5>=n))throw Vr(n,t.l);if(1>e)throw Error(`Invalid field number: ${e} (at position ${t.l})`);return t.m=e,t.h=n,!0}function Bn(t){switch(t.h){case 0:t.h!=0?Bn(t):Ks(t.g);break;case 1:ye(t=t.g,t.g+8);break;case 2:if(t.h!=2)Bn(t);else{var e=se(t.g);ye(t=t.g,t.g+e)}break;case 5:ye(t=t.g,t.g+4);break;case 3:for(e=t.m;;){if(!Yr(t))throw Error("Unmatched start-group tag: stream EOF");if(t.h==4){if(t.m!=e)throw Error("Unmatched end-group tag");break}Bn(t)}break;default:throw Vr(t.h,t.l)}}function tn(t,e,n){const s=t.g.l,i=se(t.g),r=t.g.g+i;let o=r-s;if(0>=o&&(t.g.l=r,n(e,t,void 0,void 0,void 0),o=r-t.g.g),o)throw Error(`Message parsing ended unexpectedly. Expected to read ${i} bytes, instead read ${i-o} bytes, either the data ended unexpectedly or the message misreported its own length`);return t.g.g=r,t.g.l=s,e}function Qs(t){var e=se(t.g),n=Xr(t=t.g,e);if(t=t.h,f2){var s,i=t;(s=Ps)||(s=Ps=new TextDecoder("utf-8",{fatal:!0})),e=n+e,i=n===0&&e===i.length?i:i.subarray(n,e);try{var r=s.decode(i)}catch(a){if(On===void 0){try{s.decode(new Uint8Array([128]))}catch{}try{s.decode(new Uint8Array([97])),On=!0}catch{On=!1}}throw!On&&(Ps=void 0),a}}else{e=(r=n)+e,n=[];let a,h=null;for(;r<e;){var o=t[r++];128>o?n.push(o):224>o?r>=e?ge():(a=t[r++],194>o||(192&a)!=128?(r--,ge()):n.push((31&o)<<6|63&a)):240>o?r>=e-1?ge():(a=t[r++],(192&a)!=128||o===224&&160>a||o===237&&160<=a||(192&(s=t[r++]))!=128?(r--,ge()):n.push((15&o)<<12|(63&a)<<6|63&s)):244>=o?r>=e-2?ge():(a=t[r++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(s=t[r++]))!=128||(192&(i=t[r++]))!=128?(r--,ge()):(o=(7&o)<<18|(63&a)<<12|(63&s)<<6|63&i,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):ge(),8192<=n.length&&(h=Ar(h,n),n.length=0)}r=Ar(h,n)}return r}function $r(t){const e=se(t.g);return zr(t.g,e)}function Nn(t,e,n){var s=se(t.g);for(s=t.g.g+s;t.g.g<s;)n.push(e(t.g))}var jn=[];function qr(t){return t?/^\d+$/.test(t)?(In(t),new Qr(L,X)):null:Jr||(Jr=new Qr(0,0))}var Qr=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let Jr;function Zr(t){return t?/^-?\d+$/.test(t)?(In(t),new to(L,X)):null:eo||(eo=new to(0,0))}var to=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let eo;function Vn(t,e,n){for(;0<n||127<e;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function en(t,e){for(;127<e;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function Gn(t,e){if(0<=e)en(t,e);else{for(let n=0;9>n;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function nn(t,e){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 ke(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function yt(t,e,n){en(t.g,8*e+n)}function Js(t,e){return yt(t,e,2),e=t.g.end(),ke(t,e),e.push(t.h),e}function Zs(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;127<n;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function Wn(t,e,n){yt(t,e,2),en(t.g,n.length),ke(t,t.g.end()),ke(t,n)}function ti(t,e,n,s){n!=null&&(e=Js(t,e),s(n,t),Zs(t,e))}class Ae{constructor(e,n,s,i){this.g=e,this.h=n,this.l=s,this.pa=i}}function ut(t){return Array.prototype.slice.call(t)}function ei(t){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?Symbol():t}var Rt=ei(),no=ei("0di"),ni=ei("2ex"),si=Rt?(t,e)=>{t[Rt]|=e}:(t,e)=>{t.g!==void 0?t.g|=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}})},Hn=Rt?(t,e)=>{t[Rt]&=~e}:(t,e)=>{t.g!==void 0&&(t.g&=~e)};function Q(t,e,n){return n?t|e:t&~e}var N=Rt?t=>0|t[Rt]:t=>0|t.g,A=Rt?t=>t[Rt]:t=>t.g,j=Rt?(t,e)=>(t[Rt]=e,t):(t,e)=>(t.g!==void 0?t.g=e:Object.defineProperties(t,{g:{value:e,configurable:!0,writable:!0,enumerable:!1}}),t);function Fe(t){return si(t,34),t}function x2(t,e){j(e,-14591&(0|t))}function ii(t,e){j(e,-14557&(34|t))}function so(t){return(t=t>>14&1023)===0?536870912:t}var ri,sn={},io={};function ro(t){return!(!t||typeof t!="object"||t.Ja!==io)}function oi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)&&t.constructor===Object}function ai(t,e,n){if(t!=null){if(typeof t=="string")t=t?new Kt(t,Ee):ve();else if(t.constructor!==Kt)if(Ze(t))t=t.length?new Kt(n?t:new Uint8Array(t),Ee):ve();else{if(!e)throw Error();t=void 0}}return t}function Xn(t,e,n){if(!Array.isArray(t)||t.length)return!1;const s=N(t);return!!(1&s)||!(!e||!(Array.isArray(e)?e.includes(n):e.has(n)))&&(j(t,1|s),!0)}const oo=[];function Ot(t){if(2&t)throw Error()}j(oo,55),ri=Object.freeze(oo);class Ms{constructor(e,n,s){this.l=0,this.g=e,this.h=n,this.m=s}next(){if(this.l<this.g.length){const e=this.g[this.l++];return{done:!1,value:this.h?this.h.call(this.m,e):e}}return{done:!0,value:void 0}}[Symbol.iterator](){return new Ms(this.g,this.h,this.m)}}let Yt,ao,ho;function co(t,e){(e=Yt?e[Yt]:void 0)&&(t[Yt]=ut(e))}function lo(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function T2(){const t=Error();lo(t,"incident"),function(e){qe.setTimeout(()=>{throw e},0)}(t)}function uo(t){return lo(t=Error(t),"warning"),t}function ie(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function fo(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}Object.freeze(new class{}),Object.freeze(new class{});const E2=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function zn(t){const e=typeof t;return e==="number"?Number.isFinite(t):e==="string"&&E2.test(t)}function Se(t){if(t==null)return t;if(typeof t=="string"){if(!t)return;t=+t}return typeof t=="number"&&Number.isFinite(t)?0|t:void 0}function k2(t){if(t==null)return t;if(typeof t=="string"){if(!t)return;t=+t}return typeof t=="number"&&Number.isFinite(t)?t>>>0:void 0}function po(t){return t[0]!=="-"&&(20>t.length||t.length===20&&184467>Number(t.substring(0,6)))}function mo(t){return t[0]==="-"?20>t.length||t.length===20&&-922337<Number(t.substring(0,7)):19>t.length||t.length===19&&922337>Number(t.substring(0,6))}function hi(t){return t=Math.trunc(t),Number.isSafeInteger(t)||(_e(t),t=Hs(L,X)),t}function ci(t){var e=Math.trunc(Number(t));return Number.isSafeInteger(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),mo(t)||(In(t),t=Hr()),t)}function Kn(t){return t==null?t:zn(t)?typeof t=="number"?hi(t):ci(t):void 0}function rn(t){if(typeof t!="string")throw Error();return t}function Me(t){if(t!=null&&typeof t!="string")throw Error();return t}function we(t){return t==null||typeof t=="string"?t:void 0}function li(t,e,n,s){if(t!=null&&typeof t=="object"&&t.X===sn)return t;if(!Array.isArray(t))return n?2&s?(t=e[no])?e=t:(Fe((t=new e).s),e=e[no]=t):e=new e:e=void 0,e;let i=n=N(t);return i===0&&(i|=32&s),i|=2&s,i!==n&&j(t,i),new e(t)}function A2(t,e,n){if(e){var s=!!s;if(!zn(e=t))throw uo("int64");typeof e=="string"?s=ci(e):s?(s=Math.trunc(e),Number.isSafeInteger(s)?s=String(s):mo(e=String(s))?s=e:(_e(s),s=Hr())):s=hi(e)}else s=Kn(t);return typeof(n=(t=s)==null?n?0:void 0:t)=="string"&&(s=+n,Number.isSafeInteger(s))?s:n}let Yn,$n,go;function qn(t){switch(typeof t){case"boolean":return $n||($n=[0,void 0,!0]);case"number":return 0<t?void 0:t===0?go||(go=[0,void 0]):[-t,void 0];case"string":return[0,t];case"object":return t}}function be(t,e){return vo(t,e[0],e[1])}function vo(t,e,n){if(t==null&&(t=Yn),Yn=void 0,t==null){var s=96;n?(t=[n],s|=512):t=[],e&&(s=-16760833&s|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(2048&(s=N(t)))throw Error("farr");if(64&s)return t;if(s|=64,n&&(s|=512,n!==t[0]))throw Error("mid");t:{const i=(n=t).length;if(i){const r=i-1;if(oi(n[r])){if(1024<=(e=r-(+!!(512&(s|=256))-1)))throw Error("pvtlmt");s=-16760833&s|(1023&e)<<14;break t}}if(e){if(1024<(e=Math.max(e,i-(+!!(512&s)-1))))throw Error("spvt");s=-16760833&s|(1023&e)<<14}}}return j(t,s),t}const F2={};let S2=function(){try{return Is(new class extends Map{constructor(){super()}}),!1}catch{return!0}}();class ui{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 M2=S2?(Object.setPrototypeOf(ui.prototype,Map.prototype),Object.defineProperties(ui.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),ui):class extends Map{constructor(){super()}};function _o(t){return t}function di(t){if(2&t.N)throw Error("Cannot mutate an immutable Map")}var wt=class extends M2{constructor(t,e,n=_o,s=_o){super();let i=N(t);i|=64,j(t,i),this.N=i,this.U=e,this.S=n,this.Z=this.U?C2:s;for(let r=0;r<t.length;r++){const o=t[r],a=n(o[0],!1,!0);let h=o[1];e?h===void 0&&(h=null):h=s(o[1],!1,!0,void 0,void 0,i),super.set(a,h)}}oa(t=yo){if(this.size!==0)return this.Y(t)}Y(t=yo){const e=[],n=super.entries();for(var s;!(s=n.next()).done;)(s=s.value)[0]=t(s[0]),s[1]=t(s[1]),e.push(s);return e}clear(){di(this),super.clear()}delete(t){return di(this),super.delete(this.S(t,!0,!1))}entries(){var t=this.na();return new Ms(t,L2,this)}keys(){return this.Ia()}values(){var t=this.na();return new Ms(t,wt.prototype.get,this)}forEach(t,e){super.forEach((n,s)=>{t.call(e,this.get(s),s,this)})}set(t,e){return di(this),(t=this.S(t,!0,!1))==null?this:e==null?(super.delete(t),this):super.set(t,this.Z(e,!0,!0,this.U,!1,this.N))}Oa(t){const e=this.S(t[0],!1,!0);t=t[1],t=this.U?t===void 0?null:t:this.Z(t,!1,!0,void 0,!1,this.N),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.U;return n?((n=this.Z(e,!1,!0,n,this.ta,this.N))!==e&&super.set(t,n),n):e}}na(){return Array.from(super.keys())}Ia(){return super.keys()}[Symbol.iterator](){return this.entries()}};function C2(t,e,n,s,i,r){return t=li(t,s,n,r),i&&(t=Jn(t)),t}function yo(t){return t}function L2(t){return[t,this.get(t)]}let wo;function bo(){return wo||(wo=new wt(Fe([]),void 0,void 0,void 0,F2))}function fi(t,e,n,s,i){if(t!=null){if(Array.isArray(t))t=Xn(t,void 0,0)?void 0:i&&2&N(t)?t:Qn(t,e,n,s!==void 0,i);else if(oi(t)){const r={};for(let o in t)r[o]=fi(t[o],e,n,s,i);t=r}else t=e(t,s);return t}}function Qn(t,e,n,s,i){const r=s||n?N(t):0;s=s?!!(32&r):void 0;const o=ut(t);for(let a=0;a<o.length;a++)o[a]=fi(o[a],e,n,s,i);return n&&(co(o,t),n(r,o)),o}function R2(t){return fi(t,pi,void 0,void 0,!1)}function pi(t){return t.X===sn?t.toJSON():t instanceof wt?t.oa(R2):function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"boolean":return e?1:0;case"object":if(e)if(Array.isArray(e)){if(Xn(e,void 0,0))return}else{if(Ze(e))return Dr(e);if(e instanceof Kt){const n=e.g;return n==null?"":typeof n=="string"?n:e.g=Dr(n)}if(e instanceof wt)return e.oa()}}return e}(t)}function mi(t,e,n=ii){if(t!=null){if(Or&&t instanceof Uint8Array)return e?t:new Uint8Array(t);if(Array.isArray(t)){var s=N(t);return 2&s||(e&&(e=s===0||!!(32&s)&&!(64&s||!(16&s))),t=e?j(t,-12293&(34|s)):Qn(t,mi,4&s?ii:n,!0,!0)),t}return t.X===sn?(n=t.s,t=2&(s=A(n))?t:gi(t,n,s,!0)):t instanceof wt&&!(2&t.N)&&(n=Fe(t.Y(mi)),t=new wt(n,t.U,t.S,t.Z)),t}}function gi(t,e,n,s){return t=t.constructor,Yn=e=xo(e,n,s),e=new t(e),Yn=void 0,e}function xo(t,e,n){const s=n||2&e?ii:x2,i=!!(32&e);return t=function(r,o,a){const h=ut(r);var c=h.length;const d=256&o?h[c-1]:void 0;for(c+=d?-1:0,o=512&o?1:0;o<c;o++)h[o]=a(h[o]);if(d){o=h[o]={};for(const u in d)o[u]=a(d[u])}return co(h,r),h}(t,e,r=>mi(r,i,s)),si(t,32|(n?2:0)),t}function Jn(t){const e=t.s,n=A(e);return 2&n?gi(t,e,n,!1):t}function To(t,e,n,s){return!(4&e)||n!=null}function re(t,e){return Pt(t=t.s,A(t),e)}function Eo(t,e,n,s){if(!(0>(e=s+(+!!(512&e)-1))||e>=t.length||e>=n))return t[e]}function Pt(t,e,n,s){if(n===-1)return null;const i=so(e);if(!(n>=i)){var r=t.length;return s&&256&e&&(s=t[r-1][n])!=null?(Eo(t,e,i,n)&&ni!=null&&(4<=(e=(t=ho??(ho={}))[ni]||0)||(t[ni]=e+1,T2())),s):Eo(t,e,i,n)}return 256&e?t[t.length-1][n]:void 0}function M(t,e,n,s){const i=t.s;let r=A(i);return Ot(r),R(i,r,e,n,s),t}function R(t,e,n,s,i){const r=so(e);if(n>=r||i){let o=e;if(256&e)i=t[t.length-1];else{if(s==null)return o;i=t[r+(+!!(512&e)-1)]={},o|=256}return i[n]=s,n<r&&(t[n+(+!!(512&e)-1)]=void 0),o!==e&&j(t,o),o}return t[n+(+!!(512&e)-1)]=s,256&e&&n in(t=t[t.length-1])&&delete t[n],e}function Ce(t,e,n,s,i){var r=2&e;let o=Pt(t,e,n,i);Array.isArray(o)||(o=ri);const a=!(2&s);s=!(1&s);const h=!!(32&e);let c=N(o);return c!==0||!h||r||a?1&c||(c|=1,j(o,c)):(c|=33,j(o,c)),r?(t=!1,2&c||(Fe(o),t=!!(4&c)),(s||t)&&Object.freeze(o)):(r=!!(2&c)||!!(2048&c),s&&r?(o=ut(o),s=1,h&&!a&&(s|=32),j(o,s),R(t,e,n,o,i)):a&&32&c&&!r&&Hn(o,32)),o}function Zn(t,e){t=t.s;let n=A(t);const s=Pt(t,n,e),i=ie(s);return i!=null&&i!==s&&R(t,n,e,i),i}function ko(t){t=t.s;let e=A(t);const n=Pt(t,e,1),s=ai(n,!0,!!(34&e));return s!=null&&s!==n&&R(t,e,1,s),s}function Le(t,e,n){const s=t.s;let i=A(s);const r=2&i?1:2;let o=Ao(s,i,e);var a=N(o);if(To(t,a,void 0)){(4&a||Object.isFrozen(o))&&(o=ut(o),a=xe(a,i),i=R(s,i,e,o));let h=t=0;for(;t<o.length;t++){const c=n(o[t]);c!=null&&(o[h++]=c)}h<t&&(o.length=h),a=Q(a=Fo(a,i),20,!0),a=Q(a,4096,!1),a=Q(a,8192,!1),j(o,a),2&a&&Object.freeze(o)}return on(a)||(n=a,(a=(t=r===1||r===4&&!!(32&a))?Q(a,2,!0):Re(a,i,!1))!==n&&j(o,a),t&&Object.freeze(o)),r===2&&on(a)&&(o=ut(o),a=Re(a=xe(a,i),i,!1),j(o,a),R(s,i,e,o)),o}function Ao(t,e,n){return t=Pt(t,e,n),Array.isArray(t)?t:ri}function Fo(t,e){return t===0&&(t=xe(t,e)),Q(t,1,!0)}function on(t){return!!(2&t)&&!!(4&t)||!!(2048&t)}function So(t){t=ut(t);for(let e=0;e<t.length;e++){const n=t[e]=ut(t[e]);Array.isArray(n[1])&&(n[1]=Fe(n[1]))}return t}function ts(t,e,n){{const a=t.s;let h=A(a);if(Ot(h),n==null)R(a,h,e);else{var s,i=N(n),r=i,o=!!(2&i)||Object.isFrozen(n);if((s=!o)&&(s=!1),To(t,i))for(i=21,o&&(n=ut(n),r=0,i=Re(i=xe(i,h),h,!0)),t=0;t<n.length;t++)n[t]=rn(n[t]);s&&(n=ut(n),r=0,i=Re(i=xe(i,h),h,!0)),i!==r&&j(n,i),R(a,h,e,n)}}}function vi(t,e,n,s){t=t.s;let i=A(t);Ot(i),R(t,i,e,(s==="0"?Number(n)===0:n===s)?void 0:n)}function an(t,e,n,s){const i=A(t);Ot(i),t=Ce(t,i,e,2),s=n(s,!!(4&(e=N(t)))&&!!(4096&e)),t.push(s)}function O2(t){return t}function _i(t,e){return yi(t=t.s,A(t),va)===e?e:-1}function yi(t,e,n){let s=0;for(let i=0;i<n.length;i++){const r=n[i];Pt(t,e,r)!=null&&(s!==0&&(e=R(t,e,s)),s=r)}return s}function wi(t,e,n,s){let i=A(t);Ot(i);const r=Pt(t,i,n,s);let o;if(r!=null&&r.X===sn)return(e=Jn(r))!==r&&R(t,i,n,e,s),e.s;if(Array.isArray(r)){const a=N(r);o=2&a?xo(r,a,!1):r,o=be(o,e)}else o=be(void 0,e);return o!==r&&R(t,i,n,o,s),o}function Mo(t,e,n,s){t=t.s;let i=A(t);const r=Pt(t,i,n,s);return(e=li(r,e,!1,i))!==r&&e!=null&&R(t,i,n,e,s),e}function E(t,e,n,s=!1){if((e=Mo(t,e,n,s))==null)return e;t=t.s;let i=A(t);if(!(2&i)){const r=Jn(e);r!==e&&R(t,i,n,e=r,s)}return e}function Co(t,e,n,s,i,r){var o=2,a=!!(2&e);o=a?1:o,i=!!i,r&&(r=!a),a=Ao(t,e,s);var h=N(a);const c=!!(4&h);if(!c){var d=a,u=e;const f=!!(2&(h=Fo(h,e)));f&&(u=Q(u,2,!0));let y=!f,w=!0,T=0,q=0;for(;T<d.length;T++){const Lt=li(d[T],n,!1,u);if(Lt instanceof n){if(!f){const Xt=!!(2&N(Lt.s));y&&(y=!Xt),w&&(w=Xt)}d[q++]=Lt}}q<T&&(d.length=q),h=Q(h,4,!0),h=Q(h,16,w),h=Q(h,8,y),j(d,h),f&&Object.freeze(d)}if(r&&!(8&h||!a.length&&(o===1||o===4&&32&h))){for(on(h)&&(a=ut(a),h=xe(h,e),e=R(t,e,s,a)),n=a,r=h,d=0;d<n.length;d++)(h=n[d])!==(u=Jn(h))&&(n[d]=u);r=Q(r,8,!0),r=Q(r,16,!n.length),j(n,r),h=r}return on(h)||(n=h,(h=(r=o===1||o===4&&!!(32&h))?Q(h,!a.length||16&h&&(!c||32&h)?2:2048,!0):Re(h,e,i))!==n&&j(a,h),r&&Object.freeze(a)),o===2&&on(h)&&(a=ut(a),h=Re(h=xe(h,e),e,i),j(a,h),R(t,e,s,a)),a}function $t(t,e,n){t=t.s;const s=A(t);return Co(t,s,e,n,!1,!(2&s))}function _(t,e,n,s,i){return s==null&&(s=void 0),M(t,n,s,i)}function hn(t,e,n,s){s==null&&(s=void 0),t=t.s;let i=A(t);Ot(i),(n=yi(t,i,n))&&n!==e&&s!=null&&(i=R(t,i,n)),R(t,i,e,s)}function xe(t,e){return t=Q(t,2,!!(2&e)),t=Q(t,32,!0),Q(t,2048,!1)}function Re(t,e,n){return 32&e&&n||(t=Q(t,32,!1)),t}function es(t,e,n,s){t=t.s;const i=A(t);Ot(i),e=Co(t,i,n,e,!0),n=s??new n,e.push(n),2&N(n.s)?Hn(e,8):Hn(e,16)}function bt(t,e){return Se(re(t,e))}function Ft(t,e){return t??e}function G(t,e){return Ft(Zn(t,e),0)}function Dt(t,e){return Ft(we(re(t,e)),"")}function cn(t,e,n){if(n!=null&&typeof n!="boolean")throw t=typeof n,Error(`Expected boolean but got ${t!="object"?t:n?Array.isArray(n)?"array":t:"null"}: ${n}`);M(t,e,n)}function Ut(t,e,n){if(n!=null){if(typeof n!="number"||!Number.isFinite(n))throw uo("int32");n|=0}M(t,e,n)}function g(t,e,n){if(n!=null&&typeof n!="number")throw Error(`Value of float/double field must be a number, found ${typeof n}: ${n}`);M(t,e,n)}function St(t,e,n){e.g?e.m(t,e.g,e.h,n,!0):e.m(t,e.h,n,!0)}wt.prototype.toJSON=void 0,wt.prototype.Ja=io;var m=class{constructor(t,e){this.s=vo(t,e)}toJSON(){return Lo(this,Qn(this.s,pi,void 0,void 0,!1),!0)}l(){var t=N1;return t.g?t.l(this,t.g,t.h,!0):t.l(this,t.h,t.defaultValue,!0)}clone(){const t=this.s;return gi(this,t,A(t),!1)}P(){return!!(2&N(this.s))}};function Lo(t,e,n){var s=m2?void 0:t.constructor.B;const i=A(n?t.s:e);if(!(t=e.length))return e;let r,o;if(oi(n=e[t-1])){t:{var a=n;let d={},u=!1;for(var h in a){let f=a[h];if(Array.isArray(f)){let y=f;(Xn(f,s,+h)||ro(f)&&f.size===0)&&(f=null),f!=y&&(u=!0)}f!=null?d[h]=f:u=!0}if(u){for(var c in d){a=d;break t}a=null}}a!=n&&(r=!0),t--}for(h=+!!(512&i)-1;0<t&&(n=e[c=t-1],c-=h,n==null||Xn(n,s,c)||ro(n)&&n.size===0);t--)o=!0;return(r||o)&&(e=Array.prototype.slice.call(e,0,t),a&&e.push(a)),e}function Ro(t){return Array.isArray(t)?t[0]instanceof Ae?t:[H2,t]:[t,void 0]}function Oe(t,e){if(Array.isArray(e)){var n=N(e);if(4&n)return e;for(var s=0,i=0;s<e.length;s++){const r=t(e[s]);r!=null&&(e[i++]=r)}return i<s&&(e.length=i),j(e,-12289&(5|n)),2&n&&Object.freeze(e),e}}m.prototype.X=sn,m.prototype.toString=function(){return Lo(this,this.s,!1).toString()};const Oo=Symbol();function bi(t){let e=t[Oo];if(!e){const n=Do(t),s=Fi(t),i=s.l;e=i?(r,o)=>i(r,o,s):(r,o)=>{for(;Yr(o)&&o.h!=4;){var a=o.m,h=s[a];if(!h){var c=s.ea;c&&(c=c[a])&&(h=s[a]=P2(c))}h&&h(o,r,a)||(a=(h=o).l,Bn(h),h.ia?h=void 0:(c=h.g.g-a,h.g.g=a,h=zr(h.g,c)),a=r,h&&(Yt||(Yt=Symbol()),(c=a[Yt])?c.push(h):a[Yt]=[h]))}n===Ti||n===ns||n.j||(r[ao||(ao=Symbol())]=n)},t[Oo]=e}return e}function P2(t){const e=(t=Ro(t))[0].g;if(t=t[1]){const n=bi(t),s=Fi(t).T;return(i,r,o)=>e(i,r,o,s,n)}return e}class xi{}let Ti,ns;const ln=Symbol();function D2(t,e,n){const s=n[1];let i;if(s){const r=s[ln];i=r?r.T:qn(s[0]),t[e]=r??s}i&&i===$n?(t.g||(t.g=new Set)).add(e):n[0]&&(t.h||(t.h=new Set)).add(e)}function Po(t,e){return[t.l,!e||0<e[0]?void 0:e]}function Do(t){var e=t[ln];if(e)return e;if(!(e=Ei(t,t[ln]=new xi,Po,Po,D2)).ea&&!e.h&&!e.g){let n=!0;for(let s in e)isNaN(s)||(n=!1);n?(qn(t[0])===$n?ns?e=ns:((e=new xi).T=qn(!0),e=ns=e):e=Ti||(Ti=new xi),e=t[ln]=e):e.j=!0}return e}function U2(t,e,n){t[e]=n}function Ei(t,e,n,s,i=U2){e.T=qn(t[0]);let r=0;var o=t[++r];o&&o.constructor===Object&&(e.ea=o,typeof(o=t[++r])=="function"&&(e.l=o,e.m=t[++r],o=t[++r]));const a={};for(;Array.isArray(o)&&typeof o[0]=="number"&&0<o[0];){for(var h=0;h<o.length;h++)a[o[h]]=o;o=t[++r]}for(h=1;o!==void 0;){let u;typeof o=="number"&&(h+=o,o=t[++r]);var c=void 0;if(o instanceof Ae?u=o:(u=X2,r--),u.pa){o=t[++r],c=t;var d=r;typeof o=="function"&&(o=o(),c[d]=o),c=o}for(d=h+1,typeof(o=t[++r])=="number"&&0>o&&(d-=o,o=t[++r]);h<d;h++){const f=a[h];i(e,h,c?s(u,c,f):n(u,f))}}return e}const Uo=Symbol();function Io(t){let e=t[Uo];if(!e){const n=ss(t);e=(s,i)=>jo(s,i,n),t[Uo]=e}return e}const ki=Symbol();function I2(t){return t.h}function B2(t,e){let n,s;const i=t.h;return(r,o,a)=>i(r,o,a,s||(s=ss(e).T),n||(n=Io(e)))}function ss(t){let e=t[ki];return e||(e=Ei(t,t[ki]={},I2,B2),Bo(t),e)}const Ai=Symbol();function N2(t,e){const n=t.g;return e?(s,i,r)=>n(s,i,r,e):n}function j2(t,e,n){const s=t.g;let i,r;return(o,a,h)=>s(o,a,h,r||(r=Fi(e).T),i||(i=bi(e)),n)}function Fi(t){let e=t[Ai];return e||(Do(t),e=Ei(t,t[Ai]={},N2,j2),Bo(t),e)}function Bo(t){Ai in t&&ln in t&&ki in t&&(t.length=0)}function No(t,e){var n=t[e];if(n)return n;if((n=t.ea)&&(n=n[e])){var s=(n=Ro(n))[0].h;if(n=n[1]){const i=Io(n),r=ss(n).T;n=(n=t.m)?n(r,i):(o,a,h)=>s(o,a,h,r,i)}else n=s;return t[e]=n}}function jo(t,e,n){for(var s=A(t),i=+!!(512&s)-1,r=t.length,o=512&s?1:0,a=r+(256&s?-1:0);o<a;o++){const h=t[o];if(h==null)continue;const c=o-i,d=No(n,c);d&&d(e,h,c)}if(256&s){s=t[r-1];for(let h in s)i=+h,Number.isNaN(i)||(r=s[h])!=null&&(a=No(n,i))&&a(e,r,i)}if(t=Yt?t[Yt]:void 0)for(ke(e,e.g.end()),n=0;n<t.length;n++)ke(e,Bs(t[n])||Pn())}function at(t,e){return new Ae(t,e,!1,!1)}function Pe(t,e){return new Ae(t,e,!0,!1)}function is(t,e){return new Ae(t,e,!1,!0)}function ht(t,e,n){R(t,A(t),e,n)}var V2=is(function(t,e,n,s,i){return t.h===2&&(t=tn(t,be([void 0,void 0],s),i),Ot(s=A(e)),(i=Pt(e,s,n))instanceof wt?(2&i.N)!=0?((i=i.Y()).push(t),R(e,s,n,i)):i.Oa(t):Array.isArray(i)?(2&N(i)&&R(e,s,n,i=So(i)),i.push(t)):R(e,s,n,[t]),!0)},function(t,e,n,s,i){if(e instanceof wt)e.forEach((r,o)=>{ti(t,n,be([o,r],s),i)});else if(Array.isArray(e))for(let r=0;r<e.length;r++){const o=e[r];Array.isArray(o)&&ti(t,n,be(o,s),i)}});function Vo(t,e,n){t:if(e!=null){if(zn(e)){if(typeof e=="string"){e=ci(e);break t}if(typeof e=="number"){e=hi(e);break t}}e=void 0}e!=null&&(typeof e=="string"&&Zr(e),e!=null&&(yt(t,n,0),typeof e=="number"?(t=t.g,_e(e),Vn(t,L,X)):(n=Zr(e),Vn(t.g,n.h,n.g))))}function Go(t,e,n){(e=Se(e))!=null&&e!=null&&(yt(t,n,0),Gn(t.g,e))}function Wo(t,e,n){(e=fo(e))!=null&&(yt(t,n,0),t.g.g.push(e?1:0))}function Ho(t,e,n){(e=we(e))!=null&&Wn(t,n,Sr(e))}function rs(t,e,n,s,i){ti(t,n,e instanceof m?e.s:Array.isArray(e)?be(e,s):void 0,i)}function Xo(t,e,n){(e=e==null||typeof e=="string"||Ze(e)||e instanceof Kt?e:void 0)!=null&&Wn(t,n,js(e).buffer)}function zo(t,e,n){return(t.h===5||t.h===2)&&(e=Ce(e,A(e),n,2,!1),t.h==2?Nn(t,$s,e):e.push($s(t.g)),!0)}var z,qt=at(function(t,e,n){if(t.h!==1)return!1;var s=t.g;t=Ys(s);const i=Ys(s);s=2*(i>>31)+1;const r=i>>>20&2047;return t=4294967296*(1048575&i)+t,ht(e,n,r==2047?t?NaN:1/0*s:r==0?s*Math.pow(2,-1074)*t:s*Math.pow(2,r-1075)*(t+4503599627370496)),!0},function(t,e,n){(e=ie(e))!=null&&(yt(t,n,1),t=t.g,(n=Dn||(Dn=new DataView(new ArrayBuffer(8)))).setFloat64(0,+e,!0),L=n.getUint32(0,!0),X=n.getUint32(4,!0),nn(t,L),nn(t,X))}),K=at(function(t,e,n){return t.h===5&&(ht(e,n,$s(t.g)),!0)},function(t,e,n){(e=ie(e))!=null&&(yt(t,n,5),t=t.g,Gs(e),nn(t,L))}),G2=Pe(zo,function(t,e,n){if((e=Oe(ie,e))!=null)for(let o=0;o<e.length;o++){var s=t,i=n,r=e[o];r!=null&&(yt(s,i,5),s=s.g,Gs(r),nn(s,L))}}),Si=Pe(zo,function(t,e,n){if((e=Oe(ie,e))!=null&&e.length){yt(t,n,2),en(t.g,4*e.length);for(let s=0;s<e.length;s++)n=t.g,Gs(e[s]),nn(n,L)}}),oe=at(function(t,e,n){return t.h===0&&(ht(e,n,zs(t.g,Hs)),!0)},Vo),Mi=at(function(t,e,n){return t.h===0&&(ht(e,n,(t=zs(t.g,Hs))===0?void 0:t),!0)},Vo),W2=at(function(t,e,n){return t.h===0&&(ht(e,n,zs(t.g,Ws)),!0)},function(t,e,n){t:if(e!=null){if(zn(e)){if(typeof e=="string"){var s=Math.trunc(Number(e));Number.isSafeInteger(s)&&0<=s?e=String(s):((s=e.indexOf("."))!==-1&&(e=e.substring(0,s)),po(e)||(In(e),e=Un(L,X)));break t}if(typeof e=="number"){e=0<=(e=Math.trunc(e))&&Number.isSafeInteger(e)?e:function(i){if(0>i){_e(i);const r=Un(L,X);return i=Number(r),Number.isSafeInteger(i)?i:r}return po(String(i))?i:(_e(i),Ws(L,X))}(e);break t}}e=void 0}e!=null&&(typeof e=="string"&&qr(e),e!=null&&(yt(t,n,0),typeof e=="number"?(t=t.g,_e(e),Vn(t,L,X)):(n=qr(e),Vn(t.g,n.h,n.g))))}),V=at(function(t,e,n){return t.h===0&&(ht(e,n,ne(t.g)),!0)},Go),os=Pe(function(t,e,n){return(t.h===0||t.h===2)&&(e=Ce(e,A(e),n,2,!1),t.h==2?Nn(t,ne,e):e.push(ne(t.g)),!0)},function(t,e,n){if((e=Oe(Se,e))!=null&&e.length){n=Js(t,n);for(let s=0;s<e.length;s++)Gn(t.g,e[s]);Zs(t,n)}}),De=at(function(t,e,n){return t.h===0&&(ht(e,n,(t=ne(t.g))===0?void 0:t),!0)},Go),W=at(function(t,e,n){return t.h===0&&(ht(e,n,Ks(t.g)),!0)},Wo),un=at(function(t,e,n){return t.h===0&&(ht(e,n,(t=Ks(t.g))===!1?void 0:t),!0)},Wo),J=Pe(function(t,e,n){return t.h===2&&(an(e,n,O2,t=Qs(t)),!0)},function(t,e,n){if((e=Oe(we,e))!=null)for(let o=0;o<e.length;o++){var s=t,i=n,r=e[o];r!=null&&Wn(s,i,Sr(r))}}),ae=at(function(t,e,n){return t.h===2&&(ht(e,n,(t=Qs(t))===""?void 0:t),!0)},Ho),F=at(function(t,e,n){return t.h===2&&(ht(e,n,Qs(t)),!0)},Ho),H2=is(function(t,e,n,s,i){return t.h===2&&(tn(t,wi(e,s,n,!0),i),!0)},rs),X2=is(function(t,e,n,s,i){return t.h===2&&(tn(t,wi(e,s,n),i),!0)},rs);z=new Ae(function(t,e,n,s,i){if(t.h!==2)return!1;s=be(void 0,s);let r=A(e);Ot(r);let o=Ce(e,r,n,3);return r=A(e),4&N(o)&&(o=ut(o),j(o,-2079&(1|N(o))),R(e,r,n,o)),o.push(s),tn(t,s,i),!0},function(t,e,n,s,i){if(Array.isArray(e))for(let r=0;r<e.length;r++)rs(t,e[r],n,s,i)},!0,!0);var S=is(function(t,e,n,s,i,r){if(t.h!==2)return!1;let o=A(e);return Ot(o),(r=yi(e,o,r))&&n!==r&&R(e,o,r),tn(t,e=wi(e,s,n),i),!0},rs),Ko=at(function(t,e,n){return t.h===2&&(ht(e,n,$r(t)),!0)},Xo),z2=Pe(function(t,e,n){return(t.h===0||t.h===2)&&(e=Ce(e,A(e),n,2,!1),t.h==2?Nn(t,se,e):e.push(se(t.g)),!0)},function(t,e,n){if((e=Oe(k2,e))!=null)for(let o=0;o<e.length;o++){var s=t,i=n,r=e[o];r!=null&&(yt(s,i,0),en(s.g,r))}}),It=at(function(t,e,n){return t.h===0&&(ht(e,n,ne(t.g)),!0)},function(t,e,n){(e=Se(e))!=null&&(e=parseInt(e,10),yt(t,n,0),Gn(t.g,e))}),K2=Pe(function(t,e,n){return(t.h===0||t.h===2)&&(e=Ce(e,A(e),n,2,!1),t.h==2?Nn(t,b2,e):e.push(ne(t.g)),!0)},function(t,e,n){if((e=Oe(Se,e))!=null&&e.length){n=Js(t,n);for(let s=0;s<e.length;s++)Gn(t.g,e[s]);Zs(t,n)}});class Y2{constructor(e,n){this.h=e,this.g=n,this.l=E,this.m=_,this.defaultValue=void 0}}function Mt(t,e){return new Y2(t,e)}function he(t,e){return(n,s)=>{if(jn.length){const r=jn.pop();r.o(s),qs(r.g,n,s),n=r}else n=new class{constructor(r,o){if(Kr.length){const a=Kr.pop();qs(a,r,o),r=a}else r=new class{constructor(a,h){this.h=null,this.m=!1,this.g=this.l=this.j=0,qs(this,a,h)}clear(){this.h=null,this.m=!1,this.g=this.l=this.j=0,this.ca=!1}}(r,o);this.g=r,this.l=this.g.g,this.h=this.m=-1,this.o(o)}o({ia:r=!1}={}){this.ia=r}}(n,s);try{const r=new t,o=r.s;bi(e)(o,n);var i=r}finally{n.g.clear(),n.m=-1,n.h=-1,100>jn.length&&jn.push(n)}return i}}function as(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}}}};jo(this.s,e,ss(t)),ke(e,e.g.end());const n=new Uint8Array(e.h),s=e.l,i=s.length;let r=0;for(let o=0;o<i;o++){const a=s[o];n.set(a,r),r+=a.length}return e.l=[n],n}}var Yo=class extends m{constructor(t){super(t)}},$o=[0,ae,at(function(t,e,n){return t.h===2&&(ht(e,n,(t=$r(t))===ve()?void 0:t),!0)},function(t,e,n){if(e!=null){if(e instanceof m){const s=e.Qa;return void(s&&(e=s(e),e!=null&&Wn(t,n,js(e).buffer)))}if(Array.isArray(e))return}Xo(t,e,n)})],$2=[0,F],qo=[0,V,It,W,-1,os,It,-1],q2=[0,W,-1],Qo=class extends m{constructor(){super()}};Qo.B=[6];var Jo=[0,W,F,W,It,-1,K2,F,-1,q2,It],Zo=[0,F,-2],ta=class extends m{constructor(){super()}},ea=[0],na=[0,V,W,-4],dt=class extends m{constructor(t){super(t,2)}},P={},Q2=[-2,P,W];P[336783863]=[0,F,W,-1,V,[0,[1,2,3,4,5,6],S,ea,S,Jo,S,Zo,S,na,S,qo,S,[0,F]],$2,W,[0,[1,3],[2,4],S,[0,os],-1,S,[0,J],-1,z,[0,F,-1]],F];var J2=[0,ae,un],sa=[0,Mi,-1,un,-3,Mi,os,ae,De,Mi,-1,un,De,un,-2,ae],dn=[-1,{}],ia=[0,F,1,dn],ra=[0,F,J,dn];function ft(t,e){vi(t,2,Me(e),"")}function C(t,e){an(t.s,3,rn,e)}function x(t,e){an(t.s,4,rn,e)}var Z=class extends m{constructor(t){super(t,500)}o(t){return _(this,0,7,t)}};Z.B=[3,4,5,6,8,13,17,1005];var Z2=[-500,ae,-1,J,-3,Q2,z,$o,De,-1,ia,ra,z,J2,ae,sa,De,J,987,J],t1=[0,ae,-1,dn],e1=[-500,F,-1,[-1,{}],998,F],n1=[-500,F,J,-1,[-2,{},W],997,J,-1],s1=[-500,F,J,dn,998,J];function pt(t,e){es(t,1,Z,e)}function O(t,e){an(t.s,10,rn,e)}function k(t,e){an(t.s,15,rn,e)}var tt=class extends m{constructor(t){super(t,500)}o(t){return _(this,0,1001,t)}};tt.B=[1,6,7,9,10,15,16,17,14,1002];var oa=[-500,z,Z2,4,z,e1,z,n1,De,z,s1,J,De,ia,ra,z,t1,J,-2,sa,ae,-1,un,979,dn,z,$o],i1=he(tt,oa);tt.prototype.g=as(oa);var r1=[0,z,[0,V,-2]],o1=class extends m{constructor(t){super(t)}},a1=[0,V,K,F,-1],Ci=class extends m{constructor(t){super(t)}g(){return $t(this,o1,1)}};Ci.B=[1];var aa=[0,z,a1],hs=he(Ci,aa),h1=[0,V,K],c1=[0,V,-1,r1],l1=class extends m{constructor(t){super(t)}},u1=[0,V,-3],d1=[0,K,-3],f1=class extends m{constructor(t){super(t)}},p1=[0,K,-1,F,K],cs=class extends m{constructor(t){super(t)}h(){return E(this,l1,2)}g(){return $t(this,f1,5)}};cs.B=[5];var m1=[0,It,u1,d1,c1,z,p1],ha=class extends m{constructor(t){super(t)}};ha.B=[1,2,3,8,9];var ca=he(ha,[0,J,os,Si,m1,F,-1,oe,z,h1,J,oe]),la=class extends m{constructor(t){super(t)}},g1=[0,K,-4],ua=class extends m{constructor(t){super(t)}};ua.B=[1];var Ue=he(ua,[0,z,g1]),da=class extends m{constructor(t){super(t)}},v1=[0,K,-4],fa=class extends m{constructor(t){super(t)}};fa.B=[1];var fn=he(fa,[0,z,v1]),pa=class extends m{constructor(t){super(t)}};pa.B=[3];var _1=[0,V,-1,Si,It],ma=class extends m{constructor(){super()}};ma.prototype.g=as([0,K,-4,oe]);var y1=class extends m{constructor(t){super(t)}},w1=[0,1,V,F,aa],ga=class extends m{constructor(t){super(t)}};ga.B=[1];var b1=he(ga,[0,z,w1,oe]),Li=class extends m{constructor(t){super(t)}};Li.B=[1];var x1=class extends m{constructor(t){super(t)}qa(){return ko(this)??ve()}},T1=class extends m{constructor(t){super(t)}},va=[1,2],E1=[0,va,S,[0,Si],S,[0,Ko],V,F],_a=class extends m{constructor(t){super(t)}};_a.B=[1];var k1=he(_a,[0,z,E1,oe]),ls=class extends m{constructor(t){super(t)}};ls.B=[4,5];var ya=[0,F,V,K,J,-1],wa=class extends m{constructor(t){super(t)}},A1=[0,W,-1],ba=class extends m{constructor(t){super(t)}},us=[1,2,3,4,5],ds=class extends m{constructor(t){super(t)}g(){return ko(this)!=null}h(){return we(re(this,2))!=null}},xa=[0,Ko,F,[0,V,oe,-1],[0,W2,oe]],D=class extends m{constructor(t){super(t)}g(){return fo(re(this,2))??!1}},H=[0,xa,W,[0,us,S,na,S,Jo,S,qo,S,ea,S,Zo],It],fs=class extends m{constructor(t){super(t)}},Ri=[0,H,K,-1,V],F1=Mt(502141897,fs);P[502141897]=Ri;var Ta=[0,xa];P[512499200]=Ta;var Ea=[0,Ta];P[515723506]=Ea;var S1=he(class extends m{constructor(t){super(t)}},[0,[0,It,-1,G2,z2],_1]),ka=[0,H];P[508981768]=ka;var Aa=class extends m{constructor(t){super(t)}},Oi=[0,H,K,ka,W],Fa=class extends m{constructor(t){super(t)}},Sa=[0,H,Ri,Oi,K,Ea];P[508968149]=Oi;var M1=Mt(508968150,Fa);P[508968150]=Sa;var Ma=class extends m{constructor(t){super(t)}},C1=Mt(513916220,Ma);P[513916220]=[0,H,Sa,V];var Ie=class extends m{constructor(t){super(t)}h(){return E(this,ls,2)}g(){M(this,2)}},Ca=[0,H,ya];P[478825465]=Ca;var La=[0,H];P[478825422]=La;var L1=class extends m{constructor(t){super(t)}},Ra=[0,H,La,Ca,-1],Oa=class extends m{constructor(t){super(t)}},Pa=[0,H,K,V],Pi=class extends m{constructor(t){super(t)}},Di=[0,H,K],Ui=class extends m{constructor(t){super(t)}},Da=[0,H,Pa,Di,K],Ua=class extends m{constructor(t){super(t)}},R1=[0,H,Da,Ra];P[463370452]=Ra,P[464864288]=Pa,P[474472470]=Di;var O1=Mt(462713202,Ui);P[462713202]=Da;var P1=Mt(479097054,Ua);P[479097054]=R1;var D1=class extends m{constructor(t){super(t)}},U1=[0,H],Ia=class extends m{constructor(t){super(t)}},Ii=[0,H,K,-1,V];P[514774813]=Ii;var Ba=class extends m{constructor(t){super(t)}},Bi=[0,H,K,W];P[518928384]=Bi;var Na=class extends m{constructor(){super()}};Na.prototype.g=as([0,H,Di,U1,Ri,Oi,Ii,Bi]);var ja=class extends m{constructor(t){super(t)}},I1=Mt(456383383,ja);P[456383383]=[0,H,ya];var Va=class extends m{constructor(t){super(t)}},B1=Mt(476348187,Va);P[476348187]=[0,H,A1];var Ga=class extends m{constructor(t){super(t)}},Wa=[0,It,-1],Ni=class extends m{constructor(t){super(t)}};Ni.B=[3];var N1=Mt(458105876,class extends m{constructor(t){super(t)}g(){var t=this.s;const e=A(t);var n=2&e;return t=function(s,i,r){var o=Ni;const a=2&i;let h=!1;if(r==null){if(a)return bo();r=[]}else if(r.constructor===wt){if((2&r.N)==0||a)return r;r=r.Y()}else Array.isArray(r)?h=!!(2&N(r)):r=[];if(a){if(!r.length)return bo();h||(h=!0,Fe(r))}else h&&(h=!1,r=So(r));return h||(64&N(r)?Hn(r,32):32&i&&si(r,32)),R(s,i,2,o=new wt(r,o,A2,void 0),!1),o}(t,e,Pt(t,e,2)),t==null||!n&&Ni&&(t.ta=!0),n=t}});P[458105876]=[0,Wa,V2,[!0,oe,[0,F,-1,J]]];var ji=class extends m{constructor(t){super(t)}},Ha=Mt(458105758,ji);P[458105758]=[0,H,F,Wa];var Vi=class extends m{constructor(t){super(t)}};Vi.B=[5,6];var j1=Mt(443442058,Vi);P[443442058]=[0,H,F,V,K,J,-1];var Xa=class extends m{constructor(t){super(t)}},V1=Mt(516587230,Xa);function Gi(t,e){return e=e?e.clone():new ls,t.displayNamesLocale!==void 0?M(e,1,Me(t.displayNamesLocale)):t.displayNamesLocale===void 0&&M(e,1),t.maxResults!==void 0?Ut(e,2,t.maxResults):"maxResults"in t&&M(e,2),t.scoreThreshold!==void 0?g(e,3,t.scoreThreshold):"scoreThreshold"in t&&M(e,3),t.categoryAllowlist!==void 0?ts(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&M(e,4),t.categoryDenylist!==void 0?ts(e,5,t.categoryDenylist):"categoryDenylist"in t&&M(e,5),e}function Wi(t,e=-1,n=""){return{categories:t.map(s=>({index:Ft(bt(s,1),0)??-1,score:G(s,2)??0,categoryName:Dt(s,3)??"",displayName:Dt(s,4)??""})),headIndex:e,headName:n}}function za(t){var e,n,s=Le(t,3,ie),i=Le(t,2,Se),r=Le(t,1,we),o=Le(t,9,we);const a={categories:[],keypoints:[]};for(let h=0;h<s.length;h++)a.categories.push({score:s[h],index:i[h]??-1,categoryName:r[h]??"",displayName:o[h]??""});if((s=(e=E(t,cs,4))==null?void 0:e.h())&&(a.boundingBox={originX:bt(s,1)??0,originY:bt(s,2)??0,width:bt(s,3)??0,height:bt(s,4)??0,angle:0}),(n=E(t,cs,4))==null?void 0:n.g().length)for(const h of E(t,cs,4).g())a.keypoints.push({x:Zn(h,1)??0,y:Zn(h,2)??0,score:Zn(h,4)??0,label:we(re(h,3))??""});return a}function ps(t){const e=[];for(const n of $t(t,da,1))e.push({x:G(n,1)??0,y:G(n,2)??0,z:G(n,3)??0,visibility:G(n,4)??0});return e}function pn(t){const e=[];for(const n of $t(t,la,1))e.push({x:G(n,1)??0,y:G(n,2)??0,z:G(n,3)??0,visibility:G(n,4)??0});return e}function Ka(t){return Array.from(t,e=>127<e?e-256:e)}function Ya(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,s=0,i=0;for(let r=0;r<t.length;r++)n+=t[r]*e[r],s+=t[r]*t[r],i+=e[r]*e[r];if(0>=s||0>=i)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(s*i)}let ms;P[516587230]=[0,H,Ii,Bi,K];const G1=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 $a(){if(ms===void 0)try{await WebAssembly.instantiate(G1),ms=!0}catch{ms=!1}return ms}async function mn(t,e=""){const n=await $a()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var Te=class{};function qa(){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/))&&1<=t.length&&17<=Number(t[1])))}async function Qa(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise((n,s)=>{e.addEventListener("load",()=>{n()},!1),e.addEventListener("error",i=>{s(i)},!1),document.body.appendChild(e)})}importScripts(t.toString())}function Ja(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 v(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 Za(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[s,i]=Ja(e);return!t.l||s===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=s,t.i.canvas.height=i),[s,i]}function t0(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const s=new Uint32Array(e.length);for(let i=0;i<e.length;i++)s[i]=t.i.stringToNewUTF8(e[i]);e=t.i._malloc(4*s.length),t.i.HEAPU32.set(s,e>>2),n(e);for(const i of s)t.i._free(i);t.i._free(e)}function Bt(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function ce(t,e,n){let s=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(i,r,o)=>{r?(n(s,o),s=[]):s.push(i)}}Te.forVisionTasks=function(t){return mn("vision",t)},Te.forTextTasks=function(t){return mn("text",t)},Te.forGenAiExperimentalTasks=function(t){return mn("genai_experimental",t)},Te.forGenAiTasks=function(t){return mn("genai",t)},Te.forAudioTasks=function(t){return mn("audio",t)},Te.isSimdSupported=function(){return $a()};async function W1(t,e,n,s){return t=await(async(i,r,o,a,h)=>{if(r&&await Qa(r),!self.ModuleFactory||o&&(await Qa(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&h&&((r=self.Module).locateFile=h.locateFile,h.mainScriptUrlOrBlob&&(r.mainScriptUrlOrBlob=h.mainScriptUrlOrBlob)),h=await self.ModuleFactory(self.Module||h),self.ModuleFactory=self.Module=void 0,new i(h,a)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:i=>i.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&i.endsWith(".data")?n.assetBinaryPath.toString():i}),await t.o(s),t}function Hi(t,e){const n=E(t.baseOptions,ds,1)||new ds;typeof e=="string"?(M(n,2,Me(e)),M(n,1)):e instanceof Uint8Array&&(M(n,1,ai(e,!1,!1)),M(n,2)),_(t.baseOptions,0,1,n)}function e0(t){try{const e=t.K.length;if(e===1)throw Error(t.K[0].message);if(1<e)throw Error("Encountered multiple errors: "+t.K.map(n=>n.message).join(", "))}finally{t.K=[]}}function p(t,e){t.J=Math.max(t.J,e)}function gs(t,e){t.C=new Z,ft(t.C,"PassThroughCalculator"),C(t.C,"free_memory"),x(t.C,"free_memory_unused_out"),O(e,"free_memory"),pt(e,t.C)}function Be(t,e){C(t.C,e),x(t.C,e+"_unused_out")}function vs(t){t.g.addBoolToStream(!0,"free_memory",t.J)}var _s=class{constructor(t){this.g=t,this.K=[],this.J=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){var n,s,i,r,o,a;if(e){const h=t.baseOptions||{};if((n=t.baseOptions)!=null&&n.modelAssetBuffer&&(s=t.baseOptions)!=null&&s.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!((i=E(this.baseOptions,ds,1))!=null&&i.g()||(r=E(this.baseOptions,ds,1))!=null&&r.h()||(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(c,d){let u=E(c.baseOptions,ba,3);if(!u){var f=u=new ba,y=new ta;hn(f,4,us,y)}"delegate"in d&&(d.delegate==="GPU"?(d=u,f=new Qo,hn(d,2,us,f)):(d=u,f=new ta,hn(d,4,us,f))),_(c.baseOptions,0,3,u)}(this,h),h.modelAssetPath)return fetch(h.modelAssetPath.toString()).then(c=>{if(c.ok)return c.arrayBuffer();throw Error(`Failed to fetch model: ${h.modelAssetPath} (${c.status})`)}).then(c=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(c),!0,!1,!1),Hi(this,"/model.dat"),this.m(),this.L()});if(h.modelAssetBuffer instanceof Uint8Array)Hi(this,h.modelAssetBuffer);else if(h.modelAssetBuffer)return async function(c){const d=[];for(var u=0;;){const{done:f,value:y}=await c.read();if(f)break;d.push(y),u+=y.length}if(d.length===0)return new Uint8Array(0);if(d.length===1)return d[0];c=new Uint8Array(u),u=0;for(const f of d)c.set(f,u),u+=f.length;return c}(h.modelAssetBuffer).then(c=>{Hi(this,c),this.m(),this.L()})}return this.m(),this.L(),Promise.resolve()}L(){}fa(){let t;if(this.g.fa(e=>{t=i1(e)}),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener((n,s)=>{this.K.push(Error(s))}),this.g.Ma(),this.g.setGraph(t,e),this.C=void 0,e0(this)}finishProcessing(){this.g.finishProcessing(),e0(this)}close(){this.C=void 0,this.g.closeGraph()}};function et(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}_s.prototype.close=_s.prototype.close,function(t,e){t=t.split(".");var n,s=qe;for((t[0]in s)||s.execScript===void 0||s.execScript("var "+t[0]);t.length&&(n=t.shift());)t.length||e===void 0?s=s[n]&&s[n]!==Object.prototype[n]?s[n]:s[n]={}:s[n]=e}("TaskRunner",_s);class H1{constructor(e,n,s,i){this.g=e,this.h=n,this.m=s,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function n0(t,e,n){const s=t.g;if(n=et(s.createShader(n),"Failed to create WebGL shader"),s.shaderSource(n,e),s.compileShader(n),!s.getShaderParameter(n,s.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${s.getShaderInfoLog(n)}`);return s.attachShader(t.h,n),n}function s0(t,e){const n=t.g,s=et(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(s);const i=et(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n