define(["ember"],function(a){return a.Component.extend({classNames:["accordion-item"],classNameBindings:["styleClasses","selectedClass","expandedClass"],accordion:a.computed.alias("parentView"),content:a.computed.alias("accordion.content"),expanded:!1,idxable:!0,index:function(){return this.get("accordion.items").indexOf(this)}.property("accordion.items.@each"),expandedClass:function(){return this.get("expanded")?"expanded":""}.property("expanded"),selectedClass:function(){return this.get("selected")?"selected":""}.property("selected"),select:function(){this.get("accordion").select(this),this.get("accordion.multiple")?this.set("expanded",!this.get("expanded")):this.get("accordion.multiple")||this.set("expanded",this.get("selected"))},selected:function(){return this.get("accordion.selected")===this}.property("accordion.selected"),didSelected:function(){this.get("accordion.multiple")||this.set("expanded",this.get("selected"))}.observes("selected"),selectByParam:function(){if(this.get("idxable")&&null!=this.get("accordion.selected")!==this){var a=parseInt(this.get("accordion.selected-idx",10));a===this.get("index")&&this.select()}}.observes("accordion.selected-idx").on("didInsertElement"),register:function(){return this.get("accordion").addItem(this)}.on("init"),unregister:function(){return this.get("accordion").removeItem(this)}.on("willDestroyElement")})});