UNPKG

ml5

Version:

A friendly machine learning library for the web.

1 lines 4.47 MB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.ml5=t():e.ml5=t()}(self,(()=>(()=>{var e={2726:function(e,t,n){(function(){"use strict";var e;function t(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 i=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof n.g&&n.g];for(var t=0;t<e.length;++t){var r=e[t];if(r&&r.Math==Math)return r}throw Error("Cannot find global object")}(this);function a(e,t){if(t)e:{var n=i;e=e.split(".");for(var a=0;a<e.length-1;a++){var o=e[a];if(!(o in n))break e;n=n[o]}(t=t(a=n[e=e[e.length-1]]))!=a&&null!=t&&r(n,e,{configurable:!0,writable:!0,value:t})}}function o(e){return(e={next:e})[Symbol.iterator]=function(){return this},e}function s(e){var n="undefined"!=typeof Symbol&&Symbol.iterator&&e[Symbol.iterator];return n?n.call(e):{next:t(e)}}function u(e){if(!(e instanceof Array)){e=s(e);for(var t,n=[];!(t=e.next()).done;)n.push(t.value);e=n}return e}a("Symbol",(function(e){function t(e,t){this.g=e,r(this,"description",{configurable:!0,writable:!0,value:t})}if(e)return e;t.prototype.toString=function(){return this.g};var n="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",i=0;return function e(r){if(this instanceof e)throw new TypeError("Symbol is not a constructor");return new t(n+(r||"")+"_"+i++,r)}})),a("Symbol.iterator",(function(e){if(e)return e;e=Symbol("Symbol.iterator");for(var n="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),a=0;a<n.length;a++){var s=i[n[a]];"function"==typeof s&&"function"!=typeof s.prototype[e]&&r(s.prototype,e,{configurable:!0,writable:!0,value:function(){return o(t(this))}})}return e}));var l,c="function"==typeof Object.create?Object.create:function(e){function t(){}return t.prototype=e,new t};if("function"==typeof Object.setPrototypeOf)l=Object.setPrototypeOf;else{var h;e:{var d={};try{d.__proto__={a:!0},h=d.a;break e}catch(e){}h=!1}l=h?function(e,t){if(e.__proto__=t,e.__proto__!==t)throw new TypeError(e+" is not extensible");return e}:null}var f=l;function p(e,t){if(e.prototype=c(t.prototype),e.prototype.constructor=e,f)f(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.ea=t.prototype}function m(){this.l=!1,this.i=null,this.h=void 0,this.g=1,this.s=this.m=0,this.j=null}function g(e){if(e.l)throw new TypeError("Generator is already running");e.l=!0}function y(e,t){e.j={U:t,V:!0},e.g=e.m||e.s}function b(e,t,n){return e.g=n,{value:t}}function v(e){this.g=new m,this.h=e}function x(e,t,n,r){try{var i=t.call(e.g.i,n);if(!(i instanceof Object))throw new TypeError("Iterator result "+i+" is not an object");if(!i.done)return e.g.l=!1,i;var a=i.value}catch(t){return e.g.i=null,y(e.g,t),w(e)}return e.g.i=null,r.call(e.g,a),w(e)}function w(e){for(;e.g.g;)try{var t=e.h(e.g);if(t)return e.g.l=!1,{value:t.value,done:!1}}catch(t){e.g.h=void 0,y(e.g,t)}if(e.g.l=!1,e.g.j){if(t=e.g.j,e.g.j=null,t.V)throw t.U;return{value:t.return,done:!0}}return{value:void 0,done:!0}}function k(e){this.next=function(t){return g(e.g),e.g.i?t=x(e,e.g.i.next,t,e.g.o):(e.g.o(t),t=w(e)),t},this.throw=function(t){return g(e.g),e.g.i?t=x(e,e.g.i.throw,t,e.g.o):(y(e.g,t),t=w(e)),t},this.return=function(t){return function(e,t){g(e.g);var n=e.g.i;return n?x(e,"return"in n?n.return:function(e){return{value:e,done:!0}},t,e.g.return):(e.g.return(t),w(e))}(e,t)},this[Symbol.iterator]=function(){return this}}function S(e,t){return t=new k(new v(t)),f&&e.prototype&&f(t,e.prototype),t}m.prototype.o=function(e){this.h=e},m.prototype.return=function(e){this.j={return:e},this.g=this.s};var _="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 i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e};a("Object.assign",(function(e){return e||_})),a("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 r(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 a=i.setTimeout;n.prototype.i=function(e){a(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.C),reject:e(this.l)}},t.prototype.C=function(e){if(e===this)this.l(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof t)this.F(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.u(e):this.m(e)}},t.prototype.u=function(e){var t=void 0;try{t=e.then}catch(e){return void this.l(e)}"function"==typeof t?this.G(t,e):this.m(e)},t.prototype.l=function(e){this.s(2,e)},t.prototype.m=function(e){this.s(1,e)},t.prototype.s=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.D(),this.A()},t.prototype.D=function(){var e=this;a((function(){if(e.B()){var t=i.console;void 0!==t&&t.error(e.i)}}),1)},t.prototype.B=function(){if(this.o)return!1;var e=i.CustomEvent,t=i.Event,n=i.dispatchEvent;return void 0===n||("function"==typeof e?e=new e("unhandledrejection",{cancelable:!0}):"function"==typeof t?e=new t("unhandledrejection",{cancelable:!0}):(e=i.document.createEvent("CustomEvent")).initCustomEvent("unhandledrejection",!1,!0,e),e.promise=this,e.reason=this.i,n(e))},t.prototype.A=function(){if(null!=this.g){for(var e=0;e<this.g.length;++e)o.h(this.g[e]);this.g=null}};var o=new n;return t.prototype.F=function(e){var t=this.j();e.J(t.resolve,t.reject)},t.prototype.G=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{i(e(t))}catch(e){a(e)}}:t}var i,a,o=new t((function(e,t){i=e,a=t}));return this.J(r(e,i),r(n,a)),o},t.prototype.catch=function(e){return this.then(void 0,e)},t.prototype.J=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?o.h(n):this.g.push(n),this.o=!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 i=s(e),a=i.next();!a.done;a=i.next())r(a.value).J(t,n)}))},t.all=function(e){var n=s(e),i=n.next();return i.done?r([]):new t((function(e,t){function a(t){return function(n){o[t]=n,0==--s&&e(o)}}var o=[],s=0;do{o.push(void 0),s++,r(i.value).J(a(o.length-1),t),i=n.next()}while(!i.done)}))},t})),a("Object.is",(function(e){return e||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}})),a("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 i=n[t];if(i===e||Object.is(i,e))return!0}return!1}})),a("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)}})),a("Array.prototype.keys",(function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,i={next:function(){if(!r&&n<e.length){var i=n++;return{value:t(i,e[i]),done:!1}}return r=!0,{done:!0,value:void 0}}};return i[Symbol.iterator]=function(){return i},i}(this,(function(e){return e}))}}));var C=this||self;function A(e,t){e=e.split(".");var n,r=C;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 T(e,t){return t=String.fromCharCode.apply(null,t),null==e?t:e+t}var E,N,I="undefined"!=typeof TextDecoder,M="undefined"!=typeof TextEncoder;function F(e){if(M)e=(N||(N=new TextEncoder)).encode(e);else{var t=void 0;t=void 0!==t&&t;for(var n=0,r=new Uint8Array(3*e.length),i=0;i<e.length;i++){var a=e.charCodeAt(i);if(128>a)r[n++]=a;else{if(2048>a)r[n++]=a>>6|192;else{if(55296<=a&&57343>=a){if(56319>=a&&i<e.length){var o=e.charCodeAt(++i);if(56320<=o&&57343>=o){a=1024*(a-55296)+o-56320+65536,r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128;continue}i--}if(t)throw Error("Found an unpaired surrogate");a=65533}r[n++]=a>>12|224,r[n++]=a>>6&63|128}r[n++]=63&a|128}}e=r.subarray(0,n)}return e}var D={},$=null;function R(e,t){void 0===t&&(t=0),z(),t=D[t];for(var n=Array(Math.floor(e.length/3)),r=t[64]||"",i=0,a=0;i<e.length-2;i+=3){var o=e[i],s=e[i+1],u=e[i+2],l=t[o>>2];o=t[(3&o)<<4|s>>4],s=t[(15&s)<<2|u>>6],u=t[63&u],n[a++]=l+o+s+u}switch(l=0,u=r,e.length-i){case 2:u=t[(15&(l=e[i+1]))<<2]||r;case 1:e=e[i],n[a]=t[e>>2]+t[(3&e)<<4|l>>4]+u+r}return n.join("")}function O(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),i=0;return function(e,t){function n(t){for(;r<e.length;){var n=e.charAt(r++),i=$[n];if(null!=i)return i;if(!/^[\s\xa0]*$/.test(n))throw Error("Unknown base64 encoding at char: "+n)}return t}z();for(var r=0;;){var i=n(-1),a=n(0),o=n(64),s=n(64);if(64===s&&-1===i)break;t(i<<2|a>>4),64!=o&&(t(a<<4&240|o>>2),64!=s&&t(o<<6&192|s))}}(e,(function(e){r[i++]=e})),r.subarray(0,i)}function z(){if(!$){$={};for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),t=["+/=","+/","-_=","-_.","-_"],n=0;5>n;n++){var r=e.concat(t[n].split(""));D[n]=r;for(var i=0;i<r.length;i++){var a=r[i];void 0===$[a]&&($[a]=i)}}}}var P,B="function"==typeof Uint8Array.prototype.slice;function L(e,t,n){return t===n?P||(P=new Uint8Array(0)):B?e.slice(t,n):new Uint8Array(e.subarray(t,n))}var j=0;function U(e,t){t=void 0!==(t=void 0===t?{}:t).v&&t.v,this.h=null,this.g=this.j=this.l=0,this.m=!1,this.v=t,e&&W(this,e)}function W(e,t){t=t.constructor===Uint8Array?t:t.constructor===ArrayBuffer||t.constructor===Array?new Uint8Array(t):t.constructor===String?O(t):t instanceof Uint8Array?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(0),e.h=t,e.l=0,e.j=e.h.length,e.g=e.l}function V(e){for(var t=128,n=0,r=0,i=0;4>i&&128<=t;i++)n|=(127&(t=e.h[e.g++]))<<7*i;if(128<=t&&(n|=(127&(t=e.h[e.g++]))<<28,r|=(127&t)>>4),128<=t)for(i=0;5>i&&128<=t;i++)r|=(127&(t=e.h[e.g++]))<<7*i+3;if(128>t)return e=n>>>0,(r=2147483648&(t=r>>>0))&&(t=~t>>>0,0==(e=1+~e>>>0)&&(t=t+1>>>0)),e=4294967296*t+(e>>>0),r?-e:e;e.m=!0}U.prototype.reset=function(){this.g=this.l},U.prototype.i=function(){var e=this.h,t=e[this.g],n=127&t;return 128>t?(this.g+=1,n):(n|=(127&(t=e[this.g+1]))<<7,128>t?(this.g+=2,n):(n|=(127&(t=e[this.g+2]))<<14,128>t?(this.g+=3,n):(n|=(127&(t=e[this.g+3]))<<21,128>t?(this.g+=4,n):(n|=(15&(t=e[this.g+4]))<<28,128>t?(this.g+=5,n>>>0):(this.g+=5,128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&128<=e[this.g++]&&this.g++,n)))))},U.prototype.o=function(){var e=this.h[this.g],t=this.h[this.g+1],n=this.h[this.g+2],r=this.h[this.g+3];return this.g+=4,e=2*((n=(e|t<<8|n<<16|r<<24)>>>0)>>31)+1,t=n>>>23&255,n&=8388607,255==t?n?NaN:1/0*e:0==t?e*Math.pow(2,-149)*n:e*Math.pow(2,t-150)*(n+Math.pow(2,23))};var G=[];function H(){this.g=new Uint8Array(64),this.h=0}function q(e,t){for(;127<t;)e.push(127&t|128),t>>>=7;e.push(t)}function Y(e){var t={},n=void 0!==t.N&&t.N;this.o={v:void 0!==t.v&&t.v},this.N=n,t=this.o,G.length?(n=G.pop(),t&&(n.v=t.v),e&&W(n,e),e=n):e=new U(e,t),this.g=e,this.m=this.g.g,this.h=this.i=this.l=-1,this.j=!1}function X(e){var t=e.g;if((t=t.g==t.j)||(t=e.j)||(t=(t=e.g).m||0>t.g||t.g>t.j),t)return!1;e.m=e.g.g;var n=7&(t=e.g.i());return 0!=n&&5!=n&&1!=n&&2!=n&&3!=n&&4!=n?(e.j=!0,!1):(e.i=t,e.l=t>>>3,e.h=n,!0)}function K(e){switch(e.h){case 0:if(0!=e.h)K(e);else{for(e=e.g;128&e.h[e.g];)e.g++;e.g++}break;case 1:1!=e.h?K(e):(e=e.g).g+=8;break;case 2:if(2!=e.h)K(e);else{var t=e.g.i();(e=e.g).g+=t}break;case 5:5!=e.h?K(e):(e=e.g).g+=4;break;case 3:for(t=e.l;;){if(!X(e)){e.j=!0;break}if(4==e.h){e.l!=t&&(e.j=!0);break}K(e)}break;default:e.j=!0}}function Z(e,t,n){var r=e.g.j,i=e.g.i(),a=e.g.g+i;if(e.g.j=a,n(t,e),0!==(n=a-e.g.g))throw Error("Message parsing ended unexpectedly. Expected to read "+i+" bytes, instead read "+(i-n)+" bytes, either the data ended unexpectedly or the message misreported its own length");return e.g.g=a,e.g.j=r,t}function J(e){return e.g.o()}function Q(e){var t,n=e.g.i(),r=(e=e.g).g;if(e.g+=n,e=e.h,I)(t=E)||(t=E=new TextDecoder("utf-8",{fatal:!1})),t=t.decode(e.subarray(r,r+n));else{n=r+n;for(var i,a,o,s=[],u=null;r<n;)128>(i=e[r++])?s.push(i):224>i?r>=n?s.push(65533):(a=e[r++],194>i||128!=(192&a)?(r--,s.push(65533)):s.push((31&i)<<6|63&a)):240>i?r>=n-1?s.push(65533):128!=(192&(a=e[r++]))||224===i&&160>a||237===i&&160<=a||128!=(192&(t=e[r++]))?(r--,s.push(65533)):s.push((15&i)<<12|(63&a)<<6|63&t):244>=i?r>=n-2?s.push(65533):128!=(192&(a=e[r++]))||a-144+(i<<28)>>30||128!=(192&(t=e[r++]))||128!=(192&(o=e[r++]))?(r--,s.push(65533)):(i=(7&i)<<18|(63&a)<<12|(63&t)<<6|63&o,i-=65536,s.push(55296+(i>>10&1023),56320+(1023&i))):s.push(65533),8192<=s.length&&(u=T(u,s),s.length=0);t=T(u,s)}return t}function ee(e,t,n){var r=e.g.i();for(r=e.g.g+r;e.g.g<r;)n.push(t.call(e.g))}function te(e,t){2==e.h?ee(e,U.prototype.o,t):t.push(J(e))}function ne(){this.h=[],this.i=0,this.g=new H}function re(e,t){0!==t.length&&(e.h.push(t),e.i+=t.length)}function ie(e){var t=e.i+e.g.length();if(0===t)return new Uint8Array(0);t=new Uint8Array(t);for(var n=e.h,r=n.length,i=0,a=0;a<r;a++){var o=n[a];0!==o.length&&(t.set(o,i),i+=o.length)}return 0!==(r=(n=e.g).h)&&(t.set(n.g.subarray(0,r),i),n.h=0),e.h=[t],t}function ae(e,t,n){if(null!=n){q(e.g,8*t+5),e=e.g;var r=n;0===(r=(n=0>r?1:0)?-r:r)?0<1/r?j=0:j=2147483648:isNaN(r)?j=2147483647:34028234663852886e22<r?j=(n<<31|2139095040)>>>0:11754943508222875e-54>r?(r=Math.round(r/Math.pow(2,-149)),j=(n<<31|r)>>>0):(t=Math.floor(Math.log(r)/Math.LN2),r*=Math.pow(2,-t),16777216<=(r=Math.round(8388608*r))&&++t,j=(n<<31|t+127<<23|8388607&r)>>>0),n=j,e.push(n>>>0&255),e.push(n>>>8&255),e.push(n>>>16&255),e.push(n>>>24&255)}}H.prototype.push=function(e){if(!(this.h+1<this.g.length)){var t=this.g;this.g=new Uint8Array(Math.ceil(1+2*this.g.length)),this.g.set(t)}this.g[this.h++]=e},H.prototype.length=function(){return this.h},H.prototype.end=function(){var e=this.g,t=this.h;return this.h=0,L(e,0,t)},Y.prototype.reset=function(){this.g.reset(),this.h=this.l=-1};var oe="function"==typeof Uint8Array;function se(e,t,n){if(null!=e)return"object"==typeof e?oe&&e instanceof Uint8Array?n(e):ue(e,t,n):t(e)}function ue(e,t,n){if(Array.isArray(e)){for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=se(e[i],t,n);return Array.isArray(e)&&e.W&&de(r),r}for(i in r={},e)r[i]=se(e[i],t,n);return r}function le(e){return"number"==typeof e?isFinite(e)?e:String(e):e}var ce,he={W:{value:!0,configurable:!0}};function de(e){return Array.isArray(e)&&!Object.isFrozen(e)&&Object.defineProperties(e,he),e}function fe(e,t,n){var r=ce;if(ce=null,e||(e=r),r=this.constructor.ca,e||(e=r?[r]:[]),this.j=r?0:-1,this.m=this.g=null,this.h=e,e=(r=this.h.length)-1,!r||(null===(r=this.h[e])||"object"!=typeof r||Array.isArray(r)||oe&&r instanceof Uint8Array)?void 0!==t&&-1<t?(this.l=Math.max(t,e+1-this.j),this.i=null):this.l=Number.MAX_VALUE:(this.l=e-this.j,this.i=r),n)for(t=0;t<n.length;t++)(e=n[t])<this.l?(e+=this.j,(r=this.h[e])?de(r):this.h[e]=pe):(me(this),(r=this.i[e])?de(r):this.i[e]=pe)}var pe=Object.freeze(de([]));function me(e){var t=e.l+e.j;e.h[t]||(e.i=e.h[t]={})}function ge(e,t,n){return-1===t?null:void 0!==n&&n||t>=e.l?e.i?e.i[t]:void 0:e.h[t+e.j]}function ye(e,t){var n=void 0!==n&&n,r=ge(e,t,n);return null==r&&(r=pe),r===pe&&we(e,t,r=de([]),n),r}function be(e){var t=ye(e,3);if(e.m||(e.m={}),!e.m[3]){for(var n=0;n<t.length;n++)t[n]=+t[n];e.m[3]=!0}return t}function ve(e,t,n){return null==(e=ge(e,t))?n:e}function xe(e,t,n){return null==(e=null==(e=ge(e,t))?e:+e)?void 0===n?0:n:e}function we(e,t,n,r){void 0!==r&&r||t>=e.l?(me(e),e.i[t]=n):e.h[t+e.j]=n}function ke(e,t,n){if(-1===n)return null;if(e.g||(e.g={}),!e.g[n]){var r=ge(e,n,!1);r&&(e.g[n]=new t(r))}return e.g[n]}function Se(e,t){e.g||(e.g={});var n=e.g[1];if(!n){var r=ye(e,1);n=[];for(var i=0;i<r.length;i++)n[i]=new t(r[i]);e.g[1]=n}return n}function _e(e,t,n){var r=void 0!==r&&r;e.g||(e.g={});var i=n?Ae(n,!1):n;e.g[t]=n,we(e,t,i,r)}function Ce(e,t,n,r){var i=Se(e,n);t=t||new n,e=ye(e,1),null!=r?(i.splice(r,0,t),e.splice(r,0,Ae(t,!1))):(i.push(t),e.push(Ae(t,!1)))}function Ae(e,t){if(e.g)for(var n in e.g){var r=e.g[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)r[i]&&Ae(r[i],t);else r&&Ae(r,t)}return e.h}function Te(e,t){if(e=e.o){re(t,t.g.end());for(var n=0;n<e.length;n++)re(t,e[n])}}function Ee(e,t){if(4==t.h)return!1;var n=t.m;return K(t),t.N||(t=L(t.g.h,n,t.g.g),(n=e.o)?n.push(t):e.o=[t]),!0}function Ne(e){fe.call(this,e,-1,Me)}function Ie(e,t){for(;X(t);)switch(t.i){case 8:var n=t.g.i();we(e,1,n);break;case 16:we(e,2,n=t.g.i());break;case 29:case 26:te(t,e.getPackedDataList());break;case 32:we(e,4,n=V(t.g));break;default:if(!Ee(e,t))return e}return e}fe.prototype.toJSON=function(){return ue(Ae(this,!1),le,R)},fe.prototype.toString=function(){return Ae(this,!1).toString()},p(Ne,fe),Ne.prototype.getRows=function(){return ge(this,1)},Ne.prototype.getCols=function(){return ge(this,2)},Ne.prototype.getPackedDataList=function(){return be(this)},Ne.prototype.getLayout=function(){return ve(this,4,0)};var Me=[3];function Fe(e,t){var n=void 0;return new(n||(n=Promise))((function(r,i){function a(e){try{s(t.next(e))}catch(e){i(e)}}function o(e){try{s(t.throw(e))}catch(e){i(e)}}function s(e){e.done?r(e.value):new n((function(t){t(e.value)})).then(a,o)}s((t=t.apply(e,void 0)).next())}))}function De(e){fe.call(this,e)}function $e(e,t){for(;X(t);)switch(t.i){case 8:var n=t.g.i();we(e,1,n);break;case 21:we(e,2,n=J(t));break;case 26:we(e,3,n=Q(t));break;case 34:we(e,4,n=Q(t));break;default:if(!Ee(e,t))return e}return e}function Re(e){fe.call(this,e,-1,Oe)}p(De,fe),p(Re,fe),Re.prototype.addClassification=function(e,t){return Ce(this,e,De,t),this};var Oe=[1];function ze(e){fe.call(this,e)}function Pe(e,t){for(;X(t);)switch(t.i){case 13:var n=J(t);we(e,1,n);break;case 21:we(e,2,n=J(t));break;case 29:we(e,3,n=J(t));break;case 37:we(e,4,n=J(t));break;case 45:we(e,5,n=J(t));break;default:if(!Ee(e,t))return e}return e}function Be(e){fe.call(this,e,-1,je)}function Le(e){e:{var t=new Be;for(e=new Y(e);X(e);)if(10===e.i){Ce(t,Z(e,new ze,Pe),ze,void 0)}else if(!Ee(t,e))break e}return t}p(ze,fe),p(Be,fe);var je=[1];function Ue(e){fe.call(this,e)}function We(e){fe.call(this,e,-1,Ge)}function Ve(e,t){for(;X(t);)switch(t.i){case 8:var n=V(t.g);we(e,1,n);break;case 16:we(e,2,n=V(t.g));break;case 29:case 26:te(t,e.getVertexBufferList());break;case 32:case 34:n=t;var r=e.getIndexBufferList();2==n.h?ee(n,U.prototype.i,r):r.push(n.g.i());break;default:if(!Ee(e,t))return e}return e}p(Ue,fe),p(We,fe),We.prototype.getVertexType=function(){return ve(this,1,0)},We.prototype.getPrimitiveType=function(){return ve(this,2,0)},We.prototype.getVertexBufferList=function(){return be(this)},We.prototype.getIndexBufferList=function(){return ye(this,4)};var Ge=[3,4];function He(e){fe.call(this,e)}function qe(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 Ye(e){return Se(e,De).map((function(e){return{index:ve(e,1,0),Y:xe(e,2),label:null!=ge(e,3)?ve(e,3,""):void 0,displayName:null!=ge(e,4)?ve(e,4,""):void 0}}))}function Xe(e){return{x:xe(e,1),y:xe(e,2),z:xe(e,3),visibility:null!=ge(e,4)?xe(e,4):void 0}}function Ke(e,t){this.h=e,this.g=t,this.l=0}function Ze(e,t,n){return function(e,t){var n=e.g;if(void 0===e.m){var r=qe(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),i=qe(n,"\n precision mediump float;\n varying vec2 vTex;\n uniform sampler2D sampler0;\n void main(){\n gl_FragColor = texture2D(sampler0, vTex);\n }",1),a=n.createProgram();if(n.attachShader(a,r),n.attachShader(a,i),n.linkProgram(a),!n.getProgramParameter(a,n.LINK_STATUS))throw Error("Could not compile WebGL program.\n\n"+n.getProgramInfoLog(a));r=e.m=a,n.useProgram(r),i=n.getUniformLocation(r,"sampler0"),e.j={I:n.getAttribLocation(r,"aVertex"),H:n.getAttribLocation(r,"aTex"),da:i},e.s=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.enableVertexAttribArray(e.j.I),n.vertexAttribPointer(e.j.I,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.o=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.enableVertexAttribArray(e.j.H),n.vertexAttribPointer(e.j.H,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(i,0)}r=e.j,n.useProgram(e.m),n.canvas.width=t.width,n.canvas.height=t.height,n.viewport(0,0,t.width,t.height),n.activeTexture(n.TEXTURE0),e.h.bindTexture2d(t.glName),n.enableVertexAttribArray(r.I),n.bindBuffer(n.ARRAY_BUFFER,e.s),n.vertexAttribPointer(r.I,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,e.o),n.vertexAttribPointer(r.H,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.I),n.disableVertexAttribArray(r.H),n.bindBuffer(n.ARRAY_BUFFER,null),e.h.bindTexture2d(0)}(e,t),"function"==typeof e.g.canvas.transferToImageBitmap?Promise.resolve(e.g.canvas.transferToImageBitmap()):n?Promise.resolve(e.g.canvas):"function"==typeof createImageBitmap?createImageBitmap(e.g.canvas):(void 0===e.i&&(e.i=document.createElement("canvas")),new Promise((function(t){e.i.height=e.g.canvas.height,e.i.width=e.g.canvas.width,e.i.getContext("2d",{}).drawImage(e.g.canvas,0,0,e.g.canvas.width,e.g.canvas.height),t(e.i)})))}function Je(e){this.g=e}p(He,fe),He.prototype.getMesh=function(){return ke(this,We,1)},He.prototype.getPoseTransformMatrix=function(){return ke(this,Ne,2)};var Qe=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 et(e,t){return t+e}function tt(e,t){window[e]=t}function nt(e){if(this.g=e,this.listeners={},this.j={},this.F={},this.m={},this.s={},this.G=this.o=this.R=!0,this.C=Promise.resolve(),this.P="",this.B={},this.locateFile=e&&e.locateFile||et,"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.S=t,e.options)for(var n=(t=s(Object.keys(e.options))).next();!n.done;n=t.next()){n=n.value;var r=e.options[n].default;void 0!==r&&(this.j[n]="function"==typeof r?r():r)}}function rt(e){return Fe(e,(function e(){var t,n,r,i,a,o,s,l,c,h,d,f=this;return S(e,(function(e){switch(e.g){case 1:return t=f,f.R?(n=function(e,t){return void 0===e.g.files?[]:"function"==typeof e.g.files?e.g.files(t):e.g.files}(f,f.j),b(e,function(){return Fe(this,(function e(){return S(e,(function(e){switch(e.g){case 1:return e.m=2,b(e,WebAssembly.instantiate(Qe),4);case 4:e.g=3,e.m=0;break;case 2:return e.m=0,e.j=null,e.return(!1);case 3:return e.return(!0)}}))}))}(),2)):e.return();case 2:if(r=e.h,"object"==typeof window)return tt("createMediapipeSolutionsWasm",{locateFile:f.locateFile}),tt("createMediapipeSolutionsPackedAssets",{locateFile:f.locateFile}),o=n.filter((function(e){return void 0!==e.data})),s=n.filter((function(e){return void 0===e.data})),l=Promise.all(o.map((function(e){var n=it(t,e.url);if(void 0!==e.path){var r=e.path;n=n.then((function(e){return t.overrideFile(r,e),Promise.resolve(e)}))}return n}))),c=Promise.all(s.map((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r?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)}))}(t.locateFile(e.url,t.S)):Promise.resolve()}))).then((function(){return Fe(t,(function e(){var t,n,r=this;return S(e,(function(e){if(1==e.g)return t=window.createMediapipeSolutionsWasm,n=window.createMediapipeSolutionsPackedAssets,b(e,t(n),2);r.h=e.h,e.g=0}))}))})),h=Fe(t,(function e(){var t=this;return S(e,(function(e){return t.g.graph&&t.g.graph.url?e=b(e,it(t,t.g.graph.url),0):(e.g=0,e=void 0),e}))})),b(e,Promise.all([c,l,h]),7);if("function"!=typeof importScripts)throw Error("solutions can only be loaded on a web page or in a web worker");return i=n.filter((function(e){return void 0===e.simd||e.simd&&r||!e.simd&&!r})).map((function(e){return t.locateFile(e.url,t.S)})),importScripts.apply(null,u(i)),b(e,createMediapipeSolutionsWasm(Module),6);case 6:f.h=e.h,f.l=new OffscreenCanvas(1,1),f.h.canvas=f.l,a=f.h.GL.createContext(f.l,{antialias:!1,alpha:!1,ba:"undefined"!=typeof WebGL2RenderingContext?2:1}),f.h.GL.makeContextCurrent(a),e.g=4;break;case 7:if(f.l=document.createElement("canvas"),!(d=f.l.getContext("webgl2",{}))&&!(d=f.l.getContext("webgl",{})))return alert("Failed to create WebGL canvas context when passing video frame."),e.return();f.D=d,f.h.canvas=f.l,f.h.createContext(f.l,!0,!0,{});case 4:f.i=new f.h.SolutionWasm,f.R=!1,e.g=0}}))}))}function it(e,t){return Fe(e,(function e(){var n,r,i=this;return S(e,(function(e){return t in i.F?e.return(i.F[t]):(n=i.locateFile(t,""),r=fetch(n).then((function(e){return e.arrayBuffer()})),i.F[t]=r,e.return(r))}))}))}function at(e,t,n){return Fe(e,(function e(){var r,i,a,o,u,l,c,h,d,f,p,m,g,y,v=this;return S(e,(function(e){switch(e.g){case 1:if(!n)return e.return(t);for(r={},i=0,a=s(Object.keys(n)),o=a.next();!o.done;o=a.next())u=o.value,"string"!=typeof(l=n[u])&&"texture"===l.type&&void 0!==t[l.stream]&&++i;1<i&&(v.G=!1),c=s(Object.keys(n)),o=c.next();case 2:if(o.done){e.g=4;break}if(h=o.value,"string"==typeof(d=n[h]))return g=r,y=h,b(e,function(e,t,n){return Fe(e,(function e(){var r,i=this;return S(e,(function(e){return"number"==typeof n||n instanceof Uint8Array||n instanceof i.h.Uint8BlobList?e.return(n):n instanceof i.h.Texture2dDataOut?((r=i.s[t])||(r=new Ke(i.h,i.D),i.s[t]=r),e.return(Ze(r,n,i.G))):e.return(void 0)}))}))}(v,h,t[d]),14);if(f=t[d.stream],"detection_list"===d.type){if(f){for(var x=f.getRectList(),w=f.getLandmarksList(),k=f.getClassificationsList(),_=[],C=0;C<x.size();++C){var A=x.get(C);e:{var T=new Ue;for(A=new Y(A);X(A);)switch(A.i){case 13:var E=J(A);we(T,1,E);break;case 21:we(T,2,E=J(A));break;case 29:we(T,3,E=J(A));break;case 37:we(T,4,E=J(A));break;case 45:we(T,5,E=J(A));break;case 48:we(T,6,E=V(A.g));break;default:if(!Ee(T,A))break e}}T={Z:xe(T,1),$:xe(T,2),height:xe(T,3),width:xe(T,4),rotation:xe(T,5,0),X:ve(T,6,0)},A=Se(Le(w.get(C)),ze).map(Xe);var N=k.get(C);e:for(E=new Re,N=new Y(N);X(N);)if(10===N.i)E.addClassification(Z(N,new De,$e));else if(!Ee(E,N))break e;T={T,O:A,M:Ye(E)},_.push(T)}x=_}else x=[];r[h]=x,e.g=7;break}if("proto_list"===d.type){if(f){for(x=Array(f.size()),w=0;w<f.size();w++)x[w]=f.get(w);f.delete()}else x=[];r[h]=x,e.g=7;break}if(void 0===f){e.g=3;break}if("float_list"===d.type){r[h]=f,e.g=7;break}if("proto"===d.type){r[h]=f,e.g=7;break}if("texture"!==d.type)throw Error("Unknown output config type: '"+d.type+"'");return(p=v.s[h])||(p=new Ke(v.h,v.D),v.s[h]=p),b(e,Ze(p,f,v.G),13);case 13:m=e.h,r[h]=m;case 7:d.transform&&r[h]&&(r[h]=d.transform(r[h])),e.g=3;break;case 14:g[y]=e.h;case 3:o=c.next(),e.g=2;break;case 4:return e.return(r)}}))}))}function ot(e,t){for(var n=t.name||"$",r=[].concat(u(t.wants)),i=new e.h.StringList,a=s(t.wants),o=a.next();!o.done;o=a.next())i.push_back(o.value);a=e.h.PacketListener.implement({onResults:function(i){for(var a={},o=0;o<t.wants.length;++o)a[r[o]]=i.get(o);var s=e.listeners[n];s&&(e.C=at(e,a,t.outs).then((function(n){n=s(n);for(var i=0;i<t.wants.length;++i){var o=a[r[i]];"object"==typeof o&&o.hasOwnProperty&&o.hasOwnProperty("delete")&&o.delete()}n&&(e.C=n)})))}}),e.i.attachMultiListener(i,a),i.delete()}function st(e){e=function(e){e:{var t=new He;for(e=new Y(e);X(e);)switch(e.i){case 10:var n=Z(e,new We,Ve);_e(t,1,n);break;case 18:_e(t,2,n=Z(e,new Ne,Ie));break;default:if(!Ee(t,e))break e}}return t}(e);var t=e.getMesh();if(!t)return e;var n=new Float32Array(t.getVertexBufferList());t.getVertexBufferList=function(){return n};var r=new Uint32Array(t.getIndexBufferList());return t.getIndexBufferList=function(){return r},e}(e=nt.prototype).close=function(){return this.i&&this.i.delete(),Promise.resolve()},e.reset=function(){return Fe(this,(function e(){var t=this;return S(e,(function(e){t.i&&(t.i.reset(),t.m={},t.s={}),e.g=0}))}))},e.setOptions=function(e,t){var n=this;if(t=t||this.g.options){for(var r=[],i=[],a={},o=s(Object.keys(e)),u=o.next();!u.done;a={K:a.K,L:a.L},u=o.next()){var l=u.value;l in this.j&&this.j[l]===e[l]||(this.j[l]=e[l],void 0!==(u=t[l])&&(u.onChange&&(a.K=u.onChange,a.L=e[l],r.push(function(e){return function(){return Fe(n,(function t(){var n=this;return S(t,(function(t){if(1==t.g)return b(t,e.K(e.L),2);!0===t.h&&(n.o=!0),t.g=0}))}))}}(a))),u.graphOptionXref&&(l={valueNumber:1===u.type?e[l]:0,valueBoolean:0===u.type&&e[l],valueString:2===u.type?e[l]:""},u=Object.assign(Object.assign(Object.assign({},{calculatorName:"",calculatorIndex:0}),u.graphOptionXref),l),i.push(u))))}0===r.length&&0===i.length||(this.o=!0,this.A=(void 0===this.A?[]:this.A).concat(i),this.u=(void 0===this.u?[]:this.u).concat(r))}},e.initialize=function(){return Fe(this,(function e(){var t=this;return S(e,(function(e){return 1==e.g?b(e,rt(t),2):3!=e.g?b(e,Fe(t,(function e(){var t,n,r,i,a,o,u,l,c=this;return S(e,(function(e){if(1==e.g)return c.g.graph&&c.g.graph.url&&c.P===c.g.graph.url?e.return():(c.o=!0,c.g.graph&&c.g.graph.url?(c.P=c.g.graph.url,b(e,it(c,c.g.graph.url),3)):void(e.g=2));for(2!=e.g&&(t=e.h,c.i.loadGraph(t)),n=s(Object.keys(c.B)),r=n.next();!r.done;r=n.next())i=r.value,c.i.overrideFile(i,c.B[i]);if(c.B={},c.g.listeners)for(a=s(c.g.listeners),o=a.next();!o.done;o=a.next())u=o.value,ot(c,u);l=c.j,c.j={},c.setOptions(l),e.g=0}))})),3):b(e,function(e){return Fe(e,(function e(){var t,n,r,i,a,o,u=this;return S(e,(function(e){switch(e.g){case 1:if(!u.o)return e.return();if(!u.u){e.g=2;break}t=s(u.u),n=t.next();case 3:if(n.done){e.g=5;break}return b(e,(0,n.value)(),4);case 4:n=t.next(),e.g=3;break;case 5:u.u=void 0;case 2:if(u.A){for(r=new u.h.GraphOptionChangeRequestList,i=s(u.A),a=i.next();!a.done;a=i.next())o=a.value,r.push_back(o);u.i.changeOptions(r),r.delete(),u.A=void 0}u.o=!1,e.g=0}}))}))}(t),0)}))}))},e.overrideFile=function(e,t){this.i?this.i.overrideFile(e,t):this.B[e]=t},e.clearOverriddenFiles=function(){this.B={},this.i&&this.i.clearOverriddenFiles()},e.send=function(e,t){return Fe(this,(function n(){var r,i,a,o,u,l,c,h,d,f=this;return S(n,(function(n){switch(n.g){case 1:return f.g.inputs?(r=1e3*(null==t?performance.now():t),b(n,f.C,2)):n.return();case 2:return b(n,f.initialize(),3);case 3:for(i=new f.h.PacketDataList,a=s(Object.keys(e)),o=a.next();!o.done;o=a.next())if(u=o.value,l=f.g.inputs[u]){e:{var p=f,m=e[u];switch(l.type){case"video":var g=p.m[l.stream];if(g||(g=new Ke(p.h,p.D),p.m[l.stream]=g),0===(p=g).l&&(p.l=p.h.createTexture()),"undefined"!=typeof HTMLVideoElement&&m instanceof HTMLVideoElement){var y=m.videoWidth;g=m.videoHeight}else"undefined"!=typeof HTMLImageElement&&m instanceof HTMLImageElement?(y=m.naturalWidth,g=m.naturalHeight):(y=m.width,g=m.height);g={glName:p.l,width:y,height:g},(y=p.g).canvas.width=g.width,y.canvas.height=g.height,y.activeTexture(y.TEXTURE0),p.h.bindTexture2d(p.l),y.texImage2D(y.TEXTURE_2D,0,y.RGBA,y.RGBA,y.UNSIGNED_BYTE,m),p.h.bindTexture2d(0),p=g;break e;case"detections":for((g=p.m[l.stream])||(g=new Je(p.h),p.m[l.stream]=g),(p=g).data||(p.data=new p.g.DetectionListData),p.data.reset(m.length),g=0;g<m.length;++g){y=m[g];var v=p.data,x=v.setBoundingBox,w=g,k=y.T,S=new Ue;we(S,1,k.Z),we(S,2,k.$),we(S,3,k.height),we(S,4,k.width),we(S,5,k.rotation),we(S,6,k.X);var _=k=new ne;ae(_,1,ge(S,1)),ae(_,2,ge(S,2)),ae(_,3,ge(S,3)),ae(_,4,ge(S,4)),ae(_,5,ge(S,5));var C=ge(S,6);if(null!=C&&null!=C){q(_.g,48);var A=_.g,T=C;C=0>T;var E=(T=Math.abs(T))>>>0;for(T=Math.floor((T-E)/4294967296),T>>>=0,C&&(T=~T>>>0,4294967295<(E=1+(~E>>>0))&&(E=0,4294967295<++T&&(T=0))),C=j=E,E=T;0<E||127<C;)A.push(127&C|128),C=(C>>>7|E<<25)>>>0,E>>>=7;A.push(C)}if(Te(S,_),k=ie(k),x.call(v,w,k),y.O)for(v=0;v<y.O.length;++v)_=!!(S=y.O[v]).visibility,w=(x=p.data).addNormalizedLandmark,k=g,S=Object.assign(Object.assign({},S),{visibility:_?S.visibility:0}),we(_=new ze,1,S.x),we(_,2,S.y),we(_,3,S.z),S.visibility&&we(_,4,S.visibility),ae(A=S=new ne,1,ge(_,1)),ae(A,2,ge(_,2)),ae(A,3,ge(_,3)),ae(A,4,ge(_,4)),ae(A,5,ge(_,5)),Te(_,A),S=ie(S),w.call(x,k,S);if(y.M)for(v=0;v<y.M.length;++v){if(w=(x=p.data).addClassification,k=g,S=y.M[v],we(_=new De,2,S.Y),S.index&&we(_,1,S.index),S.label&&we(_,3,S.label),S.displayName&&we(_,4,S.displayName),A=S=new ne,null!=(E=ge(_,1))&&null!=E)if(q(A.g,8),C=A.g,0<=E)q(C,E);else{for(T=0;9>T;T++)C.push(127&E|128),E>>=7;C.push(1)}ae(A,2,ge(_,2)),null!=(C=ge(_,3))&&(C=F(C),q(A.g,26),q(A.g,C.length),re(A,A.g.end()),re(A,C)),null!=(C=ge(_,4))&&(C=F(C),q(A.g,34),q(A.g,C.length),re(A,A.g.end()),re(A,C)),Te(_,A),S=ie(S),w.call(x,k,S)}}p=p.data;break e;default:p={}}}switch(c=p,h=l.stream,l.type){case"video":i.pushTexture2d(Object.assign(Object.assign({},c),{stream:h,timestamp:r}));break;case"detections":(d=c).stream=h,d.timestamp=r,i.pushDetectionList(d);break;default:throw Error("Unknown input config type: '"+l.type+"'")}}return f.i.send(i),b(n,f.C,4);case 4:i.delete(),n.g=0}}))}))},e.onResults=function(e,t){this.listeners[t||"$"]=e},A("Solution",nt),A("OptionType",{BOOL:0,NUMBER:1,aa:2,0:"BOOL",1:"NUMBER",2:"STRING"});var ut={files:[{url:"face_mesh_solution_packed_assets_loader.js"},{simd:!0,url:"face_mesh_solution_simd_wasm_bin.js"},{simd:!1,url:"face_mesh_solution_wasm_bin.js"}],graph:{url:"face_mesh.binarypb"},listeners:[{wants:["multi_face_geometry","image_transformed","multi_face_landmarks"],outs:{image:"image_transformed",multiFaceGeometry:{type:"proto_list",stream:"multi_face_geometry",transform:function(e){return e.map(st)}},multiFaceLandmarks:{type:"proto_list",stream:"multi_face_landmarks",transform:function(e){return e.map((function(e){return Se(Le(e),ze).map(Xe)}))}}}}],inputs:{image:{type:"video",stream:"input_frames_gpu"}},options:{useCpuInference:{type:0,graphOptionXref:{calculatorType:"InferenceCalculator",fieldName:"use_cpu_inference"},default:"iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";").includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document},enableFaceGeometry:{type:0,graphOptionXref:{calculatorName:"EnableFaceGeometryConstant",calculatorType:"ConstantSidePacketCalculator",fieldName:"bool_value"}},selfieMode:{type:0,graphOptionXref:{calculatorType:"GlScalerCalculator",calculatorIndex:1,fieldName:"flip_horizontal"}},maxNumFaces:{type:1,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorNumFaces",fieldName:"int_value"}},refineLandmarks:{type:0,graphOptionXref:{calculatorType:"ConstantSidePacketCalculator",calculatorName:"ConstantSidePacketCalculatorRefineLandmarks",fieldName:"bool_value"}},minDetectionConfidence:{type:1,graphOptionXref:{calculatorType:"TensorsToDetectionsCalculator",calculatorName:"facelandmarkfrontgpu__facedetectionshortrangegpu__facedetectionshortrangecommon__TensorsToDetectionsCalculator",fieldName:"min_score_thresh"}},minTrackingConfidence:{type:1,graphOptionXref:{calculatorType:"ThresholdingCalculator",calculatorName:"facelandmarkfrontgpu__facelandmarkgpu__ThresholdingCalculator",fieldName:"threshold"}},cameraNear:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"near"}},cameraFar:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"far"}},cameraVerticalFovDegrees:{type:1,graphOptionXref:{calculatorType:"FaceGeometryEnvGeneratorCalculator",fieldName:"vertical_fov_degrees"}}}},lt=[[61,146],[146,91],[91,181],[181,84],[84,17],[17,314],[314,405],[405,321],[321,375],[375,291],[61,185],[185,40],[40,39],[39,37],[37,0],[0,267],[267,269],[269,270],[270,409],[409,291],[78,95],[95,88],[88,178],[178,87],[87,14],[14,317],[317,402],[402,318],[318,324],[324,308],[78,191],[191,80],[80,81],[81,82],[82,13],[13,312],[312,311],[311,310],[310,415],[415,308]],ct=[[263,249],[249,390],[390,373],[373,374],[374,380],[380,381],[381,382],[382,362],[263,466],[466,388],[388,387],[387,386],[386,385],[385,384],[384,398],[398,362]],ht=[[276,283],[283,282],[282,295],[295,285],[300,293],[293,334],[334,296],[296,336]],dt=[[33,7],[7,163],[163,144],[144,145],[145,153],[153,154],[154,155],[155,133],[33,246],[246,161],[161,160],[160,159],[159,158],[158,157],[157,173],[173,133]],ft=[[46,53],[53,52],[52,65],[65,55],[70,63],[63,105],[105,66],[66,107]],pt=[[10,338],[338,297],[297,332],[332,284],[284,251],[251,389],[389,356],[356,454],[454,323],[323,361],[361,288],[288,397],[397,365],[365,379],[379,378],[378,400],[400,377],[377,152],[152,148],[148,176],[176,149],[149,150],[150,136],[136,172],[172,58],[58,132],[132,93],[93,234],[234,127],[127,162],[162,21],[21,54],[54,103],[103,67],[67,109],[109,10]],mt=[].concat(u(lt),u(ct),u(ht),u(dt),u(ft),u(pt));function gt(e){e=e||{},e=Object.assign(Object.assign({},ut),e),this.g=new nt(e)}(e=gt.prototype).close=function(){return this.g.close(),Promise.resolve()},e.onResults=function(e){this.g.onResults(e)},e.initialize=function(){return Fe(this,(function e(){var t=this;return S(e,(function(e){return b(e,t.g.initialize(),0)}))}))},e.reset=function(){this.g.reset()},e.send=function(e){return Fe(this,(function t(){var n=this;return S(t,(function(t){return b(t,n.g.send(e),0)}))}))},e.setOptions=function(e){this.g.setOptions(e)},A("FACE_GEOMETRY",{Layout:{COLUMN_MAJOR:0,ROW_MAJOR:1,0:"COLUMN_MAJOR",1:"ROW_MAJOR"},PrimitiveType:{TRIANGLE:0,0:"TRIANGLE"},VertexType:{VERTEX_PT:0,0:"VERTEX_PT"},DEFAULT_CAMERA_PARAMS:{verticalFovDegrees:63,near:1,far:1e4}}),A("FaceMesh",gt),A("FACEMESH_LIPS",lt),A("FACEMESH_LEFT_EYE",ct),A("FACEMESH_LEFT_EYEBROW",ht),A("FACEMESH_LEFT_IRIS",[[474,475],[475,476],[476,477],[477,474]]),A("FACEMESH_RIGHT_EYE",dt),A("FACEMESH_RIGHT_EYEBROW",ft),A("FACEMESH_RIGHT_IRIS",[[469,470],[470,471],[471,472],[472,469]]),A("FACEMESH_FACE_OVAL",pt),A("FACEMESH_CONTOURS",mt),A("FACEMESH_TESSELATION",[[127,34],[34,139],[139,127],[11,0],[0,37],[37,11],[232,231],[231,120],[120,232],[72,37],[37,39],[39,72],[128,121],[121,47],[47,128],[232,121],[121,128],[128,232],[104,69],[69,67],[67,104],[175,171],[171,148],[148,175],[118,50],[50,101],[101,118],[73,39],[39,40],[40,73],[9,151],[151,108],[108,9],[48,115],[115,131],[131,48],[194,204],[204,211],[211,194],[74,40],[40,185],[185,74],[80,42],[42,183],[183,80],[40,92],[92,186],[186,40],[230,229],[229,118],[118,230],[202,212],[212,214],[214,202],[83,18],[18,17],[17,83],[76,61],[61,146],[146,76],[160,29],[29,30],[30,160],[56,157],[157,173],[173,56],[106,204],[204,194],[194,106],[135,214],[214,192],[192,135],[203,165],[165,98],[98,203],[21,71],[71,68],[68,21],[51,45],[45,4],[4,51],[144,24],[24,23],[23,144],[77,146],[146,91],[91,77],[205,50],[50,187],[187,205],[201,200],[200,18],[18,201],[91,106],[106,182],[182,91],[90,91],[91,181],[181,90],[85,84],[84,17],[17,85],[206,203],[203,36],[36,206],[148,171],[171,140],[140,148],[92,40],[40,39],[39,92],[193,189],[189,244],[244,193],[159,158],[158,28],[28,159],[247,246],[246,161],[161,247],[236,3],[3,196],[196,236],[54,68],[68,104],[104,54],[193,168],[168,8],[8,193],[117,228],[228,31],[31,117],[189,193],[193,55],[55,189],[98,97],[97,99],[99,98],[126,47],[47,100],[100,126],[166,79],[79,218],[218,166],[155,154],[154,26],[26,155],[209,49],[49,131],[131,209],[135,136],[136,150],[150,135],[47,126],[126,217],[217,47],[223,52],[52,53],[53,223],[45,51],[51,134],[134,45],[211,170],[170,140],[140,211],[67,69],[69,108],[108,67],[43,106],[106,91],[91,43],[230,119],[119,120],[120,230],[226,130],[130,247],[247,226],[63,53],[53,52],[52,63],[238,20],[20,242],[242,238],[46,70],[70,156],[156,46],[78,62],[62,96],[96,78],[46,53],[53,63],[63,46],[143,34],[34,227],[227,143],[123,117],[117,111],[111,123],[44,125],[125,19],[19,44],[236,134],[134,51],[51,236],[216,206],[206,205],[205,216],[154,153],[153,22],[22,154],[39,37],[37,167],[167,39],[200,201],[201,208],[208,200],[36,142],[142,100],[100,36],[57,212],[212,202],[202,57],[20,60],[60,99],[99,20],[28,158],[158,157],[157,28],[35,226],[226,113],[113,35],[160,159],[159,27],[27,160],[204,202],[202,210],[210,204],[113,225],[225,46],[46,113],[43,202],[202,204],[204,43],[62,76],[76,77],[77,62],[137,123],[123,116],[116,137],[41,38],[38,72],[72,41],[203,129],[129,142],[142,203],[64,98],[98,240],[240,64],[49,102],[102,64],[64,49],[41,73],[73,74],[74,41],[212,216],[216,207],[207,212],[42,74],[74,184],[184,42],[169,170],[170,211],[211,169],[170,149],[149,176],[176,170],[105,66],[66,69],[69,105],[122,6],[6,168],[168,122],[123,147],[147,187],[187,123],[96,77],[77,90],[90,96],[65,55],[55,107],[107,65],[89,90],[90,180],[180,89],[101,100],[100,120],[120,101],[63,105],[105,104],[104,63],[93,137],[137,227],[227,93],[15,86],[86,85],[85,15],[129,102],[102,49],[49,129],[14,87],[87,86],[86,14],[55,8],[8,9],[9,55],[100,47],[47,121],[121,100],[145,23],[23,22],[22,145],[88,89],[89,179],[179,88],[6,122],[122,196],[196,6],[88,95],[95,96],[96,88],[138,172],[172,136],[136,138],[215,58],[58,172],[172,215],[115,48],[48,219],[219,115],[42,80],[80,81],[81,42],[195,3],[3,51],[51,195],[43,146],[146,61],[61,43],[171,175],[175,199],[199,171],[81,82],[82,38],[38,81],[53,46],[46,225],[225,53],[144,163],[163,110],[110,144],[52,65],[65,66],[66,52],[229,228],[228,117],[117,229],[34,127],[127,234],[234,34],[107,108],[108,69],[69,107],[109,108],[108,151],[151,109],[48,64],[64,235],[235,48],[62,78],[78,191],[191,62],[129,209],[209,126],[126,129],[111,35],[35,143],[143,111],[117,123],[123,50],[50,117],[222,65],[65,52],[52,222],[19,125],[125,141],[141,19],[221,55],[55,65],[65,221],[3,195],[195,197],[197,3],[25,7],[7,33],[33,25],[220,237],[237,44],[44,220],[70,71],[71,139],[139,70],[122,193],[193,245],[245,122],[247,130],[130,33],[33,247],[71,21],[21,162],[162,71],[170,169],[169,150],[150,170],[188,174],[174,196],[196,188],[216,186],[186,92],[92,216],[2,97],[97,167],[167,2],[141,125],[125,241],[241,141],[164,167],[167,37],[37,164],[72,38],[38,12],[12,72],[38,82],[82,13],[13,38],[63,68],[68,71],[71,63],[226,35],[35,111],[111,226],[101,50],[50,205],[205,101],[206,92],[92,165],[165,206],[209,198],[198,217],[217,209],[165,167],[167,97],[97,165],[220,115],[115,218],[218,220],[133,112],[112,243],[243,133],[239,238],[238,241],[241,239],[214,135],[135,169],[169,214],[190,173],[173,133],[133,190],[171,208],[208,32],[32,171],[125,44],[44,237],[237,125],[86,87],[87,178],[178,86],[85,86],[86,179],[179,85],[84,85],[85,180],[180,84],[83,84],[84,181],[181,83],[201,83],[83,182],[182,201],[137,93],[93,132],[132,137],[76,62],[62,183],[183,76],[61,76],[76,184],[184,61],[57,61],[61,185],[185,57],[212,57],[57,186],[186,212],[214,207],[207,187],[187,214],[34,143],[143,156],[156,34],[79,239],[239,237],[237,79],[123,137],[137,177],[177,123],[44,1],[1,4],[4,44],[201,194],[194,32],[32,201],[64,102],[102,129],[129,64],[213,215],[215,138],[138,213],[59,166],[166,219],[219,59],[242,99],[99,97],[97,242],[2,94],[94,141],[141,2],[75,59],[59,235],[235,75],[24,110],[110,228],[228,24],[25,130],[130,226],[226,25],[23,24],[24,229],[229,23],[22,23],[23,230],[230,22],[26,22],[22,231],[231,26],[112,26],[26,232],[232,112],[189,190],[190,243],[243,189],[221,56],[56,190],[190,221],[28,56],[56,221],[221,28],[27,28],[28,222],[222,27],[29,27],[27,223],[223,29],[30,29],[29,224],[224,30],[247,30],[30,225],[225,247],[238,79],[79,20],[20,238],[166,59],[59,75],[75,166],[60,75],[75,240],[240,60],[147,177],[177,215],[215,147],[20,79],[79,166],[166,20],[187,147],[147,213],[213,187],[112,233],[233,244],[244,112],[233,128],[128,245],[245,233],[128,114],[114,188],[188,128],[114,217],[217,174],[174,114],[131,115],[115,220],[220,131],[217,198],[198,236],[236,217],[198,131],[131,134],[134,198],[177,132],[132,58],[58,177],[143,35],[35,124],[124,143],[110,163],[163,7],[7,110],[228,110],[110,25],[25,228],[356,389],[389,368],[368,356],[11,302],[302,267],[267,11],[452,350],[350,349],[349,452],[302,303],[303,269],[269,302],[357,343],[343,277],[277,357],[452,453],[453,357],[357,452],[333,332],[332,297],[297,333],[175,152],[152,377],[377,175],[347,348],[348,330],[330,347],[303,304],[304,270],[270,303],[9,336],[336,337],[337,9],[278,279],[279,360],[360,278],[418,262],[262,431],[431,418],[304,408],[408,409],[409,304],[310,415],[415,407],[407,310],[270,409],[409,410],[410,270],[450,348],[348,347],[347,450],[422,430],[430,434],[434,422],[313,314],[314,17],[17,313],[306,307],[307,375],[375,306],[387,388],[388,260],[260,387],[286,414],[414,398],[398,286],[335,406],[406,418],[418,335],[364,367],[367,416],[416,364],[423,358],[358,327],[327,423],[251,284],[284,298],[298,251],[281,5],[5,4],[4,281],[373,374],[374,253],[253,373],[307,320],[320,321],[321,307],[425,427],[427,411],[411,425],[421,313],[313,18],[18,421],[321,405],[405,406],[406,321],[320,404],[404,405],[405,320],[315,16],[16,17],[17,315],[426,425],[425,266],[266,426],[377,400],[400,369],[369,377],[322,391],[391,269],[269,322],[417,465],[465,464],[464,417],[386,257],[257,258],[258,386],[466,260],[260,388],[388,466],[456,399],[399,419],[419,456],[284,332],[332,333],[333,284],[417,285],[285,8],[8,417],[346,340],[340,261],[261,346],[413,441],[441,285],[285,413],[327,460],[460,328],[328,327],[355,371],[371,329],[329,355],[392,439],[439,438],[438,392],[382,341],[341,256],[256,382],[429,420],[420,360],[360,429],[364,394],[394,379],[379,364],[277,343],[343,437],[437,277],[443,444],[444,283],[283,443],[275,440],[440,363],[363,275],[431,262],[262,369],[369,431],[297,338],[338,337],[337,297],[273,375],[375,321],[321,273],[450,451],[451,349],[349,450],[446,342],[342,467],[467,446],[293,334],[334,282],[282,293],[458,461],[461,462],[462,458],[276,353],[353,383],[383,276],[308,324],[324,325],[325,308],[276,300],[300,293],[293,276],[372,345],[345,447],[447,372],[352,345],[345,340],[340,352],[274,1],[1,19],[19,274],[456,248],[248,281],[281,456],[436,427],[427,425],[425,436],[381,256],[256,252],[252,381],[269,391],[391,393],[393,269],[200,199],[199,428],[428,200],[266,330],[330,329],[329,266],[287,273],[273,422],[422,287],[250,462],[462,328],[328,250],[258,286],[286,384],[384,258],[265,353],[353,342],[342,265],[387,259],[259,257],[257,387],[424,431],[431,430],[430,424],[342,353],[353,276],[276,342],[273,335],[335,424],[424,273],[292,325],[325,307],[307,292],[366,447],[447,345],[345,366],[271,303],[303,302],[302,271],[423,266],[266,371],[371,423],[294,455],[455,460],[460,294],[279,278],[278,294],[294,279],[271,272],[272,304],[304,271],[432,434],[434,427],[427,432],[272,407],[407,408],[408,272],[394,430],[430,431],[431,394],[395,369],[369,400],[400,395],[334,333],[333,299],[299,334],[351,417],[417,168],[168,351],[352,280],[280,411],[411,352],[325,319],[319,320],[320,325],[295,296],[296,336],[336,295],[319,403],[403,404],[404,319],[330,348],[348,349],[349,330],[293,298],[298,333],[333,293],[323,454],[454,447],[447,323],[15,16],[16,315],[315,15],[358,429],[429,279],[279,358],[14,15],[15,316],[316,14],[285,336],[336,9],[9,285],[329,349],[349,350],[350,329],[374,380],[380,252],[252,374],[318,402],[402,403],[403,318],[6,197],[197,419],[419,6],[318,319],[319,325],[325,318],[367,364],[364,365],[365,367],[435,367],[367,397],[397,435],[344,438],[438,439],[439,344],[272,271],[271,311],[311,272],[195,5],[5,281],[281,195],[273,287],[287,291],[291,273],[396,428],[428,199],[199,396],[311,271],[271,268],[268,311],[283,444],[444,445],[445,283],[373,254],[254,339],[339,373],[282,334],[334,296],[296,282],[449,347],[347,346],[346,449],[264,447],[447,454],[454,264],[336,296],[296,299],[299,336],[338,10],[10,151],[151,338],[278,439],[439,455],[455,278],[292,407],[407,415],[415,292],[358,371],[371,355],[355,358],[340,345],[345,372],[372,340],[346,347],[347,280],[280,346],[442,443],[443,282],[282,442],[19,94],[94,370],[370,19],[441,442],[442,295],[295,441],[248,419],[419,197],[197,248],[263,255],[255,359],[359,263],[440,275],[275,274],[274,440],[300,383],[383,368],[368,300],[351,412],[412,465],[465,351],[263,467],[467,466],[466,263],[301,368],[368,389],[389,301],[395,378],[378,379],[379,395],[412,351],[351,419],[419,412],[436,426],[426,322],[322,436],[2,164],[164,393],[393,2],[370,462],[462,461],[461,370],[164,0],[0,267],[267,164],[302,11],[11,12],[12,302],[268,12],[12,13],[13,268],[293,300],[300,301],[301,293],[446,261],[261,340],[340,446],[330,266],[266