{"size": 35060, "ext": "js", "max_stars_repo_path": "build/myojs-0.14.0.min.js", "max_stars_repo_name": "carlos4z/myo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "build/myojs-0.14.0.min.js", "max_issues_repo_name": "carlos4z/myo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "build/myojs-0.14.0.min.js", "max_forks_repo_name": "carlos4z/myo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 3895.5555555556, "max_line_length": 32002, "alphanum_fraction": 0.6839132915}
/*! 
 * MyoJS v0.14.0
 * https://github.com/logotype/myojs.git
 * 
 * Copyright 2015 Victor Norgren
 * Released under the MIT license
 */
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function e(a){return"function"==typeof a}function f(a){return"number"==typeof a}function g(a){return"object"==typeof a&&null!==a}function h(a){return void 0===a}b.exports=d,d.EventEmitter=d,d.prototype._events=void 0,d.prototype._maxListeners=void 0,d.defaultMaxListeners=10,d.prototype.setMaxListeners=function(a){if(!f(a)||0>a||isNaN(a))throw TypeError("n must be a positive number");return this._maxListeners=a,this},d.prototype.emit=function(a){var b,c,d,f,i,j;if(this._events||(this._events={}),"error"===a&&(!this._events.error||g(this._events.error)&&!this._events.error.length)){if(b=arguments[1],b instanceof Error)throw b;throw TypeError('Uncaught, unspecified "error" event.')}if(c=this._events[a],h(c))return!1;if(e(c))switch(arguments.length){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];c.apply(this,f)}else if(g(c)){for(d=arguments.length,f=new Array(d-1),i=1;d>i;i++)f[i-1]=arguments[i];for(j=c.slice(),d=j.length,i=0;d>i;i++)j[i].apply(this,f)}return!0},d.prototype.addListener=function(a,b){var c;if(!e(b))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",a,e(b.listener)?b.listener:b),this._events[a]?g(this._events[a])?this._events[a].push(b):this._events[a]=[this._events[a],b]:this._events[a]=b,g(this._events[a])&&!this._events[a].warned){var c;c=h(this._maxListeners)?d.defaultMaxListeners:this._maxListeners,c&&c>0&&this._events[a].length>c&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),"function"==typeof console.trace&&console.trace())}return this},d.prototype.on=d.prototype.addListener,d.prototype.once=function(a,b){function c(){this.removeListener(a,c),d||(d=!0,b.apply(this,arguments))}if(!e(b))throw TypeError("listener must be a function");var d=!1;return c.listener=b,this.on(a,c),this},d.prototype.removeListener=function(a,b){var c,d,f,h;if(!e(b))throw TypeError("listener must be a function");if(!this._events||!this._events[a])return this;if(c=this._events[a],f=c.length,d=-1,c===b||e(c.listener)&&c.listener===b)delete this._events[a],this._events.removeListener&&this.emit("removeListener",a,b);else if(g(c)){for(h=f;h-->0;)if(c[h]===b||c[h].listener&&c[h].listener===b){d=h;break}if(0>d)return this;1===c.length?(c.length=0,delete this._events[a]):c.splice(d,1),this._events.removeListener&&this.emit("removeListener",a,b)}return this},d.prototype.removeAllListeners=function(a){var b,c;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[a]&&delete this._events[a],this;if(0===arguments.length){for(b in this._events)"removeListener"!==b&&this.removeAllListeners(b);return this.removeAllListeners("removeListener"),this._events={},this}if(c=this._events[a],e(c))this.removeListener(a,c);else for(;c.length;)this.removeListener(a,c[c.length-1]);return delete this._events[a],this},d.prototype.listeners=function(a){var b;return b=this._events&&this._events[a]?e(this._events[a])?[this._events[a]]:this._events[a].slice():[]},d.listenerCount=function(a,b){var c;return c=a._events&&a._events[b]?e(a._events[b])?1:a._events[b].length:0}},{}],2:[function(a,b,c){function d(){k=!1,h.length?j=h.concat(j):l=-1,j.length&&e()}function e(){if(!k){var a=setTimeout(d);k=!0;for(var b=j.length;b;){for(h=j,j=[];++l<b;)h[l].run();l=-1,b=j.length}h=null,k=!1,clearTimeout(a)}}function f(a,b){this.fun=a,this.array=b}function g(){}var h,i=b.exports={},j=[],k=!1,l=-1;i.nextTick=function(a){var b=new Array(arguments.length-1);if(arguments.length>1)for(var c=1;c<arguments.length;c++)b[c-1]=arguments[c];j.push(new f(a,b)),1!==j.length||k||setTimeout(e,0)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.binding=function(a){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(a){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],3:[function(a,b,c){(function(){function a(a){function b(b,c,d,e,f,g){for(;f>=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=u),c._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=a(1),u.reduceRight=u.foldr=a(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-(1/0),g=-(1/0);if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-(1/0)&&f===-(1/0))&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||e===1/0&&f===1/0)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])<e?f=h+1:g=h}return f},u.indexOf=e(1,u.findIndex,u.sortedIndex),u.lastIndexOf=e(-1,u.findLastIndex),u.range=function(a,b,c){null==b&&(b=a||0,a=0),c=c||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=Array(d),f=0;d>f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d<arguments.length;)f.push(arguments[d++]);return F(a,c,this,this,f)};return c},u.bindAll=function(a){var b,c,d=arguments.length;if(1>=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)},{}],4:[function(a,b,c){function d(a,b,c){var d;return d=b?new f(a,b):new f(a)}var e=function(){return this}(),f=e.WebSocket||e.MozWebSocket;b.exports=f?d:null,f&&(d.prototype=f.prototype)},{}],5:[function(a,b,c){var d=b.exports=function(a){this.pos=0,this._buf=[],this.size=a};d.prototype.get=function(a){return void 0===a&&(a=0),a>=this.size?void 0:a>=this._buf.length?void 0:this._buf[(this.pos-a-1)%this.size]},d.prototype.push=function(a){return this._buf[this.pos%this.size]=a,this.pos++}},{}],6:[function(a,b,c){var d=a("./Pose"),e=a("./Quaternion"),f=a("./Vector3"),g=b.exports=function(a){if(!a)throw new Error("Missing constructor arguments");if("object"!=typeof a)throw new Error("Constructor parameter needs to be an object");if(!a.hasOwnProperty("id")||a.id!==parseInt(a.id,10))throw new Error("Frame id needs to be of type integer");if(!a.hasOwnProperty("timestamp")||a.timestamp!==parseInt(a.timestamp,10))throw new Error("Timestamp needs to be of type integer");this.id=a.id,this.timestamp=a.timestamp,a.euler&&(this.euler=a.euler),a.rssi&&(this.rssi=a.rssi),a.event&&(this.event=a.event),a.pose?this.pose=new d(a.pose):this.pose=d.invalid(),a.rotation?this.rotation=new e(a.rotation):this.rotation=e.invalid(),a.accel?this.accel=new f(a.accel):this.accel=f.invalid(),a.gyro?this.gyro=new f(a.gyro):this.gyro=f.invalid(),a.emg?this.emg=a.emg:this.emg=[],this.data=a,this.type="frame"};g.prototype.toString=function(){return"[Frame id:"+this.id+" timestamp:"+this.timestamp+" accel:"+this.accel.toString()+"]"}},{"./Pose":10,"./Quaternion":11,"./Vector3":12}],7:[function(a,b,c){var d=a("events").EventEmitter,e=a("./Myo"),f=a("underscore"),g=b.exports=function(b){this.connectionType=a("./connection/BaseConnection"),this.connection=new this.connectionType(b),this.historyType=a("./CircularBuffer"),this.history=new this.historyType(200),this.myos=[],this.connection.connect();var c=this;this.connection.on("deviceInfo",function(){c.myo=new e(c.connection)}),this.connection.on("frame",function(a){c.history.push(a),c.emit("frame",a)}),this.connection.on("pose",function(a){c.emit("pose",a)}),this.connection.on("event",function(a){c.emit(a.type)}),this.connection.on("ready",function(){c.emit("ready")}),this.connection.on("connect",function(){c.emit("connect")}),this.connection.on("disconnect",function(){c.emit("disconnect")})};g.prototype.frame=function(a){return this.history.get(a)||null},g.prototype.waitForMyo=function(a){if(!a||a!==parseInt(a,10))throw new Error("timeoutMilliseconds needs to be of type integer");this.connection.send({waitForMyo:a})},g.prototype.run=function(a){if(!a||a!==parseInt(a,10))throw new Error("durationMilliseconds needs to be of type integer");this.connection.send({run:a})},g.prototype.runOnce=function(a){if(!a||a!==parseInt(a,10))throw new Error("durationMilliseconds needs to be of type integer");this.connection.send({runOnce:a})},f.extend(g.prototype,d.prototype)},{"./CircularBuffer":5,"./Myo":9,"./connection/BaseConnection":14,events:1,underscore:3}],8:[function(a,b,c){Myo=b.exports={BaseConnection:a("./connection/BaseConnection"),Hub:a("./Hub"),Myo:a("./Myo"),CircularBuffer:a("./CircularBuffer"),Pose:a("./Pose"),Quaternion:a("./Quaternion"),Vector3:a("./Vector3"),Frame:a("./Frame"),Version:a("./Version.js")}},{"./CircularBuffer":5,"./Frame":6,"./Hub":7,"./Myo":9,"./Pose":10,"./Quaternion":11,"./Vector3":12,"./Version.js":13,"./connection/BaseConnection":14}],9:[function(a,b,c){var d=b.exports=function(a){if(!a)throw new Error("Missing context");this.VIBRATION_SHORT=0,this.VIBRATION_MEDIUM=1,this.VIBRATION_LONG=2,this.UNLOCK_TIMED=0,this.UNLOCK_HOLD=1,this.USER_ACTION_SINGLE=0,this.context=a};d.prototype.requestRssi=function(){this.context.send({requestRssi:!0})},d.prototype.vibrate=function(a){switch(a){case this.VIBRATION_SHORT:this.context.send({command:"vibrate",args:[this.VIBRATION_SHORT]});break;case this.VIBRATION_MEDIUM:this.context.send({command:"vibrate",args:[this.VIBRATION_MEDIUM]});break;case this.VIBRATION_LONG:this.context.send({command:"vibrate",args:[this.VIBRATION_LONG]});break;default:throw new Error("Valid values are: Myo.VIBRATION_SHORT, Myo.VIBRATION_MEDIUM, Myo.VIBRATION_LONG")}},d.prototype.unlock=function(a){switch(a){case this.UNLOCK_TIMED:this.context.send({command:"unlock",args:[this.UNLOCK_TIMED]});break;case this.UNLOCK_HOLD:this.context.send({command:"unlock",args:[this.UNLOCK_HOLD]});break;default:throw new Error("Valid values are: Myo.UNLOCK_TIMED, Myo.UNLOCK_HOLD")}},d.prototype.lock=function(){this.context.send({command:"lock"})},d.prototype.notifyUserAction=function(a){switch(a){case this.USER_ACTION_SINGLE:this.context.send({command:"notifyUserAction",args:[this.USER_ACTION_SINGLE]});break;default:throw new Error("Valid values are: Myo.USER_ACTION_SINGLE")}}},{}],10:[function(a,b,c){var d=b.exports=function(a){if(this.valid=a.hasOwnProperty("invalid")?!1:!0,this.valid){if("object"!=typeof a||"[object Array]"===Object.prototype.toString.call(a))throw new Error("Constructor parameter needs to be an object");if(!a.hasOwnProperty("type")||a.type!==parseInt(a.type,10))throw new Error("Pose type needs to be of type integer")}this.type=a.type,this.POSE_REST=0,this.POSE_FIST=1,this.POSE_WAVE_IN=2,this.POSE_WAVE_OUT=3,this.POSE_FINGERS_SPREAD=4,this.DOUBLE_TAP=5};d.prototype.isEqualTo=function(a){return this.type===a.type},d.invalid=function(){return new d({invalid:!0})},d.prototype.toString=function(){if(!this.valid)return"[Pose invalid]";switch(this.type){case this.POSE_REST:return"[Pose type:"+this.type.toString()+" POSE_REST]";case this.POSE_FIST:return"[Pose type:"+this.type.toString()+" POSE_FIST]";case this.POSE_WAVE_IN:return"[Pose type:"+this.type.toString()+" POSE_WAVE_IN]";case this.POSE_WAVE_OUT:return"[Pose type:"+this.type.toString()+" POSE_WAVE_OUT]";case this.POSE_FINGERS_SPREAD:return"[Pose type:"+this.type.toString()+" POSE_FINGERS_SPREAD]";case this.DOUBLE_TAP:return"[Pose type:"+this.type.toString()+" DOUBLE_TAP]"}return"[Pose type:"+this.type.toString()+"]"}},{}],11:[function(a,b,c){var d=b.exports=function(a){if(this.valid=a.hasOwnProperty("invalid")?!1:!0,this.valid){if("[object Array]"!==Object.prototype.toString.call(a))throw new Error("Components needs to be an array");if(isNaN(a[0])||isNaN(a[1])||isNaN(a[2])||isNaN(a[3]))throw new Error("Component values needs to be integers or numbers");this.x=a[0],this.y=a[1],this.z=a[2],this.w=a[3]}else this.x=NaN,this.y=NaN,this.z=NaN,this.w=NaN};d.prototype.normalized=function(){var a=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return new d([this.x/a,this.y/a,this.z/a,this.w/a])},d.prototype.conjugate=function(){return new d([-this.x,-this.y,-this.z,this.w])},d.prototype.toEuler=function(){var a,b,c,d,e,f,g,h,i;return h=this.w*this.w,e=this.x*this.x,f=this.y*this.y,g=this.z*this.z,i=e+f+g+h,a=this.x*this.y+this.z*this.w,a>.499*i?(b=2*Math.atan2(this.x,this.w),c=Math.PI/2,void(d=0)):-.499*i>a?(b=-2*Math.atan2(this.x,this.w),c=-Math.PI/2,void(d=0)):(b=Math.atan2(2*this.y*this.w-2*this.x*this.z,e-f-g+h),c=Math.asin(2*a/i),d=Math.atan2(2*this.x*this.w-2*this.y*this.z,-e+f-g+h),{heading:b,attitude:c,bank:d})},d.prototype.roll=function(){return Math.atan2(2*this.y*this.w-2*this.x*this.z,1-2*this.y*this.y-2*this.z*this.z)},d.prototype.pitch=function(){return Math.atan2(2*this.x*this.w-2*this.y*this.z,1-2*this.x*this.x-2*this.z*this.z)},d.prototype.yaw=function(){return Math.asin(2*this.x*this.y+2*this.z*this.w)},d.invalid=function(){return new d({invalid:!0})},d.prototype.toString=function(){return this.valid?"[Quaternion x:"+this.x+" y:"+this.y+" z:"+this.z+" w:"+this.w+"]":"[Quaternion invalid]"}},{}],12:[function(a,b,c){var d=b.exports=function(a){if(!a)throw new Error("Missing constructor arguments");if("object"!=typeof a)throw new Error("Constructor parameter needs to be an object");if(this.valid=a.hasOwnProperty("invalid")?!1:!0,this.valid){if(!a||"[object Array]"!==Object.prototype.toString.call(a))throw new Error("Components needs to be an array");if(isNaN(a[0])||isNaN(a[1])||isNaN(a[2]))throw new Error("Component values needs to be integers or numbers");this.x=a[0],this.y=a[1],this.z=a[2]}else this.x=NaN,this.y=NaN,this.z=NaN};d.prototype.opposite=function(){return new d([-this.x,-this.y,-this.z])},d.prototype.plus=function(a){return new d([this.x+a.x,this.y+a.y,this.z+a.z])},d.prototype.plusAssign=function(a){return this.x+=a.x,this.y+=a.y,this.z+=a.z,this},d.prototype.minus=function(a){return new d([this.x-a.x,this.y-a.y,this.z-a.z])},d.prototype.minusAssign=function(a){return this.x-=a.x,this.y-=a.y,this.z-=a.z,this},d.prototype.multiply=function(a){return new d([this.x*a,this.y*a,this.z*a])},d.prototype.multiplyAssign=function(a){return this.x*=a,this.y*=a,this.z*=a,this},d.prototype.divide=function(a){return new d([this.x/a,this.y/a,this.z/a])},d.prototype.divideAssign=function(a){return this.x/=a,this.y/=a,this.z/=a,this},d.prototype.isEqualTo=function(a){return!(this.x!==a.x||this.y!==a.y||this.z!==a.z)},d.prototype.angleTo=function(a){var b=this.magnitudeSquared()*a.magnitudeSquared();return 0>=b?0:Math.acos(this.dot(a)/Math.sqrt(b))},d.prototype.cross=function(a){return new d([this.y*a.z-this.z*a.y,this.z*a.x-this.x*a.z,this.x*a.y-this.y*a.x])},d.prototype.distanceTo=function(a){return Math.sqrt((this.x-a.x)*(this.x-a.x)+(this.y-a.y)*(this.y-a.y)+(this.z-a.z)*(this.z-a.z))},d.prototype.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z},d.prototype.isValid=function(){return this.x<=Number.MAX_VALUE&&this.x>=-Number.MAX_VALUE&&this.y<=Number.MAX_VALUE&&this.y>=-Number.MAX_VALUE&&this.z<=Number.MAX_VALUE&&this.z>=-Number.MAX_VALUE},d.prototype.magnitude=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},d.prototype.magnitudeSquared=function(){return this.x*this.x+this.y*this.y+this.z*this.z},d.prototype.normalized=function(){var a=this.magnitudeSquared();return 0>=a?new d([0,0,0]):(a=1/Math.sqrt(a),new d([this.x*a,this.y*a,this.z*a]))},d.prototype.pitch=function(){return Math.atan2(this.y,-this.z)},d.prototype.yaw=function(){return Math.atan2(this.x,-this.z)},d.prototype.roll=function(){return Math.atan2(this.x,-this.y)},d.prototype.zero=function(){return new d([0,0,0])},d.prototype.xAxis=function(){return new d([1,0,0])},d.prototype.yAxis=function(){return new d([0,1,0])},d.prototype.zAxis=function(){return new d([0,0,1])},d.prototype.left=function(){return new d([-1,0,0])},d.prototype.right=function(){return this.xAxis()},d.prototype.down=function(){return new d([0,-1,0])},d.prototype.up=function(){return this.yAxis()},d.prototype.forward=function(){return new d([0,0,-1])},d.prototype.backward=function(){return this.zAxis()},d.invalid=function(){return new d({invalid:!0})},d.prototype.toString=function(){return this.valid?"[Vector3 x:"+this.x+" y:"+this.y+" z:"+this.z+"]":"[Vector3 invalid]"}},{}],13:[function(a,b,c){b.exports={
full:"0.14.0",major:0,minor:1443,dot:0}},{}],14:[function(a,b,c){(function(c){var d=a("../Frame"),e=a("events").EventEmitter,f=a("underscore"),g=b.exports=function(a){"use strict";if(a){if("object"!=typeof a)throw new Error("Constructor parameter needs to be an object");if(!a.hasOwnProperty("host")||"string"!=typeof a.host)throw new Error("Host needs to be of type string");if(!a.hasOwnProperty("port")||a.port!==parseInt(a.port,10))throw new Error("Port needs to be of type integer")}this.options=f.defaults(a||{},{host:"127.0.0.1",port:6450}),this.host=this.options.host,this.port=this.options.port,this.connected=!1};g.prototype.getUrl=function(){"use strict";return"ws://"+this.host+":"+this.port+"/"},g.prototype.handleOpen=function(){"use strict";return this.connected?"connected":(this.send({command:"requestDeviceInfo"}),"connecting")},g.prototype.handleClose=function(){"use strict";return this.connected?(this.disconnect(),this.startReconnection(),"disconnecting"):"disconnected"},g.prototype.startReconnection=function(){"use strict";var a=this;return this.reconnectionTimer?"already reconnecting":(this.reconnectionTimer=setInterval(function(){a.reconnect()},500),"reconnecting")},g.prototype.stopReconnection=function(){"use strict";this.reconnectionTimer=clearInterval(this.reconnectionTimer)},g.prototype.disconnect=function(a){"use strict";return a||this.stopReconnection(),this.socket?(this.socket.close(),delete this.socket,this.connected&&(this.connected=!1,this.emit("disconnect")),!0):void 0},g.prototype.reconnect=function(){"use strict";this.connected?this.stopReconnection():(this.disconnect(!0),this.connect())},g.prototype.handleData=function(a){"use strict";var b,c,e,f;if(!a)throw new Error("No data received");try{b=JSON.parse(a)}catch(g){throw new Error("Invalid JSON")}return!this.connected&&b.hasOwnProperty("frame")&&(e=b.frame,e.hasOwnProperty("deviceInfo"))?(f=e.deviceInfo,this.emit("deviceInfo",f),this.connected=!0,void this.emit("connect")):void(this.connected&&b.hasOwnProperty("frame")&&(c=new d(b.frame),this.emit(c.type,c),c.pose&&this.emit("pose",c.pose),c.event&&this.emit("event",c.event)))},g.prototype.connect=function(){"use strict";if(!this.socket){this.emit("ready");var b,d="undefined"!=typeof c&&c.versions&&c.versions.node,e=this;return d?(b=a("ws"),this.socket=new b(this.getUrl())):this.socket=new WebSocket(this.getUrl()),this.socket.onopen=function(){e.handleOpen()},this.socket.onclose=function(a){e.handleClose(a.code,a.reason)},this.socket.onmessage=function(a){e.handleData(a.data)},this.socket.onerror=function(a){e.handleClose("connectError",a.data)},!0}},g.prototype.send=function(a){"use strict";if("object"!=typeof a||"string"==typeof a)throw new Error("Parameter needs to be an object");this.socket.send(JSON.stringify(a))},f.extend(g.prototype,e.prototype)}).call(this,a("_process"))},{"../Frame":6,_process:2,events:1,underscore:3,ws:4}]},{},[8]);