@ericblade/quagga2
Version:
An advanced barcode-scanner written in JavaScript
3 lines • 143 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quagga=e():t.Quagga=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=73)}([function(t,e,n){var r=n(61);t.exports=function(t,e,n){return(e=r(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(61);function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,r(o.key),o)}}t.exports=function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return a}));var r={};n.r(r),n.d(r,"EPSILON",(function(){return u})),n.d(r,"ARRAY_TYPE",(function(){return c})),n.d(r,"RANDOM",(function(){return s})),n.d(r,"setMatrixArrayType",(function(){return f})),n.d(r,"toRadian",(function(){return d})),n.d(r,"equals",(function(){return h}));var o={};n.r(o),n.d(o,"create",(function(){return v})),n.d(o,"clone",(function(){return p})),n.d(o,"copy",(function(){return y})),n.d(o,"identity",(function(){return g})),n.d(o,"fromValues",(function(){return x})),n.d(o,"set",(function(){return m})),n.d(o,"transpose",(function(){return _})),n.d(o,"invert",(function(){return b})),n.d(o,"adjoint",(function(){return w})),n.d(o,"determinant",(function(){return O})),n.d(o,"multiply",(function(){return R})),n.d(o,"rotate",(function(){return M})),n.d(o,"scale",(function(){return C})),n.d(o,"fromRotation",(function(){return E})),n.d(o,"fromScaling",(function(){return A})),n.d(o,"str",(function(){return S})),n.d(o,"frob",(function(){return k})),n.d(o,"LDU",(function(){return P})),n.d(o,"add",(function(){return T})),n.d(o,"subtract",(function(){return D})),n.d(o,"exactEquals",(function(){return j})),n.d(o,"equals",(function(){return I})),n.d(o,"multiplyScalar",(function(){return z})),n.d(o,"multiplyScalarAndAdd",(function(){return U})),n.d(o,"mul",(function(){return L})),n.d(o,"sub",(function(){return N}));var i={};n.r(i),n.d(i,"create",(function(){return F})),n.d(i,"clone",(function(){return B})),n.d(i,"fromValues",(function(){return W})),n.d(i,"copy",(function(){return q})),n.d(i,"set",(function(){return V})),n.d(i,"add",(function(){return G})),n.d(i,"subtract",(function(){return H})),n.d(i,"multiply",(function(){return X})),n.d(i,"divide",(function(){return Q})),n.d(i,"ceil",(function(){return Y})),n.d(i,"floor",(function(){return $})),n.d(i,"min",(function(){return Z})),n.d(i,"max",(function(){return K})),n.d(i,"round",(function(){return J})),n.d(i,"scale",(function(){return tt})),n.d(i,"scaleAndAdd",(function(){return et})),n.d(i,"distance",(function(){return nt})),n.d(i,"squaredDistance",(function(){return rt})),n.d(i,"length",(function(){return ot})),n.d(i,"squaredLength",(function(){return it})),n.d(i,"negate",(function(){return at})),n.d(i,"inverse",(function(){return ut})),n.d(i,"normalize",(function(){return ct})),n.d(i,"dot",(function(){return st})),n.d(i,"cross",(function(){return ft})),n.d(i,"lerp",(function(){return lt})),n.d(i,"random",(function(){return dt})),n.d(i,"transformMat2",(function(){return ht})),n.d(i,"transformMat2d",(function(){return vt})),n.d(i,"transformMat3",(function(){return pt})),n.d(i,"transformMat4",(function(){return yt})),n.d(i,"rotate",(function(){return gt})),n.d(i,"angle",(function(){return xt})),n.d(i,"zero",(function(){return mt})),n.d(i,"str",(function(){return _t})),n.d(i,"exactEquals",(function(){return bt})),n.d(i,"equals",(function(){return wt})),n.d(i,"len",(function(){return Rt})),n.d(i,"sub",(function(){return Mt})),n.d(i,"mul",(function(){return Ct})),n.d(i,"div",(function(){return Et})),n.d(i,"dist",(function(){return At})),n.d(i,"sqrDist",(function(){return St})),n.d(i,"sqrLen",(function(){return kt})),n.d(i,"forEach",(function(){return Pt}));var a={};n.r(a),n.d(a,"create",(function(){return Tt})),n.d(a,"clone",(function(){return Dt})),n.d(a,"length",(function(){return jt})),n.d(a,"fromValues",(function(){return It})),n.d(a,"copy",(function(){return zt})),n.d(a,"set",(function(){return Ut})),n.d(a,"add",(function(){return Lt})),n.d(a,"subtract",(function(){return Nt})),n.d(a,"multiply",(function(){return Ft})),n.d(a,"divide",(function(){return Bt})),n.d(a,"ceil",(function(){return Wt})),n.d(a,"floor",(function(){return qt})),n.d(a,"min",(function(){return Vt})),n.d(a,"max",(function(){return Gt})),n.d(a,"round",(function(){return Ht})),n.d(a,"scale",(function(){return Xt})),n.d(a,"scaleAndAdd",(function(){return Qt})),n.d(a,"distance",(function(){return Yt})),n.d(a,"squaredDistance",(function(){return $t})),n.d(a,"squaredLength",(function(){return Zt})),n.d(a,"negate",(function(){return Kt})),n.d(a,"inverse",(function(){return Jt})),n.d(a,"normalize",(function(){return te})),n.d(a,"dot",(function(){return ee})),n.d(a,"cross",(function(){return ne})),n.d(a,"lerp",(function(){return re})),n.d(a,"hermite",(function(){return oe})),n.d(a,"bezier",(function(){return ie})),n.d(a,"random",(function(){return ae})),n.d(a,"transformMat4",(function(){return ue})),n.d(a,"transformMat3",(function(){return ce})),n.d(a,"transformQuat",(function(){return se})),n.d(a,"rotateX",(function(){return fe})),n.d(a,"rotateY",(function(){return le})),n.d(a,"rotateZ",(function(){return de})),n.d(a,"angle",(function(){return he})),n.d(a,"zero",(function(){return ve})),n.d(a,"str",(function(){return pe})),n.d(a,"exactEquals",(function(){return ye})),n.d(a,"equals",(function(){return ge})),n.d(a,"sub",(function(){return xe})),n.d(a,"mul",(function(){return me})),n.d(a,"div",(function(){return _e})),n.d(a,"dist",(function(){return be})),n.d(a,"sqrDist",(function(){return we})),n.d(a,"len",(function(){return Oe})),n.d(a,"sqrLen",(function(){return Re})),n.d(a,"forEach",(function(){return Me}));var u=1e-6,c="undefined"!=typeof Float32Array?Float32Array:Array,s=Math.random;function f(t){c=t}var l=Math.PI/180;function d(t){return t*l}function h(t,e){return Math.abs(t-e)<=u*Math.max(1,Math.abs(t),Math.abs(e))}function v(){var t=new c(4);return c!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}function p(t){var e=new c(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function y(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function g(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t}function x(t,e,n,r){var o=new c(4);return o[0]=t,o[1]=e,o[2]=n,o[3]=r,o}function m(t,e,n,r,o){return t[0]=e,t[1]=n,t[2]=r,t[3]=o,t}function _(t,e){if(t===e){var n=e[1];t[1]=e[2],t[2]=n}else t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3];return t}function b(t,e){var n=e[0],r=e[1],o=e[2],i=e[3],a=n*i-o*r;return a?(a=1/a,t[0]=i*a,t[1]=-r*a,t[2]=-o*a,t[3]=n*a,t):null}function w(t,e){var n=e[0];return t[0]=e[3],t[1]=-e[1],t[2]=-e[2],t[3]=n,t}function O(t){return t[0]*t[3]-t[2]*t[1]}function R(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],u=n[0],c=n[1],s=n[2],f=n[3];return t[0]=r*u+i*c,t[1]=o*u+a*c,t[2]=r*s+i*f,t[3]=o*s+a*f,t}function M(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],u=Math.sin(n),c=Math.cos(n);return t[0]=r*c+i*u,t[1]=o*c+a*u,t[2]=r*-u+i*c,t[3]=o*-u+a*c,t}function C(t,e,n){var r=e[0],o=e[1],i=e[2],a=e[3],u=n[0],c=n[1];return t[0]=r*u,t[1]=o*u,t[2]=i*c,t[3]=a*c,t}function E(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t}function A(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=e[1],t}function S(t){return"mat2("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"}function k(t){return Math.hypot(t[0],t[1],t[2],t[3])}function P(t,e,n,r){return t[2]=r[2]/r[0],n[0]=r[0],n[1]=r[1],n[3]=r[3]-t[2]*n[1],[t,e,n]}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t}function D(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}function j(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function I(t,e){var n=t[0],r=t[1],o=t[2],i=t[3],a=e[0],c=e[1],s=e[2],f=e[3];return Math.abs(n-a)<=u*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-c)<=u*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(o-s)<=u*Math.max(1,Math.abs(o),Math.abs(s))&&Math.abs(i-f)<=u*Math.max(1,Math.abs(i),Math.abs(f))}function z(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t}function U(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var L=R,N=D;function F(){var t=new c(2);return c!=Float32Array&&(t[0]=0,t[1]=0),t}function B(t){var e=new c(2);return e[0]=t[0],e[1]=t[1],e}function W(t,e){var n=new c(2);return n[0]=t,n[1]=e,n}function q(t,e){return t[0]=e[0],t[1]=e[1],t}function V(t,e,n){return t[0]=e,t[1]=n,t}function G(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function H(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t}function X(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}function Q(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}function Y(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t}function $(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t}function Z(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function K(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function J(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t}function tt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function et(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t}function nt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.hypot(n,r)}function rt(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}function ot(t){var e=t[0],n=t[1];return Math.hypot(e,n)}function it(t){var e=t[0],n=t[1];return e*e+n*n}function at(t,e){return t[0]=-e[0],t[1]=-e[1],t}function ut(t,e){return t[0]=1/e[0],t[1]=1/e[1],t}function ct(t,e){var n=e[0],r=e[1],o=n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t}function st(t,e){return t[0]*e[0]+t[1]*e[1]}function ft(t,e,n){var r=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=r,t}function lt(t,e,n,r){var o=e[0],i=e[1];return t[0]=o+r*(n[0]-o),t[1]=i+r*(n[1]-i),t}function dt(t,e){e=e||1;var n=2*s()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t}function ht(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o,t[1]=n[1]*r+n[3]*o,t}function vt(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[2]*o+n[4],t[1]=n[1]*r+n[3]*o+n[5],t}function pt(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[3]*o+n[6],t[1]=n[1]*r+n[4]*o+n[7],t}function yt(t,e,n){var r=e[0],o=e[1];return t[0]=n[0]*r+n[4]*o+n[12],t[1]=n[1]*r+n[5]*o+n[13],t}function gt(t,e,n,r){var o=e[0]-n[0],i=e[1]-n[1],a=Math.sin(r),u=Math.cos(r);return t[0]=o*u-i*a+n[0],t[1]=o*a+i*u+n[1],t}function xt(t,e){var n=t[0],r=t[1],o=e[0],i=e[1],a=Math.sqrt(n*n+r*r)*Math.sqrt(o*o+i*i),u=a&&(n*o+r*i)/a;return Math.acos(Math.min(Math.max(u,-1),1))}function mt(t){return t[0]=0,t[1]=0,t}function _t(t){return"vec2("+t[0]+", "+t[1]+")"}function bt(t,e){return t[0]===e[0]&&t[1]===e[1]}function wt(t,e){var n=t[0],r=t[1],o=e[0],i=e[1];return Math.abs(n-o)<=u*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-i)<=u*Math.max(1,Math.abs(r),Math.abs(i))}var Ot,Rt=ot,Mt=H,Ct=X,Et=Q,At=nt,St=rt,kt=it,Pt=(Ot=F(),function(t,e,n,r,o,i){var a,u;for(e||(e=2),n||(n=0),u=r?Math.min(r*e+n,t.length):t.length,a=n;a<u;a+=e)Ot[0]=t[a],Ot[1]=t[a+1],o(Ot,Ot,i),t[a]=Ot[0],t[a+1]=Ot[1];return t});function Tt(){var t=new c(3);return c!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Dt(t){var e=new c(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function jt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function It(t,e,n){var r=new c(3);return r[0]=t,r[1]=e,r[2]=n,r}function zt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ut(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Lt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Nt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Ft(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function Bt(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t}function Wt(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function qt(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Vt(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}function Gt(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}function Ht(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}function Xt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Qt(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function Yt(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return Math.hypot(n,r,o)}function $t(t,e){var n=e[0]-t[0],r=e[1]-t[1],o=e[2]-t[2];return n*n+r*r+o*o}function Zt(t){var e=t[0],n=t[1],r=t[2];return e*e+n*n+r*r}function Kt(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function Jt(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function te(t,e){var n=e[0],r=e[1],o=e[2],i=n*n+r*r+o*o;return i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ne(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[0],u=n[1],c=n[2];return t[0]=o*c-i*u,t[1]=i*a-r*c,t[2]=r*u-o*a,t}function re(t,e,n,r){var o=e[0],i=e[1],a=e[2];return t[0]=o+r*(n[0]-o),t[1]=i+r*(n[1]-i),t[2]=a+r*(n[2]-a),t}function oe(t,e,n,r,o,i){var a=i*i,u=a*(2*i-3)+1,c=a*(i-2)+i,s=a*(i-1),f=a*(3-2*i);return t[0]=e[0]*u+n[0]*c+r[0]*s+o[0]*f,t[1]=e[1]*u+n[1]*c+r[1]*s+o[1]*f,t[2]=e[2]*u+n[2]*c+r[2]*s+o[2]*f,t}function ie(t,e,n,r,o,i){var a=1-i,u=a*a,c=i*i,s=u*a,f=3*i*u,l=3*c*a,d=c*i;return t[0]=e[0]*s+n[0]*f+r[0]*l+o[0]*d,t[1]=e[1]*s+n[1]*f+r[1]*l+o[1]*d,t[2]=e[2]*s+n[2]*f+r[2]*l+o[2]*d,t}function ae(t,e){e=e||1;var n=2*s()*Math.PI,r=2*s()-1,o=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*o,t[1]=Math.sin(n)*o,t[2]=r*e,t}function ue(t,e,n){var r=e[0],o=e[1],i=e[2],a=n[3]*r+n[7]*o+n[11]*i+n[15];return a=a||1,t[0]=(n[0]*r+n[4]*o+n[8]*i+n[12])/a,t[1]=(n[1]*r+n[5]*o+n[9]*i+n[13])/a,t[2]=(n[2]*r+n[6]*o+n[10]*i+n[14])/a,t}function ce(t,e,n){var r=e[0],o=e[1],i=e[2];return t[0]=r*n[0]+o*n[3]+i*n[6],t[1]=r*n[1]+o*n[4]+i*n[7],t[2]=r*n[2]+o*n[5]+i*n[8],t}function se(t,e,n){var r=n[0],o=n[1],i=n[2],a=n[3],u=e[0],c=e[1],s=e[2],f=o*s-i*c,l=i*u-r*s,d=r*c-o*u,h=o*d-i*l,v=i*f-r*d,p=r*l-o*f,y=2*a;return f*=y,l*=y,d*=y,h*=2,v*=2,p*=2,t[0]=u+f+h,t[1]=c+l+v,t[2]=s+d+p,t}function fe(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[0],i[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),i[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function le(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),i[1]=o[1],i[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function de(t,e,n,r){var o=[],i=[];return o[0]=e[0]-n[0],o[1]=e[1]-n[1],o[2]=e[2]-n[2],i[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),i[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),i[2]=o[2],t[0]=i[0]+n[0],t[1]=i[1]+n[1],t[2]=i[2]+n[2],t}function he(t,e){var n=t[0],r=t[1],o=t[2],i=e[0],a=e[1],u=e[2],c=Math.sqrt(n*n+r*r+o*o)*Math.sqrt(i*i+a*a+u*u),s=c&&ee(t,e)/c;return Math.acos(Math.min(Math.max(s,-1),1))}function ve(t){return t[0]=0,t[1]=0,t[2]=0,t}function pe(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"}function ye(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function ge(t,e){var n=t[0],r=t[1],o=t[2],i=e[0],a=e[1],c=e[2];return Math.abs(n-i)<=u*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(r-a)<=u*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(o-c)<=u*Math.max(1,Math.abs(o),Math.abs(c))}var xe=Nt,me=Ft,_e=Bt,be=Yt,we=$t,Oe=jt,Re=Zt,Me=function(){var t=Tt();return function(e,n,r,o,i,a){var u,c;for(n||(n=3),r||(r=0),c=o?Math.min(o*n+r,e.length):e.length,u=r;u<c;u+=n)t[0]=e[u],t[1]=e[u+1],t[2]=e[u+2],i(t,t,a),e[u]=t[0],e[u+1]=t[1],e[u+2]=t[2];return e}}()},function(t,e,n){var r=n(13).default,o=n(1);t.exports=function(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(40);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(141)();t.exports=r;try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){"use strict";e.a={init:function(t,e){t.fill(e)},shuffle:function(t){for(var e=t.length-1;e>0;e--){var n=Math.floor(Math.random()*(e+1)),r=[t[n],t[e]];t[e]=r[0],t[n]=r[1]}return t},toPointList:function(t){var e=t.reduce((function(t,e){var n="[".concat(e.join(","),"]");return t.push(n),t}),[]);return"[".concat(e.join(",\r\n"),"]")},threshold:function(t,e,n){return t.reduce((function(r,o){return n.apply(t,[o])>=e&&r.push(o),r}),[])},maxIndex:function(t){for(var e=0,n=0;n<t.length;n++)t[n]>t[e]&&(e=n);return e},max:function(t){for(var e=0,n=0;n<t.length;n++)t[n]>e&&(e=t[n]);return e},sum:function(t){for(var e=t.length,n=0;e--;)n+=t[e];return n}}},function(t,e,n){"use strict";n.d(e,"h",(function(){return u})),n.d(e,"i",(function(){return s})),n.d(e,"b",(function(){return f})),n.d(e,"j",(function(){return l})),n.d(e,"e",(function(){return d})),n.d(e,"c",(function(){return h})),n.d(e,"f",(function(){return v})),n.d(e,"g",(function(){return p})),n.d(e,"a",(function(){return g})),n.d(e,"d",(function(){return m}));var r=n(5),o=n(9);r.a.setMatrixArrayType(Array);var i=function(t,e){var n=[],o={rad:0,vec:r.c.clone([0,0])},i={};function a(t){i[t.id]=t,n.push(t)}function u(){var t,e=0;for(t=0;t<n.length;t++)e+=n[t].rad;o.rad=e/n.length,o.vec=r.c.clone([Math.cos(o.rad),Math.sin(o.rad)])}return a(t),u(),{add:function(t){i[t.id]||(a(t),u())},fits:function(t){return Math.abs(r.c.dot(t.point.vec,o.vec))>e},getPoints:function(){return n},getCenter:function(){return o}}},a=function(t,e,n){return{rad:t[n],point:t,id:e}};function u(t,e){return{x:t,y:e,toVec2:function(){return r.c.clone([this.x,this.y])},toVec3:function(){return r.d.clone([this.x,this.y,1])},round:function(){return this.x=this.x>0?Math.floor(this.x+.5):Math.floor(this.x-.5),this.y=this.y>0?Math.floor(this.y+.5):Math.floor(this.y-.5),this}}}function c(t,e){e||(e=8);for(var n=t.data,r=n.length,o=8-e,i=new Int32Array(1<<e);r--;)i[n[r]>>o]++;return i}function s(t,e){var n=function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,r=8-n;function i(t,n){for(var r=0,o=t;o<=n;o++)r+=e[o];return r}function a(t,n){for(var r=0,o=t;o<=n;o++)r+=o*e[o];return r}function u(){var r,u,s,f,l=[0],d=(1<<n)-1;e=c(t,n);for(var h=1;h<d;h++)0===(s=(r=i(0,h))*(u=i(h+1,d)))&&(s=1),f=a(0,h)*u-a(h+1,d)*r,l[h]=f*f/s;return o.a.maxIndex(l)}var s=u();return s<<r}(t);return function(t,e,n){n||(n=t);for(var r=t.data,o=r.length,i=n.data;o--;)i[o]=r[o]<e?1:0}(t,n,e),n}function f(t,e,n){var r,o,u,c,s=[];function f(t){var e=!1;for(o=0;o<s.length;o++)(u=s[o]).fits(t)&&(u.add(t),e=!0);return e}for(n||(n="rad"),r=0;r<t.length;r++)f(c=a(t[r],r,n))||s.push(i(c,e));return s}r.a.setMatrixArrayType(Array);function l(t,e,n){var r,o,i,a,u=0,c=0,s=[];for(r=0;r<e;r++)s[r]={score:0,item:null};for(r=0;r<t.length;r++)if((o=n.apply(this,[t[r]]))>c)for((i=s[u]).score=o,i.item=t[r],c=Number.MAX_VALUE,a=0;a<e;a++)s[a].score<c&&(c=s[a].score,u=a);return s}function d(t,e,n){for(var r,o=0,i=e.x,a=Math.floor(t.length/4),u=e.x/2,c=0,s=e.x;i<a;){for(r=0;r<u;r++)n[c]=(.299*t[4*o+0]+.587*t[4*o+1]+.114*t[4*o+2]+(.299*t[4*(o+1)+0]+.587*t[4*(o+1)+1]+.114*t[4*(o+1)+2])+(.299*t[4*i+0]+.587*t[4*i+1]+.114*t[4*i+2])+(.299*t[4*(i+1)+0]+.587*t[4*(i+1)+1]+.114*t[4*(i+1)+2]))/4,c++,o+=2,i+=2;o+=s,i+=s}}function h(t,e,n){var r=t.length/4|0;if(n&&!0===n.singleChannel)for(var o=0;o<r;o++)e[o]=t[4*o+0];else for(var i=0;i<r;i++)e[i]=.299*t[4*i+0]+.587*t[4*i+1]+.114*t[4*i+2]}function v(t,e){for(var n=t.data,r=t.size.x,o=e.data,i=0,a=r,u=n.length,c=r/2,s=0;a<u;){for(var f=0;f<c;f++)o[s]=Math.floor((n[i]+n[i+1]+n[a]+n[a+1])/4),s++,i+=2,a+=2;i+=r,a+=r}}function p(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],n=t[0],r=t[1],o=t[2],i=o*r,a=i*(1-Math.abs(n/60%2-1)),u=o-i,c=0,s=0,f=0;return n<60?(c=i,s=a):n<120?(c=a,s=i):n<180?(s=i,f=a):n<240?(s=a,f=i):n<300?(c=a,f=i):n<360&&(c=i,f=a),e[0]=255*(c+u)|0,e[1]=255*(s+u)|0,e[2]=255*(f+u)|0,e}function y(t){for(var e=[],n=[],r=1;r<Math.sqrt(t)+1;r++)t%r==0&&(n.push(r),r!==t/r&&e.unshift(Math.floor(t/r)));return n.concat(e)}function g(t,e){var n,r=y(e.x),o=y(e.y),i=Math.max(e.x,e.y),a=function(t,e){for(var n=0,r=0,o=[];n<t.length&&r<e.length;)t[n]===e[r]?(o.push(t[n]),n++,r++):t[n]>e[r]?r++:n++;return o}(r,o),u=[8,10,15,20,32,60,80],c={"x-small":5,small:4,medium:3,large:2,"x-large":1},s=c[t]||c.medium,f=u[s],l=Math.floor(i/f);function d(t){for(var e=0,n=t[Math.floor(t.length/2)];e<t.length-1&&t[e]<l;)e++;return e>0&&(n=Math.abs(t[e]-l)>Math.abs(t[e-1]-l)?t[e-1]:t[e]),l/n<u[s+1]/u[s]&&l/n>u[s-1]/u[s]?{x:n,y:n}:null}return(n=d(a))||(n=d(y(i)))||(n=d(y(l*f))),n}var x={top:function(t,e){return"%"===t.unit?Math.floor(e.height*(t.value/100)):null},right:function(t,e){return"%"===t.unit?Math.floor(e.width-e.width*(t.value/100)):null},bottom:function(t,e){return"%"===t.unit?Math.floor(e.height-e.height*(t.value/100)):null},left:function(t,e){return"%"===t.unit?Math.floor(e.width*(t.value/100)):null}};function m(t,e,n){var r={width:t,height:e},o=Object.keys(n).reduce((function(t,e){var o=function(t){return{value:parseFloat(t),unit:(t.indexOf("%"),t.length,"%")}}(n[e]),i=x[e](o,r);return t[e]=i,t}),{});return{sx:o.left,sy:o.top,sw:o.right-o.left,sh:o.bottom-o.top}}},function(t,e,n){"use strict";var r=n(62),o=n.n(r),i=n(3),a=n.n(i),u=n(4),c=n.n(u),s=n(0),f=n.n(s),l=n(5),d=n(9),h=n(10);function v(t){if(t<0)throw new Error("expected positive number, received ".concat(t))}l.a.setMatrixArrayType(Array);var p=function(){function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Uint8Array,o=arguments.length>3?arguments[3]:void 0;a()(this,t),f()(this,"data",void 0),f()(this,"size",void 0),f()(this,"indexMapping",void 0),n?this.data=n:(this.data=new r(e.x*e.y),o&&d.a.init(this.data,0)),this.size=e}return c()(t,[{key:"inImageWithBorder",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return v(e),t.x>=0&&t.y>=0&&t.x<this.size.x+2*e&&t.y<this.size.y+2*e}},{key:"subImageAsCopy",value:function(t,e){v(e.x),v(e.y);for(var n=t.size,r=n.x,o=n.y,i=0;i<r;i++)for(var a=0;a<o;a++)t.data[a*r+i]=this.data[(e.y+a)*this.size.x+e.x+i];return t}},{key:"get",value:function(t,e){return this.data[e*this.size.x+t]}},{key:"getSafe",value:function(t,e){if(!this.indexMapping){this.indexMapping={x:[],y:[]};for(var n=0;n<this.size.x;n++)this.indexMapping.x[n]=n,this.indexMapping.x[n+this.size.x]=n;for(var r=0;r<this.size.y;r++)this.indexMapping.y[r]=r,this.indexMapping.y[r+this.size.y]=r}return this.data[this.indexMapping.y[e+this.size.y]*this.size.x+this.indexMapping.x[t+this.size.x]]}},{key:"set",value:function(t,e,n){return this.data[e*this.size.x+t]=n,delete this.indexMapping,this}},{key:"zeroBorder",value:function(){for(var t=this.size,e=t.x,n=t.y,r=0;r<e;r++)this.data[r]=this.data[(n-1)*e+r]=0;for(var o=1;o<n-1;o++)this.data[o*e]=this.data[o*e+(e-1)]=0;return delete this.indexMapping,this}},{key:"moments",value:function(t){var e,n,r,o,i,a,u,c,s,f,d=this.data,h=this.size.y,v=this.size.x,p=[],y=[],g=Math.PI,x=g/4;if(t<=0)return y;for(i=0;i<t;i++)p[i]={m00:0,m01:0,m10:0,m11:0,m02:0,m20:0,theta:0,rad:0};for(n=0;n<h;n++)for(o=n*n,e=0;e<v;e++)(r=d[n*v+e])>0&&((a=p[r-1]).m00+=1,a.m01+=n,a.m10+=e,a.m11+=e*n,a.m02+=o,a.m20+=e*e);for(i=0;i<t;i++)a=p[i],isNaN(a.m00)||0===a.m00||(c=a.m10/a.m00,s=a.m01/a.m00,u=a.m11/a.m00-c*s,f=(a.m02/a.m00-s*s-(a.m20/a.m00-c*c))/(2*u),f=.5*Math.atan(f)+(u>=0?x:-x)+g,a.theta=(180*f/g+90)%180-90,a.theta<0&&(a.theta+=180),a.rad=f>g?f-g:f,a.vec=l.c.clone([Math.cos(f),Math.sin(f)]),y.push(a));return y}},{key:"getAsRGBA",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=new Uint8ClampedArray(4*this.size.x*this.size.y),n=0;n<this.size.y;n++)for(var r=0;r<this.size.x;r++){var o=n*this.size.x+r,i=this.get(r,n)*t;e[4*o+0]=i,e[4*o+1]=i,e[4*o+2]=i,e[4*o+3]=255}return e}},{key:"show",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;console.warn("* imagewrapper show getcontext 2d");var n=t.getContext("2d");if(!n)throw new Error("Unable to get canvas context");var r=n.getImageData(0,0,t.width,t.height),o=this.getAsRGBA(e);t.width=this.size.x,t.height=this.size.y;var i=new ImageData(o,r.width,r.height);n.putImageData(i,0,0)}},{key:"overlay",value:function(t,e,n){var r=e<0||e>360?360:e,i=[0,1,1],a=[0,0,0],u=[255,255,255],c=[0,0,0];console.warn("* imagewrapper overlay getcontext 2d");var s=t.getContext("2d");if(!s)throw new Error("Unable to get canvas context");for(var f=s.getImageData(n.x,n.y,this.size.x,this.size.y),l=f.data,d=this.data.length;d--;){i[0]=this.data[d]*r;var v=4*d,p=i[0]<=0?u:i[0]>=360?c:Object(h.g)(i,a),y=o()(p,3);l[v]=y[0],l[v+1]=y[1],l[v+2]=y[2],l[v+3]=255}s.putImageData(f,n.x,n.y)}}]),t}();e.a=p},function(t,e){function n(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}t.exports=function(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function u(t){n(a,o,i,u,c,"next",t)}function c(t){n(a,o,i,u,c,"throw",t)}u(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){function n(e){return t.exports=n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(142);function o(){return"undefined"!=typeof Reflect&&Reflect.get?(t.exports=o=Reflect.get.bind(),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=o=function(t,e,n){var o=r(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},t.exports.__esModule=!0,t.exports.default=t.exports),o.apply(this,arguments)}t.exports=o,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";e.a={drawRect:function(t,e,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth||1,n.beginPath(),n.strokeRect(t.x,t.y,e.x,e.y)},drawPath:function(t,e,n,r){n.strokeStyle=r.color,n.fillStyle=r.color,n.lineWidth=r.lineWidth,n.beginPath(),n.moveTo(t[0][e.x],t[0][e.y]);for(var o=1;o<t.length;o++)n.lineTo(t[o][e.x],t[o][e.y]);n.closePath(),n.stroke()},drawImage:function(t,e,n){var r=n.getImageData(0,0,e.x,e.y),o=r.data,i=o.length,a=t.length;if(i/a!=4)return!1;for(;a--;){var u=t[a];o[--i]=255,o[--i]=u,o[--i]=u,o[--i]=u}return n.putImageData(r,0,0),!0}}},function(t,e,n){var r=n(74),o=n(129)((function(t,e,n){r(t,e,n)}));t.exports=o},function(t,e,n){var r=n(44),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){"use strict";e.a={searchDirections:[[0,1],[1,1],[1,0],[1,-1],[0,-1],[-1,-1],[-1,0],[-1,1]],create:function(t,e){var n,r=t.data,o=e.data,i=this.searchDirections,a=t.size.x;function u(t,e,u,c){var s,f,l;for(s=0;s<i.length;s++){if(f=t.cy+i[t.dir][0],l=t.cx+i[t.dir][1],r[n=f*a+l]===e&&(0===o[n]||o[n]===u))return o[n]=u,t.cy=f,t.cx=l,!0;0===o[n]&&(o[n]=c),t.dir=(t.dir+1)%8}return!1}function c(t,e,n){return{dir:n,x:t,y:e,next:null,prev:null}}return{trace:function(t,e,n,r){return u(t,e,n,r)},contourTracing:function(e,n,r,o,i){return function(e,n,r,o,i){var a,s,f,l=null,d={cx:n,cy:e,dir:0};if(u(d,o,r,i)){a=l=c(n,e,d.dir),f=d.dir,(s=c(d.cx,d.cy,0)).prev=a,a.next=s,s.next=null,a=s;var h=t.size.x*t.size.y,v=0;do{d.dir=(d.dir+6)%8,u(d,o,r,i),f!==d.dir?(a.dir=d.dir,(s=c(d.cx,d.cy,0)).prev=a,a.next=s,s.next=null,a=s):(a.dir=f,a.x=d.cx,a.y=d.cy),f=d.dir}while((d.cx!==n||d.cy!==e)&&++v<h);l.prev=a.prev,a.prev.next=l}return l}(e,n,r,o,i)}}}}},function(t,e,n){var r=n(27),o=n(87),i=n(88),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,n){"use strict";(function(t){var r,o,i,a,u,c,s,f,l,d,h=n(5),v=n(11),p=n(10),y=n(9),g=(n(17),n(65)),x=n(21),m=n(66);h.a.setMatrixArrayType(Array);var _,b,w={ctx:{binary:null},dom:{binary:null}},O={x:0,y:0};function R(t){var e,n,o,i,a,u,c,s=l.size.x,f=l.size.y,d=-l.size.x,v=-l.size.y;for(e=0,n=0;n<t.length;n++)e+=(i=t[n]).rad;for((e=(180*(e/=t.length)/Math.PI+90)%180-90)<0&&(e+=180),e=(180-e)*Math.PI/180,a=h.b.copy(h.b.create(),[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e)]),n=0;n<t.length;n++){for(i=t[n],o=0;o<4;o++)h.c.transformMat2(i.box[o],i.box[o],a);0}for(n=0;n<t.length;n++)for(i=t[n],o=0;o<4;o++)i.box[o][0]<s&&(s=i.box[o][0]),i.box[o][0]>d&&(d=i.box[o][0]),i.box[o][1]<f&&(f=i.box[o][1]),i.box[o][1]>v&&(v=i.box[o][1]);for(u=[[s,f],[d,f],[d,v],[s,v]],c=r.halfSample?2:1,a=h.b.invert(a,a),o=0;o<4;o++)h.c.transformMat2(u[o],u[o],a);for(o=0;o<4;o++)h.c.scale(u[o],u[o],c);return u}function M(t,e){l.subImageAsCopy(a,Object(p.h)(t,e)),b.skeletonize()}function C(t,e,n,r){var o,i,u,c,s=[],f=[],l=Math.ceil(d.x/3);if(t.length>=2){for(o=0;o<t.length;o++)t[o].m00>l&&s.push(t[o]);if(s.length>=2){for(u=function(t){var e=Object(p.b)(t,.9),n=Object(p.j)(e,1,(function(t){return t.getPoints().length})),r=[],o=[];if(1===n.length){r=n[0].item.getPoints();for(var i=0;i<r.length;i++)o.push(r[i].point)}return o}(s),i=0,o=0;o<u.length;o++){var v,y;i+=null!==(v=null===(y=u[o])||void 0===y?void 0:y.rad)&&void 0!==v?v:0}u.length>1&&u.length>=s.length/4*3&&u.length>t.length/4&&(i/=u.length,c={index:e[1]*O.x+e[0],pos:{x:n,y:r},box:[h.c.clone([n,r]),h.c.clone([n+a.size.x,r]),h.c.clone([n+a.size.x,r+a.size.y]),h.c.clone([n,r+a.size.y])],moments:u,rad:i,vec:h.c.clone([Math.cos(i),Math.sin(i)])},f.push(c))}}return f}e.a={init:function(e,n){r=n,_=e,function(){o=r.halfSample?new v.a({x:_.size.x/2|0,y:_.size.y/2|0}):_,d=Object(p.a)(r.patchSize,o.size),O.x=o.size.x/d.x|0,O.y=o.size.y/d.y|0,l=new v.a(o.size,void 0,Uint8Array,!1),u=new v.a(d,void 0,Array,!0);var e=new ArrayBuffer(65536);a=new v.a(d,new Uint8Array(e,0,d.x*d.y)),i=new v.a(d,new Uint8Array(e,d.x*d.y*3,d.x*d.y),void 0,!0),b=Object(m.a)("undefined"!=typeof window?window:"undefined"!=typeof self?self:t,{size:d.x},e),f=new v.a({x:o.size.x/a.size.x|0,y:o.size.y/a.size.y|0},void 0,Array,!0),c=new v.a(f.size,void 0,void 0,!0),s=new v.a(f.size,void 0,Int32Array,!0)}(),function(){if(!r.useWorker&&"undefined"!=typeof document){w.dom.binary=document.createElement("canvas"),w.dom.binary.className="binaryBuffer";var t=!!r.willReadFrequently;console.warn("* initCanvas willReadFrequently",t,r),w.ctx.binary=w.dom.binary.getContext("2d",{willReadFrequently:t}),w.dom.binary.width=l.size.x,w.dom.binary.height=l.size.y}}()},locate:function(){r.halfSample&&Object(p.f)(_,o),Object(p.i)(o,l),l.zeroBorder();var t=function(){var t,e,n,r,o,c,s=[];for(t=0;t<O.x;t++)for(e=0;e<O.y;e++)M(n=a.size.x*t,r=a.size.y*e),i.zeroBorder(),y.a.init(u.data,0),c=g.a.create(i,u).rasterize(0),o=u.moments(c.count),s=s.concat(C(o,[t,e],n,r));return s}();if(t.length<O.x*O.y*.05)return null;var e=function(t){var e,n,r=0,o=0;function i(){var t;for(t=0;t<s.data.length;t++)if(0===s.data[t]&&1===c.data[t])return t;return s.data.length}function a(t){var e,n,o,i,u,l=t%s.size.x,d=t/s.size.x|0;if(t<s.data.length)for(o=f.data[t],s.data[t]=r,u=0;u<x.a.searchDirections.length;u++)n=d+x.a.searchDirections[u][0],e=l+x.a.searchDirections[u][1],i=n*s.size.x+e,0!==c.data[i]?0===s.data[i]&&Math.abs(h.c.dot(f.data[i].vec,o.vec))>.95&&a(i):s.data[i]=Number.MAX_VALUE}for(y.a.init(c.data,0),y.a.init(s.data,0),y.a.init(f.data,null),e=0;e<t.length;e++)n=t[e],f.data[n.index]=n,c.data[n.index]=1;for(c.zeroBorder();(o=i())<s.data.length;)r++,a(o);return r}(t);if(e<1)return null;var n=function(t){var e,n,r=[];for(e=0;e<t;e++)r.push(0);for(n=s.data.length;n--;)s.data[n]>0&&r[s.data[n]-1]++;return(r=r.map((function(t,e){return{val:t,label:e+1}}))).sort((function(t,e){return e.val-t.val})),r.filter((function(t){return t.val>=5}))}(e);return 0===n.length?null:function(t,e){var n,r,o,i,a=[],u=[];for(n=0;n<t.length;n++){for(r=s.data.length,a.length=0;r--;)s.data[r]===t[n].label&&(o=f.data[r],a.push(o));(i=R(a))&&u.push(i)}return u}(n)},checkImageConstraints:function(t,e){var n,r,o=t.getWidth(),i=t.getHeight(),a=e.halfSample?.5:1;t.getConfig().area&&(r=Object(p.d)(o,i,t.getConfig().area),t.setTopRight({x:r.sx,y:r.sy}),t.setCanvasSize({x:o,y:i}),o=r.sw,i=r.sh);var u={x:Math.floor(o*a),y:Math.floor(i*a)};if(n=Object(p.a)(e.patchSize,u),t.setWidth(Math.max(Math.floor(Math.floor(u.x/n.x)*(1/a)*n.x),n.x)),t.setHeight(Math.max(Math.floor(Math.floor(u.y/n.y)*(1/a)*n.y),n.y)),t.getWidth()%n.x==0&&t.getHeight()%n.y==0)return!0;throw new Error("Image dimensions do not comply with the current settings: Width (".concat(o," )and height (").concat(i,") must a multiple of ").concat(n.x))}}}).call(this,n(45))},function(t,e,n){var r=n(76),o=n(77),i=n(78),a=n(79),u=n(80);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(26);t.exports=function(t,e){for(var n=t.length;n--;)if(r(t[n][0],e))return n;return-1}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(19).Symbol;t.exports=r},function(t,e,n){var r=n(34)(Object,"create");t.exports=r},function(t,e,n){var r=n(101);t.exports=function(t,e){var n=t.__data__;return r(e)?n["string"==typeof e?"string":"hash"]:n.map}},function(t,e,n){var r=n(116),o=n(20),i=Object.prototype,a=i.hasOwnProperty,u=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&a.call(t,"callee")&&!u.call(t,"callee")};t.exports=c},function(t,e){var n=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&n.test(t))&&t>-1&&t%1==0&&t<e}},function(t,e,n){var r=n(16),o=n(149),i=n(150),a=n(153);t.exports=function(t,e){return r(t)?t:o(t,e)?[t]:i(a(t))}},function(t,e,n){var r=n(143),o=n(144),i=n(59),a=n(145);t.exports=function(t){return r(t)||o(t)||i(t)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(86),o=n(92);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(22),o=n(15);t.exports=function(t){if(!o(t))return!1;var e=r(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e,n){var r=n(48);t.exports=function(t,e,n){"__proto__"==e&&r?r(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){var r=n(35),o=n(39);t.exports=function(t){return null!=t&&o(t.length)&&!r(t)}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e){function n(e,r){return t.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,n(e,r)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(22),o=n(20);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(41);t.exports=function(t){if("string"==typeof t||r(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}},function(t,e,n){var r=n(34)(n(19),"Map");t.exports=r},function(t,e,n){(function(e){var n="object"==typeof e&&e&&e.Object===Object&&e;t.exports=n}).call(this,n(45))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(93),o=n(100),i=n(102),a=n(103),u=n(104);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(36),o=n(26);t.exports=function(t,e,n){(void 0!==n&&!o(t[e],n)||void 0===n&&!(e in t))&&r(t,e,n)}},function(t,e,n){var r=n(34),o=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e,n){var r=n(115)(Object.getPrototypeOf,Object);t.exports=r},function(t,e){var n=Object.prototype;t.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},function(t,e,n){(function(t){var r=n(19),o=n(118),i=e&&!e.nodeType&&e,a=i&&"object"==typeof t&&t&&!t.nodeType&&t,u=a&&a.exports===i?r.Buffer:void 0,c=(u?u.isBuffer:void 0)||o;t.exports=c}).call(this,n(37)(t))},function(t,e,n){var r=n(120),o=n(121),i=n(122),a=i&&i.isTypedArray,u=a?o(a):r;t.exports=u},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e,n){var r=n(36),o=n(26),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,n){var a=t[e];i.call(t,e)&&o(a,n)&&(void 0!==n||e in t)||r(t,e,n)}},function(t,e,n){var r=n(125),o=n(127),i=n(38);t.exports=function(t){return i(t)?r(t,!0):o(t)}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var r=n(131),o=Math.max;t.exports=function(t,e,n){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,a=-1,u=o(i.length-e,0),c=Array(u);++a<u;)c[a]=i[e+a];a=-1;for(var s=Array(e+1);++a<e;)s[a]=i[a];return s[e]=n(c),r(t,this,s)}}},function(t,e,n){var r=n(132),o=n(134)(r);t.exports=o},function(t,e,n){var r=n(60);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(13).default,o=n(140);t.exports=function(t){var e=o(t,"string");return"symbol"===r(e)?e:String(e)},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(137),o=n(138),i=n(59),a=n(139);t.exports=function(t,e){return r(t)||o(t,e)||i(t,e)||a()},t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){var r=n(146),o=n(160)((function(t,e){return null==t?{}:r(t,e)}));t.exports=o},function(t,e,n){var r=n(2),o=n(40),i=n(165),a=n(166);function u(e){var n="function"==typeof Map?new Map:void 0;return t.exports=u=function(t){if(null===t||!i(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return a(t,arguments,r(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),o(e,t)},t.exports.__esModule=!0,t.exports.default=t.exports,u(e)}t.exports=u,t.exports.__esModule=!0,t.exports.default=t.exports},function(t,e,n){"use strict";var r=n(21),o={createContour2D:function(){return{dir:null,index:null,firstVertex:null,insideContours:null,nextpeer:null,prevpeer:null}},CONTOUR_DIR:{CW_DIR:0,CCW_DIR:1,UNKNOWN_DIR:2},DIR:{OUTSIDE_EDGE:-32767,INSIDE_EDGE:-32766},create:function(t,e){var n=t.data,i=e.data,a=t.size.x,u=t.size.y,c=r.a.create(t,e);return{rasterize:function(t){var e,r,s,f,l,d,h,v,p,y,g,x,m=[],_=0;for(x=0;x<400;x++)m[x]=0;for(m[0]=n[0],p=null,d=1;d<u-1;d++)for(f=0,r=m[0],l=1;l<a-1;l++)if(0===i[g=d*a+l])if((e=n[g])!==r){if(0===f)m[s=_+1]=e,r=e,null!==(h=c.contourTracing(d,l,s,e,o.DIR.OUTSIDE_EDGE))&&(_++,f=s,(v=o.createContour2D()).dir=o.CONTOUR_DIR.CW_DIR,v.index=f,v.firstVertex=h,v.nextpeer=p,v.insideContours=null,null!==p&&(p.prevpeer=v),p=v);else if(null!==(h=c.contourTracing(d,l,o.DIR.INSIDE_EDGE,e,f))){for((v=o.createContour2D()).firstVertex=h,v.insideContours=null,v.dir=0===t?o.CONTOUR_DIR.CCW_DIR:o.CONTOUR_DIR.CW_DIR,v.index=t,y=p;null!==y&&y.index!==f;)y=y.nextpeer;null!==y&&(v.nextpeer=y.insideContours,null!==y.insideContours&&(y.insideContours.prevpeer=v),y.insideContours=v)}}else i[g]=f;else i[g]===o.DIR.OUTSIDE_EDGE||i[g]===o.DIR.INSIDE_EDGE?(f=0,r=i[g]===o.DIR.INSIDE_EDGE?n[g]:m[0]):r=m[f=i[g]];for(y=p;null!==y;)y.index=t,y=y.nextpeer;return{cc:p,count:_}},debug:{drawContour:function(t,e){var n,r,i,a=t.getContext("2d"),u=e;for(a.strokeStyle="red",a.fillStyle="red",a.lineWidth=1,n=null!==u?u.insideContours:null;null!==u;){switch(null!==n?(r=n,n=n.nextpeer):(r=u,n=null!==(u=u.nextpeer)?u.insideContours:null),r.dir){case o.CONTOUR_DIR.CW_DIR:a.strokeStyle="red";break;case o.CONTOUR_DIR.CCW_DIR:a.strokeStyle="blue";break;case o.CONTOUR_DIR.UNKNOWN_DIR:a.strokeStyle="green"}i=r.firstVertex,a.beginPath(),a.moveTo(i.x,i.y);do{i=i.next,a.lineTo(i.x,i.y)}while(i!==r.firstVertex);a.stroke()}}}}}};e.a=o},function(t,e,n){"use strict";
/* @preserve ASM BEGIN */
/* @preserve ASM END */e.a=function(t,e,n){"use asm";var r=new t.Uint8Array(n),o=e.size|0,i=t.Math.imul;function a(t,e){t|=0;e|=0;var n=0;var i=0;var a=0;var u=0;var c=0;var s=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){u=l-o|0;c=l+o|0;s=i-1|0;f=i+1|0;a=(r[t+u+s|0]|0)+(r[t+u+f|0]|0)+(r[t+l+i|0]|0)+(r[t+c+s|0]|0)+(r[t+c+f|0]|0)|0;if((a|0)==(5|0)){r[e+l+i|0]=1}else{r[e+l+i|0]=0}}}}function u(t,e,n){t|=0;e|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=(r[t+a|0]|0)-(r[e+a|0]|0)|0}}function c(t,e,n){t|=0;e|=0;n|=0;var a=0;a=i(o,o)|0;while((a|0)>0){a=a-1|0;r[n+a|0]=r[t+a|0]|0|(r[e+a|0]|0)|0}}function s(t){t|=0;var e=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;e=(e|0)+(r[t+n|0]|0)|0}return e|0}function f(t,e){t|=0;e|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[t+n|0]=e}}function l(t,e){t|=0;e|=0;var n=0;var i=0;var a=0;var u=0;var c=0;var s=0;var f=0;var l=0;for(n=1;(n|0)<(o-1|0);n=n+1|0){l=l+o|0;for(i=1;(i|0)<(o-1|0);i=i+1|0){u=l-o|0;c=l+o|0;s=i-1|0;f=i+1|0;a=(r[t+u+s|0]|0)+(r[t+u+f|0]|0)+(r[t+l+i|0]|0)+(r[t+c+s|0]|0)+(r[t+c+f|0]|0)|0;if((a|0)>(0|0)){r[e+l+i|0]=1}else{r[e+l+i|0]=0}}}}function d(t,e){t|=0;e|=0;var n=0;n=i(o,o)|0;while((n|0)>0){n=n-1|0;r[e+n|0]=r[t+n|0]|0}}function h(t){t|=0;var e=0;var n=0;for(e=0;(e|0)<(o-1|0);e=e+1|0){r[t+e|0]=0;r[t+n|0]=0;n=n+o-1|0;r[t+n|0]=0;n=n+1|0}for(e=0;(e|0)<(o|0);e=e+1|0){r[t+n|0]=0;n=n+1|0}}function v(){var t=0;var e=0;var n=0;var r=0;var v=0;var p=0;e=i(o,o)|0;n=e+e|0;r=n+e|0;f(r,0);h(t);do{a(t,e);l(e,n);u(t,n,n);c(r,n,r);d(e,t);v=s(t)|0;p=(v|0)==0|0}while(!p)}return{skeletonize:v}}},,,,,,,function(t,e,n){t.exports=n(168)},function(t,e,n){var r=n(75),o=n(47),i=n(105),a=n(107),u=n(15),c=n(55),s=n(53);t.exports=function t(e,n,f,l,d){e!==n&&i(n,(function(i,c){if(d||(d=new r),u(i))a(e,n,c,f,t,l,d);else{var h=l?l(s(e,c),i,c+"",e,n,d):void 0;void 0===h&&(h=i),o(e,c,h)}}),c)}},function(t,e,n){var r=n(24),o=n(81),i=n(82),a=n(83),u=n(84),c=n(85);function s(t){var e=this.__data__=new r(t);this.size=e.size}s.prototype.clear=o,s.prototype.delete=i,s.prototype.get=a,s.prototype.has=u,s.prototype.set=c,t.exports=s},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(25),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0)&&(n==e.length-1?e.pop():o.call(e,n,1),--this.size,!0)}},function(t,e,n){var r=n(25);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?void 0:e[n][1]}},function(t,e,n){var r=n(25);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(25);t.exports=function(t,e){var n=this.__data__,o=r(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this}},function(t,e,n){var r=n(24);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(24),o=n(43),i=n(46);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(35),o=n(89),i=n(15),a=n(91),u=/^\[object .+?Constructor\]$/,c=Function.prototype,s=Object.prototype,f=c.toString,l=s.hasOwnProperty,d=RegExp("^"+f.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!i(t)||o(t))&&(r(t)?d:u).test(a(t))}},function(t,e,n){var r=n(27),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;t.exports=function(t){var e=i.call(t,u),n=t[u];try{t[u]=void 0;var r=!0}catch(t){}var o=a.call(t);return r&&(e?t[u]=n:delete t[u]),o}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,o=n(90),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!i&&i in t}},function(t,e,n){var r=n(19)["__core-js_shared__"];t.exports=r},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(94),o=n(24),i=n(43);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},function(t,e,n){var r=n(95),o=n(96),i=n(97),a=n(98),u=n(99);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=a,c.prototype.set=u,t.exports=c},function(t,e,n){var r=n(28);t.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(t,e){t.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},function(t,e,n){var r=n(28),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;if(r){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(e,t)?e[t]:void 0}},function(t,e,n){var r=n(28),o=Object.prototype.hasOwnProperty;t.exports=function(t){var e=this.__data__;return r?void 0!==e[t]:o.call(e,t)}},function(t,e,n){var r=n(28);t.exports=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=r&&void 0===e?"__lodash_hash_undefined__":e,this}},function(t,e,n){var r=n(29);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(29);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(29);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(29);t.exports=function(t,e){var n=r(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this}},function(t,e,n){var r=n(106)();t.exports=r},function(t,e){t.exports=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){va