//>>built
define("dojox/lang/async",["dijit","dojo","dojox"],function(x,q,u){q.provide("dojox.lang.async");(function(){var l=q.Deferred,m=q.forEach,t=q.some,n=u.lang.async,v=Array.prototype.slice,r=Object.prototype.toString;n.seq=function(c){var g="[object Array]"==r.call(c)?c:arguments;return function(k){var a=new l;m(g,function(e){a.addCallback(e)});a.callback(k);return a}};n.par=function(c){var g="[object Array]"==r.call(c)?c:arguments;return function(k){var a=Array(g.length),e=function(){m(a,function(b){b instanceof
l&&0>b.fired&&b.cancel()})},f=new l(e),d=g.length;m(g,function(b,h){try{var p=b(k)}catch(w){p=w}a[h]=p});t(a,function(b){return b instanceof Error?(e(),f.errback(b),!0):!1})||m(a,function(b,h){b instanceof l?b.addCallbacks(function(p){a[h]=p;--d||f.callback(a)},function(p){e();f.errback(p)}):--d});d||f.callback(a);return f}};n.any=function(c){var g="[object Array]"==r.call(c)?c:arguments;return function(k){var a=Array(g.length),e=!0;cancel=function(f){m(a,function(d,b){b!=f&&d instanceof l&&0>d.fired&&
d.cancel()})};c=new l(cancel);m(g,function(f,d){try{var b=f(k)}catch(h){b=h}a[d]=b});t(a,function(f,d){return f instanceof l?!1:(cancel(d),c.callback(f),!0)})||m(a,function(f,d){f.addBoth(function(b){e&&(e=!1,cancel(d),c.callback(b))})});return c}};n.select=function(c,g){var k="[object Array]"==r.call(g)?g:v.call(arguments,1);return function(a){return(new l).addCallback(c).addCallback(function(e){return"number"==typeof e&&0<=e&&e<k.length?k[e](a):Error("async.select: out of range")}).callback(a)}};
n.ifThen=function(c,g,k){return function(a){return(new l).addCallback(c).addCallback(function(e){return(e?g:k)(a)}).callback(a)}};n.loop=function(c,g){return function(k){function a(h){b.errback(h)}function e(h){h?d.addCallback(g).addCallback(f):b.callback(h);return h}function f(h){d=(new l).addCallback(c).addCallback(e).addErrback(a);d.callback(h)}var d,b=new l(function(){d.cancel()});f(k);return b}}})()});