//>>built
define("dojox/timing/Sequence",["dojo/_base/kernel","dojo/_base/array","dojo/_base/declare","dojo/_base/lang","./_base"],function(b){b.experimental("dojox.timing.Sequence");return b.declare("dojox.timing.Sequence",null,{_goOnPause:0,_running:!1,constructor:function(){this._defsResolved=[]},go:function(c,a){this._running=!0;b.forEach(c,function(a){if(1<a.repeat)for(var e=a.repeat,b=0;b<e;b++)a.repeat=1,this._defsResolved.push(a);else this._defsResolved.push(a)},this);a&&this._defsResolved.push({func:a});
this._defsResolved.push({func:[this.stop,this]});this._curId=0;this._go()},_go:function(){function c(a){var c=null;return c=b.isArray(a)?2<a.length?a[0].apply(a[1],a.slice(2)):a[0].apply(a[1]):a()}if(this._running){var a=this._defsResolved[this._curId];this._curId+=1;if(this._curId>=this._defsResolved.length)c(a.func);else if(a.pauseAfter)!1!==c(a.func)?setTimeout(b.hitch(this,"_go"),a.pauseAfter):this._goOnPause=a.pauseAfter;else if(a.pauseBefore){var d=b.hitch(this,function(){!1!==c(a.func)&&this._go()});
setTimeout(d,a.pauseBefore)}else!1!==c(a.func)&&this._go()}},goOn:function(){this._goOnPause?(setTimeout(b.hitch(this,"_go"),this._goOnPause),this._goOnPause=0):this._go()},stop:function(){this._running=!1}})});