(function(){/*

 Copyright The Closure Library Authors.
 SPDX-License-Identifier: Apache-2.0
*/
'use strict';var v;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var ba="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
function ca(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var w=ca(this);function x(a,b){if(b)a:{var c=w;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&ba(c,a,{configurable:!0,writable:!0,value:b})}}
x("Symbol",function(a){function b(g){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(g||"")+"_"+e++,g)}function c(g,f){this.g=g;ba(this,"description",{configurable:!0,writable:!0,value:f})}if(a)return a;c.prototype.toString=function(){return this.g};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
x("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=w[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&ba(d.prototype,a,{configurable:!0,writable:!0,value:function(){return da(aa(this))}})}return a});function da(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
function A(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function ea(a){if(!(a instanceof Array)){a=A(a);for(var b,c=[];!(b=a.next()).done;)c.push(b.value);a=c}return a}var fa="function"==typeof Object.assign?Object.assign:function(a,b){for(var c=1;c<arguments.length;c++){var d=arguments[c];if(d)for(var e in d)Object.prototype.hasOwnProperty.call(d,e)&&(a[e]=d[e])}return a};x("Object.assign",function(a){return a||fa});
var ha="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},ia;if("function"==typeof Object.setPrototypeOf)ia=Object.setPrototypeOf;else{var ja;a:{var ka={a:!0},la={};try{la.__proto__=ka;ja=la.a;break a}catch(a){}ja=!1}ia=ja?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var ma=ia;
function B(a,b){a.prototype=ha(b.prototype);a.prototype.constructor=a;if(ma)ma(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.za=b.prototype}function na(){this.l=!1;this.i=null;this.h=void 0;this.g=1;this.v=this.s=0;this.j=null}function oa(a){if(a.l)throw new TypeError("Generator is already running");a.l=!0}na.prototype.u=function(a){this.h=a};
function pa(a,b){a.j={ma:b,na:!0};a.g=a.s||a.v}na.prototype.return=function(a){this.j={return:a};this.g=this.v};function C(a,b,c){a.g=c;return{value:b}}function qa(a){this.g=new na;this.h=a}function ra(a,b){oa(a.g);var c=a.g.i;if(c)return sa(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return ta(a)}
function sa(a,b,c,d){try{var e=b.call(a.g.i,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.l=!1,e;var g=e.value}catch(f){return a.g.i=null,pa(a.g,f),ta(a)}a.g.i=null;d.call(a.g,g);return ta(a)}function ta(a){for(;a.g.g;)try{var b=a.h(a.g);if(b)return a.g.l=!1,{value:b.value,done:!1}}catch(c){a.g.h=void 0,pa(a.g,c)}a.g.l=!1;if(a.g.j){b=a.g.j;a.g.j=null;if(b.na)throw b.ma;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
function ua(a){this.next=function(b){oa(a.g);a.g.i?b=sa(a,a.g.i.next,b,a.g.u):(a.g.u(b),b=ta(a));return b};this.throw=function(b){oa(a.g);a.g.i?b=sa(a,a.g.i["throw"],b,a.g.u):(pa(a.g,b),b=ta(a));return b};this.return=function(b){return ra(a,b)};this[Symbol.iterator]=function(){return this}}function va(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function g(f){f.done?d(f.value):Promise.resolve(f.value).then(b,c).then(g,e)}g(a.next())})}
function D(a){return va(new ua(new qa(a)))}
x("Promise",function(a){function b(f){this.h=0;this.i=void 0;this.g=[];this.u=!1;var h=this.j();try{f(h.resolve,h.reject)}catch(k){h.reject(k)}}function c(){this.g=null}function d(f){return f instanceof b?f:new b(function(h){h(f)})}if(a)return a;c.prototype.h=function(f){if(null==this.g){this.g=[];var h=this;this.i(function(){h.l()})}this.g.push(f)};var e=w.setTimeout;c.prototype.i=function(f){e(f,0)};c.prototype.l=function(){for(;this.g&&this.g.length;){var f=this.g;this.g=[];for(var h=0;h<f.length;++h){var k=
f[h];f[h]=null;try{k()}catch(l){this.j(l)}}}this.g=null};c.prototype.j=function(f){this.i(function(){throw f;})};b.prototype.j=function(){function f(l){return function(m){k||(k=!0,l.call(h,m))}}var h=this,k=!1;return{resolve:f(this.H),reject:f(this.l)}};b.prototype.H=function(f){if(f===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(f instanceof b)this.K(f);else{a:switch(typeof f){case "object":var h=null!=f;break a;case "function":h=!0;break a;default:h=!1}h?this.B(f):this.s(f)}};
b.prototype.B=function(f){var h=void 0;try{h=f.then}catch(k){this.l(k);return}"function"==typeof h?this.L(h,f):this.s(f)};b.prototype.l=function(f){this.v(2,f)};b.prototype.s=function(f){this.v(1,f)};b.prototype.v=function(f,h){if(0!=this.h)throw Error("Cannot settle("+f+", "+h+"): Promise already settled in state"+this.h);this.h=f;this.i=h;2===this.h&&this.J();this.F()};b.prototype.J=function(){var f=this;e(function(){if(f.G()){var h=w.console;"undefined"!==typeof h&&h.error(f.i)}},1)};b.prototype.G=
function(){if(this.u)return!1;var f=w.CustomEvent,h=w.Event,k=w.dispatchEvent;if("undefined"===typeof k)return!0;"function"===typeof f?f=new f("unhandledrejection",{cancelable:!0}):"function"===typeof h?f=new h("unhandledrejection",{cancelable:!0}):(f=w.document.createEvent("CustomEvent"),f.initCustomEvent("unhandledrejection",!1,!0,f));f.promise=this;f.reason=this.i;return k(f)};b.prototype.F=function(){if(null!=this.g){for(var f=0;f<this.g.length;++f)g.h(this.g[f]);this.g=null}};var g=new c;b.prototype.K=
function(f){var h=this.j();f.T(h.resolve,h.reject)};b.prototype.L=function(f,h){var k=this.j();try{f.call(h,k.resolve,k.reject)}catch(l){k.reject(l)}};b.prototype.then=function(f,h){function k(p,n){return"function"==typeof p?function(q){try{l(p(q))}catch(t){m(t)}}:n}var l,m,r=new b(function(p,n){l=p;m=n});this.T(k(f,l),k(h,m));return r};b.prototype.catch=function(f){return this.then(void 0,f)};b.prototype.T=function(f,h){function k(){switch(l.h){case 1:f(l.i);break;case 2:h(l.i);break;default:throw Error("Unexpected state: "+
l.h);}}var l=this;null==this.g?g.h(k):this.g.push(k);this.u=!0};b.resolve=d;b.reject=function(f){return new b(function(h,k){k(f)})};b.race=function(f){return new b(function(h,k){for(var l=A(f),m=l.next();!m.done;m=l.next())d(m.value).T(h,k)})};b.all=function(f){var h=A(f),k=h.next();return k.done?d([]):new b(function(l,m){function r(q){return function(t){p[q]=t;n--;0==n&&l(p)}}var p=[],n=0;do p.push(void 0),n++,d(k.value).T(r(p.length-1),m),k=h.next();while(!k.done)})};return b});
function wa(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var g=c++;return{value:b(g,a[g]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}x("Number.isNaN",function(a){return a?a:function(b){return"number"===typeof b&&isNaN(b)}});x("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}});
x("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var g=d[c];if(g===b||Object.is(g,b))return!0}return!1}});
x("String.prototype.includes",function(a){return a?a:function(b,c){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(b,c||0)}});x("Array.prototype.keys",function(a){return a?a:function(){return wa(this,function(b){return b})}});var xa=this||self;
function ya(a,b){a=a.split(".");var c=xa;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};var za={},Aa=null;function Ba(a){var b;void 0===b&&(b=0);Ca();b=za[b];for(var c=Array(Math.floor(a.length/3)),d=b[64]||"",e=0,g=0;e<a.length-2;e+=3){var f=a[e],h=a[e+1],k=a[e+2],l=b[f>>2];f=b[(f&3)<<4|h>>4];h=b[(h&15)<<2|k>>6];k=b[k&63];c[g++]=l+f+h+k}l=0;k=d;switch(a.length-e){case 2:l=a[e+1],k=b[(l&15)<<2]||d;case 1:a=a[e],c[g]=b[a>>2]+b[(a&3)<<4|l>>4]+k+d}return c.join("")}
function Da(a){var b=a.length,c=3*b/4;c%3?c=Math.floor(c):-1!="=.".indexOf(a[b-1])&&(c=-1!="=.".indexOf(a[b-2])?c-2:c-1);var d=new Uint8Array(c),e=0;Ea(a,function(g){d[e++]=g});return e!==c?d.subarray(0,e):d}
function Ea(a,b){function c(k){for(;d<a.length;){var l=a.charAt(d++),m=Aa[l];if(null!=m)return m;if(!/^[\s\xa0]*$/.test(l))throw Error("Unknown base64 encoding at char: "+l);}return k}Ca();for(var d=0;;){var e=c(-1),g=c(0),f=c(64),h=c(64);if(64===h&&-1===e)break;b(e<<2|g>>4);64!=f&&(b(g<<4&240|f>>2),64!=h&&b(f<<6&192|h))}}
function Ca(){if(!Aa){Aa={};for(var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),b=["+/=","+/","-_=","-_.","-_"],c=0;5>c;c++){var d=a.concat(b[c].split(""));za[c]=d;for(var e=0;e<d.length;e++){var g=d[e];void 0===Aa[g]&&(Aa[g]=e)}}}};var Fa="undefined"!==typeof Uint8Array;function Ga(a){return Fa&&null!=a&&a instanceof Uint8Array}var Ha;function Ia(){return Ha||(Ha=new Uint8Array(0))}var Ja={};var Ka="function"===typeof Uint8Array.prototype.slice,G=0,H=0;function La(a){var b=0>a;a=Math.abs(a);var c=a>>>0;a=Math.floor((a-c)/4294967296);b&&(c=A(Ma(c,a)),b=c.next().value,a=c.next().value,c=b);G=c>>>0;H=a>>>0}
function Na(a){a=+a;if(0===a)0<1/a?G=H=0:(H=0,G=2147483648);else if(isNaN(a))H=0,G=2147483647;else{var b=0>a?-2147483648:0;a=b?-a:a;if(3.4028234663852886E38<a)H=0,G=(b|2139095040)>>>0;else if(1.1754943508222875E-38>a)a=Math.round(a/Math.pow(2,-149)),H=0,G=(b|a)>>>0;else{var c=Math.floor(Math.log(a)/Math.LN2);a*=Math.pow(2,-c);a=Math.round(8388608*a);16777216<=a&&++c;H=0;G=(b|c+127<<23|a&8388607)>>>0}}}var Oa="function"===typeof BigInt;function Ma(a,b){b=~b;a?a=~a+1:b+=1;return[a,b]};function Pa(a,b){this.h=a>>>0;this.g=b>>>0}
function Qa(a){if(!a)return Ra||(Ra=new Pa(0,0));if(!/^-?\d+$/.test(a))return null;if(16>a.length)La(Number(a));else if(Oa)a=BigInt(a),G=Number(a&BigInt(4294967295))>>>0,H=Number(a>>BigInt(32)&BigInt(4294967295));else{var b=+("-"===a[0]);H=G=0;for(var c=a.length,d=b,e=(c-b)%6+b;e<=c;d=e,e+=6)d=Number(a.slice(d,e)),H*=1E6,G=1E6*G+d,4294967296<=G&&(H+=G/4294967296|0,G%=4294967296);b&&(b=A(Ma(G,H)),a=b.next().value,b=b.next().value,G=a,H=b)}return new Pa(G,H)}var Ra;function Sa(a,b){return Error("Invalid wire type: "+a+" (at position "+b+")")}function Ta(){return Error("Failed to read varint, encoding is invalid.")}function Ua(a,b){return Error("Tried to read past the end of the data "+b+" > "+a)};function I(){throw Error("Invalid UTF8");}function Va(a,b){b=String.fromCharCode.apply(null,b);return null==a?b:a+b}var Wa=void 0,Xa,Ya="undefined"!==typeof TextDecoder,Za,$a="undefined"!==typeof TextEncoder;var ab;function bb(a){if(a!==Ja)throw Error("illegal external caller");}function cb(a,b){bb(b);this.V=a;if(null!=a&&0===a.length)throw Error("ByteString should be constructed with non-empty values");}function db(){return ab||(ab=new cb(null,Ja))}function eb(a){bb(Ja);var b=a.V;b=null==b||Ga(b)?b:"string"===typeof b?Da(b):null;return null==b?b:a.V=b};function fb(a){if("string"===typeof a)return{buffer:Da(a),A:!1};if(Array.isArray(a))return{buffer:new Uint8Array(a),A:!1};if(a.constructor===Uint8Array)return{buffer:a,A:!1};if(a.constructor===ArrayBuffer)return{buffer:new Uint8Array(a),A:!1};if(a.constructor===cb)return{buffer:eb(a)||Ia(),A:!0};if(a instanceof Uint8Array)return{buffer:new Uint8Array(a.buffer,a.byteOffset,a.byteLength),A:!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 gb(a){this.h=null;this.s=!1;this.g=this.i=this.j=0;hb(this,a)}function hb(a,b){var c={};a.S=void 0===c.S?!1:c.S;b&&(b=fb(b),a.h=b.buffer,a.s=b.A,a.j=0,a.i=a.h.length,a.g=a.j)}gb.prototype.reset=function(){this.g=this.j};function J(a,b){a.g=b;if(b>a.i)throw Ua(a.i,b);}
function K(a){var b=a.h,c=a.g,d=b[c++],e=d&127;if(d&128&&(d=b[c++],e|=(d&127)<<7,d&128&&(d=b[c++],e|=(d&127)<<14,d&128&&(d=b[c++],e|=(d&127)<<21,d&128&&(d=b[c++],e|=d<<28,d&128&&b[c++]&128&&b[c++]&128&&b[c++]&128&&b[c++]&128&&b[c++]&128)))))throw Ta();J(a,c);return e}function ib(a){var b=a.h,c=a.g,d=b[c],e=b[c+1],g=b[c+2];b=b[c+3];J(a,a.g+4);return(d<<0|e<<8|g<<16|b<<24)>>>0}
gb.prototype.l=function(){var a=ib(this),b=2*(a>>31)+1,c=a>>>23&255;a&=8388607;return 255==c?a?NaN:Infinity*b:0==c?b*Math.pow(2,-149)*a:b*Math.pow(2,c-150)*(a+Math.pow(2,23))};function jb(a){for(var b=0,c=a.g,d=c+10,e=a.h;c<d;){var g=e[c++];b|=g;if(0===(g&128))return J(a,c),!!(b&127)}throw Ta();}function kb(a,b){if(0>b)throw Error("Tried to read a negative byte length: "+b);var c=a.g,d=c+b;if(d>a.i)throw Ua(b,a.i-c);a.g=d;return c}var lb=[];function mb(){this.g=[]}mb.prototype.length=function(){return this.g.length};mb.prototype.end=function(){var a=this.g;this.g=[];return a};function nb(a,b,c){for(;0<c||127<b;)a.g.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.g.push(b)}function ob(a,b){for(;127<b;)a.g.push(b&127|128),b>>>=7;a.g.push(b)}function pb(a,b){if(0<=b)ob(a,b);else{for(var c=0;9>c;c++)a.g.push(b&127|128),b>>=7;a.g.push(1)}}function qb(a,b){a.g.push(b>>>0&255);a.g.push(b>>>8&255);a.g.push(b>>>16&255);a.g.push(b>>>24&255)};function rb(a){if(lb.length){var b=lb.pop();hb(b,a);a=b}else a=new gb(a);this.g=a;this.i=this.g.g;this.h=this.j=-1;this.setOptions(void 0)}rb.prototype.setOptions=function(a){a=void 0===a?{}:a;this.da=void 0===a.da?!1:a.da};rb.prototype.reset=function(){this.g.reset();this.i=this.g.g;this.h=this.j=-1};
function sb(a){var b=a.g;if(b.g==b.i)return!1;a.i=a.g.g;var c=K(a.g)>>>0;b=c>>>3;c&=7;if(!(0<=c&&5>=c))throw Sa(c,a.i);if(1>b)throw Error("Invalid field number: "+b+" (at position "+a.i+")");a.j=b;a.h=c;return!0}
function tb(a){switch(a.h){case 0:0!=a.h?tb(a):jb(a.g);break;case 1:a=a.g;J(a,a.g+8);break;case 2:if(2!=a.h)tb(a);else{var b=K(a.g)>>>0;a=a.g;J(a,a.g+b)}break;case 5:a=a.g;J(a,a.g+4);break;case 3:b=a.j;do{if(!sb(a))throw Error("Unmatched start-group tag: stream EOF");if(4==a.h){if(a.j!=b)throw Error("Unmatched end-group tag");break}tb(a)}while(1);break;default:throw Sa(a.h,a.i);}}
function ub(a,b,c){var d=a.g.i,e=K(a.g)>>>0,g=a.g.g+e,f=g-d;0>=f&&(a.g.i=g,c(b,a,void 0,void 0,void 0),f=g-a.g.g);if(f)throw Error("Message parsing ended unexpectedly. Expected to read "+(e+" bytes, instead read "+(e-f)+" bytes, either the data ended unexpectedly or the message misreported its own length"));a.g.g=g;a.g.i=d}var vb=[];function wb(){this.i=[];this.h=0;this.g=new mb}function xb(a,b){0!==b.length&&(a.i.push(b),a.h+=b.length)}function yb(a,b){M(a,b,2);b=a.g.end();xb(a,b);b.push(a.h);return b}function zb(a,b){var c=b.pop();for(c=a.h+a.g.length()-c;127<c;)b.push(c&127|128),c>>>=7,a.h++;b.push(c);a.h++}function Ab(a,b){if(b=b.P){xb(a,a.g.end());for(var c=0;c<b.length;c++)xb(a,eb(b[c])||Ia())}}function M(a,b,c){ob(a.g,8*b+c)};var Bb={};function Cb(a){if(a!==Bb)throw Error("requires a valid immutable API token");};var N="function"===typeof Symbol&&"symbol"===typeof Symbol()?Symbol(void 0):void 0;function Db(a,b){Object.isFrozen(a)||(N?a[N]|=b:void 0!==a.D?a.D|=b:Object.defineProperties(a,{D:{value:b,configurable:!0,writable:!0,enumerable:!1}}))}function Eb(a){var b;N?b=a[N]:b=a.D;return null==b?0:b}function P(a){Db(a,1);return a}function Fb(a){return Array.isArray(a)?!!(Eb(a)&2):!1}function Gb(a){if(!Array.isArray(a))throw Error("cannot mark non-array as immutable");Db(a,2)}
function Hb(a,b){if(!Array.isArray(a))throw Error("cannot mark non-array as mutable");b?Db(a,8):Object.isFrozen(a)||(N?a[N]&=-9:void 0!==a.D&&(a.D&=-9))};function Q(a){return Fb(a.o)}function Ib(a){return null!==a&&"object"===typeof a&&!Array.isArray(a)&&a.constructor===Object}var Jb=Object.freeze(P([]));function Kb(a){if(Q(a))throw Error("Cannot mutate an immutable Message");}var Lb="undefined"!=typeof Symbol&&"undefined"!=typeof Symbol.hasInstance;function Mb(a){return{value:a,configurable:!1,writable:!1,enumerable:!1}};function Nb(a,b,c){c=void 0===c?!1:c;if(Array.isArray(a))return new b(a);if(c)return new b};function Ob(a){switch(typeof a){case "number":return isFinite(a)?a:String(a);case "object":if(a&&!Array.isArray(a)){if(Ga(a))return Ba(a);if(a instanceof cb){var b=a.V;b=null==b||"string"===typeof b?b:Fa&&b instanceof Uint8Array?Ba(b):null;return null==b?"":a.V=b}}}return a};function Pb(a){var b=Qb;b=void 0===b?Rb:b;return Sb(a,b)}function Tb(a,b){if(null!=a){if(Array.isArray(a))a=Sb(a,b);else if(Ib(a)){var c={},d;for(d in a)c[d]=Tb(a[d],b);a=c}else a=b(a);return a}}function Sb(a,b){for(var c=a.slice(),d=0;d<c.length;d++)c[d]=Tb(c[d],b);Array.isArray(a)&&Eb(a)&1&&P(c);return c}function Qb(a){if(a&&"object"==typeof a&&a.toJSON)return a.toJSON();a=Ob(a);return Array.isArray(a)?Pb(a):a}function Rb(a){return Ga(a)?new Uint8Array(a):a};function Ub(a){return a.g||(a.g=a.o[a.h+a.C]={})}function R(a,b,c){return-1===b?null:b>=a.h?a.g?a.g[b]:void 0:(void 0===c?0:c)&&a.g&&(c=a.g[b],null!=c)?c:a.o[b+a.C]}function S(a,b,c,d,e){d=void 0===d?!1:d;(void 0===e?0:e)||Kb(a);b<a.h&&!d?(a.o[b+a.C]=c,void 0!==a.g&&b in a.g&&delete a.g[b]):Ub(a)[b]=c}function Vb(a,b,c,d){c=void 0===c?!0:c;var e=R(a,b,d);Array.isArray(e)||(e=Jb);if(Q(a))c&&(Gb(e),Object.freeze(e));else if(e===Jb||Fb(e))e=P(e.slice()),S(a,b,e,d);return e}
function Wb(a,b){var c=Number,d=Vb(a,b,!1);if(d.length&&!(Eb(d)&4)){Object.isFrozen(d)&&(d=P(d.slice()),S(a,b,d,void 0,!0));for(b=0;b<d.length;b++)d[b]=c(d[b]);Db(d,5)}Q(a)&&Object.freeze(d);return d}function Xb(a,b,c){a=R(a,b);return null==a?c:a}function T(a,b,c){a=R(a,b);a=null==a?a:+a;return null==a?void 0===c?0:c:a}function Yb(a,b,c,d){Kb(a);c!==d?S(a,b,c):S(a,b,void 0,!1)}
function Zb(a,b,c){var d=void 0===d?!1:d;if(-1===c)var e=null;else a.m||(a.m={}),e=a.m[c],e||(b=Nb(R(a,c,d),b),void 0!=b&&(a.m[c]=b,Q(a)&&Gb(b.o),e=b));if(null==e)return e;Q(e)&&!Q(a)&&(e=e.R(Bb),S(a,c,e.o,d),a.m[c]=e);return e}
function $b(a,b,c,d,e){e=void 0===e?!0:e;a.m||(a.m={});var g=Q(a),f=a.m[c];d=Vb(a,c,!0,d);var h=g||Fb(d);if(!f){f=[];g=g||h;for(var k=0;k<d.length;k++){var l=d[k];g=g||Fb(l);l=Nb(l,b);void 0!==l&&(f.push(l),h&&Gb(l.o))}a.m[c]=f;Hb(d,!g)}b=h||e;e=Fb(f);b&&!e&&(Object.isFrozen(f)&&(a.m[c]=f=f.slice()),Gb(f),Object.freeze(f));!b&&e&&(a.m[c]=f=f.slice());return f}
function ac(a,b,c){var d=void 0===d?!1:d;var e=Q(a);b=$b(a,b,c,d,e);a=Vb(a,c,d);if(!(c=e)&&(c=a)){if(!Array.isArray(a))throw Error("cannot check mutability state of non-array");c=!(Eb(a)&8)}if(c){for(c=0;c<b.length;c++)(d=b[c])&&Q(d)&&!e&&(b[c]=b[c].R(Bb),a[c]=b[c].o);Hb(a,!0)}return b}function bc(a,b,c,d,e){Kb(a);var g=$b(a,c,b,void 0,!1);c=null!=d?d:new c;a=Vb(a,b);void 0!=e?(g.splice(e,0,c),a.splice(e,0,c.o)):(g.push(c),a.push(c.o));c.A(Bb)&&Hb(a,!1);return c};function cc(a,b,c){a||(a=dc);dc=null;var d=this.constructor.h;a||(a=d?[d]:[]);this.C=(d?0:-1)-(this.constructor.g||0);this.m=void 0;this.o=a;a:{d=this.o.length;a=d-1;if(d&&(d=this.o[a],Ib(d))){this.h=a-this.C;this.g=d;break a}void 0!==b&&-1<b?(this.h=Math.max(b,a+1-this.C),this.g=void 0):this.h=Number.MAX_VALUE}if(c)for(b=0;b<c.length;b++)if(a=c[b],a<this.h)a+=this.C,(d=this.o[a])?Array.isArray(d)&&P(d):this.o[a]=Jb;else{d=Ub(this);var e=d[a];e?Array.isArray(e)&&P(e):d[a]=Jb}}
cc.prototype.toJSON=function(){return Pb(this.o)};cc.prototype.A=function(a){Cb(a);return Q(this)};cc.prototype.toString=function(){return this.o.toString()};var dc;function ec(){cc.apply(this,arguments)}B(ec,cc);ec.prototype.R=function(){return this};if(Lb){var fc={};Object.defineProperties(ec,(fc[Symbol.hasInstance]=Mb(function(){throw Error("Cannot perform instanceof checks for MutableMessage");}),fc))};function gc(a,b,c){if(c){var d={},e;for(e in c){var g=c[e],f=g.ra;f||(d.I=g.xa||g.oa.W,g.ja?(d.aa=hc(g.ja),f=function(h){return function(k,l,m){return h.I(k,l,m,h.aa)}}(d)):g.ka?(d.Z=ic(g.ea.O,g.ka),f=function(h){return function(k,l,m){return h.I(k,l,m,h.Z)}}(d)):f=d.I,g.ra=f);f(b,a,g.ea);d={I:d.I,aa:d.aa,Z:d.Z}}}Ab(b,a)}var jc=Symbol();function kc(a,b,c){return a[jc]||(a[jc]=function(d,e){return b(d,e,c)})}
function lc(a){var b=a[jc];if(!b){var c=mc(a);b=function(d,e){return nc(d,e,c)};a[jc]=b}return b}function oc(a){var b=a.ja;if(b)return lc(b);if(b=a.wa)return kc(a.ea.O,b,a.ka)}function pc(a){var b=oc(a),c=a.ea,d=a.oa.U;return b?function(e,g){return d(e,g,c,b)}:function(e,g){return d(e,g,c)}}function qc(a,b){var c=a[b];"function"==typeof c&&0===c.length&&(c=c(),a[b]=c);return Array.isArray(c)&&(rc in c||sc in c||0<c.length&&"function"==typeof c[0])?c:void 0}
function tc(a,b,c,d,e,g){b.O=a[0];var f=1;if(a.length>f&&"number"!==typeof a[f]){var h=a[f++];c(b,h)}for(;f<a.length;){c=a[f++];for(var k=f+1;k<a.length&&"number"!==typeof a[k];)k++;h=a[f++];k-=f;switch(k){case 0:d(b,c,h);break;case 1:(k=qc(a,f))?(f++,e(b,c,h,k)):d(b,c,h,a[f++]);break;case 2:k=f++;k=qc(a,k);e(b,c,h,k,a[f++]);break;case 3:g(b,c,h,a[f++],a[f++],a[f++]);break;case 4:g(b,c,h,a[f++],a[f++],a[f++],a[f++]);break;default:throw Error("unexpected number of binary field arguments: "+k);}}return b}
var uc=Symbol();function hc(a){var b=a[uc];if(!b){var c=vc(a);b=function(d,e){return wc(d,e,c)};a[uc]=b}return b}function ic(a,b){var c=a[uc];c||(c=function(d,e){return gc(d,e,b)},a[uc]=c);return c}var sc=Symbol();function xc(a,b){a.push(b)}function yc(a,b,c){a.push(b,c.W)}function zc(a,b,c,d){var e=hc(d),g=vc(d).O,f=c.W;a.push(b,function(h,k,l){return f(h,k,l,g,e)})}function Ac(a,b,c,d,e,g){var f=ic(d,g),h=c.W;a.push(b,function(k,l,m){return h(k,l,m,d,f)})}
function vc(a){var b=a[sc];if(b)return b;b=tc(a,a[sc]=[],xc,yc,zc,Ac);rc in a&&sc in a&&(a.length=0);return b}var rc=Symbol();function Bc(a,b){a[0]=b}function Cc(a,b,c,d){var e=c.U;a[b]=d?function(g,f,h){return e(g,f,h,d)}:e}function Dc(a,b,c,d,e){var g=c.U,f=lc(d),h=mc(d).O;a[b]=function(k,l,m){return g(k,l,m,h,f,e)}}function Ec(a,b,c,d,e,g,f){var h=c.U,k=kc(d,e,g);a[b]=function(l,m,r){return h(l,m,r,d,k,f)}}
function mc(a){var b=a[rc];if(b)return b;b=tc(a,a[rc]={},Bc,Cc,Dc,Ec);rc in a&&sc in a&&(a.length=0);return b}
function nc(a,b,c){for(;sb(b)&&4!=b.h;){var d=b.j,e=c[d];if(!e){var g=c[0];g&&(g=g[d])&&(e=c[d]=pc(g))}if(!e||!e(b,a,d)){e=b;d=a;g=e.i;tb(e);var f=e;if(!f.da){e=f.g.g-g;f.g.g=g;f=f.g;if(0==e)e=db();else{g=kb(f,e);if(f.S&&f.s)e=f.h.subarray(g,g+e);else{f=f.h;var h=g;e=g+e;e=h===e?Ia():Ka?f.slice(h,e):new Uint8Array(f.subarray(h,e))}e=0==e.length?db():new cb(e,Ja)}(g=d.P)?g.push(e):d.P=[e]}}}return a}
function Fc(a,b){if(vb.length){var c=vb.pop();c.setOptions(void 0);hb(c.g,a);a=c}else a=new rb(a);try{var d=mc(b);return nc(new d.O,a,d)}finally{b=a.g,b.h=null,b.s=!1,b.j=0,b.i=0,b.g=0,b.S=!1,a.j=-1,a.h=-1,100>vb.length&&vb.push(a)}}function wc(a,b,c){for(var d=c.length,e=1==d%2,g=e?1:0;g<d;g+=2)(0,c[g+1])(b,a,c[g]);gc(a,b,e?c[0]:void 0)}
function Gc(a,b){var c=new wb;wc(a,c,vc(b));xb(c,c.g.end());a=new Uint8Array(c.h);b=c.i;for(var d=b.length,e=0,g=0;g<d;g++){var f=b[g];a.set(f,e);e+=f.length}c.i=[a];return a}function U(a,b){return{U:a,W:b}}function Hc(a,b,c){b=R(b,c);null!=b&&(M(a,c,5),a=a.g,Na(b),qb(a,G))}function Ic(a,b,c){b=R(b,c);null!=b&&null!=b&&(M(a,c,0),pb(a.g,b))}
var Jc=U(function(a,b,c){if(1!==a.h)return!1;var d=a.g;a=ib(d);var e=ib(d);d=2*(e>>31)+1;var g=e>>>20&2047;a=4294967296*(e&1048575)+a;Yb(b,c,2047==g?a?NaN:Infinity*d:0==g?d*Math.pow(2,-1074)*a:d*Math.pow(2,g-1075)*(a+4503599627370496),0);return!0},function(a,b,c){b=R(b,c);if(null!=b){M(a,c,1);a=a.g;var d=+b;if(0===d)H=0<1/d?0:2147483648,G=0;else if(isNaN(d))H=2147483647,G=4294967295;else if(d=(c=0>d?-2147483648:0)?-d:d,1.7976931348623157E308<d)H=(c|2146435072)>>>0,G=0;else if(2.2250738585072014E-308>
d)b=d/Math.pow(2,-1074),H=(c|b/4294967296)>>>0,G=b>>>0;else{var e=d;b=0;if(2<=e)for(;2<=e&&1023>b;)b++,e/=2;else for(;1>e&&-1022<b;)e*=2,b--;d*=Math.pow(2,-b);H=(c|b+1023<<20|1048576*d&1048575)>>>0;G=4503599627370496*d>>>0}qb(a,G);qb(a,H)}}),V=U(function(a,b,c){if(5!==a.h)return!1;S(b,c,a.g.l());return!0},Hc),X=U(function(a,b,c){if(5!==a.h&&2!==a.h)return!1;b=Vb(b,c);if(2==a.h){c=gb.prototype.l;var d=K(a.g)>>>0;for(d=a.g.g+d;a.g.g<d;)b.push(c.call(a.g))}else b.push(a.g.l());return!0},function(a,b,
c){b=Vb(b,c);if(null!=b&&b.length)for(M(a,c,2),ob(a.g,4*b.length),c=0;c<b.length;c++){var d=a.g;Na(b[c]);qb(d,G)}}),Y=U(function(a,b,c){if(5!==a.h)return!1;a=a.g.l();Yb(b,c,a,0);return!0},Hc),Kc=U(function(a,b,c){if(0!==a.h)return!1;var d=a.g,e=0,g=a=0,f=d.h,h=d.g;do{var k=f[h++];e|=(k&127)<<g;g+=7}while(32>g&&k&128);32<g&&(a|=(k&127)>>4);for(g=3;32>g&&k&128;g+=7)k=f[h++],a|=(k&127)<<g;J(d,h);if(128>k){d=e>>>0;k=a>>>0;if(a=k&2147483648)d=~d+1>>>0,k=~k>>>0,0==d&&(k=k+1>>>0);d=4294967296*k+(d>>>0)}else throw Ta();
S(b,c,a?-d:d);return!0},function(a,b,c){b=R(b,c);null!=b&&("string"===typeof b&&Qa(b),null!=b&&(M(a,c,0),"number"===typeof b?(a=a.g,La(b),nb(a,G,H)):(c=Qa(b),nb(a.g,c.h,c.g))))}),Lc=U(function(a,b,c){if(0!==a.h)return!1;S(b,c,K(a.g));return!0},Ic),Mc=U(function(a,b,c){if(0!==a.h)return!1;a=K(a.g);Yb(b,c,a,0);return!0},Ic),Nc=U(function(a,b,c){if(0!==a.h)return!1;a=jb(a.g);Yb(b,c,a,!1);return!0},function(a,b,c){b=R(b,c);null!=b&&(M(a,c,0),a.g.g.push(b?1:0))}),Oc=U(function(a,b,c){if(2!==a.h)return!1;
var d=K(a.g)>>>0;a=a.g;var e=kb(a,d);a=a.h;if(Ya){var g=a,f;(f=Xa)||(f=Xa=new TextDecoder("utf-8",{fatal:!0}));a=e+d;g=0===e&&a===g.length?g:g.subarray(e,a);try{var h=f.decode(g)}catch(r){if(void 0===Wa){try{f.decode(new Uint8Array([128]))}catch(p){}try{f.decode(new Uint8Array([97])),Wa=!0}catch(p){Wa=!1}}!Wa&&(Xa=void 0);throw r;}}else{h=e;d=h+d;e=[];for(var k=null,l,m;h<d;)l=a[h++],128>l?e.push(l):224>l?h>=d?I():(m=a[h++],194>l||128!==(m&192)?(h--,I()):e.push((l&31)<<6|m&63)):240>l?h>=d-1?I():(m=
a[h++],128!==(m&192)||224===l&&160>m||237===l&&160<=m||128!==((g=a[h++])&192)?(h--,I()):e.push((l&15)<<12|(m&63)<<6|g&63)):244>=l?h>=d-2?I():(m=a[h++],128!==(m&192)||0!==(l<<28)+(m-144)>>30||128!==((g=a[h++])&192)||128!==((f=a[h++])&192)?(h--,I()):(l=(l&7)<<18|(m&63)<<12|(g&63)<<6|f&63,l-=65536,e.push((l>>10&1023)+55296,(l&1023)+56320))):I(),8192<=e.length&&(k=Va(k,e),e.length=0);h=Va(k,e)}S(b,c,h);return!0},function(a,b,c){b=R(b,c);if(null!=b){var d=!1;d=void 0===d?!1:d;if($a){if(d&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(b))throw Error("Found an unpaired surrogate");
b=(Za||(Za=new TextEncoder)).encode(b)}else{for(var e=0,g=new Uint8Array(3*b.length),f=0;f<b.length;f++){var h=b.charCodeAt(f);if(128>h)g[e++]=h;else{if(2048>h)g[e++]=h>>6|192;else{if(55296<=h&&57343>=h){if(56319>=h&&f<b.length){var k=b.charCodeAt(++f);if(56320<=k&&57343>=k){h=1024*(h-55296)+k-56320+65536;g[e++]=h>>18|240;g[e++]=h>>12&63|128;g[e++]=h>>6&63|128;g[e++]=h&63|128;continue}else f--}if(d)throw Error("Found an unpaired surrogate");h=65533}g[e++]=h>>12|224;g[e++]=h>>6&63|128}g[e++]=h&63|
128}}b=e===g.length?g:g.subarray(0,e)}M(a,c,2);ob(a.g,b.length);xb(a,a.g.end());xb(a,b)}}),Pc=U(function(a,b,c,d,e){if(2!==a.h)return!1;Kb(b);b.m||(b.m={});var g=b.m[c];g?(d=g.R(Bb),d!==g&&(S(b,c,d.o),b.m[c]=d),b=d):(g=R(b,c),d=Nb(g,d,!0).R(Bb),g!==d.o&&S(b,c,d.o),b=b.m[c]=d);ub(a,b,e);return!0},function(a,b,c,d,e){b=Zb(b,d,c);null!=b&&(c=yb(a,c),e(b,a),zb(a,c))}),Qc=U(function(a,b,c,d,e){if(2!==a.h)return!1;ub(a,bc(b,c,d),e);return!0},function(a,b,c,d,e){b=ac(b,d,c);if(null!=b)for(d=0;d<b.length;d++){var g=
yb(a,c);e(b[d],a);zb(a,g)}}),Rc=U(function(a,b,c){if(0!==a.h)return!1;S(b,c,K(a.g));return!0},function(a,b,c){b=R(b,c);null!=b&&(b=parseInt(b,10),M(a,c,0),pb(a.g,b))});function Sc(a,b,c,d,e,g){if(a=a.m&&a.m[c])if(Array.isArray(a)){e=g.ca?P(a.slice()):a;Kb(b);if(null!=e){g=P([]);d=!1;for(a=0;a<e.length;a++)g[a]=e[a].o,d=d||Fb(g[a]);b.m||(b.m={});b.m[c]=e;Hb(g,!d)}else b.m&&(b.m[c]=void 0),g=Jb;S(b,c,g)}else Kb(b),b.m||(b.m={}),e=null!=a?a.o:a,b.m[c]=a,S(b,c,e);else Fa&&d instanceof Uint8Array?e=d.length?new cb(new Uint8Array(d),Ja):db():(Array.isArray(d)&&(e?Gb(d):Array.isArray(d)&&Eb(d)&1&&g.ca&&(d=d.slice())),e=d),S(b,c,e)};function Z(){ec.apply(this,arguments)}B(Z,ec);Z.prototype.R=function(a){Cb(a);if(Q(this)){a={ca:!0};var b=Q(this);if(b&&!a.ca)throw Error("copyRepeatedFields must be true for frozen messages");var c=new this.constructor;this.P&&(c.P=this.P.slice());for(var d=this.o,e=0;e<d.length;e++){var g=d[e];if(e===d.length-1&&Ib(g))for(h in g){var f=+h;Number.isNaN(f)?Ub(c)[h]=g[h]:Sc(this,c,f,g[h],b,a)}else Sc(this,c,e-this.C,g,b,a)}var h=c}else h=this;return h};
if(Lb){var Tc={};Object.defineProperties(Z,(Tc[Symbol.hasInstance]=Mb(Object[Symbol.hasInstance]),Tc))};function Uc(a){Z.call(this,a)}B(Uc,Z);var Vc=[Uc,1,Lc,2,V,3,Oc,4,Oc];function Wc(a){Z.call(this,a,-1,Xc)}B(Wc,Z);Wc.prototype.addClassification=function(a,b){bc(this,1,Uc,a,b);return this};var Xc=[1],Yc=[Wc,1,Qc,Vc];function Zc(a){Z.call(this,a)}B(Zc,Z);var $c=[Zc,1,V,2,V,3,V,4,V,5,V];function ad(a){Z.call(this,a,-1,bd)}B(ad,Z);var bd=[1],cd=[ad,1,Qc,$c];function dd(a){Z.call(this,a)}B(dd,Z);var ed=[dd,1,V,2,V,3,V,4,V,5,V,6,Kc];function fd(a){Z.call(this,a,-1,gd)}B(fd,Z);function hd(a){Z.call(this,a)}B(hd,Z);var gd=[3,7,8,9],id=[fd,1,Rc,2,Rc,3,X,4,Pc,[hd,1,V,2,V,3,V],5,Lc,6,Lc,7,X,8,X,9,X];function jd(a){Z.call(this,a)}B(jd,Z);var kd=[jd,1,Y,2,Y,3,Y];function ld(a){Z.call(this,a)}B(ld,Z);var md=[ld,1,Y,2,Y,3,Y];function nd(a){Z.call(this,a)}B(nd,Z);var od=[nd,1,Mc,2,Pc,md,3,Pc,kd,4,Nc];function pd(a){Z.call(this,a,-1,qd)}B(pd,Z);var qd=[2,4,5,6],rd=[pd,1,Mc,2,Qc,od,3,Y,4,X,5,X,6,X];function sd(a){Z.call(this,a,-1,td)}B(sd,Z);var td=[2,5,6],ud=[sd,1,Mc,2,Qc,rd,3,Pc,id,4,Jc,5,X,6,X];function vd(a,b,c){c=a.createShader(0===c?a.VERTEX_SHADER:a.FRAGMENT_SHADER);a.shaderSource(c,b);a.compileShader(c);if(!a.getShaderParameter(c,a.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+a.getShaderInfoLog(c));return c};function wd(a){return ac(a,Uc,1).map(function(b){return{index:Xb(b,1,0),qa:T(b,2),label:null!=R(b,3)?Xb(b,3,""):void 0,displayName:null!=R(b,4)?Xb(b,4,""):void 0}})};function xd(a){return{x:T(a,1),y:T(a,2),z:T(a,3),visibility:null!=R(a,4)?T(a,4):void 0}};function yd(a,b){this.h=a;this.g=b;this.l=0}
function zd(a,b,c){Ad(a,b);if("function"===typeof a.g.canvas.transferToImageBitmap)return Promise.resolve(a.g.canvas.transferToImageBitmap());if(c)return Promise.resolve(a.g.canvas);if("function"===typeof createImageBitmap)return createImageBitmap(a.g.canvas);void 0===a.i&&(a.i=document.createElement("canvas"));return new Promise(function(d){a.i.height=a.g.canvas.height;a.i.width=a.g.canvas.width;a.i.getContext("2d",{}).drawImage(a.g.canvas,0,0,a.g.canvas.width,a.g.canvas.height);d(a.i)})}
function Ad(a,b){var c=a.g;if(void 0===a.s){var d=vd(c,"\n  attribute vec2 aVertex;\n  attribute vec2 aTex;\n  varying vec2 vTex;\n  void main(void) {\n    gl_Position = vec4(aVertex, 0.0, 1.0);\n    vTex = aTex;\n  }",0),e=vd(c,"\n  precision mediump float;\n  varying vec2 vTex;\n  uniform sampler2D sampler0;\n  void main(){\n    gl_FragColor = texture2D(sampler0, vTex);\n  }",1),g=c.createProgram();c.attachShader(g,d);c.attachShader(g,e);c.linkProgram(g);if(!c.getProgramParameter(g,c.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+
c.getProgramInfoLog(g));d=a.s=g;c.useProgram(d);e=c.getUniformLocation(d,"sampler0");a.j={N:c.getAttribLocation(d,"aVertex"),M:c.getAttribLocation(d,"aTex"),ya:e};a.v=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.v);c.enableVertexAttribArray(a.j.N);c.vertexAttribPointer(a.j.N,2,c.FLOAT,!1,0,0);c.bufferData(c.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,null);a.u=c.createBuffer();c.bindBuffer(c.ARRAY_BUFFER,a.u);c.enableVertexAttribArray(a.j.M);c.vertexAttribPointer(a.j.M,
2,c.FLOAT,!1,0,0);c.bufferData(c.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),c.STATIC_DRAW);c.bindBuffer(c.ARRAY_BUFFER,null);c.uniform1i(e,0)}d=a.j;c.useProgram(a.s);c.canvas.width=b.width;c.canvas.height=b.height;c.viewport(0,0,b.width,b.height);c.activeTexture(c.TEXTURE0);a.h.bindTexture2d(b.glName);c.enableVertexAttribArray(d.N);c.bindBuffer(c.ARRAY_BUFFER,a.v);c.vertexAttribPointer(d.N,2,c.FLOAT,!1,0,0);c.enableVertexAttribArray(d.M);c.bindBuffer(c.ARRAY_BUFFER,a.u);c.vertexAttribPointer(d.M,
2,c.FLOAT,!1,0,0);c.bindFramebuffer(c.DRAW_FRAMEBUFFER?c.DRAW_FRAMEBUFFER:c.FRAMEBUFFER,null);c.clearColor(0,0,0,0);c.clear(c.COLOR_BUFFER_BIT);c.colorMask(!0,!0,!0,!0);c.drawArrays(c.TRIANGLE_FAN,0,4);c.disableVertexAttribArray(d.N);c.disableVertexAttribArray(d.M);c.bindBuffer(c.ARRAY_BUFFER,null);a.h.bindTexture2d(0)}function Bd(a){this.g=a};var Cd=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]);function Dd(a,b){return b+a}function Ed(a,b){window[a]=b}function Fd(a){var b=document.createElement("script");b.setAttribute("src",a);b.setAttribute("crossorigin","anonymous");return new Promise(function(c){b.addEventListener("load",function(){c()},!1);b.addEventListener("error",function(){c()},!1);document.body.appendChild(b)})}
function Gd(){return D(function(a){switch(a.g){case 1:return a.s=2,C(a,WebAssembly.instantiate(Cd),4);case 4:a.g=3;a.s=0;break;case 2:return a.s=0,a.j=null,a.return(!1);case 3:return a.return(!0)}})}
function Hd(a){this.g=a;this.listeners={};this.j={};this.K={};this.s={};this.v={};this.L=this.u=this.ha=!0;this.H=Promise.resolve();this.ga="";this.G={};this.locateFile=a&&a.locateFile||Dd;if("object"===typeof window)var b=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else if("undefined"!==typeof location)b=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/";else throw Error("solutions can only be loaded on a web page or in a web worker");
this.ia=b;if(a.options){b=A(Object.keys(a.options));for(var c=b.next();!c.done;c=b.next()){c=c.value;var d=a.options[c].default;void 0!==d&&(this.j[c]="function"===typeof d?d():d)}}}v=Hd.prototype;v.close=function(){this.i&&this.i.delete();return Promise.resolve()};
function Id(a){var b,c,d,e,g,f,h,k,l,m,r;return D(function(p){switch(p.g){case 1:if(!a.ha)return p.return();b=void 0===a.g.files?[]:"function"===typeof a.g.files?a.g.files(a.j):a.g.files;return C(p,Gd(),2);case 2:c=p.h;if("object"===typeof window)return Ed("createMediapipeSolutionsWasm",{locateFile:a.locateFile}),Ed("createMediapipeSolutionsPackedAssets",{locateFile:a.locateFile}),f=b.filter(function(n){return void 0!==n.data}),h=b.filter(function(n){return void 0===n.data}),k=Promise.all(f.map(function(n){var q=
Jd(a,n.url);if(void 0!==n.path){var t=n.path;q=q.then(function(z){a.overrideFile(t,z);return Promise.resolve(z)})}return q})),l=Promise.all(h.map(function(n){return void 0===n.simd||n.simd&&c||!n.simd&&!c?Fd(a.locateFile(n.url,a.ia)):Promise.resolve()})).then(function(){var n,q,t;return D(function(z){if(1==z.g)return n=window.createMediapipeSolutionsWasm,q=window.createMediapipeSolutionsPackedAssets,t=a,C(z,n(q),2);t.h=z.h;z.g=0})}),m=function(){return D(function(n){a.g.graph&&a.g.graph.url?n=C(n,
Jd(a,a.g.graph.url),0):(n.g=0,n=void 0);return n})}(),C(p,Promise.all([l,k,m]),7);if("function"!==typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");d=b.filter(function(n){return void 0===n.simd||n.simd&&c||!n.simd&&!c}).map(function(n){return a.locateFile(n.url,a.ia)});importScripts.apply(null,ea(d));e=a;return C(p,createMediapipeSolutionsWasm(Module),6);case 6:e.h=p.h;a.l=new OffscreenCanvas(1,1);a.h.canvas=a.l;g=a.h.GL.createContext(a.l,{antialias:!1,
alpha:!1,va:"undefined"!==typeof WebGL2RenderingContext?2:1});a.h.GL.makeContextCurrent(g);p.g=4;break;case 7:a.l=document.createElement("canvas");r=a.l.getContext("webgl2",{});if(!r&&(r=a.l.getContext("webgl",{}),!r))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();a.J=r;a.h.canvas=a.l;a.h.createContext(a.l,!0,!0,{});case 4:a.i=new a.h.SolutionWasm,a.ha=!1,p.g=0}})}
function Kd(a){var b,c,d,e,g,f,h,k;return D(function(l){if(1==l.g){if(a.g.graph&&a.g.graph.url&&a.ga===a.g.graph.url)return l.return();a.u=!0;if(!a.g.graph||!a.g.graph.url){l.g=2;return}a.ga=a.g.graph.url;return C(l,Jd(a,a.g.graph.url),3)}2!=l.g&&(b=l.h,a.i.loadGraph(b));c=A(Object.keys(a.G));for(d=c.next();!d.done;d=c.next())e=d.value,a.i.overrideFile(e,a.G[e]);a.G={};if(a.g.listeners)for(g=A(a.g.listeners),f=g.next();!f.done;f=g.next())h=f.value,Ld(a,h);k=a.j;a.j={};a.setOptions(k);l.g=0})}
v.reset=function(){var a=this;return D(function(b){a.i&&(a.i.reset(),a.s={},a.v={});b.g=0})};
v.setOptions=function(a,b){var c=this;if(b=b||this.g.options){for(var d=[],e=[],g={},f=A(Object.keys(a)),h=f.next();!h.done;g={X:g.X,Y:g.Y},h=f.next())if(h=h.value,!(h in this.j&&this.j[h]===a[h])){this.j[h]=a[h];var k=b[h];void 0!==k&&(k.onChange&&(g.X=k.onChange,g.Y=a[h],d.push(function(l){return function(){var m;return D(function(r){if(1==r.g)return C(r,l.X(l.Y),2);m=r.h;!0===m&&(c.u=!0);r.g=0})}}(g))),k.graphOptionXref&&(h=Object.assign({},{calculatorName:"",calculatorIndex:0},k.graphOptionXref,
{valueNumber:1===k.type?a[h]:0,valueBoolean:0===k.type?a[h]:!1,valueString:2===k.type?a[h]:""}),e.push(h)))}if(0!==d.length||0!==e.length)this.u=!0,this.F=(void 0===this.F?[]:this.F).concat(e),this.B=(void 0===this.B?[]:this.B).concat(d)}};
function Md(a){var b,c,d,e,g,f,h;return D(function(k){switch(k.g){case 1:if(!a.u)return k.return();if(!a.B){k.g=2;break}b=A(a.B);c=b.next();case 3:if(c.done){k.g=5;break}d=c.value;return C(k,d(),4);case 4:c=b.next();k.g=3;break;case 5:a.B=void 0;case 2:if(a.F){e=new a.h.GraphOptionChangeRequestList;g=A(a.F);for(f=g.next();!f.done;f=g.next())h=f.value,e.push_back(h);a.i.changeOptions(e);e.delete();a.F=void 0}a.u=!1;k.g=0}})}
v.initialize=function(){var a=this;return D(function(b){return 1==b.g?C(b,Id(a),2):3!=b.g?C(b,Kd(a),3):C(b,Md(a),0)})};function Jd(a,b){var c,d;return D(function(e){if(b in a.K)return e.return(a.K[b]);c=a.locateFile(b,"");d=fetch(c).then(function(g){return g.arrayBuffer()});a.K[b]=d;return e.return(d)})}v.overrideFile=function(a,b){this.i?this.i.overrideFile(a,b):this.G[a]=b};v.clearOverriddenFiles=function(){this.G={};this.i&&this.i.clearOverriddenFiles()};
v.send=function(a,b){var c=this,d,e,g,f,h,k,l,m,r;return D(function(p){switch(p.g){case 1:if(!c.g.inputs)return p.return();d=1E3*(void 0===b||null===b?performance.now():b);return C(p,c.H,2);case 2:return C(p,c.initialize(),3);case 3:e=new c.h.PacketDataList;g=A(Object.keys(a));for(f=g.next();!f.done;f=g.next())if(h=f.value,k=c.g.inputs[h]){a:{var n=a[h];switch(k.type){case "video":var q=c.s[k.stream];q||(q=new yd(c.h,c.J),c.s[k.stream]=q);0===q.l&&(q.l=q.h.createTexture());if("undefined"!==typeof HTMLVideoElement&&
n instanceof HTMLVideoElement){var t=n.videoWidth;var z=n.videoHeight}else"undefined"!==typeof HTMLImageElement&&n instanceof HTMLImageElement?(t=n.naturalWidth,z=n.naturalHeight):(t=n.width,z=n.height);z={glName:q.l,width:t,height:z};t=q.g;t.canvas.width=z.width;t.canvas.height=z.height;t.activeTexture(t.TEXTURE0);q.h.bindTexture2d(q.l);t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n);q.h.bindTexture2d(0);q=z;break a;case "detections":q=c.s[k.stream];q||(q=new Bd(c.h),c.s[k.stream]=q);
q.data||(q.data=new q.g.DetectionListData);q.data.reset(n.length);for(z=0;z<n.length;++z){t=n[z];var y=q.data,E=y.setBoundingBox,O=z;var L=t.la;var u=new dd;S(u,1,L.sa);S(u,2,L.ta);S(u,3,L.height);S(u,4,L.width);S(u,5,L.rotation);S(u,6,L.pa);L=Gc(u,ed);E.call(y,O,L);if(t.fa)for(y=0;y<t.fa.length;++y){u=t.fa[y];E=q.data;O=E.addNormalizedLandmark;L=z;u=Object.assign({},u,{visibility:u.visibility?u.visibility:0});var F=new Zc;S(F,1,u.x);S(F,2,u.y);S(F,3,u.z);u.visibility&&S(F,4,u.visibility);u=Gc(F,
$c);O.call(E,L,u)}if(t.ba)for(y=0;y<t.ba.length;++y)E=q.data,O=E.addClassification,L=z,u=t.ba[y],F=new Uc,S(F,2,u.qa),u.index&&S(F,1,u.index),u.label&&S(F,3,u.label),u.displayName&&S(F,4,u.displayName),u=Gc(F,Vc),O.call(E,L,u)}q=q.data;break a;default:q={}}}l=q;m=k.stream;switch(k.type){case "video":e.pushTexture2d(Object.assign({},l,{stream:m,timestamp:d}));break;case "detections":r=l;r.stream=m;r.timestamp=d;e.pushDetectionList(r);break;default:throw Error("Unknown input config type: '"+k.type+
"'");}}c.i.send(e);return C(p,c.H,4);case 4:e.delete(),p.g=0}})};
function Nd(a,b,c){var d,e,g,f,h,k,l,m,r,p,n,q,t,z;return D(function(y){switch(y.g){case 1:if(!c)return y.return(b);d={};e=0;g=A(Object.keys(c));for(f=g.next();!f.done;f=g.next())h=f.value,k=c[h],"string"!==typeof k&&"texture"===k.type&&void 0!==b[k.stream]&&++e;1<e&&(a.L=!1);l=A(Object.keys(c));f=l.next();case 2:if(f.done){y.g=4;break}m=f.value;r=c[m];if("string"===typeof r)return t=d,z=m,C(y,Od(a,m,b[r]),14);p=b[r.stream];if("detection_list"===r.type){if(p){var E=p.getRectList();for(var O=p.getLandmarksList(),
L=p.getClassificationsList(),u=[],F=0;F<E.size();++F){var W=Fc(E.get(F),ed);W={la:{sa:T(W,1),ta:T(W,2),height:T(W,3),width:T(W,4),rotation:T(W,5,0),pa:Xb(W,6,0)},fa:ac(Fc(O.get(F),cd),Zc,1).map(xd),ba:wd(Fc(L.get(F),Yc))};u.push(W)}E=u}else E=[];d[m]=E;y.g=7;break}if("proto_list"===r.type){if(p){E=Array(p.size());for(O=0;O<p.size();O++)E[O]=p.get(O);p.delete()}else E=[];d[m]=E;y.g=7;break}if(void 0===p){y.g=3;break}if("float_list"===r.type){d[m]=p;y.g=7;break}if("proto"===r.type){d[m]=p;y.g=7;break}if("texture"!==
r.type)throw Error("Unknown output config type: '"+r.type+"'");n=a.v[m];n||(n=new yd(a.h,a.J),a.v[m]=n);return C(y,zd(n,p,a.L),13);case 13:q=y.h,d[m]=q;case 7:r.transform&&d[m]&&(d[m]=r.transform(d[m]));y.g=3;break;case 14:t[z]=y.h;case 3:f=l.next();y.g=2;break;case 4:return y.return(d)}})}
function Od(a,b,c){var d;return D(function(e){return"number"===typeof c||c instanceof Uint8Array||c instanceof a.h.Uint8BlobList?e.return(c):c instanceof a.h.Texture2dDataOut?(d=a.v[b],d||(d=new yd(a.h,a.J),a.v[b]=d),e.return(zd(d,c,a.L))):e.return(void 0)})}
function Ld(a,b){for(var c=b.name||"$",d=[].concat(ea(b.wants)),e=new a.h.StringList,g=A(b.wants),f=g.next();!f.done;f=g.next())e.push_back(f.value);g=a.h.PacketListener.implement({onResults:function(h){for(var k={},l=0;l<b.wants.length;++l)k[d[l]]=h.get(l);var m=a.listeners[c];m&&(a.H=Nd(a,k,b.outs).then(function(r){r=m(r);for(var p=0;p<b.wants.length;++p){var n=k[d[p]];"object"===typeof n&&n.hasOwnProperty&&n.hasOwnProperty("delete")&&n.delete()}r&&(a.H=r)}))}});a.i.attachMultiListener(e,g);e.delete()}
v.onResults=function(a,b){this.listeners[b||"$"]=a};ya("Solution",Hd);ya("OptionType",{BOOL:0,NUMBER:1,ua:2,0:"BOOL",1:"NUMBER",2:"STRING"});function Pd(a){var b=Xb(a,1,0);var c=Zb(a,jd,3);c={x:T(c,1),y:T(c,2),depth:T(c,3)};a=Zb(a,ld,2);return{id:b,point2d:c,point3d:{x:T(a,1),y:T(a,2),z:T(a,3)}}}function Qd(a){var b=Fc(a,ud);a=[];b=ac(b,pd,2);for(var c=0;c<b.length;c++)a.push({id:Xb(b[c],1,0),keypoints:ac(b[c],nd,2).map(Pd),visibility:T(b[c],3),scale:Wb(b[c],6),translation:Wb(b[c],5),rotation:Wb(b[c],4)});return a};function Rd(a){switch(a){case "Camera":return"object_detection_3d_camera.tflite";case "Chair":return"object_detection_3d_chair.tflite";case "Cup":return"object_detection_3d_cup.tflite";default:return"object_detection_3d_sneakers.tflite"}}function Sd(a){switch(a){case "Camera":return"Camera";case "Chair":return"Chair";case "Cup":return"Coffee cup, Mug";default:return"Footwear"}}
var Td={focalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_x"}},focalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_focal_y"}},principalX:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_x"}},principalY:{type:1,graphOptionXref:{calculatorType:"Lift2DFrameAnnotationTo3DCalculator",fieldName:"normalized_principal_point_y"}},
allowedLabels:{type:2,graphOptionXref:{calculatorName:"ConstantSidePacketCalculatorAllowedLabels",calculatorType:"ConstantSidePacketCalculator",fieldName:"string_value"}}};
function Ud(a){var b=this;a=a||{};this.g=new Hd({locateFile:a.locateFile,files:[{url:"objectron_solution_packed_assets_loader.js"},{simd:!1,url:"objectron_solution_wasm_bin.js"},{simd:!0,url:"objectron_solution_simd_wasm_bin.js"}],graph:{url:"objectron.binarypb"},inputs:{image:{type:"video",stream:"input_frames_gpu"}},listeners:[{wants:["lifted_objects","image_transformed"],outs:{image:"image_transformed",objectDetections:{type:"proto",stream:"lifted_objects",transform:Qd}}}],options:{useCpuInference:{type:0,
graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"!==typeof window||void 0===window.navigator?!1:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},selfieMode:{type:0,default:!1,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumObjects:{type:1,default:5,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",
calculatorName:"ConstantSidePacketCalculatorMaxNumObjects",fieldName:"int_value"}},staticImageMode:{type:0,default:!0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"objectrongpusubgraph__ConstantSidePacketCalculator",fieldName:"bool_value"}},minDetectionConfidence:{type:1,default:.5,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"objectrongpusubgraph__objectdetectionoidv4subgraph__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},
minTrackingConfidence:{type:1,default:.99,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"objectrongpusubgraph__boxlandmarksubgraph__ThresholdingCalculator",fieldName:"threshold"}},modelName:{default:"Shoe",onChange:function(c){var d,e,g,f;return D(function(h){if(1==h.g)return d=c,b.g.setOptions({allowedLabels:Sd(d)},Td),e=Rd(d),g="object_detection_3d.tflite",C(h,Jd(b.g,e),2);f=h.h;b.g.overrideFile(g,f);return h.return(!0)})}},focalLength:{default:[1,1],onChange:function(c){var d;
return D(function(e){d=c;b.h=d;b.g.setOptions({focalX:d[0],focalY:d[1]},Td);return e.return(!0)})}},principalPoint:{default:[0,0],onChange:function(c){var d;return D(function(e){d=c;b.i=d;b.g.setOptions({principalX:d[0],principalY:d[1]},Td);return e.return(!0)})}},imageSize:{onChange:function(c){var d,e,g,f;return D(function(h){if(void 0===b.h||void 0===b.i)return console.error('"focalLength" and "principalPoint" must be set if setting image size'),h.return();d=c;e=[d[0]/2,d[1]/2];g=[b.h[0]/e[0],
b.h[1]/e[1]];f=[b.i[0]/e[0],b.i[1]/e[1]];b.setOptions({focalLength:g,principalPoint:f});h.g=0})}}}})}v=Ud.prototype;v.close=function(){this.g.close();return Promise.resolve()};v.onResults=function(a){this.g.onResults(a)};v.initialize=function(){var a=this;return D(function(b){return C(b,a.g.initialize(),0)})};v.reset=function(){this.g.reset()};v.send=function(a){var b=this;return D(function(c){return C(c,b.g.send(a),0)})};v.setOptions=function(a){this.g.setOptions(a)};ya("Objectron",Ud);
ya("BOX_CONNECTIONS",[[1,2],[2,4],[4,3],[3,1],[5,6],[6,8],[8,7],[7,5],[1,5],[2,6],[3,7],[4,8]]);ya("BOX_KEYPOINTS",{CENTER:0,BACK_BOTTOM_LEFT:1,FRONT_BOTTOM_LEFT:2,BACK_TOP_LEFT:3,FRONT_TOP_LEFT:4,BACK_BOTTOM_RIGHT:5,FRONT_BOTTOM_RIGHT:6,BACK_TOP_RIGHT:7,FRONT_TOP_RIGHT:8});ya("VERSION","0.4.1657300402");}).call(this);
