UNPKG

@createjs/tweenjs

Version:

A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.

13 lines (12 loc) 21.3 kB
/** * @license TweenJS * Visit https://createjs.com for documentation, updates and examples. * * Copyright (c) 2017 gskinner.com, inc. * * Distributed under the terms of the MIT license. * http://www.opensource.org/licenses/mit-license.html * * This notice shall be included in all copies or substantial portions of the Software. */ !function(t){"use strict";var u=function(){function i(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),this.type=t,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=e,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var t=i.prototype;return t.preventDefault=function(){return this.defaultPrevented=this.cancelable,this},t.stopPropagation=function(){return this.propagationStopped=!0,this},t.stopImmediatePropagation=function(){return this.immediatePropagationStopped=this.propagationStopped=!0,this},t.remove=function(){return this.removed=!0,this},t.clone=function(){var t=new i(this.type,this.bubbles,this.cancelable);for(var e in this)this.hasOwnProperty(e)&&(t[e]=this[e]);return t},t.set=function(t){for(var e in t)this[e]=t[e];return this},t.toString=function(){return"["+this.constructor.name+" (type="+this.type+")]"},i}(),e=function(){function i(){this._listeners=null,this._captureListeners=null}i.initialize=function(t){var e=i.prototype;t.addEventListener=e.addEventListener,t.on=e.on,t.removeEventListener=t.off=e.removeEventListener,t.removeAllEventListeners=e.removeAllEventListeners,t.hasEventListener=e.hasEventListener,t.dispatchEvent=e.dispatchEvent,t._dispatchEvent=e._dispatchEvent,t.willTrigger=e.willTrigger};var t=i.prototype;return t.addEventListener=function(t,e,i){var n;void 0===i&&(i=!1);var s=(n=i?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{})[t];return s&&(this.removeEventListener(t,e,i),s=n[t]),s?s.push(e):n[t]=[e],e},t.on=function(t,e,i,n,s,r){return void 0===i&&(i=null),void 0===n&&(n=!1),void 0===s&&(s={}),void 0===r&&(r=!1),e.handleEvent&&(i=i||e,e=e.handleEvent),i=i||this,this.addEventListener(t,function(t){e.call(i,t,s),n&&t.remove()},r)},t.removeEventListener=function(t,e,i){void 0===i&&(i=!1);var n=i?this._captureListeners:this._listeners;if(n){var s=n[t];if(s)for(var r=s.length,o=0;o<r;o++)if(s[o]===e){1===r?delete n[t]:s.splice(o,1);break}}},t.off=function(t,e,i){void 0===i&&(i=!1),this.removeEventListener(t,e,i)},t.removeAllEventListeners=function(t){void 0===t&&(t=null),t?(this._listeners&&delete this._listeners[t],this._captureListeners&&delete this._captureListeners[t]):this._listeners=this._captureListeners=null},t.dispatchEvent=function(t,e,i){if(void 0===e&&(e=!1),void 0===i&&(i=!1),"string"==typeof t){var n=this._listeners;if(!(e||n&&n[t]))return!0;t=new u(t,e,i)}else t.target&&t.clone&&(t=t.clone());try{t.target=this}catch(t){}if(t.bubbles&&this.parent){for(var s=this,r=[s];s.parent;)r.push(s=s.parent);var o,a=r.length;for(o=a-1;0<=o&&!t.propagationStopped;o--)r[o]._dispatchEvent(t,1+(0==o));for(o=1;o<a&&!t.propagationStopped;o++)r[o]._dispatchEvent(t,3)}else this._dispatchEvent(t,2);return!t.defaultPrevented},t.hasEventListener=function(t){var e=this._listeners,i=this._captureListeners;return!!(e&&e[t]||i&&i[t])},t.willTrigger=function(t){for(var e=this;e;){if(e.hasEventListener(t))return!0;e=e.parent}return!1},t.toString=function(){return"["+(this.constructor.name+this.name?" "+this.name:"")+"]"},t._dispatchEvent=function(t,e){var i=1===e?this._captureListeners:this._listeners;if(t&&i){var n,s=i[t.type];if(!s||0===(n=s.length))return;try{t.currentTarget=this}catch(t){}try{t.eventPhase=e}catch(t){}t.removed=!1,s=s.slice();for(var r=0;r<n&&!t.immediatePropagationStopped;r++){var o=s[r];o.handleEvent?o.handleEvent(t):o(t),t.removed&&(this.off(t.type,o,1===e),t.removed=!1)}}},i}();function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t}function r(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}var o=function(n){function i(t){var e;return(e=n.call(this)||this).name=t,e.timingMode=i.TIMEOUT,e.maxDelta=0,e.paused=!1,e._inited=!1,e._startTime=0,e._pausedTime=0,e._ticks=0,e._pausedTicks=0,e._interval=50,e._lastTime=0,e._times=null,e._tickTimes=null,e._timerId=null,e._raf=!0,e}r(i,n),s(i,null,[{key:"RAF_SYNCHED",get:function(){return"synched"}},{key:"RAF",get:function(){return"raf"}},{key:"TIMEOUT",get:function(){return"timeout"}}]);var t=i.prototype;return t.init=function(){this._inited||(this._inited=!0,this._times=[],this._tickTimes=[],this._startTime=this._getTime(),this._times.push(this._lastTime=0),this._setupTick())},t.reset=function(){if(this._raf){var t=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;t&&t(this._timerId)}else clearTimeout(this._timerId);this.removeAllEventListeners("tick"),this._timerId=this._times=this._tickTimes=null,this._startTime=this._lastTime=this._ticks=0,this._inited=!1},t.addEventListener=function(t,e,i){return!this._inited&&this.init(),n.prototype.addEventListener.call(this,t,e,i)},t.getMeasuredTickTime=function(t){void 0===t&&(t=null);var e=this._tickTimes;return!e||e.length<1?-1:(t=Math.min(e.length,t||0|this.framerate),e.reduce(function(t,e){return t+e},0)/t)},t.getMeasuredFPS=function(t){void 0===t&&(t=null);var e=this._times;return!e||e.length<2?-1:(t=Math.min(e.length-1,t||0|this.framerate),1e3/((e[0]-e[t])/t))},t.getTime=function(t){return void 0===t&&(t=!1),this._startTime?this._getTime()-(t?this._pausedTime:0):-1},t.getEventTime=function(t){return void 0===t&&(t=!1),this._startTime?(this._lastTime||this._startTime)-(t?this._pausedTime:0):-1},t.getTicks=function(t){return void 0===t&&(t=!1),this._ticks-(t?this._pausedTicks:0)},t._handleSynch=function(){this._timerId=null,this._setupTick(),this._getTime()-this._lastTime>=.97*(this._interval-1)&&this._tick()},t._handleRAF=function(){this._timerId=null,this._setupTick(),this._tick()},t._handleTimeout=function(){this._timerId=null,this._setupTick(),this._tick()},t._setupTick=function(){if(null==this._timerId){var t=this.timingMode||this._raf&&i.RAF;if(t===i.RAF_SYNCHED||t===i.RAF){var e=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(e)return this._timerId=e(t===i.RAF?this._handleRAF.bind(this):this._handleSynch.bind(this)),void(this._raf=!0)}this._raf=!1,this._timerId=setTimeout(this._handleTimeout.bind(this),this._interval)}},t._tick=function(){var t=this.paused,e=this._getTime(),i=e-this._lastTime;if(this._lastTime=e,this._ticks++,t&&(this._pausedTicks++,this._pausedTime+=i),this.hasEventListener("tick")){var n=new u("tick"),s=this.maxDelta;n.delta=s&&s<i?s:i,n.paused=t,n.time=e,n.runTime=e-this._pausedTime,this.dispatchEvent(n)}for(this._tickTimes.unshift(this._getTime()-e);100<this._tickTimes.length;)this._tickTimes.pop();for(this._times.unshift(e);100<this._times.length;)this._times.pop()},t._getTime=function(){var t=window.performance&&window.performance.now;return(t&&t.call(performance)||(new Date).getTime())-this._startTime},i.on=function(t,e,i,n,s,r){return a.on(t,e,i,n,s,r)},i.removeEventListener=function(t,e,i){a.removeEventListener(t,e,i)},i.off=function(t,e,i){a.off(t,e,i)},i.removeAllEventListeners=function(t){a.removeAllEventListeners(t)},i.dispatchEvent=function(t,e,i){return a.dispatchEvent(t,e,i)},i.hasEventListener=function(t){return a.hasEventListener(t)},i.willTrigger=function(t){return a.willTrigger(t)},i.toString=function(){return a.toString()},i.init=function(){a.init()},i.reset=function(){a.reset()},i.addEventListener=function(t,e,i){a.addEventListener(t,e,i)},i.getMeasuredTickTime=function(t){return a.getMeasuredTickTime(t)},i.getMeasuredFPS=function(t){return a.getMeasuredFPS(t)},i.getTime=function(t){return a.getTime(t)},i.getEventTime=function(t){return a.getEventTime(t)},i.getTicks=function(t){return a.getTicks(t)},s(i,[{key:"interval",get:function(){return this._interval},set:function(t){this._interval=t,this._inited&&this._setupTick()}},{key:"framerate",get:function(){return 1e3/this._interval},set:function(t){this.interval=1e3/t}}],[{key:"interval",get:function(){return a.interval},set:function(t){a.interval=t}},{key:"framerate",get:function(){return a.framerate},set:function(t){a.framerate=t}},{key:"name",get:function(){return a.name},set:function(t){a.name=t}},{key:"timingMode",get:function(){return a.timingMode},set:function(t){a.timingMode=t}},{key:"maxDelta",get:function(){return a.maxDelta},set:function(t){a.maxDelta=t}},{key:"paused",get:function(){return a.paused},set:function(t){a.paused=t}}]),i}(e),a=new o("createjs.global"),h=function(n){function t(t){var e;return(e=n.call(this)||this).ignoreGlobalPause=!1,e.loop=0,e.useTicks=!1,e.reversed=!1,e.bounce=!1,e.timeScale=1,e.duration=0,e.position=0,e.rawPosition=-1,e._paused=!0,e._next=null,e._prev=null,e._parent=null,e._labels=null,e._labelList=null,t&&(e.useTicks=!!t.useTicks,e.ignoreGlobalPause=!!t.ignoreGlobalPause,e.loop=!0===t.loop?-1:t.loop||0,e.reversed=!!t.reversed,e.bounce=!!t.bounce,e.timeScale=t.timeScale||1,t.onChange&&e.addEventListener("change",t.onChange),t.onComplete&&e.addEventListener("complete",t.onComplete)),e}r(t,n);var e=t.prototype;return e.advance=function(t,e){void 0===e&&(e=!1),this.setPosition(this.rawPosition+t*this.timeScale,e)},e.setPosition=function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1);var s=this.duration,r=this.loop,o=this.rawPosition,a=0,u=0,h=!1;if(t<0&&(t=0),0===s){if(h=!0,-1!==o)return h}else{if(u=t-(a=t/s|0)*s,(h=-1!==r&&r*s+s<=t)&&(t=(u=s)*(a=r)+s),t===o)return h;!this.reversed!=!(this.bounce&&a%2)&&(u=s-u)}this.position=u,this.rawPosition=t,this._updatePosition(i,h),h&&(this.paused=!0),n&&n(this),e||this._runActions(o,t,i,!i&&-1===o),this.dispatchEvent("change"),h&&this.dispatchEvent("complete")},e.calculatePosition=function(t){var e=this.duration,i=this.loop,n=0,s=0;return 0===e?0:(-1!==i&&i*e+e<=t?(s=e,n=i):s=t<0?0:t-(n=t/e|0)*e,!this.reversed!=!(this.bounce&&n%2)?e-s:s)},e.addLabel=function(t,e){this._labels||(this._labels={}),this._labels[t]=e;var n=this._labelList;if(n){for(var s=0,r=n.length;s<r&&!(e<n[s].position);s++);n.splice(i,0,{label:t,position:e})}},e.gotoAndPlay=function(t){this.paused=!1,this._goto(t)},e.gotoAndStop=function(t){this.paused=!0,this._goto(t)},e.resolve=function(t){var e=Number(t);return isNaN(e)?this._labels&&this._labels[t]:e},e.toString=function(){return"["+this.constructor.name+(this.name?" (name="+this.name+")":"")+"]"},e.clone=function(){throw"AbstractTween cannot be cloned."},e._init=function(t){t&&t.paused||(this.paused=!1),t&&null!=t.position&&this.setPosition(t.position)},e._goto=function(t){var e=this.resolve(t);null!=e&&this.setPosition(e,!1,!0)},e._runActions=function(t,e,i,n){if(this._actionHead||this.tweens){var s,r,o,a,u=this.duration,h=this.loop,c=this.reversed,l=this.bounce;if(0===u?(s=r=o=a=0,c=l=!1):(o=t-(s=t/u|0)*u,a=e-(r=e/u|0)*u),-1!==h&&(h<r&&(a=u,r=h),h<s&&(o=u,s=h)),i)return this._runActionsRange(a,a,i,n);if(s!==r||o!==a||i||n){-1===s&&(s=o=0);var p=t<=e,d=s;do{var f=d===s?o:p?0:u,v=d===r?a:p?u:0;if(!c!=!(l&&d%2)&&(f=u-f,v=u-v),l&&d!==s&&f===v);else if(this._runActionsRange(f,v,i,n||d!==s&&!l))return!0;n=!1}while(p&&++d<=r||!p&&--d>=r)}}},e._runActionsRange=function(t,e,i,n){throw"_runActionsRange is abstract and must be overridden by a subclass."},e._updatePosition=function(t,e){throw"_updatePosition is abstract and must be overridden by a subclass."},s(t,[{key:"labels",get:function(){var t=this._labelList;if(!t){t=this._labelList=[];var e=this._labels;for(var i in e)t.push({label:i,position:e[i]});t.sort(function(t,e){return t.position-e.position})}return t},set:function(t){this._labels=t,this._labelList=null}},{key:"currentLabel",get:function(){for(var t=this.labels,e=this.position,n=0,s=t.length;n<s&&!(e<t[n].position);n++);return 0===i?null:t[i-1].label}},{key:"paused",get:function(){return this._paused},set:function(t){N._register(this,t),this._paused=t}}]),t}(e);function c(t){return t}function l(e){return function(t){return Math.pow(t,e)}}function p(e){return function(t){return 1-Math.pow(1-t,e)}}function d(e){return function(t){return(t*=2)<1?.5*Math.pow(t,e):1-.5*Math.abs(Math.pow(2-t,e))}}function f(e){return function(t){return t*t*((e+1)*t-e)}}function v(e){return function(t){return--t*t*((e+1)*t+e)+1}}function _(e){return e*=1.525,function(t){return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}function m(i,n){var s=2*Math.PI;return function(t){if(0===t||1===t)return t;var e=n/s*Math.asin(1/i);return-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*s/n)}}function g(i,n){var s=2*Math.PI;return function(t){if(0===t||1===t)return t;var e=n/s*Math.asin(1/i);return i*Math.pow(2,-10*t)*Math.sin((t-e)*s/n)+1}}function w(i,n){var s=2*Math.PI;return function(t){var e=n/s*Math.asin(1/i);return(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*s/n)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*s/n)*.5+1}}var T=c,b=l(2),E=p(2),k=d(2),P=l(3),y=p(3),I=d(3),L=l(4),A=p(4),M=d(4),O=l(5),S=p(5),x=d(5),R=f(1.7),j=v(1.7),F=_(1.7),q=m(1,.3),D=g(1,.3),H=w(1,.3*1.5),C=Object.freeze({linear:c,get:function(e){return e<-1?e=-1:1<e&&(e=1),function(t){return 0==e?t:e<0?t*(t*-e+1+e):t*((2-t)*e+(1-e))}},getPowIn:l,getPowOut:p,getPowInOut:d,sineIn:function(t){return 1-Math.cos(t*Math.PI/2)},sineOut:function(t){return Math.sin(t*Math.PI/2)},sineInOut:function(t){return-.5*(Math.cos(Math.PI*t)-1)},getBackIn:f,getBackOut:v,getBackInOut:_,circIn:function(t){return-(Math.sqrt(1-t*t)-1)},circOut:function(t){return Math.sqrt(1- --t*t)},circInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},bounceIn:function(t){return 1-Ease.bounceOut(1-t)},bounceOut: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},bounceInOut:function(t){return t<.5?.5*Ease.bounceIn(2*t):.5*Ease.bounceOut(2*t-1)+.5},getElasticIn:m,getElasticOut:g,getElasticInOut:w,none:T,quadIn:b,quadOut:E,quadInOut:k,cubicIn:P,cubicOut:y,cubicInOut:I,quartIn:L,quartOut:A,quartInOut:M,quintIn:O,quintOut:S,quintInOut:x,backIn:R,backOut:j,backInOut:F,elasticIn:q,elasticOut:D,elasticInOut:H}),N=function(n){function m(t,e){var i;return(i=n.call(this,e)||this).pluginData=null,i.target=t,i.passive=!1,i._stepHead=new z(null,0,0,{},null,!0),i._stepTail=i._stepHead,i._stepPosition=0,i._actionHead=null,i._actionTail=null,i._plugins=null,i._pluginIds=null,i._injected=null,e&&(i.pluginData=e.pluginData,e.override&&m.removeTweens(t)),i.pluginData||(i.pluginData={}),i._init(e),i}r(m,n),m.get=function(t,e){return new m(t,e)},m.tick=function(t,e){for(var i=m._tweenHead;i;){var n=i._next;e&&!i.ignoreGlobalPause||i._paused||i.advance(i.useTicks?1:t),i=n}},m.handleEvent=function(t){"tick"===t.type&&this.tick(t.delta,t.paused)},m.removeTweens=function(t){if(t.tweenjs_count){for(var e=m._tweenHead;e;){var i=e._next;e.target===t&&(e.paused=!0),e=i}t.tweenjs_count=0}},m.removeAllTweens=function(){for(var t=m._tweenHead;t;){var e=t._next;t._paused=!0,t.target&&(t.target.tweenjs_count=0),t._next=t._prev=null,t=e}m._tweenHead=m._tweenTail=null},m.hasActiveTweens=function(t){return t?!!t.tweenjs_count:!!m._tweenHead},m.installPlugin=function(t,e){t.install(e);for(var n=t.priority=t.priority||0,s=m._plugins=m._plugins||[],r=0,o=s.length;r<o&&!(n<s[r].priority);r++);s.splice(i,0,t)},m._register=function(t,e){var i=t.target;if(!e&&t._paused){i&&(i.tweenjs_count=i.tweenjs_count?i.tweenjs_count+1:1);var n=m._tweenTail;n?(m._tweenTail=n._next=t,t._prev=n):m._tweenHead=m._tweenTail=t,m._inited||(o.addEventListener("tick",m),m._inited=!0)}else if(e&&!t._paused){i&&i.tweenjs_count--;var s=t._next,r=t._prev;s?s._prev=r:m._tweenTail=r,r?r._next=s:m._tweenHead=s,t._next=t._prev=null}};var t=m.prototype;return t.wait=function(t,e){return void 0===e&&(e=!1),0<t&&this._addStep(+t,this._stepTail.props,null,e),this},t.to=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=c),e<0&&(e=0);var n=this._addStep(+e,null,i);return this._appendProps(t,n),this},t.label=function(t){return this.addLabel(t,this.duration),this},t.call=function(t,e,i){return this._addAction(i||this.target,t,e||[this])},t.set=function(t,e){return this._addAction(e||this.target,this._set,[t])},t.play=function(t){return this._addAction(t||this,this._set,[{paused:!1}])},t.pause=function(t){return this._addAction(t||this,this._set,[{paused:!1}])},t.clone=function(){throw"Tween can not be cloned."},t._addPlugin=function(t){var e=this._pluginIds||(this._pluginIds={}),i=t.id;if(i&&!e[i]){e[i]=!0;for(var n=this._plugins||(this._plugins=[]),s=t.priority||0,r=0,o=n.length;r<o;r++)if(s<n[r].priority)return void n.splice(r,0,t);n.push(t)}},t._updatePosition=function(t,e){var i=this._stepHead.next,n=this.position,s=this.duration;if(this.target&&i){for(var r=i.next;r&&r.t<=n;)r=(i=i.next).next;var o=e?0===s?1:n/s:(n-i.t)/i.d;this._updateTargetProps(i,o,e)}this._stepPosition=i?n-i.t:0},t._updateTargetProps=function(t,e,i){if(!(this.passive=!!t.passive)){var n,s,r,o,a=t.prev.props,u=t.props;(o=t.ease)&&(e=o(e,0,1,1));var h=this._plugins;t:for(var c in a){if(n=(s=a[c])!==(r=u[c])&&"number"==typeof s?s+(r-s)*e:1<=e?r:s,h)for(var l=0,p=h.length;l<p;l++){var d=h[l].change(this,t,c,n,e,i);if(d===m.IGNORE)continue t;void 0!==d&&(n=d)}this.target[c]=n}}},t._runActionsRange=function(t,e,i,n){var s=e<t,r=s?this._actionTail:this._actionHead,o=e,a=t;s&&(o=t,a=e);for(var u=this.position;r;){var h=r.t;if((h===e||a<h&&h<o||n&&h===t)&&(r.funct.apply(r.scope,r.params),u!==this.position))return!0;r=s?r.prev:r.next}},t._appendProps=function(t,e,i){var n,s,r,o,a,u=this._stepHead.props,h=this.target,c=m._plugins,l=e.prev,p=l.props,d=e.props||(e.props=this._cloneProps(p)),f={};for(n in t)if(t.hasOwnProperty(n)&&(f[n]=d[n]=t[n],void 0===u[n])){if(o=void 0,c)for(s=c.length-1;0<=s;s--)if(void 0!==(r=c[s].init(this,n,o))&&(o=r),o===m.IGNORE){(ignored=ignored||{})[n]=!0,delete d[n],delete f[n];break}o!==m.IGNORE&&(void 0===o&&(o=h[n]),p[n]=void 0===o?null:o)}for(n in f){r=t[n];for(var v=void 0,_=l;(v=_)&&(_=v.prev);)if(_.props!==v.props){if(void 0!==_.props[n])break;_.props[n]=p[n]}}if(i&&(c=this._plugins))for(s=c.length-1;0<=s;s--)c[s].step(this,e,f);(a=this._injected)&&(this._injected=null,this._appendProps(a,e,!1))},t._injectProp=function(t,e){(this._injected||(this._injected={}))[t]=e},t._addStep=function(t,e,i,n){void 0===n&&(n=!1);var s=new z(this._stepTail,this.duration,t,e,i,n);return this.duration+=t,this._stepTail=this._stepTail.next=s},t._addAction=function(t,e,i){var n=new B(this._actionTail,this.duration,t,e,i);return this._actionTail?this._actionTail.next=n:this._actionHead=n,this._actionTail=n,this},t._set=function(t){for(var e in t)this[e]=t[e]},t._cloneProps=function(t){var e={};for(var i in t)e[i]=t[i];return e},m}(h),G=N.prototype;G.w=G.wait,G.t=G.to,G.c=G.call,G.s=G.set,N.IGNORE={},N._tweens=[],N._plugins=null,N._tweenHead=null,N._tweenTail=null;var z=function(t,e,i,n,s,r){this.next=null,this.prev=t,this.t=e,this.d=i,this.props=n,this.ease=s,this.passive=r,this.index=t?t.index+1:0},B=function(t,e,i,n,s){this.next=null,this.d=0,this.prev=t,this.t=e,this.scope=i,this.funct=n,this.params=s},U=function(n){function t(t){var e,i;(void 0===t&&(t={}),(e=n.call(this,t)||this).tweens=[],t.tweens)&&(i=e).addTween.apply(i,t.tweens);return t.labels&&(e.labels=t.labels),e._init(t),e}r(t,n);var e=t.prototype;return e.addTween=function(){var t=arguments.length;if(1===t){var e=arguments.length<=0?void 0:arguments[0];this.tweens.push(e),e._parent=this,e.paused=!0;var i=e.duration;return 0<e.loop&&(i*=e.loop+1),i>this.duration&&(this.duration=i),0<=this.rawPosition&&e.setPosition(this.rawPosition),e}if(1<t){for(var n=0;n<t;n++)this.addTween(n<0||arguments.length<=n?void 0:arguments[n]);return t-1<0||arguments.length<=t-1?void 0:arguments[t-1]}return null},e.removeTween=function(){var t=arguments.length;if(1===t){for(var e=this.tweens,i=arguments.length<=0?void 0:arguments[0],n=e.length;n--;)if(e[n]===i)return e.splice(n,1),i._parent=null,i.duration>=this.duration&&this.updateDuration(),!0;return!1}if(1<t){for(var s=!0,r=0;r<t;r++)s=s&&this.removeTween(r<0||arguments.length<=r?void 0:arguments[r]);return s}return!0},e.updateDuration=function(){for(var t=this.duration=0,e=this.tweens.length;t<e;t++){var i=this.tweens[t],n=i.duration;0<i.loop&&(n*=i.loop+1),n>this.duration&&(this.duration=n)}},e.clone=function(){throw"Timeline can not be cloned."},e._updatePosition=function(t,e){for(var i=this.position,n=0,s=this.tweens.length;n<s;n++)this.tweens[n].setPosition(i,!0,t)},e._runActionsRange=function(t,e,i,n){for(var s=this.position,r=0,o=this.tweens.length;r<o;r++)if(this.tweens[r]._runActions(t,e,i,n),s!==this.position)return!0},t}(h);t.Ease=C,t.Event=u,t.EventDispatcher=e,t.Ticker=o,t.Tween=N,t.AbstractTween=h,t.Timeline=U,(t.versions=t.versions||{}).tweenjs="2.0.0-beta.4"}(this.createjs=this.createjs||{});