UNPKG

@xtravision/js-sdk

Version:

1 lines 579 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).XtraVision=e()}}((function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!u&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var s=n[a]={exports:{}};t[a][0].call(s.exports,(function(e){return o(t[a][1][e]||e)}),s,s.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){(function(e){(function(){(function(){"use strict";function t(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var r=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var n=0;n<t.length;++n){var r=t[n];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function o(e,t){if(t)e:{var o=r;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in o))break e;o=o[a]}(t=t(i=o[e=e[e.length-1]]))!=i&&null!=t&&n(o,e,{configurable:!0,writable:!0,value:t})}}function i(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function a(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function u(){this.i=!1,this.g=null,this.o=void 0,this.j=1,this.m=0,this.h=null}function l(e){if(e.i)throw new TypeError("Generator is already running");e.i=!0}function c(e,t){e.h={F:t,G:!0},e.j=e.m}function s(e){this.g=new u,this.h=e}function f(e,t,n,r){try{var o=t.call(e.g.g,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.g.i=!1,o;var i=o.value}catch(t){return e.g.g=null,c(e.g,t),d(e)}return e.g.g=null,r.call(e.g,i),d(e)}function d(e){for(;e.g.j;)try{var t=e.h(e.g);if(t)return e.g.i=!1,{value:t.value,done:!1}}catch(t){e.g.o=void 0,c(e.g,t)}if(e.g.i=!1,e.g.h){if(t=e.g.h,e.g.h=null,t.G)throw t.F;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function p(e){this.next=function(t){return l(e.g),e.g.g?t=f(e,e.g.g.next,t,e.g.l):(e.g.l(t),t=d(e)),t},this.throw=function(t){return l(e.g),e.g.g?t=f(e,e.g.g.throw,t,e.g.l):(c(e.g,t),t=d(e)),t},this.return=function(t){return function(e,t){l(e.g);var n=e.g.g;return n?f(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),d(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function h(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,o){!function e(i){i.done?r(i.value):Promise.resolve(i.value).then(t,n).then(e,o)}(e.next())}))}o("Symbol",(function(e){function t(e,t){this.g=e,n(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(n){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(r+(n||"")+"_"+o++,n)}})),o("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var o="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<o.length;a++){var u=r[o[a]];"function"==typeof u&&"function"!=typeof u.prototype[e]&&n(u.prototype,e,{configurable:!0,writable:!0,value:function(){return i(t(this))}})}return e})),u.prototype.l=function(e){this.o=e},u.prototype.return=function(e){this.h={return:e},this.j=this.m},o("Promise",(function(e){function t(e){this.h=0,this.i=void 0,this.g=[],this.o=!1;var t=this.j();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.g=null}function o(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.h=function(e){if(null==this.g){this.g=[];var t=this;this.i((function(){t.l()}))}this.g.push(e)};var i=r.setTimeout;n.prototype.i=function(e){i(e,0)},n.prototype.l=function(){for(;this.g&&this.g.length;){var e=this.g;this.g=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.j(e)}}}this.g=null},n.prototype.j=function(e){this.i((function(){throw e}))},t.prototype.j=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.A),reject:e(this.l)}},t.prototype.A=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.C(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.v(e):this.m(e)}},t.prototype.v=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.D(t,e):this.m(e)},t.prototype.l=function(e){this.u(2,e)},t.prototype.m=function(e){this.u(1,e)},t.prototype.u=function(e,t){if(0!=this.h)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.h);this.h=e,this.i=t,2===this.h&&this.B(),this.H()},t.prototype.B=function(){var e=this;i((function(){if(e.I()){var t=r.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.I=function(){if(this.o)return!1;var e=r.CustomEvent,t=r.Event,n=r.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=r.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.H=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)u.h(this.g[e]);this.g=null}};var u=new n;return t.prototype.C=function(e){var t=this.j();e.s(t.resolve,t.reject)},t.prototype.D=function(e,t){var n=this.j();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t((function(e,t){o=e,i=t}));return this.s(r(e,o),r(n,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.s=function(e,t){function n(){switch(r.h){case 1:e(r.i);break;case 2:t(r.i);break;default:throw Error("Unexpected state: "+r.h)}}var r=this;null==this.g?u.h(n):this.g.push(n),this.o=!0},t.resolve=o,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var r=a(e),i=r.next();!i.done;i=r.next())o(i.value).s(t,n)}))},t.all=function(e){var n=a(e),r=n.next();return r.done?o([]):new t((function(e,t){function i(t){return function(n){a[t]=n,0==--u&&e(a)}}var a=[],u=0;do{a.push(void 0),u++,o(r.value).s(i(a.length-1),t),r=n.next()}while(!r.done)}))},t}));var v="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};o("Object.assign",(function(e){return e||v}));var m=this||self,y={facingMode:"user",width:640,height:480};function g(e,t){this.video=e,this.i=0,this.h=Object.assign(Object.assign({},y),t)}function b(e){window.requestAnimationFrame((function(){!function(e){var t=null;e.video.paused||e.video.currentTime===e.i||(e.i=e.video.currentTime,t=e.h.onFrame()),t?t.then((function(){b(e)})):b(e)}(e)}))}g.prototype.stop=function(){var e,t,n,r=this;return h(new p(new s((function(o){if(r.g){for(e=r.g.getTracks(),t=a(e),n=t.next();!n.done;n=t.next())n.value.stop();r.g=void 0}o.j=0}))))},g.prototype.start=function(){var e,t=this;return h(new p(new s((function(n){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia||alert("No navigator.mediaDevices.getUserMedia exists."),e=t.h,n.return(navigator.mediaDevices.getUserMedia({video:{facingMode:e.facingMode,width:e.width,height:e.height}}).then((function(e){!function(e,t){e.g=t,e.video.srcObject=t,e.video.onloadedmetadata=function(){e.video.play(),b(e)}}(t,e)})).catch((function(e){var t="Failed to acquire camera feed: "+e;throw console.error(t),alert(t),e})))}))))};var w,_=["Camera"],E=m;_[0]in E||void 0===E.execScript||E.execScript("var "+_[0]);for(;_.length&&(w=_.shift());)_.length||void 0===g?E=E[w]&&E[w]!==Object.prototype[w]?E[w]:E[w]={}:E[w]=g}).call(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){(function(e){(function(){(function(){"use strict";var t;function n(e){var t=0;return function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}var r="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof e&&e];for(var n=0;n<t.length;++n){var r=t[n];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function i(e,t){if(t)e:{var n=o;e=e.split(".");for(var i=0;i<e.length-1;i++){var a=e[i];if(!(a in n))break e;n=n[a]}(t=t(i=n[e=e[e.length-1]]))!=i&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function a(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function u(e){var t="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return t?t.call(e):{next:n(e)}}function l(e){if(!(e instanceof Array)){e=u(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}i("Symbol",(function(e){function t(e,t){this.h=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.h};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+o++,r)}})),i("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var t="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<t.length;i++){var u=o[t[i]];"function"==typeof u&&"function"!=typeof u.prototype[e]&&r(u.prototype,e,{configurable:!0,writable:!0,value:function(){return a(n(this))}})}return e}));var c="function"==typeof Object.assign?Object.assign:function(e,t){for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r)for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e};i("Object.assign",(function(e){return e||c}));var s,f="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var d;e:{var p={};try{p.__proto__={a:!0},d=p.a;break e}catch(e){}d=!1}s=d?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var h=s;function v(e,t){if(e.prototype=f(t.prototype),e.prototype.constructor=e,h)h(e,t);else for(var n in t)if("prototype"!=n)if(Object.defineProperties){var r=Object.getOwnPropertyDescriptor(t,n);r&&Object.defineProperty(e,n,r)}else e[n]=t[n];e.za=t.prototype}function m(){this.m=!1,this.j=null,this.i=void 0,this.h=1,this.v=this.s=0,this.l=null}function y(e){if(e.m)throw new TypeError("Generator is already running");e.m=!0}function g(e,t){e.l={ma:t,na:!0},e.h=e.s||e.v}function b(e,t,n){return e.h=n,{value:t}}function w(e){this.h=new m,this.i=e}function _(e,t,n,r){try{var o=t.call(e.h.j,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return e.h.m=!1,o;var i=o.value}catch(t){return e.h.j=null,g(e.h,t),E(e)}return e.h.j=null,r.call(e.h,i),E(e)}function E(e){for(;e.h.h;)try{var t=e.i(e.h);if(t)return e.h.m=!1,{value:t.value,done:!1}}catch(t){e.h.i=void 0,g(e.h,t)}if(e.h.m=!1,e.h.l){if(t=e.h.l,e.h.l=null,t.na)throw t.ma;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function k(e){this.next=function(t){return y(e.h),e.h.j?t=_(e,e.h.j.next,t,e.h.u):(e.h.u(t),t=E(e)),t},this.throw=function(t){return y(e.h),e.h.j?t=_(e,e.h.j.throw,t,e.h.u):(g(e.h,t),t=E(e)),t},this.return=function(t){return function(e,t){y(e.h);var n=e.h.j;return n?_(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.h.return):(e.h.return(t),E(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function x(e){return function(e){function t(t){return e.next(t)}function n(t){return e.throw(t)}return new Promise((function(r,o){!function e(i){i.done?r(i.value):Promise.resolve(i.value).then(t,n).then(e,o)}(e.next())}))}(new k(new w(e)))}function T(e){return e||Array.prototype.fill}m.prototype.u=function(e){this.i=e},m.prototype.return=function(e){this.l={return:e},this.h=this.v},i("Promise",(function(e){function t(e){this.i=0,this.j=void 0,this.h=[],this.u=!1;var t=this.l();try{e(t.resolve,t.reject)}catch(e){t.reject(e)}}function n(){this.h=null}function r(e){return e instanceof t?e:new t((function(t){t(e)}))}if(e)return e;n.prototype.i=function(e){if(null==this.h){this.h=[];var t=this;this.j((function(){t.m()}))}this.h.push(e)};var i=o.setTimeout;n.prototype.j=function(e){i(e,0)},n.prototype.m=function(){for(;this.h&&this.h.length;){var e=this.h;this.h=[];for(var t=0;t<e.length;++t){var n=e[t];e[t]=null;try{n()}catch(e){this.l(e)}}}this.h=null},n.prototype.l=function(e){this.j((function(){throw e}))},t.prototype.l=function(){function e(e){return function(r){n||(n=!0,e.call(t,r))}}var t=this,n=!1;return{resolve:e(this.I),reject:e(this.m)}},t.prototype.I=function(e){if(e===this)this.m(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.L(e);else{e:switch(typeof e){case"object":var n=null!=e;break e;case"function":n=!0;break e;default:n=!1}n?this.F(e):this.s(e)}},t.prototype.F=function(e){var t=void 0;try{t=e.then}catch(e){return void this.m(e)}"function"==typeof t?this.M(t,e):this.s(e)},t.prototype.m=function(e){this.v(2,e)},t.prototype.s=function(e){this.v(1,e)},t.prototype.v=function(e,t){if(0!=this.i)throw Error("Cannot settle("+e+", "+t+"): Promise already settled in state"+this.i);this.i=e,this.j=t,2===this.i&&this.K(),this.H()},t.prototype.K=function(){var e=this;i((function(){if(e.D()){var t=o.console;void 0!==t&&t.error(e.j)}}),1)},t.prototype.D=function(){if(this.u)return!1;var e=o.CustomEvent,t=o.Event,n=o.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=o.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.j,n(e))},t.prototype.H=function(){if(null!=this.h){for(var e=0;e<this.h.length;++e)a.i(this.h[e]);this.h=null}};var a=new n;return t.prototype.L=function(e){var t=this.l();e.T(t.resolve,t.reject)},t.prototype.M=function(e,t){var n=this.l();try{e.call(t,n.resolve,n.reject)}catch(e){n.reject(e)}},t.prototype.then=function(e,n){function r(e,t){return"function"==typeof e?function(t){try{o(e(t))}catch(e){i(e)}}:t}var o,i,a=new t((function(e,t){o=e,i=t}));return this.T(r(e,o),r(n,i)),a},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.T=function(e,t){function n(){switch(r.i){case 1:e(r.j);break;case 2:t(r.j);break;default:throw Error("Unexpected state: "+r.i)}}var r=this;null==this.h?a.i(n):this.h.push(n),this.u=!0},t.resolve=r,t.reject=function(e){return new t((function(t,n){n(e)}))},t.race=function(e){return new t((function(t,n){for(var o=u(e),i=o.next();!i.done;i=o.next())r(i.value).T(t,n)}))},t.all=function(e){var n=u(e),o=n.next();return o.done?r([]):new t((function(e,t){function i(t){return function(n){a[t]=n,0==--u&&e(a)}}var a=[],u=0;do{a.push(void 0),u++,r(o.value).T(i(a.length-1),t),o=n.next()}while(!o.done)}))},t})),i("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,o={next:function(){if(!r&&n<e.length){var o=n++;return{value:t(o,e[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(e){return e}))}})),i("Array.prototype.fill",(function(e){return e||function(e,t,n){var r=this.length||0;for(0>t&&(t=Math.max(0,r+t)),(null==n||n>r)&&(n=r),0>(n=Number(n))&&(n=Math.max(0,r+n)),t=Number(t||0);t<n;t++)this[t]=e;return this}})),i("Int8Array.prototype.fill",T),i("Uint8Array.prototype.fill",T),i("Uint8ClampedArray.prototype.fill",T),i("Int16Array.prototype.fill",T),i("Uint16Array.prototype.fill",T),i("Int32Array.prototype.fill",T),i("Uint32Array.prototype.fill",T),i("Float32Array.prototype.fill",T),i("Float64Array.prototype.fill",T),i("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),i("Array.prototype.includes",(function(e){return e||function(e,t){var n=this;n instanceof String&&(n=String(n));var r=n.length;for(0>(t=t||0)&&(t=Math.max(t+r,0));t<r;t++){var o=n[t];if(o===e||Object.is(o,e))return!0}return!1}})),i("String.prototype.includes",(function(e){return e||function(e,t){if(null==this)throw new TypeError("The 'this' value for String.prototype.includes must not be null or undefined");if(e instanceof RegExp)throw new TypeError("First argument to String.prototype.includes must not be a regular expression");return-1!==this.indexOf(e,t||0)}}));var S=this||self;function C(e,t){e=e.split(".");var n,r=S;e[0]in r||void 0===r.execScript||r.execScript("var "+e[0]);for(;e.length&&(n=e.shift());)e.length||void 0===t?r=r[n]&&r[n]!==Object.prototype[n]?r[n]:r[n]={}:r[n]=t}function R(e){var t;return(t=S.navigator)&&(t=t.userAgent)||(t=""),-1!=t.indexOf(e)}var P=Array.prototype.map?function(e,t){return Array.prototype.map.call(e,t,void 0)}:function(e,t){for(var n=e.length,r=Array(n),o="string"==typeof e?e.split(""):e,i=0;i<n;i++)i in o&&(r[i]=t.call(void 0,o[i],i,e));return r},O={},I=null;function N(e){var t=e.length,n=3*t/4;n%3?n=Math.floor(n):-1!="=.".indexOf(e[t-1])&&(n=-1!="=.".indexOf(e[t-2])?n-2:n-1);var r=new Uint8Array(n),o=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),o=I[n];if(null!=o)return o;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}A();for(var r=0;;){var o=n(-1),i=n(0),a=n(64),u=n(64);if(64===u&&-1===o)break;t(o<<2|i>>4),64!=a&&(t(i<<4&240|a>>2),64!=u&&t(a<<6&192|u))}}(e,(function(e){r[o++]=e})),o!==n?r.subarray(0,o):r}function A(){if(!I){I={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));O[n]=r;for(var o=0;o<r.length;o++){var i=r[o];void 0===I[i]&&(I[i]=o)}}}}var D="undefined"!=typeof Uint8Array,M=!(R("Trident")||R("MSIE"))&&"function"==typeof S.btoa;function L(e){if(!M){var t;void 0===t&&(t=0),A(),t=O[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",o=0,i=0;o<e.length-2;o+=3){var a=e[o],u=e[o+1],l=e[o+2],c=t[a>>2];a=t[(3&a)<<4|u>>4],u=t[(15&u)<<2|l>>6],l=t[63&l],n[i++]=c+a+u+l}switch(c=0,l=r,e.length-o){case 2:l=t[(15&(c=e[o+1]))<<2]||r;case 1:e=e[o],n[i]=t[e>>2]+t[(3&e)<<4|c>>4]+l+r}return n.join("")}for(t="";10240<e.length;)t+=String.fromCharCode.apply(null,e.subarray(0,10240)),e=e.subarray(10240);return t+=String.fromCharCode.apply(null,e),btoa(t)}var j,F=RegExp("[-_.]","g");function U(e){switch(e){case"-":return"+";case"_":return"/";case".":return"=";default:return""}}function z(e){if(!M)return N(e);F.test(e)&&(e=e.replace(F,U)),e=atob(e);for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function W(){return j||(j=new Uint8Array(0))}var B={},V="function"==typeof Uint8Array.prototype.slice,H=0,$=0;function G(e){var t=0>e,n=(e=Math.abs(e))>>>0;e=Math.floor((e-n)/4294967296),t&&(t=(n=u(q(n,e))).next().value,e=n.next().value,n=t),H=n>>>0,$=e>>>0}var Y,Q="function"==typeof BigInt;function q(e,t){return t=~t,e?e=1+~e:t+=1,[e,t]}function K(e,t){this.i=e>>>0,this.h=t>>>0}function X(e){if(!e)return Y||(Y=new K(0,0));if(!/^-?\d+$/.test(e))return null;if(16>e.length)G(Number(e));else if(Q)e=BigInt(e),H=Number(e&BigInt(4294967295))>>>0,$=Number(e>>BigInt(32)&BigInt(4294967295));else{var t=+("-"===e[0]);$=H=0;for(var n=e.length,r=t,o=(n-t)%6+t;o<=n;r=o,o+=6)r=Number(e.slice(r,o)),$*=1e6,4294967296<=(H=1e6*H+r)&&($+=H/4294967296|0,H%=4294967296);t&&(e=(t=u(q(H,$))).next().value,t=t.next().value,H=e,$=t)}return new K(H,$)}function J(e,t){return Error("Invalid wire type: "+e+" (at position "+t+")")}function Z(){return Error("Failed to read varint, encoding is invalid.")}function ee(e,t){return Error("Tried to read past the end of the data "+t+" > "+e)}function te(){throw Error("Invalid UTF8")}function ne(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var re,oe,ie,ae=void 0,ue="undefined"!=typeof TextDecoder,le="undefined"!=typeof TextEncoder;function ce(e){if(e!==B)throw Error("illegal external caller")}function se(e,t){if(ce(t),this.V=e,null!=e&&0===e.length)throw Error("ByteString should be constructed with non-empty values")}function fe(){return ie||(ie=new se(null,B))}function de(e){ce(B);var t=e.V;return null==(t=null==t||D&&null!=t&&t instanceof Uint8Array?t:"string"==typeof t?z(t):null)?t:e.V=t}function pe(e,t){this.i=null,this.m=!1,this.h=this.j=this.l=0,he(this,e,t)}function he(e,t,n){n=void 0===n?{}:n,e.S=void 0!==n.S&&n.S,t&&(t=function(e){if("string"==typeof e)return{buffer:z(e),C:!1};if(Array.isArray(e))return{buffer:new Uint8Array(e),C:!1};if(e.constructor===Uint8Array)return{buffer:e,C:!1};if(e.constructor===ArrayBuffer)return{buffer:new Uint8Array(e),C:!1};if(e.constructor===se)return{buffer:de(e)||W(),C:!0};if(e instanceof Uint8Array)return{buffer:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),C:!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")}(t),e.i=t.buffer,e.m=t.C,e.l=0,e.j=e.i.length,e.h=e.l)}function ve(e,t){if(e.h=t,t>e.j)throw ee(e.j,t)}function me(e){var t=e.i,n=e.h,r=t[n++],o=127&r;if(128&r&&(o|=(127&(r=t[n++]))<<7,128&r&&(o|=(127&(r=t[n++]))<<14,128&r&&(o|=(127&(r=t[n++]))<<21,128&r&&(o|=(r=t[n++])<<28,128&r&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++]&&128&t[n++])))))throw Z();return ve(e,n),o}function ye(e,t){if(0>t)throw Error("Tried to read a negative byte length: "+t);var n=e.h,r=n+t;if(r>e.j)throw ee(t,e.j-n);return e.h=r,n}pe.prototype.reset=function(){this.h=this.l};var ge=[];function be(){this.h=[]}function we(e,t,n){for(;0<n||127<t;)e.h.push(127&t|128),t=(t>>>7|n<<25)>>>0,n>>>=7;e.h.push(t)}function _e(e,t){for(;127<t;)e.h.push(127&t|128),t>>>=7;e.h.push(t)}function Ee(e,t){if(ge.length){var n=ge.pop();he(n,e,t),e=n}else e=new pe(e,t);this.h=e,this.j=this.h.h,this.i=this.l=-1,this.setOptions(t)}function ke(e){var t=e.h;if(t.h==t.j)return!1;e.j=e.h.h;var n=me(e.h)>>>0;if(t=n>>>3,!(0<=(n&=7)&&5>=n))throw J(n,e.j);if(1>t)throw Error("Invalid field number: "+t+" (at position "+e.j+")");return e.l=t,e.i=n,!0}function xe(e){switch(e.i){case 0:if(0!=e.i)xe(e);else e:{for(var t=(e=e.h).h,n=t+10,r=e.i;t<n;)if(0==(128&r[t++])){ve(e,t);break e}throw Z()}break;case 1:ve(e=e.h,e.h+8);break;case 2:2!=e.i?xe(e):(t=me(e.h)>>>0,ve(e=e.h,e.h+t));break;case 5:ve(e=e.h,e.h+4);break;case 3:for(t=e.l;;){if(!ke(e))throw Error("Unmatched start-group tag: stream EOF");if(4==e.i){if(e.l!=t)throw Error("Unmatched end-group tag");break}xe(e)}break;default:throw J(e.i,e.j)}}be.prototype.length=function(){return this.h.length},be.prototype.end=function(){var e=this.h;return this.h=[],e},Ee.prototype.setOptions=function(e){e=void 0===e?{}:e,this.ca=void 0!==e.ca&&e.ca},Ee.prototype.reset=function(){this.h.reset(),this.j=this.h.h,this.i=this.l=-1};var Te=[];function Se(){this.j=[],this.i=0,this.h=new be}function Ce(e,t){0!==t.length&&(e.j.push(t),e.i+=t.length)}var Re="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():void 0;function Pe(e,t){return Re?e[Re]|=t:void 0!==e.A?e.A|=t:(Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}}),t)}function Oe(e,t){Re?e[Re]&&(e[Re]&=~t):void 0!==e.A&&(e.A&=~t)}function Ie(e){var t;return null==(t=Re?e[Re]:e.A)?0:t}function Ne(e,t){Re?e[Re]=t:void 0!==e.A?e.A=t:Object.defineProperties(e,{A:{value:t,configurable:!0,writable:!0,enumerable:!1}})}function Ae(e){return Pe(e,1),e}function De(e,t){Ne(t,-51&(0|e))}function Me(e,t){Ne(t,-41&(18|e))}var Le={};function je(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)&&e.constructor===Object}var Fe,Ue,ze=[];function We(e){if(2&Ie(e.o))throw Error("Cannot mutate an immutable Message")}function Be(e){var t=e.length;(t=t?e[t-1]:void 0)&&je(t)?t.g=1:(t={},e.push((t.g=1,t)))}function Ve(e){var t=e.i+e.G;return e.B||(e.B=e.o[t]={})}function He(e,t){return-1===t?null:t>=e.i?e.B?e.B[t]:void 0:e.o[t+e.G]}function $e(e,t,n,r){We(e),Ge(e,t,n,r)}function Ge(e,t,n,r){e.j&&(e.j=void 0),t>=e.i||r?Ve(e)[t]=n:(e.o[t+e.G]=n,(e=e.B)&&t in e&&delete e[t])}function Ye(e,t,n,r){var o=He(e,t);Array.isArray(o)||(o=Fe);var i=Ie(o);if(1&i||Ae(o),r)2&i||Pe(o,2),1&n||Object.freeze(o);else{r=!(2&n);var a=2&i;1&n||!a?r&&16&i&&!a&&Oe(o,16):Ge(e,t,o=Ae(Array.prototype.slice.call(o)))}return o}function Qe(e,t){var n=He(e,t),r=null==n?n:"number"==typeof n||"NaN"===n||"Infinity"===n||"-Infinity"===n?Number(n):void 0;return null!=r&&r!==n&&Ge(e,t,r),r}function qe(e,t,n,r,o){e.h||(e.h={});var i=e.h[n],a=Ye(e,n,3,o);if(!i){var u=a;i=[];var l=!!(16&Ie(e.o));a=!!(2&Ie(u));var c=u;!o&&a&&(u=Array.prototype.slice.call(u));for(var s=a,f=0;f<u.length;f++){var d=u[f],p=t,h=!1;if(h=void 0!==h&&h,void 0!==(d=Array.isArray(d)?new p(d):h?new p:void 0)){var v=h=Ie(p=d.o);a&&(v|=2),l&&(v|=16),v!=h&&Ne(p,v),p=v,s=s||!!(2&p),i.push(d)}}return e.h[n]=i,t=33|(l=Ie(u)),l!=(t=s?-9&t:8|t)&&(s=u,Object.isFrozen(s)&&(s=Array.prototype.slice.call(s)),Ne(s,t),u=s),c!==u&&Ge(e,n,u),(o||r&&a)&&Pe(i,2),r&&Object.freeze(i),i}return o||(o=Object.isFrozen(i),r&&!o?Object.freeze(i):!r&&o&&(i=Array.prototype.slice.call(i),e.h[n]=i)),i}function Ke(e,t,n){var r=!!(2&Ie(e.o));if(t=qe(e,t,n,r,r),e=Ye(e,n,3,r),!(r||8&Ie(e))){for(r=0;r<t.length;r++){if(2&Ie((n=t[r]).o)){var o=lt(n,!1);o.j=n}else o=n;n!==o&&(t[r]=o,e[r]=o.o)}Pe(e,8)}return t}function Xe(e,t,n){if(null!=n&&"number"!=typeof n)throw Error("Value of float/double field must be a number|null|undefined, found "+typeof n+": "+n);$e(e,t,n)}function Je(e,t,n,r,o){We(e);var i=qe(e,n,t,!1,!1);return n=null!=r?r:new n,e=Ye(e,t,2,!1),null!=o?(i.splice(o,0,n),e.splice(o,0,n.o)):(i.push(n),e.push(n.o)),n.C()&&Oe(e,8),n}function Ze(e,t){return null==e?t:e}function et(e,t,n){return n=void 0===n?0:n,Ze(Qe(e,t),n)}function tt(e,t,n,r){if(null!=e){if(Array.isArray(e))e=nt(e,t,n,void 0!==r);else if(je(e)){var o,i={};for(o in e)i[o]=tt(e[o],t,n,r);e=i}else e=t(e,r);return e}}function nt(e,t,n,r){var o=Ie(e);r=r?!!(16&o):void 0,e=Array.prototype.slice.call(e);for(var i=0;i<e.length;i++)e[i]=tt(e[i],t,n,r);return n(o,e),e}function rt(e){return e.ja===Le?e.toJSON():function(e){switch(typeof e){case"number":return isFinite(e)?e:String(e);case"object":if(e)if(Array.isArray(e)){if(0!=(128&Ie(e)))return Be(e=Array.prototype.slice.call(e)),e}else{if(D&&null!=e&&e instanceof Uint8Array)return L(e);if(e instanceof se){var t=e.V;return null==t?"":"string"==typeof t?t:e.V=L(t)}}}return e}(e)}function ot(e,t){128&e&&Be(t)}function it(e,t,n){if(n=void 0===n?Me:n,null!=e){if(D&&e instanceof Uint8Array)return e.length?new se(new Uint8Array(e),B):fe();if(Array.isArray(e)){var r=Ie(e);return 2&r?e:!t||32&r||!(16&r||0===r)?(4&(t=Ie(e=nt(e,it,4&r?Me:n,!0)))&&2&t&&Object.freeze(e),e):(Ne(e,2|r),e)}return e.ja===Le?ut(e):e}}function at(e,t,n,r,o,i,a){if(e=e.h&&e.h[n]){if(2&(r=Ie(e))?r=e:(Me(r,i=P(e,ut)),Object.freeze(i),r=i),We(t),a=null==r?Fe:Ae([]),null!=r){for(i=!!r.length,e=0;e<r.length;e++){var u=r[e];i=i&&!(2&Ie(u.o)),a[e]=u.o}i=1|(i?8:0),((e=Ie(a))&i)!==i&&(Object.isFrozen(a)&&(a=Array.prototype.slice.call(a)),Ne(a,e|i)),t.h||(t.h={}),t.h[n]=r}else t.h&&(t.h[n]=void 0);Ge(t,n,a,o)}else $e(t,n,it(r,i,a),o)}function ut(e){return 2&Ie(e.o)||Pe((e=lt(e,!0)).o,2),e}function lt(e,t){var n=e.o,r=[];Pe(r,16);var o=e.constructor.h;if(o&&r.push(o),o=e.B){r.length=n.length,r.fill(void 0,r.length,n.length);var i={};r[r.length-1]=i}0!=(128&Ie(n))&&Be(r),t=t||e.C()?Me:De,i=e.constructor,Ue=r,r=new i(r),Ue=void 0,e.R&&(r.R=e.R.slice()),i=!!(16&Ie(n));for(var a=o?n.length-1:n.length,u=0;u<a;u++)at(e,r,u-e.G,n[u],!1,i,t);if(o)for(var l in o)at(e,r,+l,o[l],!0,i,t);return r}function ct(e,t,n){null==e&&(e=Ue),Ue=void 0;var r,o=this.constructor.i||0,i=0<o,a=this.constructor.h,u=!1;if(null==e){var l=48,c=!0;i&&(o=0,l|=128),Ne(e=a?[a]:[],l)}else{if(!Array.isArray(e))throw Error();if(a&&a!==e[0])throw Error();var s=l=Pe(e,0);if((c=0!=(16&s))&&((u=0!=(32&s))||(s|=32)),i){if(128&s)o=0;else if(0<e.length){var f=e[e.length-1];if(je(f)&&"g"in f){o=0,s|=128,delete f.g;var d,p=!0;for(d in f){p=!1;break}p&&e.pop()}}}else if(128&s)throw Error();l!==s&&Ne(e,s)}if(this.G=(a?0:-1)-o,this.h=void 0,this.o=e,o=(a=this.o.length)-1,a&&je(a=this.o[o])?(this.B=a,this.i=o-this.G):void 0!==t&&-1<t?(this.i=Math.max(t,o+1-this.G),this.B=void 0):this.i=Number.MAX_VALUE,!i&&this.B&&"g"in this.B)throw Error('Unexpected "g" flag in sparse object of message that is not a group type.');if(n)for(t=c&&!u&&!0,i=this.i,c=0;c<n.length;c++)(u=n[c])<i?(o=e[u+=this.G])?st(o,t):e[u]=Fe:(r||(r=Ve(this)),(o=r[u])?st(o,t):r[u]=Fe)}function st(e,t){if(Array.isArray(e)){var n=Ie(e),r=1;!t||2&n||(r|=16),(n&r)!==r&&Ne(e,n|r)}}function ft(e,t,n){if(n){var r,o={};for(r in n){var i=n[r],a=i.ra;a||(o.J=i.xa||i.oa.W,i.ia?(o.aa=bt(i.ia),a=function(e){return function(t,n,r){return e.J(t,n,r,e.aa)}}(o)):i.ka?(o.Z=wt(i.da.P,i.ka),a=function(e){return function(t,n,r){return e.J(t,n,r,e.Z)}}(o)):a=o.J,i.ra=a),a(t,e,i.da),o={J:o.J,aa:o.aa,Z:o.Z}}}!function(e,t){if(t=t.R){Ce(e,e.h.end());for(var n=0;n<t.length;n++)Ce(e,de(t[n])||W())}}(t,e)}Ne(ze,23),Fe=Object.freeze(ze),ct.prototype.toJSON=function(){return nt(this.o,rt,ot)},ct.prototype.C=function(){return!!(2&Ie(this.o))},ct.prototype.ja=Le,ct.prototype.toString=function(){return this.o.toString()};var dt=Symbol();function pt(e,t,n){return e[dt]||(e[dt]=function(e,r){return t(e,r,n)})}function ht(e){var t=e[dt];if(!t){var n=Nt(e);t=function(e,t){return At(e,t,n)},e[dt]=t}return t}function vt(e){var t=function(e){var t=e.ia;return t?ht(t):(t=e.wa)?pt(e.da.P,t,e.ka):void 0}(e),n=e.da,r=e.oa.U;return t?function(e,o){return r(e,o,n,t)}:function(e,t){return r(e,t,n)}}function mt(e,t){var n=e[t];return"function"==typeof n&&0===n.length&&(n=n(),e[t]=n),Array.isArray(n)&&(Ct in n||_t in n||0<n.length&&"function"==typeof n[0])?n:void 0}function yt(e,t,n,r,o,i){t.P=e[0];var a=1;if(e.length>a&&"number"!=typeof e[a]){var u=e[a++];n(t,u)}for(;a<e.length;){n=e[a++];for(var l=a+1;l<e.length&&"number"!=typeof e[l];)l++;switch(u=e[a++],l-=a){case 0:r(t,n,u);break;case 1:(l=mt(e,a))?(a++,o(t,n,u,l)):r(t,n,u,e[a++]);break;case 2:o(t,n,u,l=mt(e,l=a++),e[a++]);break;case 3:i(t,n,u,e[a++],e[a++],e[a++]);break;case 4:i(t,n,u,e[a++],e[a++],e[a++],e[a++]);break;default:throw Error("unexpected number of binary field arguments: "+l)}}return t}var gt=Symbol();function bt(e){var t=e[gt];if(!t){var n=St(e);t=function(e,t){return Dt(e,t,n)},e[gt]=t}return t}function wt(e,t){var n=e[gt];return n||(n=function(e,n){return ft(e,n,t)},e[gt]=n),n}var _t=Symbol();function Et(e,t){e.push(t)}function kt(e,t,n){e.push(t,n.W)}function xt(e,t,n,r){var o=bt(r),i=St(r).P,a=n.W;e.push(t,(function(e,t,n){return a(e,t,n,i,o)}))}function Tt(e,t,n,r,o,i){var a=wt(r,i),u=n.W;e.push(t,(function(e,t,n){return u(e,t,n,r,a)}))}function St(e){var t=e[_t];return t||(t=yt(e,e[_t]=[],Et,kt,xt,Tt),Ct in e&&_t in e&&(e.length=0),t)}var Ct=Symbol();function Rt(e,t){e[0]=t}function Pt(e,t,n,r){var o=n.U;e[t]=r?function(e,t,n){return o(e,t,n,r)}:o}function Ot(e,t,n,r,o){var i=n.U,a=ht(r),u=Nt(r).P;e[t]=function(e,t,n){return i(e,t,n,u,a,o)}}function It(e,t,n,r,o,i,a){var u=n.U,l=pt(r,o,i);e[t]=function(e,t,n){return u(e,t,n,r,l,a)}}function Nt(e){var t=e[Ct];return t||(t=yt(e,e[Ct]={},Rt,Pt,Ot,It),Ct in e&&_t in e&&(e.length=0),t)}function At(e,t,n){for(;ke(t)&&4!=t.i;){var r=t.l,o=n[r];if(!o){var i=n[0];i&&(i=i[r])&&(o=n[r]=vt(i))}if(!o||!o(t,e,r)){r=e,i=(o=t).j,xe(o);var a=o;if(!a.ca){if(o=a.h.h-i,a.h.h=i,a=a.h,0==o)o=fe();else{if(i=ye(a,o),a.S&&a.m)o=a.i.subarray(i,i+o);else{a=a.i;var u=i;o=u===(o=i+o)?W():V?a.slice(u,o):new Uint8Array(a.subarray(u,o))}o=0==o.length?fe():new se(o,B)}(i=r.R)?i.push(o):r.R=[o]}}}return e}function Dt(e,t,n){for(var r=n.length,o=1==r%2,i=o?1:0;i<r;i+=2)(0,n[i+1])(t,e,n[i]);ft(e,t,o?n[0]:void 0)}function Mt(e,t){return{U:e,W:t}}var Lt=Mt((function(e,t,n){if(5!==e.i)return!1;var r=(e=e.h).i,o=e.h,i=r[o],a=r[o+1],u=r[o+2];return r=r[o+3],ve(e,e.h+4),e=2*((a=(i<<0|a<<8|u<<16|r<<24)>>>0)>>31)+1,i=a>>>23&255,a&=8388607,$e(t,n,255==i?a?NaN:1/0*e:0==i?e*Math.pow(2,-149)*a:e*Math.pow(2,i-150)*(a+Math.pow(2,23))),!0}),(function(e,t,n){if(null!=(t=Qe(t,n))){_e(e.h,8*n+5),e=e.h;var r=+t;0===r?0<1/r?H=$=0:($=0,H=2147483648):isNaN(r)?($=0,H=2147483647):34028234663852886e22<(r=(n=0>r?-2147483648:0)?-r:r)?($=0,H=(2139095040|n)>>>0):11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),$=0,H=(n|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,$=0,H=(n|t+127<<23|8388607&r)>>>0),n=H,e.h.push(n>>>0&255),e.h.push(n>>>8&255),e.h.push(n>>>16&255),e.h.push(n>>>24&255)}})),jt=Mt((function(e,t,n){if(0!==e.i)return!1;var r=e.h,o=0,i=e=0,a=r.i,u=r.h;do{var l=a[u++];o|=(127&l)<<i,i+=7}while(32>i&&128&l);for(32<i&&(e|=(127&l)>>4),i=3;32>i&&128&l;i+=7)e|=(127&(l=a[u++]))<<i;if(ve(r,u),!(128>l))throw Z();return r=o>>>0,(e=2147483648&(l=e>>>0))&&(l=~l>>>0,0==(r=1+~r>>>0)&&(l=l+1>>>0)),r=4294967296*l+(r>>>0),$e(t,n,e?-r:r),!0}),(function(e,t,n){null!=(t=He(t,n))&&("string"==typeof t&&X(t),null!=t&&(_e(e.h,8*n),"number"==typeof t?(e=e.h,G(t),we(e,H,$)):(n=X(t),we(e.h,n.i,n.h))))})),Ft=Mt((function(e,t,n){return 0===e.i&&($e(t,n,me(e.h)),!0)}),(function(e,t,n){if(null!=(t=He(t,n))&&null!=t)if(_e(e.h,8*n),e=e.h,0<=(n=t))_e(e,n);else{for(t=0;9>t;t++)e.h.push(127&n|128),n>>=7;e.h.push(1)}})),Ut=Mt((function(e,t,n){if(2!==e.i)return!1;var r=me(e.h)>>>0,o=ye(e=e.h,r);if(e=e.i,ue){var i,a=e;(i=re)||(i=re=new TextDecoder("utf-8",{fatal:!0})),e=o+r,a=0===o&&e===a.length?a:a.subarray(o,e);try{var u=i.decode(a)}catch(e){if(void 0===ae){try{i.decode(new Uint8Array([128]))}catch(e){}try{i.decode(new Uint8Array([97])),ae=!0}catch(e){ae=!1}}throw!ae&&(re=void 0),e}}else{r=(u=o)+r,o=[];for(var l,c,s=null;u<r;)128>(l=e[u++])?o.push(l):224>l?u>=r?te():(c=e[u++],194>l||128!=(192&c)?(u--,te()):o.push((31&l)<<6|63&c)):240>l?u>=r-1?te():128!=(192&(c=e[u++]))||224===l&&160>c||237===l&&160<=c||128!=(192&(a=e[u++]))?(u--,te()):o.push((15&l)<<12|(63&c)<<6|63&a):244>=l?u>=r-2?te():128!=(192&(c=e[u++]))||0!=c-144+(l<<28)>>30||128!=(192&(a=e[u++]))||128!=(192&(i=e[u++]))?(u--,te()):(l=(7&l)<<18|(63&c)<<12|(63&a)<<6|63&i,l-=65536,o.push(55296+(l>>10&1023),56320+(1023&l))):te(),8192<=o.length&&(s=ne(s,o),o.length=0);u=ne(s,o)}return $e(t,n,u),!0}),(function(e,t,n){if(null!=(t=He(t,n))){var r=!1;if(r=void 0!==r&&r,le){if(r&&/(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])/.test(t))throw Error("Found an unpaired surrogate");t=(oe||(oe=new TextEncoder)).encode(t)}else{for(var o=0,i=new Uint8Array(3*t.length),a=0;a<t.length;a++){var u=t.charCodeAt(a);if(128>u)i[o++]=u;else{if(2048>u)i[o++]=u>>6|192;else{if(55296<=u&&57343>=u){if(56319>=u&&a<t.length){var l=t.charCodeAt(++a);if(56320<=l&&57343>=l){u=1024*(u-55296)+l-56320+65536,i[o++]=u>>18|240,i[o++]=u>>12&63|128,i[o++]=u>>6&63|128,i[o++]=63&u|128;continue}a--}if(r)throw Error("Found an unpaired surrogate");u=65533}i[o++]=u>>12|224,i[o++]=u>>6&63|128}i[o++]=63&u|128}}t=o===i.length?i:i.subarray(0,o)}_e(e.h,8*n+2),_e(e.h,t.length),Ce(e,e.h.end()),Ce(e,t)}})),zt=Mt((function(e,t,n,r,o){if(2!==e.i)return!1;t=Je(t,n,r),n=e.h.j,r=me(e.h)>>>0;var i=e.h.h+r,a=i-n;if(0>=a&&(e.h.j=i,o(t,e,void 0,void 0,void 0),a=i-e.h.h),a)throw Error("Message parsing ended unexpectedly. Expected to read "+r+" bytes, instead read "+(r-a)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.h.h=i,e.h.j=n,!0}),(function(e,t,n,r,o){if(null!=(t=Ke(t,r,n)))for(r=0;r<t.length;r++){var i=e;_e(i.h,8*n+2);var a=i.h.end();Ce(i,a),a.push(i.i),i=a,o(t[r],e),a=e;var u=i.pop();for(u=a.i+a.h.length()-u;127<u;)i.push(127&u|128),u>>>=7,a.i++;i.push(u),a.i++}}));function Wt(e){return function(t,n){e:{if(Te.length){var r=Te.pop();r.setOptions(n),he(r.h,t,n),t=r}else t=new Ee(t,n);try{var o=Nt(e),i=At(new o.P,t,o);break e}finally{(o=t.h).i=null,o.m=!1,o.l=0,o.j=0,o.h=0,o.S=!1,t.l=-1,t.i=-1,100>Te.length&&Te.push(t)}i=void 0}return i}}function Bt(e){return function(){var t=new Se;Dt(this,t,St(e)),Ce(t,t.h.end());for(var n=new Uint8Array(t.i),r=t.j,o=r.length,i=0,a=0;a<o;a++){var u=r[a];n.set(u,i),i+=u.length}return t.j=[n],n}}function Vt(e){ct.call(this,e)}v(Vt,ct);var Ht=[Vt,1,Ft,2,Lt,3,Ut,4,Ut];function $t(e){ct.call(this,e,-1,Gt)}Vt.prototype.l=Bt(Ht),v($t,ct),$t.prototype.addClassification=function(e,t){return Je(this,1,Vt,e,t),this};var Gt=[1],Yt=Wt([$t,1,zt,Ht]);function Qt(e){ct.call(this,e)}v(Qt,ct);var qt=[Qt,1,Lt,2,Lt,3,Lt,4,Lt,5,Lt];function Kt(e){ct.call(this,e,-1,Xt)}Qt.prototype.l=Bt(qt),v(Kt,ct);var Xt=[1],Jt=Wt([Kt,1,zt,qt]);function Zt(e){ct.call(this,e)}v(Zt,ct);var en=[Zt,1,Lt,2,Lt,3,Lt,4,Lt,5,Lt,6,jt],tn=Wt(en);function nn(e,t,n){if(n=e.createShader(0===n?e.VERTEX_SHADER:e.FRAGMENT_SHADER),e.shaderSource(n,t),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))throw Error("Could not compile WebGL shader.\n\n"+e.getShaderInfoLog(n));return n}function rn(e){return Ke(e,Vt,1).map((function(e){var t=He(e,1);return{index:null==t?0:t,qa:et(e,2),label:null!=He(e,3)?Ze(He(e,3),""):void 0,displayName:null!=He(e,4)?Ze(He(e,4),""):void 0}}))}function on(e){return{x:et(e,1),y:et(e,2),z:et(e,3),visibility:null!=Qe(e,4)?et(e,4):void 0}}function an(e){return Ke(Jt(e),Qt,1).map(on)}function un(e,t){this.i=e,this.h=t,this.m=0}function ln(e,t,n){return function(e,t){var n=e.h;if(void 0===e.s){var r=nn(n,"\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),o=nn(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),i=n.createProgram();if(n.attachShader(i,r),n.attachShader(i,o),n.linkProgram(i),!n.getProgramParameter(i,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(i));r=e.s=i,n.useProgram(r),o=n.getUniformLocation(r,"sampler0"),e.l={O:n.getAttribLocation(r,"aVertex"),N:n.getAttribLocation(r,"aTex"),ya:o},e.v=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.v),n.enableVertexAttribArray(e.l.O),n.vertexAttribPointer(e.l.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),e.u=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.enableVertexAttribArray(e.l.N),n.vertexAttribPointer(e.l.N,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,1,0,0,1,0,1,1]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.uniform1i(o,0)}r=e.l,n.useProgram(e.s),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.i.bindTexture2d(t.glName),n.enableVertexAttribArray(r.O),n.bindBuffer(n.ARRAY_BUFFER,e.v),n.vertexAttribPointer(r.O,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.N),n.bindBuffer(n.ARRAY_BUFFER,e.u),n.vertexAttribPointer(r.N,2,n.FLOAT,!1,0,0),n.bindFramebuffer(n.DRAW_FRAMEBUFFER?n.DRAW_FRAMEBUFFER:n.FRAMEBUFFER,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.colorMask(!0,!0,!0,!0),n.drawArrays(n.TRIANGLE_FAN,0,4),n.disableVertexAttribArray(r.O),n.disableVertexAttribArray(r.N),n.bindBuffer(n.ARRAY_BUFFER,null),e.i.bindTexture2d(0)}(e,t),"function"==typeof e.h.canvas.transferToImageBitmap?Promise.resolve(e.h.canvas.transferToImageBitmap()):n?Promise.resolve(e.h.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.h.canvas):(void 0===e.j&&(e.j=document.createElement("canvas")),new Promise((function(t){e.j.height=e.h.canvas.height,e.j.width=e.h.canvas.width,e.j.getContext("2d",{}).drawImage(e.h.canvas,0,0,e.h.canvas.width,e.h.canvas.height),t(e.j)})))}function cn(e){this.h=e}Zt.prototype.l=Bt(en);var sn=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 fn(e,t){return t+e}function dn(e,t){window[e]=t}function pn(e){if(this.h=e,this.listeners={},this.l={},this.L={},this.s={},this.v={},this.M=this.u=this.ga=!0,this.I=Promise.resolve(),this.fa="",this.D={},this.locateFile=e&&e.locateFile||fn,"object"==typeof window)var t=window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/";else{if("undefined"==typeof location)throw Error("solutions can only be loaded on a web page or in a web worker");t=location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/"}if(this.ha=t,e.options)for(var n=(t=u(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var r=e.options[n].default;void 0!==r&&(this.l[n]="function"==typeof r?r():r)}}function hn(e){var t,n,r,o,i,a,u,c,s,f,d;return x((function(p){switch(p.h){case 1:return e.ga?(t=void 0===e.h.files?[]:"function"==typeof e.h.files?e.h.files(e.l):e.h.files,b(p,x((function(e){switch(e.h){case 1:return e.s=2,b(e,WebAssembly.instantiate(sn),4);case 4:e.h=3,e.s=0;break;case 2:return e.s=0,e.l=null,e.return(!1);case 3:return e.return(!0)}})),2)):p.return();case 2:if(n=p.i,"object"==typeof window)return dn("createMediapipeSolutionsWasm",{locateFile:e.locateFile}),dn("createMediapipeSolutionsPackedAssets",{locateFile:e.locateFile}),a=t.filter((function(e){return void 0!==e.data})),u=t.filter((function(e){return void 0===e.data})),c=Promise.all(a.map((function(t){var n=vn(e,t.url);if(void 0!==t.path){var r=t.path;n=n.then((function(t){return e.overrideFile(r,t),Promise.resolve(t)}))}return n}))),s=Promise.all(u.map((function(t){return void 0===t.simd||t.simd&&n||!t.simd&&!n?function(e){var t=document.createElement("script");return t.setAttribute("src",e),t.setAttribute("crossorigin","anonymous"),new Promise((function(e){t.addEventListener("load",(function(){e()}),!1),t.addEventListener("error",(function(){e()}),!1),document.body.appendChild(t)}))}(e.locateFile(t.url,e.ha)):Promise.resolve()}))).then((function(){var t,n,r;return x((function(o){if(1==o.h)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,r=e,b(o,t(n),2);r.i=o.i,o.h=0}))})),f=x((function(t){return e.h.graph&&e.h.graph.url?t=b(t,vn(e,e.h.graph.url),0):(t.h=0,t=void 0),t})),b(p,Promise.all([s,c,f]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return r=t.filter((function(e){return void 0===e.simd||e.simd&&n||!e.simd&&!n})).map((function(t){return e.locateFile(t.url,e.ha)})),importScripts.apply(null,l(r)),o=e,b(p,createMediapipeSolutionsWasm(Module),6);case 6:o.i=p.i,e.m=new OffscreenCanvas(1,1),e.i.canvas=e.m,i=e.i.GL.createContext(e.m,{antialias:!1,alpha:!1,va:"undefined"!=typeof WebGL2RenderingContext?2:1}),e.i.GL.makeContextCurrent(i),p.h=4;break;case 7:if(e.m=document.createElement("canvas"),!(d=e.m.getContext("webgl2",{}))&&!(d=e.m.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),p.return();e.K=d,e.i.canvas=e.m,e.i.createContext(e.m,!0,!0,{});case 4:e.j=new e.i.SolutionWasm,e.ga=!1,p.h=0}}))}function vn(e,t){var n,r;return x((function(o){return t in e.L?o.return(e.L[t]):(n=e.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),e.L[t]=r,o.return(r))}))}function mn(e,t,n){var r,o,i,a,l,c,s,f,d,p,h,v,m,y;return x((function(g){switch(g.h){case 1:if(!n)return g.return(t);for(r={},o=0,i=u(Object.keys(n)),a=i.next();!a.done;a=i.next())l=a.value,"string"!=typeof(c=n[l])&&"texture"===c.type&&void 0!==t[c.stream]&&++o;1<o&&(e.M=!1),s=u(Object.keys(n)),a=s.next();case 2:if(a.done){g.h=4;break}if(f=a.value,"string"==typeof(d=n[f]))return m=r,y=f,b(g,function(e,t,n){var r;return x((function(o){return"number"==typeof n||n instanceof Uint8Array||n instanceof e.i.Uint8BlobList?o.return(n):n instanceof e.i.Texture2dDataOut?((r=e.v[t])||(r=new un(e.i,e.K),e.v[t]=r),o.return(ln(r,n,e.M))):o.return(void 0)}))}(e,f,t[d]),14);if(p=t[d.stream],"detection_list"===d.type){if(p){for(var w=p.getRectList(),_=p.getLandmarksList(),E=p.getClassificationsList(),k=[],T=0;T<w.size();++T){var S=tn(w.get(T)),C=void 0;C=void 0===C?0:C,S={la:{sa:et(S,1),ta:et(S,2),height:et(S,3),width:et(S,4),rotation:et(S,5,0),pa:Ze(He(S,6),C)},ea:an(_.get(T)),ba:rn(Yt(E.get(T)))},k.push(S)}w=k}else w=[];r[f]=w,g.h=7;break}if("proto_list"===d.type){if(p){for(w=Array(p.size()),_=0;_<p.size();_++)w[_]=p.get(_);p.delete()}else w=[];r[f]=w,g.h=7;break}if(void 0===p){g.h=3;break}if("float_list"===d.type){r[f]=p,g.h=7;break}if("proto"===d.type){r[f]=p,g.h=7;break}if("texture"!==d.type)throw Error("Unknown output config type: '"+d.type+"'");return(h=e.v[f])||(h=new un(e.i,e.K),e.v[f]=h),b(g,ln(h,p,e.M),13);case 13:v=g.i,r[f]=v;case 7:d.transform&&r[f]&&(r[f]=d.transform(r[f])),g.h=3;break;case 14:m[y]=g.i;case 3:a=s.next(),g.h=2;break;case 4:return g.return(r)}}))}function yn(e,t){for(var n=t.name||"$",r=[].concat(l(t.wants)),o=new e.i.StringList,i=u(t.wants),a=i.next();!a.done;a=i.next())o.push_back(a.value);i=e.i.PacketListener.implement({onResults:function(o){for(var i={},a=0;a<t.wants.length;++a)i[r[a]]=o.get(a);var u=e.listeners[n];u&&(e.I=mn(e,i,t.outs).then((function(n){n=u(n);for(var o=0;o<t.wants.length;++o){var a=i[r[o]];"object"==typeof a&&a.hasOwnProperty&&a.hasOwnProperty("delete")&&a.delete()}n&&(e.I=n)})))}}),e.j.attachMultiListener(o,i),o.delete()}function gn(e){switch(void 0===e&&(e=0),e){case 1:return"pose_landmark_full.tflite";case 2:return"pose_landmark_heavy.tflite";default:return"pose_landmark_lite.tflite"}}function bn(e){var t=this;e=e||{},this.h=new pn({locateFile:e.locateFile,files:function(e){return[{url:"pose_solution_packed_assets_loader.js"},{simd:!1,url:"pose_solution_wasm_bin.js"},{simd:!0,url:"pose_solution_simd_wasm_bin.js"},{data:!0,url:gn(e.modelComplexity)}]},graph:{url:"pose_web.binarypb"},listeners:[{wants:["pose_landmarks","world_landmarks","segmentation_mask","image_transformed"],outs:{image:{type:"texture",stream:"image_transformed"},poseLandmarks:{type:"proto",stream:"pose_landmarks",transform:an},poseWorldLandmarks:{type:"proto",stream:"world_landmarks",transform:an},segmentationMask:{type:"texture",stream:"segmentation_mask"}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"object"==typeof window&&void 0!==window.navigator&&("iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},modelComplexity:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorModelComplexity",fieldName:"int_value"},onChange:function(e){var n,r,o;return x((function(i){return 1==i.h?(n=gn(e),r="third_party/mediapipe/modules/pose_landmark/"+n,b(i,vn(t.h,n),2)):(o=i.i,t.h.overrideFile(r,o),i.return(!0))}))}},smoothLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothLandmarks",fieldName:"bool_value"}},enableSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorEnableSegmentation",fieldName:"bool_value"}},smoothSegmentation:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorSmoothSegmentation",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"poselandmarkgpu__posedetectiongpu__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"poselandmarkgpu__poselandmarkbyroigpu__tensorstoposelandmarksandsegmentation__ThresholdingCalculator",fieldName:"threshold"}}}})}(t=pn.prototype).close=function(){return this.j&&this.j.delete(),Promise.resolve()},t.reset=function(){var e=this;return x((function(t){e.j&&(e.j.reset(),e.s={},e.v={}),t.h=0}))},t.setOptions=function(e,t){var n=this;if(t=t||this.h.options){for(var r=[],o=[],i={},a=u(Object.keys(e)),l=a.next();!l.done;i={X:i.X,Y:i.Y},l=a.next())if(!((l=l.value)in this.l)||this.l[l]!==e[l]){this.l[l]=e[l];var c=t[l];void 0!==c&&(c.onChange&&(i.X=c.onChange,i.Y=e[l],r.push(function(e){return function(){return x((function(t){if(1==t.h)return b(t,e.X(e.Y),2);!0===t.i&&(n.u=!0),t.h=0}))}}(i))),c.graphOptionXref&&(l=Object.assign({},{calculatorName:"",calculatorIndex:0},c.graphOptionXref,{valueNumber:1===c.type?e[l]:0,valueBoolean:0===c.type&&e[l],valueString:2===c.type?e[l]:""}),o.push(l)))}0===r.length&&0===o.length||(this.u=!0,this.H=(void 0===this.H?[]:this.H).concat(o),this.F=(void 0===this.F?[]:this.F).concat(r))}},t.initialize=function(){var e=this;return x((function(t){return 1==t.h?b(t,hn(e),2):3!=t.h?b(t,function(e){var t,n,r,o,i,a,l,c;return x((function(s){if(1==s.h)return e.h.gra