define(["ember","mm","broad","velocity"],function(a,b,c){return b.post(["upload","convert","copy"],{module:"messageHost",action:"sendEvent"}),a.Component.extend({layoutName:"upload-progress",classNames:["unrc"],expended:!1,expendAnimate:function(){var a=this.get("listContainer");a.velocity(this.get("expended")?"slideDown":"slideUp")}.observes("expended"),showPulse:function(){return!this.get("expended")&&0!=this.get("items.length")}.property("expended","items.@each"),actions:{expandProcess:function(a){this.set("expended",a)}},totalFiles:function(){return this.get("items").length}.property("items.@each"),percentEvent:function(a,b){"process"==b.status?this.fetch(b):this.pop(b)},initialize:function(){var a=this;b.listener.on("upload",a.percentEvent.bind(a)),b.listener.on("convert",a.percentEvent.bind(a)),b.listener.on("copy",a.percentEvent.bind(a));var d=[];this.set("items",d),c.on("focusupload",function(a,b){var c=d.findBy("title",b);c&&c.set("focused",!0)}),c.on("collapseupload",function(a,b){this.set("expended",b)})}.on("init"),domReady:function(){this.set("listContainer",this.$(".udlist"))}.on("didInsertElement"),find:function(a){return this.items.findBy("name",a)},push:function(b){var c=this.get("items");c.pushObject(a.Object.create({title:b.title,name:b.name,category:b.category,percent:b.percent?b.percent:0,on:b.event}))},fetch:function(a){if(100==a.percent)return this.pop(a);var b=this.find(a.name);b?b.set("percent",a.percent):this.push(a)},pop:function(a){var b=this.get("items"),c=this.find(a.name);c&&b.removeObject(c)}})});