define(["ember","broad","core/utilities/math.helper","mm"],function(a,b,c,d){return a.Mixin.create({beforeModel:function(){console.log("application-route-mixin beforeModel");var a=this.controllerFor("application");a.set("dialog-name-loading","dialog-name-loading-"+c.newGuid()),b.on("loading",function(b){a.send("startLoading",b)}).on("loaded",function(b){a.send("stopLoading",b)}).on("tokenExpired",function(b){a.send("tokenExpired",b)}).on("notice",function(b){a.send("notice",b)}),d.listener.on("upgrading",function(){console.log("client upgrading!")}),d.listener.on("upgraded",function(){console.log("client upgraded!"),a.send("reload")}),d.post({version:App.version},{module:"instruction"}),d.post({},{module:"splash",action:"hide"}),4==window.applicationCache.status?a.send("reload"):window.applicationCache.addEventListener("updateready",function(){a.send("reload")}),window.applicationCache.addEventListener("downloading",function(){a.set("updateState","downloading")}),window.applicationCache.addEventListener("cached",function(){a.set("updateState","none")})},model:function(){console.log("application-route-mixin model")},afterModel:function(){console.log("application-route-mixin afterModel")},setupController:function(){console.log("application-route-mixin setupController")},actions:{loading:function(){console.log("application-route-mixin loading"),b.trigger("loading"),this.router.one("didTransition",function(){b.trigger("loaded")})},willTransition:function(a){console.log("application-route-mixin willTransition"),this.controllerFor("application").set("attemptedTransition",a)},didTransition:function(){console.log("application-route-mixin didTransition"),this.controllerFor("application").set("activeTransition",this.controllerFor("application").get("attemptedTransition"))}}})});