text: var W={};"undefined"!=typeof module&&module.exports&&(module.exports=W),function(W){function bind(fn,scope){var bound,args;return fn.bind===nativeBind&&nativeBind?nativeBind.apply(fn,Array.prototype.slice.call(arguments,1)):(args=Array.prototype.slice.call(arguments,2),bound=function(){if(!(this instanceof bound))return fn.apply(scope,args.concat(Array.prototype.slice.call(arguments)));W.ctor.prototype=fn.prototype;var self=new ctor,result=fn.apply(self,args.concat(Array.prototype.slice.call(arguments)));return Object(result)===result?result:self})}function call(fn){"function"==typeof fn&&fn.apply(this,rest(toArray(arguments)))}function clone(obj){var target={};for(var i in obj)obj.hasOwnProperty(i)&&(target[i]=obj[i]);return target}function composeAsync(fns){return function(){function next(){var args=toArray(arguments);args.push(++idx===fns.length-1?finishedCallback:next),fns[idx].apply(this,args)}var args=toArray(arguments),finishedCallback=W.last(args),initialArgs=W.withoutLast(args),idx=-1;next.apply(this,initialArgs)}}function compose(){var args=arguments;return function(){return W.toArray(args).reduce(function(acc,fn,idx){return 0===idx?fn.apply(this,acc):fn(acc)},arguments)}}function each(obj,iterator,context){if(null!==obj)if(nativeForEach&&obj.forEach===nativeForEach)obj.forEach(iterator,context);else if(obj.length===+obj.length){for(var i=0,l=obj.length;l>i;i++)if(i in obj&&iterator.call(context,obj[i],i,obj)===breaker)return}else for(var key in obj)if(_.has(obj,key)&&iterator.call(context,obj[key],key,obj)===breaker)return}function extend(obj){return each(Array.prototype.slice.call(arguments,1),function(source){if(source)for(var prop in source)obj[prop]=source[prop]}),obj}function first(arr){return arr[0]}function flatten(arr){return[].concat.apply([],arr)}function flip(fn){return function(){return fn.apply(fn,Array.prototype.slice.call(arguments).reverse())}}function interpose(arr,seperator){for(var result=[],i=0;i<arr.length-1;++i)result.push(arr[i]),result.push(seperator);return result.push(arr[arr.length-1]),result}function isNotOk(obj){return!isOk(obj)}function isOk(obj){return"undefined"==typeof obj?!1:"string"==typeof obj?0===obj.length?!1:/([^\s])/.test(obj):"number"==typeof obj?!0:null===obj?!1:"[object Array]"===Object.prototype.toString.call(obj)?obj.length>0:!!obj}function isUndefined(){return Array.prototype.every.call(arguments,function(v){return"undefined"==typeof v})}function last(arr){return arr[arr.length-1]}function List(){this.length=0,this.first=null,this.last=null}function loop(iterations,fn,callback){var index=0,done=!1,end=function(){done=!0,callback()},next=function(){done||(iterations>index?(index++,fn(index-1,next,end)):(done=!0,callback&&callback()))};return next(),next}function Middleware(){var middleware=[];this.add=function(fn){middleware.push(fn)},this.route=function(){function next(){++middlewareCounter<middleware.length&&middleware[middlewareCounter].apply(this,args)}var args=Array.prototype.slice.call(arguments);args.push(next);var middlewareCounter=-1;next()}}function noop(){}function objInherits(parent,protoProps,staticProps){var child;return child=protoProps&&protoProps.hasOwnProperty("constructor")?protoProps.constructor:function(){parent.apply(this,arguments)},extend(child,parent),ctor.prototype=parent.prototype,child.prototype=new ctor,protoProps&&extend(child.prototype,protoProps),staticProps&&extend(child,staticProps),child.prototype.constructor=child,child.__super__=parent.prototype,child}function objExtend(protoProps,classProps){var child=objInherits(this,protoProps,classProps);return child.extend=objExtend,child}function Obj(){}function partialRight(fn){var args=W.rest(W.toArray(arguments));return function(){return fn.apply(this,W.toArray(arguments).concat(args))}}function partial(fn){var rest=Array.prototype.slice.call(arguments,1);return function(){return fn.apply(this,Array.prototype.concat.apply(rest,arguments))}}function partition(arr,length){for(var result=[],i=0;i<arr.length;i++)i%length===0&&result.push([]),result[result.length-1].push(arr[i]);return result}function promise(fn){if("function"!=typeof fn)throw new Error("Promise constructor needs to be passed a function");var timeoutId,success=noop,error=noop,done=noop,debug=!1,resolve=function(){clearTimeout(timeoutId),success.apply(this,arguments),Array.prototype.unshift.call(arguments,null),done.apply(this,arguments),debug&&console.log("Promise resolved with",arguments)},reject=function(){clearTimeout(timeoutId),0===arguments.length&&Array.prototype.unshift.call(arguments,new Error("Promise rejected")),error.apply(this,arguments),done.apply(this,arguments),debug&&console.log("Promise rejected with",arguments)};setTimeout(function(){fn(resolve,reject)},0);var chain={success:function(fn){return success=fn,chain},error:function(fn){return error=fn,chain},done:function(fn){return done=fn,chain},timeoutAfter:function(delay,fn){return timeoutId=setTimeout(function(){success=noop,reject(new Error("Promise timed out")),reject=noop,"function"==typeof fn&&fn()},delay),chain},debug:function(){debug=!0}};return chain}function rest(arr,n){return arr.splice(n||1)}function Router(){this.routes=[],this.noMatch=function(){}}function RouterTriggerPromise(allCallbacksDidNext){this.allCallbacksDidNext=allCallbacksDidNext,this.onAllCallbacksDidNext=function(fn){return this.allCallbacksDidNext=fn,this},this.done=noOp,this.onDone=function(fn){return this.done=fn,this},this.method="none",this.withMethod=function(method){return this.method=method,this}}function RouterMapPromise(routes,routerContext){var self=this;return this.to=function(fn){return routes.forEach(function(route){route.callbacks.push(fn)}),self},this.toWhenMethod=function(methods,fn){return methods instanceof Array||(methods=[methods]),routes.forEach(function(route){route.callbacks.push(function(req){methods.indexOf(req.method)>-1?fn.apply(this,arguments):arguments[arguments.length-1]()})}),self},this.map=function(){return routerContext.map.apply(routerContext,arguments)},this.trigger=function(){return routerContext.trigger.apply(routerContext,arguments)},this.noMatch=function(fn){return routerContext.noMatch=fn,this},this}function Route(method,path,callbacks,options){options=options||{},this.path=path,this.method=method,this.callbacks=callbacks,this.regexp=pathRegexp(path,this.keys=[],options.sensitive,options.strict)}function pathRegexp(path,keys,sensitive,strict){return"[object RegExp]"==toString.call(path)?path:(Array.isArray(path)&&(path="("+path.join("|")+")"),path=path.concat(strict?"":"/?").replace(/\/\(/g,"(?:/").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?(\*)?/g,function(_,slash,format,key,capture,optional,star){return keys.push({name:key,optional:!!optional}),slash=slash||"",""+(optional?"":slash)+"(?:"+(optional?slash:"")+(format||"")+(capture||format&&"([^/.]+?)"||"([^/]+?)")+")"+(optional||"")+(star?"(/*)?":"")}).replace(/([\/.])/g,"\\$1").replace(/\*/g,"(.*)"),new RegExp("^"+path+"$",sensitive?"":"i"))}function Sequence(fn){function triggerFn(fn){fn.length>0?fn(done):(fn(),done())}var self=this,fns=[],done=function(){return fns.shift(),fns.length>0&&triggerFn(fns[0]),self};return this.then=function(fn){return fns.push(fn),self},this.delay=function(ms){return self.then(function(done){setTimeout(done,ms)}),self},this.start=function(){return triggerFn(fns[0]),self},"function"==typeof fn&&this.then(fn),this}function sequence(fn){return new Sequence(fn)}function TickTimer(){extend(this,eventMixin),this.lastTickTime=Date.now()}function Timer(options){extend(this,eventMixin),this.options=extend({updateTime:1e3,loops:!0,eventName:"fired",stoppedEventName:"stop",restartEventName:"restart"},options),this.setIntervalID=void 0,this._count=0}function toArray(obj){return Array.prototype.slice.call(obj)}function withoutLast(arr){return Array.prototype.slice.call(arr,0,arr.length-1)}var W=W||{},nativeBind=Function.prototype.bind,countedCallbackMixin={getCountedCallback:function(){var self=this;return self._totalCallbacks=self._totalCallbacks||0,self._totalCallbacks++,this.callbackComplete=this.callbackComplete||function(){--self._totalCallbacks||self.trigger("allCallbacksComplete",self)},this.callbackComplete}},breaker={},nativeForEach=Array.prototype.forEach,eventMixin={on:function(event,callback){if("function"!=typeof callback)throw"callback not function";return this.events()[event]=this.events()[event]||[],this.events()[event]&&this.events()[event].push(callback),this},off:function(event,callback){if(callback){if(this.events()[event])for(var listeners=this.events()[event],i=listeners.length-1;i>=0;--i)listeners[i]===callback&&listeners.splice(i,1)}else delete this.events()[event];return this},trigger:function(name){var listeners,length,args=Array.prototype.slice.call(arguments,1);if("*"!==name&&this.events()[name])for(listeners=this.events()[name],length=listeners.length;length--;)"function"==typeof listeners[length]&&listeners[length].apply(this,args);if(this.events()["*"])for(listeners=this.events()["*"],length=listeners.length,args.unshift(name);length--;)"function"==typeof listeners[length]&&listeners[length].apply(this,args);return this},events:function(){return this.eventsArray=this.eventsArray||[],this.eventsArray}};List.prototype={append:function(obj){return null===this.first?(obj.prev=obj,obj.next=obj,this.first=obj,this.last=obj):(obj.prev=this.last,obj.next=this.first,this.first.prev=obj,this.last.next=obj,this.last=obj),++this.length,this},insertAfter:function(after,obj){return obj.prev=after,obj.next=after.next,after.next.prev=obj,after.next=obj,obj.prev==this.last&&(this.last=obj),++this.length,this},remove:function(obj){return this.length>1?(obj.prev.next=obj.next,obj.next.prev=obj.prev,obj==this.first&&(this.first=obj.next),obj==this.last&&(this.last=obj.prev)):(this.first=null,this.last=null),obj.prev=null,obj.next=null,--this.length,this},at:function(index){if(index>=this.length)return!1;var obj=this.first;if(0===index)return obj;for(var i=0;index>i;++i)obj=obj.next;return obj},each:function(fn,context){for(var bound=context?W.bind(fn,context):fn,next=this.first,i=0;i<this.length;++i)bound(next,i),next=next.next;return this},sendToBack:function(obj){this.remove(obj),this.append(obj)}};var ctor=function(){};Obj.extend=objExtend;var noOp=function(){};Router.prototype.trigger=function(path){var self=this,triggerArguments=arguments,promise=new RouterTriggerPromise(noOp,noOp);return setTimeout(function(promise){return function(){for(var matchingRoute,i=0;i<self.routes.length;){if(self.routes[i].method===promise.method&&self.routes[i].match(path)){matchingRoute=self.routes[i];break}++i}if(matchingRoute){var route={method:promise.method,params:{},path:path};Object.keys(matchingRoute.params).forEach(function(key){route.params[key]=matchingRoute.params[key]});for(var args=[route],j=1;j<triggerArguments.length;j++)args.push(triggerArguments[j]);args.push(null),W.loop(matchingRoute.callbacks.length,function(i,next){var callback=matchingRoute.callbacks[i];args[args.length-1]=next,callback.apply(this,args)},function(){promise.allCallbacksDidNext()}),promise.done()}else{for(var route={method:promise.method,params:{},path:path},args=[route],j=1;j<triggerArguments.length;j++)args.push(triggerArguments[j]);self.noMatch.apply(this,args),promise.done()}}}(promise),0),promise},Router.prototype.map=function(path,methods){var routerContext=this,routes=[];return("undefined"==typeof methods||null===methods)&&(methods=["none"]),"string"==typeof methods&&(methods=[methods]),methods.forEach(function(method){routes.push(new Route(method,path,[],{sensitive:!0,strict:!0}))}),this.routes=this.routes.concat(routes),new RouterMapPromise(routes,routerContext)},Route.prototype.match=function(path){var keys=this.keys,params=this.params=[],m=this.regexp.exec(path);if(!m)return!1;for(var i=1,len=m.length;len>i;++i){var key=keys[i-1],val="string"==typeof m[i]?decodeURIComponent(m[i]):m[i];key?params[key.name]=val:params.push(val)}return!0},TickTimer.prototype={start:function(){this.isStarted!==!0&&(this.lastTickTime=Date.now(),this.isStarted=!0,this.trigger("started",this))},stopTicker:function(){this.isStarted&&(this.isStarted=!1,this.trigger("stopped",this))},reset:function(){this.trigger("reset",this),this.lastTickTime=Date.now()},tick:function(){this.usesEvents&&this.trigger("tick",this),this.lastTickTime=Date.now()},getTimeSinceLastTickMS:function(){return this.isStarted?Date.now()-this.lastTickTime:0},getTimeSinceLastTickSec:function(){return this.isStarted?(Date.now()-this.lastTickTime)/1e3:0}},Date.now=Date.now||function(){return+new Date},Timer.prototype={restart:function(){return clearInterval(this._intervalId),this.trigger("restarting",this),this.start(),this},start:function(){return this._intervalId?!1:(this.lastUpdate=(new Date).getTime(),this._intervalId=setInterval(W.bind(this.update,this),10),!0)},stopTimer:function(){return this._intervalId?(clearInterval(this._intervalId),this._intervalId=void 0,this.trigger(this.options.stoppedEventName,this),!0):!1},update:function(){var currentTime=(new Date).getTime();return this.options.updateTime+this.lastUpdate<currentTime&&(this._count++,this.trigger(this.options.eventName,this),this.options.loops?this.lastUpdate=currentTime:this.stopTimer()),this},count:function(){return this._count},resetCounter:function(){this._count=0}},extend(W,{bind:bind,clone:clone,countedCallbackMixin:countedCallbackMixin,each:each,eventMixin:eventMixin,extend:extend,List:List,loop:loop,Middleware:Middleware,Sequence:Sequence,sequence:sequence,TickTimer:TickTimer,Timer:Timer,Object:Obj,isOk:isOk,isNotOk:isNotOk,Router:Router,interpose:interpose,partial:partial,flip:flip,partition:partition,flatten:flatten,promise:promise,last:last,first:first,rest:rest,withoutLast:withoutLast,toArray:toArray,composeAsync:composeAsync,isUndefined:isUndefined,call:call,partialRight:partialRight,compose:compose})}(W),function(W){function add(){var result=0;return Array.prototype.forEach.call(arguments,function(n){result+=n}),result}function angleBetween(center,point){var angle=Math.atan2(center.x-point.x,center.y-point.y)*(180/Math.PI);return angle=0>angle?Math.abs(angle):360-angle}function clamp(value,min,max,callbackOnClamp){return min>max?max>value?("function"==typeof callbackOnClamp&&callbackOnClamp(value,max),value=max):value>min&&("function"==typeof callbackOnClamp&&callbackOnClamp(value,min),value=min):value>max?("function"==typeof callbackOnClamp&&callbackOnClamp(value,max),value=max):min>value&&("function"==typeof callbackOnClamp&&callbackOnClamp(value,min),value=min),value}function clipNormalized(x,min,max){return 2===arguments.length?(max=min,min=0):1===arguments.length&&(max=1,min=0),min>x?min:x>max?max:x}function colorStringToHex(color){if("#"===color.substr(0,1))return color;var digits=/(.*?)rgb\((\d+), (\d+), (\d+)\)/.exec(color),red=parseInt(digits[2],10),green=parseInt(digits[3],10),blue=parseInt(digits[4],10),rgb=blue|green<<8|red<<16;return digits[1]+"#"+rgb.toString(16)}function colorValuesToHex(r,g,b){return"#"+((1<<24)+(r<<16)+(g<<8)+b).toString(16).slice(1)}function distance(obj1,obj2){var x=obj2.x-obj1.x,y=obj2.y-obj1.y;return Math.sqrt(x*x+y*y)}function getDynamicallyEasedInterpolation(ease){return function(p){return dynamicEaseInterpolation(p,ease)}}function dynamicEaseInterpolation(p,ease){return ease>=0?(ease=2.25*ease+1,Math.pow(1-Math.pow(1-p,ease),1/ease)):(ease=2.25*Math.abs(ease)+1,1-Math.pow(1-Math.pow(p,ease),1/ease))}function fitScaleRatio(width,height,boundsWidth,boundsHeight){var widthScale=boundsWidth/width,heightScale=boundsHeight/height;return Math.min(widthScale,heightScale)}function floatToString(value,precision){var power=Math.pow(10,precision||0);return String(Math.round(value*power)/power)}function hexStringToColorArray(hex){var shorthandRegex=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;hex=hex.replace(shorthandRegex,function(m,r,g,b){return r+r+g+g+b+b});var result=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);return result?[parseInt(result[1],16),parseInt(result[2],16),parseInt(result[3],16)]:[]}function inRange(test,min,max){return min===max?!1:min>max?min>test&&test>max:test>min&&max>test}function isClose(num,test,tolerance){return tolerance=tolerance||1,num>test-tolerance&&test+tolerance>num}function lerp(start,end,scalar){return start+(end-start)*scalar}function map(input,inputMin,inputMax,outputMin,outputMax,clamp,ease){input=(input-inputMin)/(inputMax-inputMin),ease&&(input=ease(input));var output=input*(outputMax-outputMin)+outputMin;return clamp&&(outputMin>outputMax?outputMax>output?output=outputMax:output>outputMin&&(output=outputMin):output>outputMax?output=outputMax:outputMin>output&&(output=outputMin)),output}function MatrixStack(){"undefined"==typeof MatrixStack.prototype.glMatrix&&("undefined"!=typeof module&&module.exports?W.extend(MatrixStack.prototype,require("gl-matrix")):W.extend(MatrixStack.prototype,{glMatrix:glMatrix,mat2:mat2,mat2d:mat2d,mat3:mat3,mat4:mat4,quat:quat,vec2:vec2,vec3:vec3,vec4:vec4})),this.stack=[this.mat4.create()]}function normalize(value,min,max,ease){return value=clamp((value-min)/(max-min),0,1),ease?ease(value):value}function randomBetween(from,to){return map(Math.random(),0,1,from,to)}function shuffleArray(arr,leaveOriginalUntouched){var tmp,current,array=leaveOriginalUntouched?arr.slice(0):arr,top=array.length;if(top)for(;--top;)current=Math.floor(Math.random()*(top+1)),tmp=array[current],array[current]=array[top],array[top]=tmp;return array}var W=W||{};MatrixStack.prototype.getMat=function(){return this.stack[this.stack.length-1]},MatrixStack.prototype.push=function(){return this.stack.push(this.mat4.clone(this.getMat())),this},MatrixStack.prototype.pop=function(){return this.stack.pop(),this},MatrixStack.prototype.rotateZ=function(rad){return this.mat4.rotateZ(this.getMat(),this.getMat(),rad),this},MatrixStack.prototype.translate=function(x,y,z){return y=y||0,z=z||0,this.mat4.translate(this.getMat(),this.getMat(),[x,y,z]),this},MatrixStack.prototype.applyTo=function(arr){return 2===arr.length&&this.vec2.transformMat4(arr,arr,this.getMat()),this};var PI=Math.PI,PI_2=Math.PI/2;!new function(W){function backEaseInOut(p){var f;return.5>p?(f=2*p,.5*(f*f*f-f*Math.sin(f*W.Math.PI))):(f=1-(2*p-1),.5*(1-(f*f*f-f*Math.sin(f*W.Math.PI)))+.5)}function backEaseIn(p){return p*p*p-p*Math.sin(p*W.Math.PI)}function backEaseOut(p){var f=1-p;return 1-(f*f*f-f*Math.sin(f*W.Math.PI))}function bounceEaseInOut(p){return.5>p?.5*W.Math.bounceEaseIn(2*p):.5*W.Math.bounceEaseOut(2*p-1)+.5}function bounceEaseIn(p){return 1-W.Math.bounceEaseOut(1-p)}function bounceEaseOut(p){return 4/11>p?121*p*p/16:8/11>p?9.075*p*p-9.9*p+3.4:.9>p?4356/361*p*p-35442/1805*p+16061/1805:10.8*p*p-20.52*p+10.72}function circularEaseInOut(p){return.5>p?.5*(1-Math.sqrt(1-4*p*p)):.5*(Math.sqrt(-(2*p-3)*(2*p-1))+1)}function circularEaseIn(p){return 1-Math.sqrt(1-p*p)}function circularEaseOut(p){return Math.sqrt((2-p)*p)}function cubicEaseInOut(p){if(.5>p)return 4*p*p*p;var f=2*p-2;return.5*f*f*f+1}function cubicEaseIn(p){return p*p*p}function cubicEaseOut(p){var f=p-1;return f*f*f+1}function elasticEaseInOut(p){return.5>p?.5*Math.sin(13*M_PI_2*2*p)*Math.pow(2,10*(2*p-1)):.5*(Math.sin(-13*M_PI_2*(2*p-1+1))*Math.pow(2,-10*(2*p-1))+2)}function elasticEaseIn(p){return Math.sin(13*W.Math.PI_2*p)*Math.pow(2,10*(p-1))}function elasticEaseOut(p){return Math.sin(-13*W.Math.PI_2*(p+1))*Math.pow(2,-10*p)+1}function exponentialEaseInOut(p){return 0===p||1===p?p:.5>p?.5*Math.pow(2,20*p-10):-.5*Math.pow(2,-20*p+10)+1}function exponentialEaseIn(p){return 0===p?p:Math.pow(2,10*(p-1))}function exponentialEaseOut(p){return 1===p?p:1-Math.pow(2,-10*p)}function linearInterpolation(p){return p}function quadraticEaseInOut(p){return.5>p?2*p*p:-2*p*p+4*p-1}function quadraticEaseIn(p){return p*p}function quadraticEaseOut(p){return-(p*(p-2))}function quarticEaseInOut(p){if(.5>p)return 8*p*p*p*p;var f=p-1;return-8*f*f*f*f+1}function quarticEaseIn(p){return p*p*p*p}function quarticEaseOut(p){var f=p-1;return f*f*f*(1-p)+1}function quinticEaseInOut(p){if(.5>p)return 16*p*p*p*p*p;var f=2*p-2;return.5*f*f*f*f*f+1}function quinticEaseIn(p){return p*p*p*p*p}function quinticEaseOut(p){var f=p-1;return f*f*f*f*f+1}function sineEaseInOut(p){return.5*(1-cos(p*W.Math.PI))}function sineEaseIn(p){return sin((p-1)*W.Math.PI_2)+1}function sineEaseOut(p){return sin(p*W.Math.PI_2)}var W=W||{},all=["linearInterpolation","quadraticEaseIn","quadraticEaseOut","quadraticEaseInOut","cubicEaseIn","cubicEaseOut","cubicEaseInOut","quarticEaseIn","quarticEaseOut","quarticEaseInOut","quinticEaseIn","quinticEaseOut","quinticEaseInOut","sineEaseIn","sineEaseOut","sineEaseInOut","circularEaseIn","circularEaseOut","circularEaseInOut","exponentialEaseIn","exponentialEaseOut","exponentialEaseInOut","elasticEaseIn","elasticEaseOut","elasticEaseInOut","backEaseIn","backEaseOut","backEaseInOut","bounceEaseIn","bounceEaseOut","bounceEaseInOut"];W.interpolations={linearInterpolation:linearInterpolation,quadraticEaseIn:quadraticEaseIn,quadraticEaseOut:quadraticEaseOut,quadraticEaseInOut:quadraticEaseInOut,cubicEaseIn:cubicEaseIn,cubicEaseOut:cubicEaseOut,cubicEaseInOut:cubicEaseInOut,quarticEaseIn:quarticEaseIn,quarticEaseOut:quarticEaseOut,quarticEaseInOut:quarticEaseInOut,quinticEaseIn:quinticEaseIn,quinticEaseOut:quinticEaseOut,quinticEaseInOut:quinticEaseInOut,sineEaseIn:sineEaseIn,sineEaseOut:sineEaseOut,sineEaseInOut:sineEaseInOut,circularEaseIn:circularEaseIn,circularEaseOut:circularEaseOut,circularEaseInOut:circularEaseInOut,exponentialEaseIn:exponentialEaseIn,exponentialEaseOut:exponentialEaseOut,exponentialEaseInOut:exponentialEaseInOut,elasticEaseIn:elasticEaseIn,elasticEaseOut:elasticEaseOut,elasticEaseInOut:elasticEaseInOut,backEaseIn:backEaseIn,backEaseOut:backEaseOut,backEaseInOut:backEaseInOut,bounceEaseIn:bounceEaseIn,bounceEaseOut:bounceEaseOut,bounceEaseInOut:bounceEaseInOut,all:all}}(W),W.extend(W,{angleBetween:angleBetween,clamp:clamp,clipNormalized:clipNormalized,colorStringToHex:colorStringToHex,colorValuesToHex:colorValuesToHex,distance:distance,getDynamicallyEasedInterpolation:getDynamicallyEasedInterpolation,dynamicEaseInterpolation:dynamicEaseInterpolation,fitScaleRatio:fitScaleRatio,floatToString:floatToString,hexStringToColorArray:hexStringToColorArray,inRange:inRange,isClose:isClose,lerp:lerp,map:map,normalize:normalize,randomBetween:randomBetween,shuffleArray:shuffleArray,PI:PI,PI_2:PI_2,MatrixStack:MatrixStack,add:add})}(W),function(W){function HSLGradient(){this._hStops=[],this._sStops=[],this._lStops=[],this._hasChanged=!1,this._resolution=10,this._gradientArray=void 0}function hslToRgb(h,s,l){function hue2rgb(p,q,t){return 0>t&&(t+=1),t>1&&(t-=1),1/6>t?p+6*(q-p)*t:.5>t?q:2/3>t?p+(q-p)*(2/3-t)*6:p}var r,g,b;if(0==s)r=g=b=l;else{var q=.5>l?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return[255*r,255*g,255*b]}function hsvToRgb(h,s,v){var r,g,b,i=Math.floor(6*h),f=6*h-i,p=v*(1-s),q=v*(1-f*s),t=v*(1-(1-f)*s);switch(i%6){case 0:r=v,g=t,b=p;break;case 1:r=q,g=v,b=p;break;case 2:r=p,g=v,b=t;break;case 3:r=p,g=q,b=v;break;case 4:r=t,g=p,b=v;break;case 5:r=v,g=p,b=q}return[255*r,255*g,255*b]}function RandomColorSequence(){this.r=255*Math.random(),this.g=255*Math.random(),this.b=255*Math.random(),this.rStep=10*Math.random()-5,this.gStep=10*Math.random()-5,this.bStep=10*Math.random()-5}function randomHex(){return"#"+Math.floor(16777215*Math.random()).toString(16)}function rgbToHsl(r,g,b){r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),l=(max+min)/2;if(max==min)h=s=0;else{var d=max-min;switch(s=l>.5?d/(2-max-min):d/(max+min),max){case r:h=(g-b)/d+(b>g?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4}h/=6}return[h,s,l]}function rgbToHsv(r,g,b){r/=255,g/=255,b/=255;var h,s,max=Math.max(r,g,b),min=Math.min(r,g,b),v=max,d=max-min;if(s=0==max?0:d/max,max==min)h=0;else{switch(max){case r:h=(g-b)/d+(b>g?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4}h/=6}return[h,s,v]}var W=W||{},hue2rgb=function(p,q,t){return 0>t&&(t+=1),t>1&&(t-=1),1/6>t?p+6*(q-p)*t:.5>t?q:2/3>t?p+(q-p)*(2/3-t)*6:p},hslToRgb=function(h,s,l){var r,g,b;if(0===s)r=g=b=l;else{var q=.5>l?l*(1+s):l+s-l*s,p=2*l-q;r=hue2rgb(p,q,h+1/3),g=hue2rgb(p,q,h),b=hue2rgb(p,q,h-1/3)}return[255*r,255*g,255*b]};HSLGradient.prototype.addColorStop=function(position,color){var wrappedPointColor;W.extend(color,W.HSLtoStringMixin),_.isUndefined(color.h)||(wrappedPointColor={position:position,value:color.h},this._hStops.splice(_.sortedIndex(this._hStops,wrappedPointColor,function(pointColor){return pointColor.position}),0,wrappedPointColor),this._hasChanged=!0),_.isUndefined(color.s)||(wrappedPointColor={position:position,value:color.s},this._sStops.splice(_.sortedIndex(this._sStops,wrappedPointColor,function(pointColor){return pointColor.position}),0,wrappedPointColor),this._hasChanged=!0),_.isUndefined(color.l)||(wrappedPointColor={position:position,value:color.l},this._lStops.splice(_.sortedIndex(this._lStops,wrappedPointColor,function(pointColor){return pointColor.position}),0,wrappedPointColor),this._hasChanged=!0)},HSLGradient.prototype.resolution=function(res){return arguments.length&&res!=this._resolution&&(this._resolution=res),this._resolution},HSLGradient.prototype.compute=function(res){this._resolution=res||this._resolution;for(var computedArray=[],i=0;i<this._resolution;i++){var percentOfResultion=i/this._resolution,color={};color.h=this._calcPoint(percentOfResultion,this._hStops),color.s=this._calcPoint(percentOfResultion,this._sStops),color.l=this._calcPoint(percentOfResultion,this._lStops),W.extend(color,W.HSLtoStringMixin),computedArray.push(color)}return this._gradientArray=computedArray,this._hasChange=!1,this._gradientArray},HSLGradient.prototype.getGradientArray=function(res){var resolution=res||this._resolution;return this._gradientArray&&this._hasChange&&this._resolution===resolution||this.compute(resolution),this._gradientArray},HSLGradient.prototype._calcPoint=function(position,stops){if(!stops||0===stops.length)return 0;if(1===stops.length)return stops[0].value;if(position<=_.first(stops).position)return _.first(stops).value;if(position>=_.last(stops).position)return _.last(stops).value;var lowStop,highStop;_(stops).each(function(stop,i){position>stop.position&&(lowStop=stops[i],highStop=stops[i+1])},this),void 0===lowStop&&(console.log(position),console.log(stops));var relativePosition=(position-lowStop.position)/(highStop.position-lowStop.position),relativeChange=highStop.value-lowStop.value,value=relativeChange*relativePosition+lowStop.value;return value},RandomColorSequence.prototype.start=function(){return this.timer||(this.timer=new W.Timer({updateTime:10}),this.timer.on("fired",this.update,this)),this.timer.start(),this},RandomColorSequence.prototype.stop=function(){return this.timer.stop(),this.timer.off("fired",this.update),this.timer=void 0,this},RandomColorSequence.prototype.update=function(){return this.r+=this.rStep,this.g+=this.gStep,this.b+=this.bStep,this.r>255&&(this.r=0+(this.r-255)),this.r<0&&(this.r=255-this.r),this.g>255&&(this.g=0+(this.g-255)),this.g<0&&(this.g=255-this.g),this.b>255&&(this.b=0+(this.b-255)),this.b<0&&(this.b=255-this.b),this},RandomColorSequence.prototype.getHex=function(){return W.colorValuesToHex(this.r&this.r,this.g&this.g,this.b&this.b)},W.extend(W,{HSLGradient:HSLGradient,RandomColorSequence:RandomColorSequence,hslToRgb:hslToRgb,hsvToRgb:hsvToRgb,rgbToHsl:rgbToHsl,rgbToHsv:rgbToHsv,randomHex:randomHex})}(W),function(W){function isValidEmailAddress(address){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(address)}function makeRedisKey(){return W.interpose(Array.prototype.slice.call(arguments,0),":").join("")}var W=W||{},addCommas=function(number){if(number=""+number,number.indexOf(",")>0)return number;if(number.length>3){var mod=number.length%3,output=mod>0?number.substring(0,mod):"";for(i=0;i<Math.floor(number.length/3);i++)output+=0===mod&&0===i?number.substring(mod+3*i,mod+3*i+3):","+number.substring(mod+3*i,mod+3*i+3);return output}return number},contains=function(str,test){return-1!=str.indexOf(test)},cssGradientString=function(){var values=[],_direction="left",promise={direction:function(direction){return _direction=direction,promise},add:function(precentage,value){return values.push([precentage,value]),promise},get:function(){for(var str="-webkit-linear-gradient("+_direction+", ",i=0;i<values.length;i++)str+=values[i][1]+" "+values[i][0]+"%",i<values.length-1&&(str+=",");return str+=")"}};return promise},endsWith=function(str,test){return str.slice(-test.length)==test},hasTld=function(str){var result=str.match(/[a-z0-9.\-]+[.][a-z]{1,4}[\/:]?([\d]{1,5})?/m);return!!result},startsWith=function(str,test){return str.slice(0,test.length)==test},trim=function(str){return str.replace(/^[\s\xA0]+/,"").replace(/[\s\xA0]+$/,"")};W.extend(W,{addCommas:addCommas,contains:contains,cssGradientString:cssGradientString,endsWith:endsWith,hsTld:hasTld,startsWith:startsWith,trim:trim,isValidEmailAddress:isValidEmailAddress,makeRedisKey:makeRedisKey})}(W),function(W){function clearContext(ctx,canvasEl){ctx.save(),ctx.setTransform(1,0,0,1,0,0),ctx.clearRect(0,0,canvasEl.width,canvasEl.height),ctx.restore()}function viewportSize(){var e=window,a="inner";return"innerWidth"in window||(a="client",e=document.documentElement||document.body),{width:e[a+"Width"],height:e[a+"Height"]}}function ZIndexStack(options){options||(options={}),this.startZIndex="undefined"==typeof options.startZIndex?100:options.startZIndex,this.topZIndex=this.startZIndex,this.elList=new W.List}var W=W||{},displayViewMixin={setPosition:function(x,y){return"[object Array]"===Object.prototype.toString.call(x)?(this.x(x[0]),this.y(y[1])):"number"==typeof x?(this.x(x),this.y(y)):(this.x(x.x),this.y(x.y)),this},setSize:function(width,height){if(width.tagName&&"function"==typeof jQuery)this.width(jQuery(width).width()),this.height(jQuery(width).height());else if(width.tagName)this.width=width.width,this.height=width.height;else if("number"==typeof width)this.width(width),this.height(height);else if("[object Array]"===Object.prototype.toString.call(width))this.width(width[0]),this.height(width[1]);else if("function"==typeof width)this.width(width()),this.height(height());else{var obj=width;this.width("function"==typeof obj.width?obj.width():obj.width),this.height("function"==typeof obj.height?obj.height():obj.height)}return this},x:function(x){return arguments.length>0&&(this._x=x),"undefined"==typeof this._x&&(this._x=0),this._x},y:function(y){return arguments.length>0&&(this._y=y),"undefined"==typeof this._y&&(this._y=0),this._y},width:function(width){return arguments.length>0&&(this._width=width),"undefined"==typeof this._width&&(this._width=0),this._width},height:function(height){return arguments.length>0&&(this._height=height),"undefined"==typeof this._height&&(this._height=0),this._height}},JSONSocketConnection=W.Object.extend({constructor:function(options){W.extend(this,W.eventMixin),this.socketUrl=options.socketUrl,this._connectionDesired=!1,this.attemptReconnectionAfterMS="undefined"!=typeof options.attemptReconnectionAfterMS?options.attemptReconnectionAfterMS:1e4},openSocketConnection:function(){this._connectionDesired=!0;var self=this;this.socket=new WebSocket(this.socketUrl),this.socket.onopen=function(){self.trigger("open")},this.socket.onerror=function(error){self.trigger("error",error)},this.socket.onclose=function(){self.trigger("closed"),self._connectionDesired?(setTimeout(W.bind(self.openSocketConnection,self),self.attemptReconnectionAfterMS),self.trigger("reconnecting")):self.trigger("closed successfully")},this.socket.onmessage=function(message){self.trigger("message",message);var wasError=!1;try{message=JSON.parse(message.data)}catch(e){return self.trigger("nonjson",message.data),void(wasError=!0)}wasError||self.trigger("json",message)}},closeSocketConnection:function(){this._connectionDesired=!1,this.socket.close()
  },send:function(obj,callback){var state=this.socket.readyState;if(1!==state){var error;switch(state){case 0:error=new Error("WebSocket is CONNECTING");break;case 2:error=new Error("WebSocket is CLOSING");break;case 3:error=new Error("WebSocket is CLOSED");break;default:error=new Error("WebSocket is not in OPEN ready state. State is:"+state)}return self.trigger("error",error),callback(error)}if("string"==typeof obj){if(this.socket.send(obj),callback)return callback()}else{var str;try{str=JSON.stringify(obj)}catch(e){if(self.trigger("error",e),callback)return callback(e)}if(this.socket.send(str),callback)return callback()}}}),polyfillRequestAnimationFrame=function(){for(var lastTime=0,vendors=["webkit","moz"],x=0;x<vendors.length&&!window.requestAnimationFrame;++x)window.requestAnimationFrame=window[vendors[x]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[vendors[x]+"CancelAnimationFrame"]||window[vendors[x]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(callback){var currTime=(new Date).getTime(),timeToCall=Math.max(0,16-(currTime-lastTime)),id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);return lastTime=currTime+timeToCall,id}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(id){clearTimeout(id)})},touchEventViewMixin={enableTouchEvents:function(){this.el.ontouchstart=_.bind(function(event){this.trigger("touchStart",event)},this),this.el.ontouchmove=_.bind(function(event){this.trigger("touchMove",event)},this),this.el.ontouchend=_.bind(function(event){this.trigger("touchEnd",event)},this),this.el.ontouchcancel=_.bind(function(event){this.trigger("touchCancel",event)},this)}},privateNamespace={};!function(namespace){function chainMethod(fn,scope,chainReturn){return function(){return fn.apply(scope,arguments)||chainReturn}}function chainProperty(propName,scope,chainReturn){return function(value){return"undefined"==typeof value?scope[propName]:(scope[propName]=value,chainReturn)}}var _context2DMethods="arc arcTo beginPath bezierCurveTo clearRect clip closePath createImageData createLinearGradient createRadialGradient createPattern drawFocusRing drawImage fill fillRect fillText getImageData isPointInPath lineTo measureText moveTo putImageData quadraticCurveTo rect restore rotate save scale setTransform stroke strokeRect strokeText transform translate".split(" "),_context2DProperties="canvas fillStyle font globalAlpha globalCompositeOperation lineCap lineJoin lineWidth miterLimit shadowOffsetX shadowOffsetY shadowBlur shadowColor strokeStyle textAlign textBaseline".split(" ");namespace.Context2DWrapper=function(target){var curProp,n=_context2DMethods.length;for(this.context=target;n--;)curProp=_context2DMethods[n],this[curProp]=chainMethod(target[curProp],target,this);for(n=_context2DProperties.length;n--;)curProp=_context2DProperties[n],this[curProp]=chainProperty(curProp,target,this)}}(privateNamespace);var wrappedContext=function(context){return new privateNamespace.Context2DWrapper(context)};ZIndexStack.prototype.addToTop=function(el){$(el).css("z-index",++this.topZIndex),this.elList.append(el)},ZIndexStack.prototype.sendToFront=function(el){this.topZIndex;this.elList.sendToBack(el),this.elList.each(function(el,i){$(el).css("z-index",this.startZIndex+i)},this)},W.extend(W,{ZIndexStack:ZIndexStack,wrappedContext:wrappedContext,viewportSize:viewportSize,touchEventViewMixin:touchEventViewMixin,polyfillRequestAnimationFrame:polyfillRequestAnimationFrame,JSONSocketConnection:JSONSocketConnection,displayViewMixin:displayViewMixin,clearContext:clearContext})}(W);