i=c.collectionType,g,j,n,m;if(b[d]){g=f.result(b,d);e&&f.isString(e)&&(e=eval(e));i&&f.isString(i)&&(i=eval(i));j=c.options?f.extend({},c.options,a):a;if(c.type===h.Many){if(i&&!i.prototypeinstanceofl)throwError("collectionType must inherit from Backbone.Collection");if(ginstanceofl)n=g;else{n=i?newi:this._createCollection(e);n.add(g,j)}b[d]=n}elseif(c.type===h.One&&e){n=ginstanceofo?g:newe(g);b[d]=n}if((m=n)&&!m._proxyCallback){m._proxyCallback=function(){returnthis._bubbleEvent.call(this,
j:"");d[0]=k+":"+j;if(g){if(i=f.find(g,function(a,b){returnj.indexOf(b,j.length-b.length)!==-1}))returnthis}elseg=a._proxyCalls={};g[j]=true;if("change"===k){this._previousAttributes[b]=a._previousAttributes;this.changed[b]=a}this.trigger.apply(this,d);j&&g&&deleteg[j];returnthis},_createCollection:function(b){vara=b;f.isString(a)&&(a=eval(a));if(a&&a.prototypeinstanceofo){b=newl;b.model=a}elsethrowError("type must inherit from Backbone.AssociatedModel");returnb},toJSON:function(b){vara,
b.options,c):c;if(a[d]){e=g.result(a,d);e=k?k(e):e;if(b.type===h.Many){if(j&&!j.prototypeinstanceofm)throwError("collectionType must inherit from Backbone.Collection");if(einstanceofm)l=e;elseif(i){i._deferEvents=true;i.set(e,c);l=i}else{l=j?newj:this._createCollection(f);l.add(e,q)}}elseif(b.type===h.One&&f)if(einstanceofo)l=e;elseif(i)if(i&&e[y]&&i.get(y)===e[y]){i._deferEvents=true;i._set(e,c);l=i}elsel=newf(e,q);elsel=newf(e,q);if((p=a[d]=l)&&!p._proxyCallback){p._proxyCallback=
(c=t(c));if(c&&c.prototypeinstanceofo){a=newm;a.model=c}elsethrowError("type must inherit from Backbone.AssociatedModel");returna},_processPendingEvents:function(){if(!this.visited){this.visited=true;this._deferEvents=false;g.each(this._pendingEvents,function(a){a.c.trigger.apply(a.c,a.a)});this._pendingEvents=[];g.each(this.relations,function(a){(a=this.attributes[a.key])&&a._processPendingEvents()},this);deletethis.visited}},trigger:function(a){if(this._deferEvents){this._pendingEvents=this._pendingEvents||