this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(r.prototype,k,{model:o,initialize:function(){},toJSON:function(a){returnthis.map(function(b){returnb.toJSON(a)})},add:function(a,b){varc,d,e,g,i,j={},k={},l=[];b||(b={});a=f.isArray(a)?a.slice():[a];c=0;for(d=a.length;c<d;c++){if(!(e=a[c]=this._prepareModel(a[c],b)))throwError("Can't add an invalid model to a collection");g=e.cid;i=e.id;j[g]||this._byCid[g]||null!=i&&(k[i]||this._byId[i])?
shift:function(a){varb=this.at(0);this.remove(b,a);returnb},get:function(a){returnnull==a?void0:this._byId[null!=a.id?a.id:a]},getByCid:function(a){returna&&this._byCid[a.cid||a]},at:function(a){returnthis.models[a]},where:function(a){returnf.isEmpty(a)?[]:this.filter(function(b){for(varcina)if(a[c]!==b.get(c))return!1;return!0})},sort:function(a){a||(a={});if(!this.comparator)throwError("Cannot sort a set without a comparator");varb=f.bind(this.comparator,this);1==this.comparator.length?
""},getFragment:function(a,b){if(null==a)if(this._hasPushState||b){vara=window.location.pathname,c=window.location.search;c&&(a+=c)}elsea=this.getHash();a.indexOf(this.options.root)||(a=a.substr(this.options.root.length));returna.replace(s,"")},start:function(a){if(m.started)throwError("Backbone.history has already been started");m.started=!0;this.options=f.extend({},{root:"/"},this.options,a);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=
for(varbina){varc=a[b];f.isFunction(c)||(c=this[a[b]]);if(!c)throwError('Method "'+a[b]+'" does not exist');vard=b.match(F),e=d[1],d=d[2],c=f.bind(c,this),e=e+(".delegateEvents"+this.cid);""===d?this.$el.bind(e,c):this.$el.delegate(d,e,c)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(varb=0,c=w.length;b<c;b++){vard=w[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el)this.setElement(this.el,
b,c){vard;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){a.apply(this,arguments)};f.extend(d,a);x.prototype=a.prototype;d.prototype=newx;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;returnd},n=function(a,b){return!a||!a[b]?null:f.isFunction(a[b])?a[b]():a[b]},t=function(){throwError('A "url" property or function must be specified');}}).call(this);