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