!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TWEEN=t.TWEEN||{})}(this,function(t){"use strict";function e(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}var n,r={},i=!1,o=!1,s="undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a=0,u=function(t){return"undefined"!=typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t,16.6)},p=function(t){return"undefined"!=typeof cancelAnimationFrame?cancelAnimationFrame(t):clearTimeout(t)};!function(t,e,n){Object.defineProperty(t,e,n)}(r,"length",{enumerable:!1,writable:!0,value:0});var f=function(t){var e=t.id;r[e]=t,r.length++,o&&!i&&(d(),i=!0)},h=function(){var t=a;return a++,t},c=function(t){for(var e in r)if(t.id===+e)return r[+e];return null},l=function(t){for(var e in r)t.id===+e&&(delete r[+e],r.length--)},y=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==s.performance&&void 0!==s.performance.now)return s.performance.now.bind(s.performance);var t=s.performance&&s.performance.timing&&s.performance.timing.navigationStart?s.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),d=function(t,e){if(t=void 0!==t?t:y(),o&&(n=u(d)),0===r.length)return i=!1,p(n),!1;for(var s in r)r[s].update(t)||e?s++:(delete r[+s],r.length--);return!0},_={};if(s.document){var v=0,m=0;s.document.addEventListener("visibilitychange",function(){if(0===r.length)return!1;if(document.hidden)m=y();else{v=y()-m;for(var t in r)r[t]._startTime+=v}return!0})}var g={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-g.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*g.Bounce.In(2*t):.5*g.Bounce.Out(2*t-1)+.5}}},b={Linear:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=b.Utils.Linear;return e<0?o(t[0],t[1],r):e>1?o(t[n],t[n-1],n-r):o(t[i],t[i+1>n?n:i+1],r-i)},Bezier:function(t,e){for(var n=0,r=t.length-1,i=Math.pow,o=b.Utils.Bernstein,s=0;s<=r;s++)n+=i(1-e,r-s)*i(e,s)*t[s]*o(r,s);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,i=Math.floor(r),o=b.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(i=Math.floor(r=n*(1+e))),o(t[(i-1+n)%n],t[i],t[(i+1)%n],t[(i+2)%n],r-i)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):o(t[i?i-1:0],t[i],t[n1;r--)n*=r;return t[e]=n,n}}(),CatmullRom:function(t,e,n,r,i){var o=.5*(n-t),s=.5*(r-e),a=i*i;return(2*e-2*n+o+s)*(i*a)+(-3*e+3*n-2*o-s)*a+o*i+e}}},T=/rgb|hsl|hsv/g,I=/ahsv|ahsl|argb/g,M=/\s+|([A-Za-z?().,{}:""[\]#]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,O=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,w=/\n|\r|\t/g,j=function(t,e){var n,r,i;return 3===e.length?(n=parseInt(e[0]+e[0],16),r=parseInt(e[1]+e[1],16),i=parseInt(e[2]+e[2],16)):6===e.length&&(n=parseInt(e.substr(0,2),16),r=parseInt(e.substr(2,2),16),i=parseInt(e.substr(4,6),16)),"rgb("+n+","+r+","+i+")"},P=function(t){return"string"==typeof t?t.replace(w,""):t},E=function(t,n,r){if(void 0===r&&(r=1e4),"function"==typeof n||n&&n.nodeType)return n;if(t&&t.nodeType)return t;if(Array.isArray(t)){var i=null,o=null;n=n.map(function(e,n){return"string"==typeof e&&T.test(e)?(i=e,o=n,null):e===t[n]?null:"number"==typeof e?e-t[n]:"string"==typeof e&&M.test(e)?E(P(t[n]),P(e)):E(t[n],e)});var s=null!==o?o+6:null;i&&I.test(i)&&(o++,s++);var a=[].concat(t);return function(e){for(var i=0,u=void 0,p=n.length;i
o&&i1?1:n,n=l?1-n:n,r="function"==typeof a?a(n):D(n);for(e in m)if(void 0!==v[e]){var T=v[e],I=m[e],M=g[e];r=a[e]?a[e](n):r,M?M.update(r,n,l):"function"==typeof I?b[e]=I(r):Array.isArray(I)?b[e]=u(I,r):"string"==typeof I?"number"==typeof(I="+"===I.charAt(0)||"-"===I.charAt(0)?T+parseFloat(I):parseFloat(I))&&(b[e]=T+(I-T)*r):"number"==typeof T&&(b[e]=T+(I-T)*r)}if(this.emit("update",b,r,n),this.object=b,1===n||l&&0===n){if(p){isFinite(p)&&this._repeat--;for(e in m)"string"==typeof m[e]&&"number"==typeof v[e]&&(i._valuesStart[e]=v[e]+parseFloat(m[e]));return this.emit(l?"reverse":"repeat",b),c&&(this._reversed=!l),this._startTime+=!l&&f?_+f:l&&h?_+h:_,!0}return this.emit("complete",b),this._repeat=this._r,!1}return!0},e}(A),S=function(t){function e(e){return t.call(this),this._totalDuration=0,this._startTime=y(),this._tweens={},this._elapsed=0,this._id=h(),this._labels={},this._defaultParams=e,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setLabel=function(t,e){return this._labels[t]=this.parsePosition(0,e,0),this},e.prototype.parsePosition=function(t,e,n){var r=this,i=t+n;if("string"==typeof e){for(var o in r._labels)if(0===e.indexOf(o)){var s=e.split(o)[1];0!==s.length&&"+"!==s[0]&&"-"!==s[0]||(i=r._labels[o]+t,e=e.replace(o,""))}0!==e.indexOf("+")&&0!==e.indexOf("-")||(i+=parseFloat(e))}else"number"==typeof e&&(i+=e);return i},e.prototype.map=function(t){var e=this;for(var n in e._tweens)t(e._tweens[n]);return this},e.prototype.add=function(e,n){"object"!=typeof e||e instanceof t||(e=new t(e.from,e));var r=this,i=r._defaultParams,o=r._totalDuration;if(i)for(var s in i)e[s](i[s]);return e._startTime=this.parsePosition(0,n,o),e._startTime+=y(),this._totalDuration=Math.max(o,e._duration+e._startTime),this._tweens[e.id]=e,this},e.prototype.restart=function(){return this._startTime+=y(),f(this),this.emit("restart")},e.prototype.easing=function(t){return this.map(function(e){return e.easing(t)})},e.prototype.interpolation=function(t){return this.map(function(e){return e.interpolation(t)})},e.prototype.update=function(t){var e=this,n=e._tweens,r=e._totalDuration,i=e._repeatDelayTime,o=e._reverseDelayTime,s=e._startTime,a=e._reversed,u=e._yoyo,p=e._repeat;if(t