ember-data-source 2.5.5 → 2.6.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
- !function(){"use strict";var e,t,r,a;!function(){function i(e,t){try{return e()}finally{t()}}function n(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function o(e,t,r,a){this.id=y++,this.name=e,this.deps=!t.length&&r.length?v:t,this.exports=a||{},this.callback=r,this.state=void 0,this._require=void 0}function s(e){this.name=e}function d(e,t,r){for(var a,i=e.deps,n=i.length,o=new Array(n),s={},d=0,u=n;d<u;d++)a=i[d],"exports"===a?s.exports=o[d]=r:"require"===a?o[d]=e.makeRequire():"module"===a?(e.exports=r,s=o[d]=e):o[d]=l(c(a,t),t);return{deps:o,module:s}}function l(e,t){var a=p[e];if(!a)throw new Error("Could not find module `"+e+"` imported from `"+t+"`");return r(e)}function u(e){throw new Error("Could not find module "+e)}function c(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),a=t.split("/"),i=a.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===i.length)throw new Error("Cannot access parent module of root");i.pop()}else{if("."===s)continue;i.push(s)}}return i.join("/")}var h;h=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var p={},f={},m=!1,y=0,v=["require","exports","module"];o.prototype.makeRequire=function(){var e=this.name;return this._require||(this._require=function(t){return r(c(t,e))})},e=function(e,t,r){arguments.length<2&&n(arguments.length),h(t)||(r=t,t=[]),p[e]=new o(e,t,r)},e.petal={},e.alias=function(e){return new s(e)},a=r=t=function(e){var t=p[e];if(t&&t.callback instanceof s&&(t=p[t.callback.name]),t||u(e),t.state!==m&&f.hasOwnProperty(e))return f[e];var r,a,n=!1;f[e]={},i(function(){r=d(t,e,f[e]),a=t.callback.apply(this,r.deps),n=!0},function(){n||(t.state=m)});var o;return o=void 0===a&&r.module.exports?r.module.exports:f[e]=a,null===o||"object"!=typeof o&&"function"!=typeof o||void 0!==o.default||(o.default=o),f[e]=o},a.entries=a._eak_seen=p,a.unsee=function(e){delete f[e]},a.clear=function(){a.entries=a._eak_seen=p={},f=state={}}}(),e("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),e("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,a,i){switch(a){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(i,e);case"queryRecord":return this.urlForQueryRecord(i,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var a,i=[],n=r(this,"host"),o=this.urlPrefix();return e&&(a=this.pathForType(e),a&&i.push(a)),t&&i.push(encodeURIComponent(t)),o&&i.unshift(o),i=i.join("/"),!n&&i&&"/"!==i.charAt(0)&&(i="/"+i),i},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var a=r(this,"host"),i=r(this,"namespace");if(a&&"/"!==a||(a=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+a+e:t+"/"+e;var n=[];return a&&n.push(a),i&&n.push(i),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),e("ember-data/-private/adapters/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function i(e){a.call(this,e,"The adapter rejected the commit because it was invalid")}function n(){a.call(this,null,"The adapter operation timed out")}function o(){a.call(this,null,"The adapter operation was aborted")}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(a){for(var i=t.default.makeArray(e[a]),n=0;n<i.length;n++){var o="Invalid Attribute",s="/data/attributes/"+a;a===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:i[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:e.source.pointer.search(c)!==-1&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=a,e.InvalidError=i,e.TimeoutError=n,e.AbortError=o,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base";a.prototype=Object.create(l.prototype),i.prototype=Object.create(a.prototype),n.prototype=Object.create(a.prototype),o.prototype=Object.create(a.prototype)}),e("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var a=t.default.Namespace.create({VERSION:r.default});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",a.VERSION),e.default=a}),e("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function a(){return t.default.debug.apply(t.default,arguments)}function i(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(){return t.default.warn.apply(t.default,arguments)}function d(){return t.default.debugSeal.apply(t.default,arguments)}function l(e,r){return e.__isMixin?e.__mixin.detect(r.type.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r.type))}function u(e,t,a){var i=a.type.modelName,n=e.type.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of type '"+i+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,l(s,a))}e.assert=r,e.debug=a,e.deprecate=i,e.info=n,e.runInDebug=o,e.warn=s,e.debugSeal=d,e.assertPolymorphicType=u}),e("ember-data/-private/ext/date",["exports","ember"],function(e,t){t.default.Date=t.default.Date||{};var r=Date.parse,a=[1,4,5,6,7,10,11];t.default.Date.parse=function(e){var t,i,n=0;if(i=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,"Z"!==i[8]&&void 0!==i[9]&&(n=60*i[10]+i[11],"+"===i[9]&&(n=0-n)),t=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7])}else t=r?r(e):NaN;return t},(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=t.default.Date.parse)}),e("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.default=r}),e("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.default=r}),e("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.default=t}),e("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,a){function i(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",a.RESTAdapter),e.register("adapter:-json-api",a.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),i(e,"service:store")||e.register("service:store",t.default)}e.default=n}),e("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.default=r}),e("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e.default=t}),e("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,a){e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=a.default}),e("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var a in e)r[a]=e[a];return r}e.default=r}),e("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null==e||""===e?null:e+""}e.default=t}),e("ember-data/-private/system/container-proxy",["exports","ember-data/-private/debug"],function(e,t){function r(e){this.container=e}e.default=r,r.prototype.aliasedFactory=function(e,t){var r=this;return{create:function(){return t&&t(),r.container.lookup(e)}}},r.prototype.registerAlias=function(e,t,r){var a=this.aliasedFactory(t,r);return this.container.register(e,a)},r.prototype.registerDeprecation=function(e,t){var r=function(){};return this.registerAlias(e,t,r)},r.prototype.registerDeprecations=function(e){var t,r,a,i;for(t=e.length;t>0;t--)r=e[t-1],a=r.deprecated,i=r.valid,this.registerDeprecation(a,i)}}),e("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.default=t.default}),e("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var a=t.default.get,i=t.default.String.capitalize,n=t.default.String.underscore,o=t.default.assert;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return a(e,"attributes").forEach(function(e,a){if(r++>o.attributeLimit)return!1;var s=i(n(a).replace("_"," "));t.push({name:a,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var a=r.match(/model:(.*)/);a&&(t=a[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:a(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=a(e,n);i[n]=o}),i},getRecordKeywords:function(e){var r=[],i=t.default.A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(a(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var a=t.default.A(),i=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return i.push(e)});var n=this;i.forEach(function(i){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,i,o),a.push(function(){t.default.removeObserver(e,i,o)})});var o=function(){a.forEach(function(e){return e()})};return o}})}),e("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_debugInfo:function(){var e=["id"],t={belongsTo:[],hasMany:[]},r=[];this.eachAttribute(function(t,r){return e.push(t)}),this.eachRelationship(function(e,a){t[a.kind].push(e),r.push(e)});var a=[{name:"Attributes",properties:e,expand:!0},{name:"Belongs To",properties:t.belongsTo,expand:!0},{name:"Has Many",properties:t.hasMany,expand:!0},{name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}];return{propertyInfo:{includeOtherProperties:!0,groups:a,expensiveProperties:r}}}})}),e("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),e("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.default=r}),e("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,a,i){var n=t.default.get,o=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.currentState=t.default.A([])},record:null,canonicalState:null,currentState:null,length:0,objectAt:function(e){if(this.currentState[e])return this.currentState[e].getRecord()},flushCanonical:function(){var e=this.canonicalState.filter(function(e){return!e.isDeleted()}),t=this.currentState.filter(function(t){return t.isNew()&&e.indexOf(t)===-1});e=e.concat(t);var r=this.length;this.arrayContentWillChange(0,this.length,e.length),(0,i._objectIsAlive)(this)&&this.set("length",e.length),this.currentState=e,this.arrayContentDidChange(0,r,this.length),this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},isPolymorphic:!1,isLoaded:!1,relationship:null,meta:null,internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length),r&&this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},internalRemoveRecords:function(e){for(var t,r=0;r<e.length;r++)t=this.currentState.indexOf(e[r]),this.internalReplace(t,1)},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var a;t>0&&(a=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(a)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},promise:null,loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),i=t.default.RSVP.all(this.invoke("save"),r).then(function(t){return e},null,"DS: ManyArray#save return ManyArray");return a.PromiseArray.create({promise:i})},createRecord:function(e){var t,r=n(this,"store"),a=n(this,"type");return t=r.createRecord(a.modelName,e),this.pushObject(t),t}})}),e("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,a,i){e.RootState=a.default,e.attr=r.default,e.Errors=i.default,e.default=t.default}),e("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t.default.get,i=t.default.Map,n=t.default.Mixin.create({attributes:t.default.computed(function(){var e=i.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=i.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){a(this,"attributes").forEach(function(r,a){e.call(t,a,r)})},eachTransformedAttribute:function(e,t){a(this,"transformedAttributes").forEach(function(r,a){e.call(t,a,r)})}});e.AttrClassMethodsMixin=n;var o=t.default.Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),e("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t.default.get,i=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return a(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=a(this,"isEmpty");this._add(e,t),r&&!a(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),a(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),a=o(t),i=new Array(a.length),n=0;n<a.length;n++){var s=a[n],d=r.findBy("message",s);d?i[n]=d:i[n]={attribute:e,message:s}}return i},remove:function(e){a(this,"isEmpty")||(this._remove(e),a(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!a(this,"isEmpty")){var t=this.rejectBy("attribute",e);i(this,"content",t),a(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){a(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!a(this,"isEmpty")){var e=a(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),e("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,a,i,n,o,s,d,l){function u(e){return _[e]||(_[e]=e.split("."))}function c(e){return R[e]||(R[e]=u(e)[0])}function h(e){return function(){return y(this.currentState,e)}}function p(e,r,n,s,d){this.type=e,this.id=r,this.store=n,this._data=d||new o.default,this.modelName=e.modelName,this.dataHasInitialized=!1,this._deferredTriggers=[],this._attributes=new o.default,this._inFlightAttributes=new o.default,this._relationships=new i.default(this),this._recordArrays=void 0,this.currentState=a.default.empty,this.recordReference=new l.RecordReference(n,this),this.references={},this.isReloading=!1,this.isError=!1,this.error=null,this.__ember_meta__=null,this[t.default.GUID_KEY]=A++ +"internal-model",this._implicitRelationships=new o.default}var f=function(){function e(e,t){var r=[],a=!0,i=!1,n=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(e){i=!0,n=e}finally{try{!a&&s.return&&s.return()}finally{if(i)throw n}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=p;var m=t.default.RSVP.Promise,y=t.default.get,v=t.default.set,b=t.default.copy,g=t.default.assign||t.default.merge,R=new o.default,_=new o.default,A=0;p.prototype={isEmpty:h("isEmpty"),isLoading:h("isLoading"),isLoaded:h("isLoaded"),hasDirtyAttributes:h("hasDirtyAttributes"),isSaving:h("isSaving"),isDeleted:h("isDeleted"),isNew:h("isNew"),isValid:h("isValid"),dirtyType:h("dirtyType"),constructor:p,materializeRecord:function(){var e={store:this.store,_internalModel:this,id:this.id,currentState:y(this,"currentState"),isError:this.isError,adapterError:this.error};t.default.setOwner?t.default.setOwner(e,(0,d.getOwner)(this.store)):e.container=this.store.container,this.record=this.type._create(e),this._triggerDeferredTriggers()},recordObjectWillDestroy:function(){this.record=null},deleteRecord:function(){this.send("deleteRecord")},save:function(e){var r="DS: Model#save "+this,a=t.default.RSVP.defer(r);return this.store.scheduleSave(this,a,e),a.promise},startedReloading:function(){this.isReloading=!0,this.record&&v(this.record,"isReloading",!0)},finishedReloading:function(){this.isReloading=!1,this.record&&v(this.record,"isReloading",!1)},reload:function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new m(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags").finally(function(){e.finishedReloading(),e.updateRecordArrays()})},getRecord:function(){return this.record||this.materializeRecord(),this.record},unloadRecord:function(){this.send("unloadRecord")},eachRelationship:function(e,t){return this.type.eachRelationship(e,t)},eachAttribute:function(e,t){return this.type.eachAttribute(e,t)},inverseFor:function(e){return this.type.inverseFor(e)},setupData:function(e){var t=this._changedKeys(e.attributes);g(this._data,e.attributes),this.pushedData(),this.record&&this.record._notifyProperties(t),this.didInitalizeData()},becameReady:function(){t.default.run.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)},didInitalizeData:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},destroy:function(){if(this.record)return this.record.destroy()},createSnapshot:function(e){return new n.default(this,e)},loadingData:function(e){this.send("loadingData",e)},loadedData:function(){this.send("loadedData"),this.didInitalizeData()},notFound:function(){this.send("notFound")},pushedData:function(){this.send("pushedData")},flushChangedAttributes:function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default},hasChangedAttributes:function(){return Object.keys(this._attributes).length>0},updateChangedAttributes:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=0,a=t.length;r<a;r++){var i=t[r],n=f(e[i],2),o=n[0],s=n[1];o===s&&delete this._attributes[i]}},changedAttributes:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,a=g(b(r),t),i=new o.default,n=Object.keys(a),s=0,d=n.length;s<d;s++){var l=n[s];i[l]=[e[l],a[l]]}return i},adapterWillCommit:function(){this.send("willCommit")},adapterDidDirty:function(){this.send("becomeDirty"),this.updateRecordArraysLater()},send:function(e,t){var r=y(this,"currentState");return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},notifyHasManyAdded:function(e,t,r){this.record&&this.record.notifyHasManyAdded(e,t,r)},notifyHasManyRemoved:function(e,t,r){this.record&&this.record.notifyHasManyRemoved(e,t,r)},notifyBelongsToChanged:function(e,t){this.record&&this.record.notifyBelongsToChanged(e,t)},notifyPropertyChange:function(e){this.record&&this.record.notifyPropertyChange(e)},rollbackAttributes:function(){var e=Object.keys(this._attributes);this._attributes=new o.default,y(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)},transitionTo:function(e){var t=c(e),r=y(this,"currentState"),a=r;do a.exit&&a.exit(this),a=a.parentState;while(!a.hasOwnProperty(t));var i,n,o=u(e),s=[],d=[];for(i=0,n=o.length;i<n;i++)a=a[o[i]],a.enter&&d.push(a),a.setup&&s.push(a);for(i=0,n=d.length;i<n;i++)d[i].enter(this);for(v(this,"currentState",a),this.record&&v(this.record,"currentState",a),i=0,n=s.length;i<n;i++)s[i].setup(this);this.updateRecordArraysLater()},_unhandledEvent:function(e,r,a){var i="Attempted to handle event `"+r+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==a&&(i+="Called with "+t.default.inspect(a)+"."),new t.default.Error(i)},triggerLater:function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];1===this._deferredTriggers.push(r)&&t.default.run.scheduleOnce("actions",this,"_triggerDeferredTriggers")},_triggerDeferredTriggers:function(){if(this.record){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},clearRelationships:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var a=e._relationships.get(t);a.clear(),a.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},_preloadData:function(e){var t=this;Object.keys(e).forEach(function(r){var a=y(e,r),i=t.type.metaForProperty(r);i.isRelationship?t._preloadRelationship(r,a):t._data[r]=a})},_preloadRelationship:function(e,t){var r=this.type.metaForProperty(e),a=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,a):this._preloadBelongsTo(e,t,a)},_preloadHasMany:function(e,t,r){for(var a=new Array(t.length),i=0;i<t.length;i++){var n=t[i];a[i]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(a)},_preloadBelongsTo:function(e,t,r){var a=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(a)},_convertStringOrNumberIntoInternalModel:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},updateRecordArrays:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.type,this)},setId:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},didError:function(e){this.error=e,this.isError=!0,this.record&&this.record.setProperties({isError:!0,adapterError:e})},didCleanError:function(){this.error=null,this.isError=!1,this.record&&this.record.setProperties({isError:!1,adapterError:null})},adapterDidCommit:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);g(this._data,this._inFlightAttributes),e&&g(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)},updateRecordArraysLater:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,t.default.run.schedule("actions",this,this.updateRecordArrays))},addErrorMessageToAttribute:function(e,t){var r=this.getRecord();y(r,"errors")._add(e,t)},removeErrorMessageFromAttribute:function(e){var t=this.getRecord();y(t,"errors")._remove(e)},clearErrorMessages:function(){var e=this.getRecord();y(e,"errors")._clear()},hasErrors:function(){var e=this.getRecord(),r=y(e,"errors");return!t.default.isEmpty(r)},adapterDidInvalidate:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},adapterDidError:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},_saveWasRejected:function(){for(var e=Object.keys(this._inFlightAttributes),t=0;t<e.length;t++)void 0===this._attributes[e[t]]&&(this._attributes[e[t]]=this._inFlightAttributes[e[t]]);this._inFlightAttributes=new o.default},_changedKeys:function(e){var r=[];if(e){var a,i,n,s,d=Object.keys(e),l=d.length;for(a=g(new o.default,this._data),a=g(a,this._inFlightAttributes),i=0;i<l;i++)s=d[i],n=e[s],void 0===this._attributes[s]&&(t.default.isEqual(a[s],n)||r.push(s))}return r},toString:function(){return this.record?this.record.toString():"<"+this.modelName+":"+this.id+">"}},p.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var a=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,a):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,a)),this.references[t]=r}return r}}),e("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr"],function(e,t,r,a,i,n,o,s,d,l,u){var c=t.default.get,h=t.default.computed("currentState",function(e){return c(this._internalModel.currentState,e)}).readOnly(),p=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:h,isLoading:h,isLoaded:h,hasDirtyAttributes:t.default.computed("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:h,isDeleted:h,isNew:h,isValid:h,dirtyType:h,isError:!1,isReloading:!1,id:null,errors:t.default.computed(function(){var e=i.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this.store.serialize(this,e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:t.default.K,didLoad:t.default.K,didUpdate:t.default.K,didCreate:t.default.K,didDelete:t.default.K,becameInvalid:t.default.K,becameError:t.default.K,rolledBack:t.default.K,data:t.default.computed.readOnly("_internalModel._data"),send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t.default.beginPropertyChanges();for(var r,a=0,i=e.length;a<i;a++)r=e[a],this.notifyPropertyChange(r);t.default.endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return c(this,"id")},save:function(e){var t=this;return a.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return a.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,a=new Array(r-1),i=1;i<r;i++)a[i-1]=arguments[i];t.default.tryInvoke(this,e,a),this._super.apply(this,arguments)},willDestroy:function(){this._super.apply(this,arguments),this._internalModel.clearRelationships(),this._internalModel.recordObjectWillDestroy();
2
- },willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(){},hasMany:function(){},setId:t.default.observer("id",function(){this._internalModel.setId(this.get("id"))})});p.reopenClass({_create:p.create,create:function(){throw new t.default.Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.")},modelName:null}),t.default.setOwner&&Object.defineProperty(p.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),p.reopen({belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)}}),p.reopenClass(l.RelationshipsClassMethodsMixin),p.reopenClass(u.AttrClassMethodsMixin),e.default=p.extend(o.default,s.BelongsToMixin,l.DidDefinePropertyMixin,l.RelationshipsInstanceMethodsMixin,d.HasManyMixin,u.AttrInstanceMethodsMixin)}),e("ember-data/-private/system/model/states",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArraysLater()}function i(e){var t,r={};for(var a in e)t=e[a],t&&"object"==typeof t?r[a]=i(t):r[a]=t;return r}function n(e,t){for(var r in t)e[r]=t[r];return e}function o(e){var t=i(c);return n(t,e)}function s(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function d(e){}function l(e,t,r){e=n(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var a in e)e.hasOwnProperty(a)&&"parentState"!==a&&"stateName"!==a&&"object"==typeof e[a]&&(e[a]=l(e[a],e,r+"."+a));return e}var u=t.default.get,c={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:a,loadingData:t.default.K,propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:t.default.K,willCommit:function(e){e.transitionTo("inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},rolledBack:function(e){e.transitionTo("loaded.saved")},becameInvalid:function(e){e.transitionTo("invalid")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")}},inFlight:{isSaving:!0,didSetProperty:a,becomeDirty:t.default.K,pushedData:t.default.K,unloadRecord:d,willCommit:t.default.K,didCommit:function(e){var t=u(this,"dirtyType");e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",t)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t.default.K,becomeDirty:t.default.K,pushedData:t.default.K,willCommit:function(e){e.clearErrorMessages(),e.transitionTo("inFlight")},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")},invokeLifecycleCallbacks:function(e){e.triggerLater("becameInvalid",e)}}},h=o({dirtyType:"created",isNew:!0});h.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},h.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var p=o({dirtyType:"updated"});h.uncommitted.deleteRecord=s,h.invalid.deleteRecord=s,h.uncommitted.rollback=function(e){c.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},h.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},h.uncommitted.propertyWasReset=t.default.K,p.inFlight.unloadRecord=d,p.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var f={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:t.default.K,unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},propertyWasReset:t.default.K,empty:{isEmpty:!0,loadingData:function(e,t){e._loadingPromise=t,e.transitionTo("loading")},loadedData:function(e){e.transitionTo("loaded.created.uncommitted"),e.triggerLater("ready")},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready")}},loading:{isLoading:!0,exit:function(e){e._loadingPromise=null},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready"),e.didCleanError()},becameError:function(e){e.triggerLater("becameError",e)},notFound:function(e){e.transitionTo("empty")}},loaded:{initialState:"saved",isLoaded:!0,loadingData:t.default.K,saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:a,pushedData:t.default.K,becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},didCommit:function(e){e.send("invokeLifecycleCallbacks",u(e,"lastDirtyType"))},notFound:t.default.K},created:h,updated:p},deleted:{initialState:"uncommitted",dirtyType:"deleted",isDeleted:!0,isLoaded:!0,isDirty:!0,setup:function(e){e.updateRecordArrays()},uncommitted:{willCommit:function(e){e.transitionTo("inFlight")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")},pushedData:t.default.K,becomeDirty:t.default.K,deleteRecord:t.default.K,rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:d,willCommit:t.default.K,didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships();var t=e.store;t._dematerializeRecord(e)},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:t.default.K,didCommit:t.default.K},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t.default.K,becomeDirty:t.default.K,deleteRecord:t.default.K,willCommit:t.default.K,rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")}}},invokeLifecycleCallbacks:function(e,t){"created"===t?e.triggerLater("didCreate",e):e.triggerLater("didUpdate",e),e.triggerLater("didCommit",e)}};f=l(f,null,"root"),e.default=f}),e("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e.default=t}),e("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t.default.String.dasherize(e)}e.default=r}),e("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.default=r;var a=t.default.OrderedSet,i=t.default.guidFor;r.create=function(){var e=this;return new e},r.prototype=Object.create(a.prototype),r.prototype.constructor=r,r.prototype._super$constructor=a,r.prototype.addWithIndex=function(e,t){var r=i(e),a=this.presenceSet,n=this.list;if(a[r]!==!0)return a[r]=!0,void 0===t||null==t?n.push(e):n.splice(t,0,e),this.size+=1,this}}),e("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){return function(){var t=n(this,"content");return t[e].apply(t,arguments)}}var i=t.default.RSVP.Promise,n=t.default.get,o=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),s=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),d=function(e,t){return s.create({promise:i.resolve(e,t)})},l=function(e,t){return o.create({promise:i.resolve(e,t)})},u=o.extend({reload:function(){return u.create({promise:n(this,"content").reload()})},createRecord:a("createRecord"),on:a("on"),one:a("one"),trigger:a("trigger"),off:a("off"),has:a("has")}),c=function(e,t){return u.create({promise:i.resolve(e,t)})};e.PromiseArray=o,e.PromiseObject=s,e.PromiseManyArray=u,e.promiseArray=l,e.promiseObject=d,e.promiseManyArray=c}),e("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e){e.destroy()}function n(e){for(var r=e.length,a=t.default.A(),i=0;i<r;i++)a=a.concat(e[i]);return a}function o(e,t){var r=e.indexOf(t);return r!==-1&&(e.splice(r,1),!0)}var s=t.default.MapWithDefault,d=t.default.get;e.default=t.default.Object.extend({init:function(){var e=this;this.filteredRecordArrays=s.create({defaultValue:function(){return[]}}),this.liveRecordArrays=s.create({defaultValue:function(t){return e.createRecordArray(t)}}),this.changedRecords=[],this._adapterPopulatedRecordArrays=[]},recordDidChange:function(e){1===this.changedRecords.push(e)&&t.default.run.schedule("actions",this,this.updateRecordArrays)},recordArraysForRecord:function(e){return e._recordArrays=e._recordArrays||a.default.create(),e._recordArrays},updateRecordArrays:function(){var e=this;this.changedRecords.forEach(function(t){d(t,"record.isDestroyed")||d(t,"record.isDestroying")||"root.deleted.saved"===d(t,"currentState.stateName")?e._recordWasDeleted(t):e._recordWasChanged(t)}),this.changedRecords.length=0},_recordWasDeleted:function(e){var t=e._recordArrays;t&&(t.forEach(function(t){return t.removeInternalModel(e)}),e._recordArrays=null)},_recordWasChanged:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)})},recordWasLoaded:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);if(i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)}),this.liveRecordArrays.has(a)){var n=this.liveRecordArrays.get(a);this._addRecordToRecordArray(n,e)}},updateFilterRecordArray:function(e,t,r,a){var i=t(a.getRecord()),n=this.recordArraysForRecord(a);i?this._addRecordToRecordArray(e,a):(n.delete(e),e.removeInternalModel(a))},_addRecordToRecordArray:function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e.addInternalModel(t),r.add(e))},populateLiveRecordArray:function(e,t){for(var r,a=this.store.typeMapFor(t),i=a.records,n=0;n<i.length;n++)r=i[n],r.isDeleted()||r.isEmpty()||this._addRecordToRecordArray(e,r)},updateFilter:function(e,t,r){for(var a,i=this.store.typeMapFor(t),n=i.records,o=0;o<n.length;o++)a=n[o],a.isDeleted()||a.isEmpty()||this.updateFilterRecordArray(e,r,t,a)},liveRecordArrayFor:function(e){return this.liveRecordArrays.get(e)},createRecordArray:function(e){var a=r.RecordArray.create({type:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this});return a},createFilteredRecordArray:function(e,a,i){var n=r.FilteredRecordArray.create({query:i,type:e,content:t.default.A(),store:this.store,manager:this,filterFunction:a});return this.registerFilteredRecordArray(n,e,a),n},createAdapterPopulatedRecordArray:function(e,a){var i=r.AdapterPopulatedRecordArray.create({type:e,query:a,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(i),i},registerFilteredRecordArray:function(e,t,r){var a=this.filteredRecordArrays.get(t);a.push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.type,r=this.filteredRecordArrays.get(t),a=o(r,e),i=o(this._adapterPopulatedRecordArrays,e);if(!a&&!i&&this.liveRecordArrays.has(t)){var n=this.liveRecordArrayFor(t);e===n&&this.liveRecordArrays.delete(t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return n(e).forEach(i)}),this.liveRecordArrays.forEach(i),this._adapterPopulatedRecordArrays.forEach(i)}})}),e("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,a){e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=a.default}),e("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null"],function(e,t,r,a){var i=t.default.get;e.default=r.default.extend({query:null,replace:function(){var e=i(this,"type").toString();throw new Error("The result of a server query (on "+e+") is immutable.")},_update:function(){var e=i(this,"store"),t=i(this,"type.modelName"),r=i(this,"query");return e._query(t,r,this)},loadRecords:function(e,r){var i=this,n=t.default.A(e).mapBy("_internalModel");this.setProperties({content:t.default.A(n),isLoaded:!0,isUpdating:!1,meta:(0,a.default)(r.meta)}),n.forEach(function(e){i.manager.recordArraysForRecord(e).add(i)}),t.default.run.once(this,"trigger","didLoad")}})}),e("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){var a=t.default.get;e.default=r.default.extend({filterFunction:null,isLoaded:!0,replace:function(){var e=a(this,"type").toString();throw new Error("The result of a client-side filter (on "+e+") is immutable.")},_updateFilter:function(){var e=a(this,"manager");e.updateFilter(this,a(this,"type"),a(this,"filterFunction"))},updateFilter:t.default.observer("filterFunction",function(){t.default.run.once(this,this._updateFilter)})})}),e("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,a){var i=t.default.get,n=t.default.set;e.default=t.default.ArrayProxy.extend(t.default.Evented,{type:null,content:null,isLoaded:!1,isUpdating:!1,store:null,objectAtContent:function(e){var t=i(this,"content"),r=t.objectAt(e);return r&&r.getRecord()},update:function(){if(!i(this,"isUpdating"))return this.set("isUpdating",!0),this._update()},_update:function(){var e=i(this,"store"),t=i(this,"type.modelName");return e.findAll(t,{reload:!0})},addInternalModel:function(e,t){var r=i(this,"content");void 0===t?r.addObject(e):r.contains(e)||r.insertAt(t,e)},removeInternalModel:function(e){i(this,"content").removeObject(e)},save:function(){var e=this,a="DS: RecordArray#save "+i(this,"type"),n=t.default.RSVP.all(this.invoke("save"),a).then(function(t){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:n})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t._recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){var e=i(this,"manager");e.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),n(this,"content",void 0),this._super.apply(this,arguments)},createSnapshot:function(e){var t=this.get("meta");return new a.default(this,t,e)}})}),e("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,a){e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=a.default}),e("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,a,i){var n=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(a.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=a.default,n.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},n.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},n.prototype.link=function(){return this.belongsToRelationship.link},n.prototype.meta=function(){return this.belongsToRelationship.meta},n.prototype.push=function(e){var a=this;return r.default.RSVP.resolve(e).then(function(e){var r;return r=e instanceof t.default?e:a.store.push(e),a.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},n.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.record?e.record:null},n.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},n.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=n}),e("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,a){var i=t.default.get,n=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(r.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=r.default,n.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},n.prototype.link=function(){return this.hasManyRelationship.link},n.prototype.ids=function(){var e=this.hasManyRelationship.members,t=e.toArray().map(function(e){return e.id});return t},n.prototype.meta=function(){return this.hasManyRelationship.manyArray.meta},n.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){var t=e;"object"==typeof e&&e.data&&(t=e.data);var a=t.map(function(e){var t=r.store.push(e);return t._internalModel});return r.hasManyRelationship.computeChanges(a),r.hasManyRelationship.manyArray})},n.prototype._isLoaded=function(){var e=i(this.hasManyRelationship,"hasData");if(!e)return!1;var t=this.hasManyRelationship.members.toArray(),r=t.every(function(e){return e.isLoaded()===!0});return r},n.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},n.prototype.load=function(){if(!this._isLoaded())return this.hasManyRelationship.getRecords();var e=this.hasManyRelationship.manyArray;return t.default.RSVP.resolve(e)},n.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=n}),e("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){var a=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};a.prototype=Object.create(r.default.prototype),a.prototype.constructor=a,a.prototype._super$constructor=r.default,a.prototype.id=function(){return this._id},a.prototype.remoteType=function(){return"identity"},a.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){var t=r.store.push(e);return t})},a.prototype.value=function(){return this.internalModel.record},a.prototype.load=function(){return this.store.findRecord(this.type,this._id)},a.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=a}),e("ember-data/-private/system/references/reference",["exports"],function(e){var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e.default=t}),e("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function a(e){var a;return a=e.type||e.key,"hasMany"===e.kind&&(a=(0,t.singularize)((0,r.default)(a))),a}function i(e){return{key:e.key,kind:e.kind,type:a(e),options:e.options,parentType:e.parentType,isRelationship:!0}}e.typeForRelationshipMeta=a,e.relationshipFromMeta=i}),e("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,a){function i(e,r){var i,n;"object"==typeof e?(i=e,n=void 0):(i=r,n=e),"string"==typeof n&&(n=(0,a.default)(n)),i=i||{};var o={type:n,isRelationship:!0,options:i,kind:"belongsTo",key:null};return t.default.computed({get:function(e){return i.hasOwnProperty("serialize"),i.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.default=i;var n=t.default.Mixin.create({notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)}});e.BelongsToMixin=n}),e("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta","ember-data/-private/system/empty-object"],function(e,t,r,a,i){var n=t.default.get,o=t.default.Map,s=t.default.MapWithDefault,d=t.default.computed(function(){t.default.testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=new s({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=e.get((0,a.typeForRelationshipMeta)(r));i.push({name:t,kind:r.kind})}}),e}).readOnly(),l=t.default.computed(function(){t.default.testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e,r=t.default.A();return this.eachComputedProperty(function(t,i){i.isRelationship&&(i.key=t,e=(0,a.typeForRelationshipMeta)(i),r.contains(e)||r.push(e))}),r}).readOnly(),u=t.default.computed(function(){t.default.testing===!0&&u._cacheable===!0&&(u._cacheable=!1);var e=o.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=(0,a.relationshipFromMeta)(r);i.type=(0,a.typeForRelationshipMeta)(r),e.set(t,i)}}),e}).readOnly(),c=t.default.Mixin.create({didDefineProperty:function(e,r,a){if(a instanceof t.default.ComputedProperty){var i=a.meta();i.parentType=e.constructor}}});e.DidDefinePropertyMixin=c;var h=t.default.Mixin.create({typeForRelationship:function(e,t){var r=n(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new i.default}),inverseFor:function(e,t){var r=n(this,"inverseMap");if(r[e])return r[e];var a=this._findInverseFor(e,t);return r[e]=a,a},_findInverseFor:function(e,r){function a(t,r,i){var o=i||[],s=n(r,"relationships");if(!s)return o;var d=s.get(t.modelName);return d=d.filter(function(t){var a=r.metaForProperty(t.name).options;return!a.inverse||e===a.inverse}),d&&o.push.apply(o,d),t.superclass&&a(t.superclass,r,o),o}var i=this.typeForRelationship(e,r);if(!i)return null;var o=this.metaForProperty(e),s=o.options;if(null===s.inverse)return null;var d,l,u;if(s.inverse)d=s.inverse,u=t.default.get(i,"relationshipsByName").get(d),l=u.kind;else{o.type===o.parentType.modelName;var c=a(this,i);if(0===c.length)return null;var h=c.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===h.length&&(c=h),d=c[0].name,l=c[0].kind}return{type:i,name:d,kind:l}},relationships:d,relationshipNames:t.default.computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:l,relationshipsByName:u,fields:t.default.computed(function(){var e=o.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){n(this,"relationshipsByName").forEach(function(r,a){e.call(t,a,r)})},eachRelatedType:function(e,t){for(var r=n(this,"relatedTypes"),a=0;a<r.length;a++){var i=r[a];e.call(t,i)}},determineRelationshipType:function(e,t){var r=e.key,a=e.kind,i=this.inverseFor(r,t),n=void 0,o=void 0;return i?(n=i.name,o=i.kind,"belongsTo"===o?"belongsTo"===a?"oneToOne":"manyToOne":"belongsTo"===a?"oneToMany":"manyToMany"):"belongsTo"===a?"oneToNone":"manyToNone"}});e.RelationshipsClassMethodsMixin=h;var p=t.default.Mixin.create({eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return n(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)}});e.RelationshipsInstanceMethodsMixin=p}),e("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,a,i){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,a.default)(e));var i={type:e,isRelationship:!0,options:r,kind:"hasMany",key:null};return t.default.computed({get:function(e){var t=this._internalModel._relationships.get(e);return t.getRecords()},set:function(e,r){var a=this._internalModel._relationships.get(e);return a.clear(),a.addRecords(t.default.A(r).mapBy("_internalModel")),a.getRecords()}}).meta(i)}e.default=n;var o=t.default.Mixin.create({notifyHasManyAdded:function(e){this.notifyPropertyChange(e)}});e.HasManyMixin=o}),e("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i){function n(e,t,r,a){this._super$constructor(e,t,r,a),this.record=t,this.key=a.key,this.inverseRecord=null,this.canonicalState=null}e.default=n,n.prototype=Object.create(i.default.prototype),n.prototype.constructor=n,n.prototype._super$constructor=i.default,n.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype._super$addCanonicalRecord=i.default.prototype.addCanonicalRecord,n.prototype.addCanonicalRecord=function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,this._super$addCanonicalRecord(e))},n.prototype._super$flushCanonical=i.default.prototype.flushCanonical,n.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord=this.canonicalState,this.record.notifyBelongsToChanged(this.key),this._super$flushCanonical())},n.prototype._super$addRecord=i.default.prototype.addRecord,n.prototype.addRecord=function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,this._super$addRecord(e),this.record.notifyBelongsToChanged(this.key))},n.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},n.prototype._super$removeRecordFromOwn=i.default.prototype.removeRecordFromOwn,n.prototype.removeRecordFromOwn=function(e){this.members.has(e)&&(this.inverseRecord=null,this._super$removeRecordFromOwn(e),this.record.notifyBelongsToChanged(this.key))},n.prototype._super$removeCanonicalRecordFromOwn=i.default.prototype.removeCanonicalRecordFromOwn,n.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,this._super$removeCanonicalRecordFromOwn(e))},n.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)},n.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.record,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},n.prototype.getRecord=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),a.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.record?this.inverseRecord.record.reload():this.findRecord()}}),e("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,a,i){function n(e,t,i){var n,o=e.type.inverseFor(t.key,i);return o&&(n=o.name),"hasMany"===t.kind?new r.default(i,e,n,t):new a.default(i,e,n,t)}function o(e){this.record=e,this.initializedRelationships=new i.default}e.default=o;var s=t.default.get;o.prototype.has=function(e){return!!this.initializedRelationships[e]},o.prototype.get=function(e){var t=this.initializedRelationships,r=s(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=n(this.record,r.get(e),this.record.store)),t[e]}}),e("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,a,i,n){function o(e,t,r,a){this._super$constructor(e,t,r,a),this.belongsToType=a.type,this.canonicalState=[],this.manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:t}),this.isPolymorphic=a.options.polymorphic,this.manyArray.isPolymorphic=this.isPolymorphic}function s(e){var t=new i.default;if(e)for(var r=0,a=e.length;r<a;r++)t.add(e[r]);return t}e.default=o,o.prototype=Object.create(a.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=a.default,o.prototype.destroy=function(){this.manyArray.destroy()},o.prototype._super$updateMeta=a.default.prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this.manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=a.default.prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=a.default.prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.manyArray.internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=a.default.prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=a.default.prototype.flushCanonical,o.prototype.flushCanonical=function(){this.manyArray.flushCanonical(),this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=a.default.prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){this.members.has(e)&&(this._super$removeRecordFromOwn(e,t),void 0!==t?this.manyArray.currentState.removeAt(t):this.manyArray.internalRemoveRecords([e]))},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this,t=this.manyArray.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;
3
- this._loadingPromise.get("isRejected")&&this.manyArray.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store.scheduleFetchMany(this.manyArray.toArray()).then(function(){return e.manyArray}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,a,i=this.canonicalMembers,n=[];for(e=s(e),i.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,a=0;a<t;a++)r=e[a],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,a)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},o.prototype.findRecords=function(){for(var e=this,t=this.manyArray.toArray(),r=new Array(t.length),a=0;a<t.length;a++)r[a]=t[a]._internalModel;return this.store.findMany(r).then(function(){return e.manyArray.get("isDestroyed")||e.manyArray.set("isLoaded",!0),e.manyArray})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:this.manyArray,promise:t}),this._loadingPromise}return this.manyArray.get("isDestroyed")||this.manyArray.set("isLoaded",!0),this.manyArray}}),e("ember-data/-private/system/relationships/state/relationship",["exports","ember","ember-data/-private/debug","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e,t,r,i){var n=i.options.async;this.members=new a.default,this.canonicalMembers=new a.default,this.store=e,this.key=i.key,this.inverseKey=r,this.record=t,this.isAsync="undefined"==typeof n||n,this.relationshipMeta=i,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e.default=i,i.prototype={constructor:i,destroy:t.default.K,updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){e!==this.link&&(this.link=e,this.linkPromise=null,this.setHasLoaded(!1),this.record.notifyPropertyChange(this.key))},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e),this.setHasData(!0),this.setHasLoaded(!0)},notifyRecordRelationshipAdded:t.default.K,notifyRecordRelationshipRemoved:t.default.K,setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e}}}),e("ember-data/-private/system/snapshot-record-array",["exports","ember-data/-private/features"],function(e,t){function r(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.default=r,r.prototype.snapshots=function(){if(this._snapshots)return this._snapshots;var e=this._recordArray;return this._snapshots=e.invoke("createSnapshot"),this._snapshots}}),e("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,a){function i(e){var t=this,a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default;var i=e.getRecord();this.record=i,i.eachAttribute(function(e){return t._attributes[e]=n(i,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=a.adapterOptions,this.include=a.include,this._changedAttributes=i.changedAttributes()}e.default=i;var n=t.default.get;i.prototype={constructor:i,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t.default.copy(this._attributes)},changedAttributes:function(){for(var e=new r.default,a=Object.keys(this._changedAttributes),i=0,n=a.length;i<n;i++){var o=a[i];e[o]=t.default.copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var a,i,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"belongsTo"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=n(a,"hasData"),i=n(a,"inverseRecord"),o&&(s=i&&!i.isDeleted()?d?n(i,"id"):i.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var a,i,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"hasMany"!==a.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=n(a,"hasData"),i=n(a,"members"),o&&(s=[],i.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),e("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-link","ember-data/-private/system/normalize-model-name","ember-data/-private/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function g(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function R(e,t,r,a){if(!O(a))return e._internalModelForId(a.type,a.id)}function _(e,t,r,a){if(!O(a)){for(var i=new Array(a.length),n=0;n<a.length;n++)i[n]=R(e,t,r,a[n]);return i}}function A(e){return e.serializerFor("application")}function F(e,t,r,a){var i=a._internalModel,n=a.modelName,s=t.modelFor(n),c=e[r](t,s,a),h=(0,u.serializerForAdapter)(t,e,n),p="DS: Extract and notify about "+r+" completion of "+i;return c=C.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,i)),c.then(function(e){return t._adapterRun(function(){var n,o;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,a.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(i,{data:o})}),i},function(e){if(e instanceof o.InvalidError){var r=h.extractErrors(t,s,e,a.id);t.recordWasInvalid(i,r)}else t.recordWasError(i,e);throw e},p)}function z(e,t,r){r.relationships&&t.type.eachRelationship(function(a,n){var o=n.kind;if(r.relationships[a]){var s;if(r.relationships[a].links&&r.relationships[a].links.related){var d=(0,i.default)(r.relationships[a].links.related);d&&d.href&&(s=t._relationships.get(a),s.updateLink(d.href))}r.relationships[a].meta&&(s=t._relationships.get(a),s.updateMeta(r.relationships[a].meta)),M(e,a,n,r.relationships[a]);var l=r.relationships[a].data;void 0!==l&&("belongsTo"===o?(s=t._relationships.get(a),s.setCanonicalRecord(l)):"hasMany"===o&&(s=t._relationships.get(a),s.updateRecordsFromAdapter(l)))}})}function M(e,t,r,a){var i=a.data;if(i){var n=r.kind;"belongsTo"===n?a.data=R(e,t,r,i):"hasMany"===n&&(a.data=_(e,t,r,i))}}var S="`id` has to be non-empty string or number";e.badIdFormatAssertion=S;var T,x=t.default._Backburner,k=t.default.Map,w=Array.isArray||t.default.isArray,E=t.default.get,P=t.default.set,D=t.default.run.once,O=t.default.isNone,C=(t.default.isPresent,t.default.RSVP.Promise),I=t.default.copy,j=t.default.Service;e.Store=T=j.extend({init:function(){this._super.apply(this,arguments),this._backburner=new x(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f.default.create({store:this}),this._pendingSave=[],this._instanceCache=new m.default((0,h.getOwner)(this)),this._pendingFetch=k.create()},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:t.default.computed("adapter",function(){var e=E(this,"adapter");return e=this.retrieveManagedInstance("adapter",e)}),createRecord:function(e,t){var r=this.modelFor(e),a=I(t)||new v.default;O(a.id)&&(a.id=this._generateId(e,a)),a.id=(0,p.default)(a.id);var i=this.buildInternalModel(r,a.id),n=i.getRecord();return i.loadedData(),n.setProperties(a),i.eachRelationship(function(e,t){i._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,r,a){return 1===arguments.length,"object"===t.default.typeOf(r),this.findRecord(e,r)},findRecord:function(e,t,r){var a=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(a,r);var i=this._findRecord(a,r);return g(i,"DS: Store#findRecord "+a.typeKey+" with id: "+E(a,"id"))},_findRecord:function(e,t){if(t.reload)return this.scheduleFetch(e,t);var r=e.createSnapshot(t),a=e.type,i=this.adapterFor(a.modelName);return i.shouldReloadRecord(this,r)?this.scheduleFetch(e,t):(i.shouldBackgroundReloadRecord(this,r)&&this.scheduleFetch(e,t),C.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e._preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return g(r,"DS: Store#findRecord "+e.typeKey+" with id: "+E(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this.scheduleFetch(e,t):e.isLoading()?e._loadingPromise:C.resolve(e)},findByIds:function(e,r){for(var a=new Array(r.length),i=0;i<r.length;i++)a[i]=this.findRecord(e,r[i]);return(0,s.promiseArray)(t.default.RSVP.all(a).then(t.default.A,null,"DS: Store#findByIds of "+e+" complete"))},fetchRecord:function(e,t){var r=e.type,a=e.id,i=this.adapterFor(r.modelName),n=(0,c._find)(i,this,r,a,e,t);return n},scheduleFetchMany:function(e){for(var r=new Array(e.length),a=new Array(e.length),i=0;i<e.length;i++)r[i]=e[i]._internalModel;for(var i=0;i<r.length;i++)a[i]=this.scheduleFetch(r[i]);return t.default.RSVP.Promise.all(a)},scheduleFetch:function(e,r){var a=e.type;if(e._loadingPromise)return e._loadingPromise;var i=t.default.RSVP.defer("Fetching "+a+"with id: "+e.id),n={record:e,resolver:i,options:r},o=i.promise;return e.loadingData(o),this._pendingFetch.get(a)?this._pendingFetch.get(a).push(n):this._pendingFetch.set(a,[n]),t.default.run.scheduleOnce("afterRender",this,this.flushAllPendingFetches),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch=k.create())},_flushPendingFetchForType:function(e,r){function a(e){e.resolver.resolve(d.fetchRecord(e.record,e.options))}function i(r){return r.forEach(function(r){var a=t.default.A(e).findBy("record",r);if(a){var i=a.resolver;i.resolve(r)}}),r}function n(e){return function(r){r=t.default.A(r);var a=e.reject(function(e){return r.contains(e)});a.length,s(a)}}function o(e){return function(t){s(e,t)}}function s(r,a){r.forEach(function(r){var i=t.default.A(e).findBy("record",r);if(i){var n=i.resolver;n.reject(a)}})}var d=this,l=d.adapterFor(r.modelName),u=!!l.findMany&&l.coalesceFindRequests,h=t.default.A(e).mapBy("record");if(1===e.length)a(e[0]);else if(u){var p=t.default.A(h).invoke("createSnapshot"),f=l.groupRecordsForFindMany(this,p);f.forEach(function(s){var u=t.default.A(s).mapBy("_internalModel"),h=t.default.A(u),p=h.mapBy("id");if(p.length>1)(0,c._findMany)(l,d,r,p,h).then(i).then(n(h)).then(null,o(h));else if(1===p.length){var f=t.default.A(e).findBy("record",u[0]);a(f)}})}else e.forEach(a)},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this.scheduleFetch(e)},hasRecordForId:function(e,t){var r=this.modelFor(e),a=(0,p.default)(t),i=this.typeMapFor(r).idToRecord[a];return!!i&&i.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),a=(0,p.default)(t),i=this.typeMapFor(r).idToRecord,n=i[a];return n&&i[a]||(n=this.buildInternalModel(r,a)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return C.all(t)},findHasMany:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findHasMany)(a,this,e,t,r)},findBelongsTo:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findBelongsTo)(a,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var a=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(a,t);var i=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(i,this,a,t,r))},queryRecord:function(e,t){var r=this.modelFor(e),a=this.adapterFor(e);return(0,s.promiseObject)((0,c._queryRecord)(a,this,r,t))},findAll:function(e,t){var r=this.modelFor(e);return this._fetchAll(r,this.peekAll(e),t)},_fetchAll:function(e,t,r){r=r||{};var a=this.adapterFor(e.modelName),i=this.typeMapFor(e).metadata.since;if(P(t,"isUpdating",!0),r.reload)return(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r));var n=t.createSnapshot(r);return a.shouldReloadAll(this,n)?(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r)):(a.shouldBackgroundReloadAll(this,n)&&(0,c._findAll)(a,this,e,i,r),(0,s.promiseArray)(C.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);P(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.populateLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),a=new Array(r.length),i=0;i<r.length;i++)a[i]=t[r[i]].type.modelName;a.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,i=0;i<s.length;i++)d=s[i],d.unloadRecord(),d.destroy();o.metadata=new v.default}},filter:function(e,r,a){!t.default.ENV.ENABLE_DS_FILTER;var i,n,o=arguments.length,d=3===o;return d?i=this.query(e,r):2===arguments.length&&(a=r),e=this.modelFor(e),n=d?this.recordArrayManager.createFilteredRecordArray(e,a,r):this.recordArrayManager.createFilteredRecordArray(e,a),i=i||C.resolve(n),(0,s.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var a=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:a,resolver:t}),D(this,"flushPendingSave")},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r,a=t.snapshot,i=t.resolver,n=a._internalModel,o=e.adapterFor(n.type.modelName);return"root.deleted.saved"===E(n,"currentState.stateName")?i.resolve():(r=n.isNew()?"createRecord":n.isDeleted()?"deleteRecord":"updateRecord",void i.resolve(F(o,e,r,a)))})},didSaveRecord:function(e,t){var r;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,"_setupRelationships",e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=(e.id,(0,p.default)(t.id));this.typeMapFor(e.type).idToRecord[r]=e,e.setId(r)},typeMapFor:function(e){var r=E(this,"typeMaps"),a=t.default.guidFor(e),i=r[a];return i?i:(i={idToRecord:new v.default,records:[],metadata:new v.default,type:e},r[a]=i,i)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,n.default)(e),a=(0,h.getOwner)(this),i=a._lookupFactory("mixin:"+t);i&&a.register("model:"+t,r.default.extend(i));var o=this.modelFactoryFor(t);return o&&(o.__isMixin=!0,o.__mixin=i),o},modelFor:function(e){var r=this.modelFactoryFor(e);if(r||(r=this._modelForMixin(e)),!r)throw new t.default.Error("No model was found for '"+e+"'");return r.modelName=r.modelName||(0,n.default)(e),r},modelFactoryFor:function(e){var t=(0,n.default)(e),r=(0,h.getOwner)(this);return r._lookupFactory("model:"+t)},push:function(e){var t,r,a=e.included;if(a)for(t=0,r=a.length;t<r;t++)this._pushInternalModel(a[t]);if(w(e.data)){r=e.data.length;var i=new Array(r);for(t=0;t<r;t++)i[t]=this._pushInternalModel(e.data[t]).getRecord();return i}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n.getRecord()},_hasModelFor:function(e){return!!(0,h.getOwner)(this)._lookupFactory("model:"+e)},_pushInternalModel:function(e){var r=this,a=e.type;this.modelFor(a);t.default.ENV.DS_WARN_ON_UNKNOWN_KEYS;var i=this._load(e);return this._backburner.join(function(){r._backburner.schedule("normalizeRelationships",r,"_setupRelationships",i,e)}),i},_setupRelationships:function(e,t){z(this,e,t)},pushPayload:function(e,t){var r,a,i=this;t?(a=t,r=this.serializerFor(e)):(a=e,r=A(this)),this._adapterRun(function(){return r.pushPayload(i,a)})},normalize:function(e,t){var r=this.serializerFor(e),a=this.modelFor(e);return r.normalize(a,t)},buildInternalModel:function(e,t,r){var a=this.typeMapFor(e),i=a.idToRecord,n=new y.default(e,t,this,null,r);return t&&(i[t]=n),a.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),a=e.id;e.updateRecordArrays(),a&&delete r.idToRecord[a];var i=r.records.indexOf(e);r.records.splice(i,1)},adapterFor:function(e){return this.lookupAdapter(e)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=["application",this.adapterFor(e).get("defaultSerializer"),"-default"],r=this.lookupSerializer(e,t);return r},retrieveManagedInstance:function(e,t,r){var a=(0,n.default)(t),i=this._instanceCache.get(e,a,r);return P(i,"store",this),i},lookupAdapter:function(e){return this.retrieveManagedInstance("adapter",e,this.get("_adapterFallbacks"))},_adapterFallbacks:t.default.computed("adapter",function(){var e=this.get("adapter");return["application",e,"-json-api"]}),lookupSerializer:function(e,t){return this.retrieveManagedInstance("serializer",e,t)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this.unloadAll()}}),T.reopen({getReference:function(e,t){return this._internalModelForId(e,t).recordReference}}),e.Store=T,e.default=T}),e("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function a(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function i(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=a,e._objectIsAlive=i;var n=t.default.get}),e("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function a(e){this._owner=e,this._cache=new r.default}e.default=a;var i=t.default.assign||t.default.merge;a.prototype=new r.default,i(a.prototype,{get:function(e,t,r){var a=this._cache,i=e+":"+t;if(!(i in a)){var n=this.instanceFor(i)||this._findInstance(e,r);n&&(a[i]=n)}return a[i]},_findInstance:function(e,t){for(var r=0,a=t.length;r<a;r++){var i=t[r],n=e+":"+i,o=this.instanceFor(n);if(o)return o}},instanceFor:function(e){var t=this._cache;if(!t[e]){var r=this._owner.lookup(e);r&&(t[e]=r)}return t[e]},destroy:function(){for(var e=this._cache,t=Object.keys(e),r=0,a=t.length;r<a;r++){var i=t[r],n=e[i];n&&n.destroy()}this._owner=null},constructor:a,toString:function(){return"ContainerInstanceCache"}})}),e("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,a,i,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t.push(a);return n._internalModel})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){for(var t=(0,i.normalizeResponseHelper)(c,r,o,e,null,"findMany"),a=r.push(t),n=new Array(a.length),s=0;s<a.length;s++)n[s]=a[s]._internalModel;return n})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),a=t.push(r),n=a.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var a=t.push(r);return a._internalModel})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l.createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),f="DS: Handle Adapter#findAll of "+r;return c=p.resolve(c,f),c=(0,a._guard)(c,(0,a._bind)(a._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(h,t,r,e,null,"findAll");t.push(a)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=p.resolve(l,c),l=(0,a._guard)(l,(0,a._bind)(a._objectIsAlive,t)),l.then(function(e){var a,n;return t._adapterRun(function(){n=(0,i.normalizeResponseHelper)(u,t,r,e,null,"query"),a=t.push(n)}),s.loadRecords(a,n),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,a._guard)(d,(0,a._bind)(a._objectIsAlive,t)),d.then(function(e){var a;return t._adapterRun(function(){var n=(0,i.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");a=t.push(n)}),a},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t.default.RSVP.Promise}),e("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){var r=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&r.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):r.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||t.default.isArray(e.data)||"object"==typeof e.data||r.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&r.push("meta must be an object"),"errors"in e&&(t.default.isArray(e.errors)||r.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&r.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&r.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&r.push("included must be an array")):r.push("Top level of a JSON API document must be an object"),r}function i(e,t,r,a,i,n){var o=e.normalizeResponse(t,r,a,i,n);return o}e.validateDocumentStructure=a,e.normalizeResponseHelper=i}),e("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var a=t.serializer;return void 0===a&&(a=e.serializerFor(r)),null!==a&&void 0!==a||(a={extract:function(e,t,r){return r}}),a}e.serializerForAdapter=t}),e("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,a,i,n){e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=a.default,e.StringTransform=i.default,e.BooleanTransform=n.default}),e("ember-data/-private/transforms/boolean",["exports","ember-data/transform"],function(e,t){e.default=t.default.extend({deserialize:function(e){var t=typeof e;return"boolean"===t?e:"string"===t?null!==e.match(/^true$|^t$|^1$/i):"number"===t&&1===e},serialize:function(e){return Boolean(e)}})}),e("ember-data/-private/transforms/date",["exports","ember","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r,a){e.default=a.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date(t.default.Date.parse(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date?e.toISOString():null}})}),e("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function a(e){return e===e&&e!==1/0&&e!==-(1/0)}var i=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)},serialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)}})}),e("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var a=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return a(e)?null:String(e)},serialize:function(e){return a(e)?null:String(e)}})}),e("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return i(e,"attributes").has("type")||i(e,"relationshipsByName").has("type")}function a(e){var r;return t.default.getOwner&&(r=t.default.getOwner(e)),!r&&e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}var i=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=a}),e("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function a(e){var a=new t.default;if(!e)return a;var n=e.split(i);return n.forEach(function(e){var t=e.split(":"),i=r(t),n=i[0],o=i.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(a[n]=o)}),a}e.default=a;var i="\r\n"}),e("ember-data/adapter",["exports","ember"],function(e,t){var r=t.default.get;e.default=t.default.Object.extend({
4
- defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return r(e.record,"store").serializerFor(e.modelName).serialize(e,t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),e("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest"],function(e,t,r){e.default=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var a=this._super.apply(this,arguments);a.contentType&&(a.contentType="application/vnd.api+json");var i=a.beforeSend;return a.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),i&&i(e)},a},coalesceFindRequests:!1,findMany:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(i,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName);i.serializeIntoHash(a,t,r,{includeId:!0});var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PATCH",{data:a})}})}),e("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/-private/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/utils/parse-response-headers"],function(e,t,r,a,i,n,o){function s(e,t){return"function"!=typeof String.prototype.endsWith?e.indexOf(t,e.length-t.length)!==-1:e.endsWith(t)}var d=t.default.MapWithDefault,l=t.default.get;e.default=r.default.extend(i.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var a={},i=t.sort(),n=0;n<r;n++)a[i[n]]=e[i[n]];return a},coalesceFindRequests:!1,findRecord:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findRecord"),n=this.buildQuery(a);return this.ajax(i,"GET",{data:n})},findAll:function(e,t,r,a){var i=this.buildURL(t.modelName,null,a,"findAll"),n=this.buildQuery(a);return this.ajax(i,"GET",{data:n})},query:function(e,t,r){var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(i,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,a){var i=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,i,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,a){var i=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,i,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName),n=this.buildURL(t.modelName,null,r,"createRecord");return i.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(n,"POST",{data:a})},updateRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName);i.serializeIntoHash(a,t,r);var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PUT",{data:a})},deleteRecord:function(e,t,r){var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),a=r.split("/"),i=a[a.length-1],n=t.id;return i===n?a[a.length-1]="":s(i,"?id="+n)&&(a[a.length-1]=i.substring(0,i.length-n.length-1)),a.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,a){var n=i._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+a;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var i=s.length-1;s[i].push(e)}),s}var a=d.create({defaultValue:function(){return[]}}),i=this,n=this.maxURLLength;t.forEach(function(t){var r=i._stripIDFromURL(e,t);a.get(r).push(t)});var o=[];return a.forEach(function(e,t){var a="&ids%5B%5D=".length,i=r(e,n,a);i.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,i){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new a.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,i);return new a.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var n=this,s={url:e,method:r};return new t.default.RSVP.Promise(function(d,l){var u=n.ajaxOptions(e,r,i);u.success=function(e,r,a){var i=n.handleResponse(a.status,(0,o.default)(a.getAllResponseHeaders()),e,s);i&&i.isAdapterError?t.default.run.join(null,l,i):t.default.run.join(null,d,i)},u.error=function(e,r,i){var d=void 0;d=i instanceof Error?i:"timeout"===r?new a.TimeoutError:"abort"===r?new a.AbortError:n.handleResponse(e.status,(0,o.default)(e.getAllResponseHeaders()),n.parseErrorResponse(e.responseText)||i,s),t.default.run.join(null,l,d)},n._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var a=r||{};a.url=e,a.type=t,a.dataType="json",a.context=this,a.data&&"GET"!==t&&(a.contentType="application/json; charset=utf-8",a.data=JSON.stringify(a.data));var i=l(this,"headers");return void 0!==i&&(a.beforeSend=function(e){Object.keys(i).forEach(function(t){return e.setRequestHeader(t,i[t])})}),a},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,a){var i,n=t["Content-Type"]||"Empty Content-Type";i="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=a.method+" "+a.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,i].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t}})}),e("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var a=t.defaultValue;return a}function i(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return i(t,e)?n(t,e):a(this,r,e)},set:function(e,t){var r=this._internalModel,a=n(r,e);return t!==a&&(r._attributes[e]=t,this._internalModel.send("didSetProperty",{name:e,oldValue:a,originalValue:r._data[e],value:t})),t}}).meta(o)}e.default=o}),e("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/-private/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/container-proxy","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b,g,R,_,A,F,z,M,S,T,x){if(t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");t.default.VERSION.match(/^1\.13\./),a.default.Store=s.Store,a.default.PromiseArray=o.PromiseArray,a.default.PromiseObject=o.PromiseObject,a.default.PromiseManyArray=o.PromiseManyArray,a.default.Model=l.default,a.default.RootState=d.RootState,a.default.attr=d.attr,a.default.Errors=d.Errors,a.default.InternalModel=n.default,a.default.Snapshot=u.default,a.default.Adapter=c.default,a.default.AdapterError=f.AdapterError,a.default.InvalidError=f.InvalidError,a.default.TimeoutError=f.TimeoutError,a.default.AbortError=f.AbortError,a.default.errorsHashToArray=f.errorsHashToArray,a.default.errorsArrayToHash=f.errorsArrayToHash,a.default.Serializer=h.default,a.default.DebugAdapter=p.default,a.default.RecordArray=m.RecordArray,a.default.FilteredRecordArray=m.FilteredRecordArray,a.default.AdapterPopulatedRecordArray=m.AdapterPopulatedRecordArray,a.default.ManyArray=y.default,a.default.RecordArrayManager=v.default,a.default.RESTAdapter=b.RESTAdapter,a.default.BuildURLMixin=g.default,a.default.RESTSerializer=R.RESTSerializer,a.default.JSONSerializer=R.JSONSerializer,a.default.JSONAPIAdapter=b.JSONAPIAdapter,a.default.JSONAPISerializer=R.JSONAPISerializer,a.default.Transform=F.Transform,a.default.DateTransform=F.DateTransform,a.default.StringTransform=F.StringTransform,a.default.NumberTransform=F.NumberTransform,a.default.BooleanTransform=F.BooleanTransform,a.default.EmbeddedRecordsMixin=A.default,a.default.belongsTo=z.belongsTo,a.default.hasMany=z.hasMany,a.default.Relationship=x.default,a.default.ContainerProxy=T.default,a.default._setupContainer=M.default,a.default._initializeStoreService=S.default,Object.defineProperty(a.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:i.default}),t.default.lookup.DS=a.default,e.default=a.default}),e("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.default=t.default}),e("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t.default,e.hasMany=r.default}),e("ember-data/serializer",["exports","ember"],function(e,t){e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),e("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var i=t.default.get,n=t.default.set,o=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var a=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,a)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);var i,n=this.hasSerializeIdsOption(a),o=this.hasSerializeRecordsOption(a),s=e.belongsTo(a);n?(i=this.keyForRelationship(a,r.kind,"serialize"),s?(t[i]=s.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null):o&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var a=e.belongsTo(r.key),i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),a?(t[i]=a.record.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,a,r,t[i]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null},serializeHasMany:function(e,t,r){var a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);var i=this.hasSerializeIdsOption(a),n=this.hasSerializeRecordsOption(a);if(i){var o=this.keyForRelationship(a,r.kind,"serialize");t[o]=e.hasMany(a,{ids:!0})}else n&&this._serializeEmbeddedHasMany(e,t,r)},_serializeEmbeddedHasMany:function(e,t,r){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var a=e.hasMany(r.key),i=t.default.A(a),n=new Array(i.length),o=0;o<i.length;o++){var s=i[o],d=s.record.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,a){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var i=e.type.inverseFor(r.key,this.store);if(i){var n=i.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,i.kind,"deserialize");s&&delete a[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[o(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,a){var i=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&i._extractEmbeddedHasMany(t,r,a,n),"belongsTo"===n.kind&&i._extractEmbeddedBelongsTo(t,r,a,n))}),a},_extractEmbeddedHasMany:function(e,t,r,o){var s=i(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,o,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,a(p))}d[l]={id:h.id,type:h.type}}var m={data:d};n(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=i(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,o,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,a(u))}var h={id:l.id,type:l.type},p={data:h};n(r,"data.relationships."+t,p)}},_normalizeEmbeddedRelationship:function(e,t,r){var a=t.type;t.options.polymorphic&&(a=r.type);var i=e.modelFor(a),n=e.serializerFor(a);return n.normalize(i,r,null)}})}),e("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,a,i,n,o){var s=t.default.String.dasherize,d=a.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeResourceHelper(i)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),a=0;a<e.included.length;a++){var n=e.included[a];r[a]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);if(!this.store._hasModelFor(t))return null;var r=this.store.modelFor(t),a=this.store.serializerFor(t),i=a.normalize(r,e),n=i.data;return n},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,a,i,n){var o=this._normalizeDocumentHelper(r);return o},extractAttributes:function(e,t){var r=this,a={};return t.attributes&&e.eachAttribute(function(e){var i=r.keyForAttribute(e,"deserialize");t.attributes.hasOwnProperty(i)&&(a[e]=t.attributes[i])}),a},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeRelationshipDataHelper(i)}e.data=r}return e},extractRelationships:function(e,t){var r=this,a={};return t.relationships&&e.eachRelationship(function(e,i){var n=r.keyForRelationship(e,i.kind,"deserialize");if(t.relationships.hasOwnProperty(n)){var o=t.relationships[n];a[e]=r.extractRelationship(o)}}),a},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i.default)(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments);return r.type=this.payloadKeyFromModelName(e.modelName),{data:r}},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a);if(void 0!==i){t.relationships=t.relationships||{};var n=this._getMappedKey(a,e.type);n===a&&(n=this.keyForRelationship(a,"belongsTo","serialize"));var o=null;i&&(o={type:this.payloadKeyFromModelName(i.modelName),id:i.id}),t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var a=r.key;if(this._shouldSerializeHasMany(e,a,r)){var i=e.hasMany(a);if(void 0!==i){t.relationships=t.relationships||{};var n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"hasMany","serialize"));for(var o=new Array(i.length),s=0;s<i.length;s++){var d=i[s];o[s]={type:this.payloadKeyFromModelName(d.modelName),id:d.id}}t.relationships[n]={data:o}}}}});e.default=d}),e("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/adapters/errors","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge;e.default=a.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,a=void 0;return a=u(e,"attributes"),e.eachTransformedAttribute(function(e,i){if(t.hasOwnProperty(e)){var n=r.transformFor(i),o=a.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,a,i){switch(i){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!0)},normalizeArrayResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!1)},_normalizeResponse:function(e,t,r,a,i,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var m=r[p],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[p]=u}o.data=h}return o},normalize:function(e,r){var a=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),a={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,a.attributes)),{data:a}},extractId:function(e,t){var r=u(this,"primaryKey"),a=t[r];return(0,i.default)(a)},extractAttributes:function(e,t){var r,a=this,i={};return e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),t.hasOwnProperty(r)&&(i[e]=t[r])}),i},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,i.default)(r.id));var a=this.store.modelFor(e);return r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(a)&&(r.type=this.modelNameFromPayloadKey(r.type)),r}return{id:(0,i.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var a=this,i={};return e.eachRelationship(function(e,n){var o=null,s=a.keyForRelationship(e,n.kind,"deserialize");if(r.hasOwnProperty(s)){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?a.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):a.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=a.extractRelationship(n.type,h)}}o={data:d}}var p=a.keyForLink(e,n.kind);if(r.links&&r.links.hasOwnProperty(p)){var f=r.links[p];o=o||{},o.links={related:f}}o&&(i[e]=o)}),i},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeAttributes:function(e,t){var r,a=this;this.keyForAttribute&&e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeRelationships:function(e,t){var r,a=this;this.keyForRelationship&&e.eachRelationship(function(e,i){r=a.keyForRelationship(e,i.kind,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,a,i,n=u(this,"attrs");if(n)for(i in n)r=a=this._getMappedKey(i,e),t.hasOwnProperty(a)&&(u(e,"attributes").has(i)&&(r=this.keyForAttribute(i)),u(e,"relationshipsByName").has(i)&&(r=this.keyForRelationship(i)),a!==r&&(t[r]=t[a],delete t[a]))},_getMappedKey:function(e,t){var r,a=u(this,"attrs");return a&&a[e]&&(r=a[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},_shouldSerializeHasMany:function(e,t,r){var a=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===a||"manyToMany"===a)},serialize:function(e,t){var r=this,a={};if(t&&t.includeId){var i=e.id;i&&(a[u(this,"primaryKey")]=i)}return e.eachAttribute(function(t,i){r.serializeAttribute(e,a,t,i)}),e.eachRelationship(function(t,i){"belongsTo"===i.kind?r.serializeBelongsTo(e,a,i):"hasMany"===i.kind&&r.serializeHasMany(e,a,i)}),a},serializeIntoHash:function(e,t,r,a){h(e,this.serialize(r,a))},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n,a.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a,{id:!0}),n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"belongsTo","serialize")),c(i)?t[n]=null:t[n]=i,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var a=r.key;if(this._shouldSerializeHasMany(e,a,r)){var i=e.hasMany(a,{ids:!0});if(void 0!==i){var n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"hasMany","serialize")),t[n]=i}}},serializePolymorphicType:t.default.K,extractMeta:function(e,t,r){if(r&&r.hasOwnProperty("meta")){var a=r.meta;return delete r.meta,a}},extractErrors:function(e,t,r,a){var i=this;return r&&"object"==typeof r&&r.errors&&(r=(0,s.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=i.keyForAttribute(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=i.keyForRelationship(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}})}),e("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t.default.String.camelize,c=a.default.extend({keyForPolymorphicType:function(e,t,r){var a=this.keyForRelationship(e);return a+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t,r)},_normalizeArray:function(e,r,a,i){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(a).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,i,s,d),a=r.data,u=r.included;if(o.data.push(a),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,a,i){var n=void 0,o=void 0,d=(0,s.modelHasAttributeOrRelationshipNamedType)(a);return!d&&t.type&&e._hasModelFor(this.modelNameFromPayloadKey(t.type))?(n=e.serializerFor(this.modelNameFromPayloadKey(t.type)),o=e.modelFor(this.modelNameFromPayloadKey(t.type))):(n=i,o=a),n.normalize(o,t,r)},_normalizeResponse:function(e,r,a,i,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,a);u&&(d.meta=u);for(var c=Object.keys(a),h=0,p=c.length;h<p;h++){var f=c[h],m=f,y=!1;"_"===f.charAt(0)&&(y=!0,m=f.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=a[f];if(null!==g)if(b&&"array"!==t.default.typeOf(g)){var R=this._normalizePolymorphicRecord(e,g,f,r,this),_=R.data,A=R.included;if(d.data=_,A){var F;(F=d.included).push.apply(F,l(A))}}else{var z=this._normalizeArray(e,v,g,f),M=z.data,S=z.included;if(S){var T;(T=d.included).push.apply(T,l(S))}if(s)M.forEach(function(e){var t=b&&(0,o.default)(e.id)===i,r=b&&!i&&!d.data;r||t?d.data=e:d.included.push(e)});else if(b)d.data=M;else if(M){var x;(x=d.included).push.apply(x,l(M))}}}}return d},isPrimaryType:function(e,t,r){var a=e.modelFor(t);return a.modelName===r.modelName},pushPayload:function(e,r){var a={data:[],included:[]};for(var i in r){var n=this.modelNameFromPayloadKey(i);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t.default.makeArray(r[i]).forEach(function(e){var t=s.normalize(o,e,i),r=t.data,n=t.included;if(a.data.push(r),n){var d;(d=a.included).push.apply(d,l(n))}})}}e.push(a)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,a){var i=this.payloadKeyFromModelName(t.modelName);e[i]=this.serialize(r,a)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,a){var i=a.key,n=e.belongsTo(i),o=this.keyForPolymorphicType(i,a.type,"serialize");i=this.keyForAttribute?this.keyForAttribute(i,"serialize"):i,i+="Type",i!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=i),t.default.isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var a=r.key,i=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(a,e,"deserialize");if(o&&i.hasOwnProperty(s)&&"object"!=typeof t){var d=this.modelNameFromPayloadKey(i[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e.default=c}),e("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,a,i){function n(e){(0,i.default)(e),(0,r.default)(e),(0,a.default)(e),(0,t.default)(e)}e.default=n}),e("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.default=t.default}),e("ember-data/transform",["exports","ember"],function(e,t){e.default=t.default.Object.extend({serialize:null,deserialize:null})}),e("ember-data/version",["exports"],function(e){e.default="2.5.5"}),e("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(t,r,a,i){a.Inflector.defaultRules=a.defaultRules,r.default.Inflector=a.Inflector,r.default.String.pluralize=a.pluralize,r.default.String.singularize=a.singularize,t.default=a.Inflector,t.pluralize=a.pluralize,t.singularize=a.singularize,t.defaultRules=a.defaultRules,"undefined"!=typeof e&&e.amd?e("ember-inflector",["exports"],function(e){return e.default=a.Inflector,a.Inflector}):"undefined"!=typeof module&&module.exports&&(module.exports=a.Inflector)}),e("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),e("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){
5
- e.default=(0,r.default)(function(e){var r=void 0,a=void 0;return 1===e.length?(a=e[0],(0,t.pluralize)(a)):(r=e[0],a=e[1],1!==parseFloat(r)&&(a=(0,t.pluralize)(a)),r+" "+a)})}),e("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),e("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,a){t.default.inflector=new t.default(a.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=a.default}),e("ember-inflector/lib/system/inflections",["exports"],function(e){e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),e("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,a=t.length;r<a;r++)e.uncountable[t[r].toLowerCase()]=!0}function a(e,t){for(var r,a=0,i=t.length;a<i;a++)r=t[a],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function i(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),a(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");i.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),a(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var a,i,n,c,h,p,f,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),p="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(p=h[1],f=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[f])return e;for(v in r)if(c.match(v+"$"))return i=r[v],y&&r[f]&&(i=o(i),v=o(v)),e.replace(new RegExp(v,"i"),i);for(var g=t.length,R=0;g>R&&(a=t[g-1],v=a[0],!v.test(e));g--);return a=a||[],v=a[0],i=a[1],n=e.replace(v,i)}},e.default=i}),e("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function a(e){return t.default.inflector.singularize(e)}e.pluralize=r,e.singularize=a}),e("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.default=r}),e("ember",[],function(){return{default:Ember}}),r("ember-data")}(),function(){function e(){var e={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}(),function(){var e=Ember.K;Ember.onLoad("Ember.Application",function(t){t.initializer({name:"ember-data",initialize:DS._setupContainer}),t.instanceInitializer({name:"ember-data",initialize:DS._initializeStoreService}),t.initializer({name:"store",after:"ember-data",initialize:e}),t.initializer({name:"transforms",before:"store",initialize:e}),t.initializer({name:"data-adapter",before:"store",initialize:e}),t.initializer({name:"injectStore",before:"store",initialize:e})})}();
1
+ !function(){"use strict";var e,t,r,a,i;!function(n){function o(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function s(e,t,r){this.id=b++,this.name=e,this.deps=!t.length&&r.length?g:t,this.module={exports:{}},this.callback=r,this.state=void 0,this._require=void 0,this.finalized=!1,this.hasExportsAsDep=!1}function d(e){this.name=e}function l(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function u(e,t){for(var r=f[e]||f[e+"/index"];r&&r.callback instanceof d;)e=r.callback.name,r=f[e];return r||l(e,t),r.build(),r}function c(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),a=t.split("/"),i=a.slice(0,-1),n=0,o=r.length;o>n;n++){var s=r[n];if(".."===s){if(0===i.length)throw new Error("Cannot access parent module of root");i.pop()}else{if("."===s)continue;i.push(s)}}return i.join("/")}var h={loader:e,define:t,requireModule:r,require:a,requirejs:i};e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&h.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=h[t])}};var p;p=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var f={},m={},y=!1,v=!0,b=0,g=["require","exports","module"];s.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e["default"]||(e["default"]=e)},s.prototype.exports=function(t){if(this.finalized)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback));var r=this.callback.apply(this,t);return this.hasExportsAsDep&&void 0===r||(this.module.exports=r),this.makeDefaultExport(),this.finalized=!0,this.module.exports},s.prototype.unsee=function(){this.finalized=!1,this.state=void 0,this.module={exports:{}}},s.prototype.reify=function(){for(var e,t=this.deps,r=t.length,a=new Array(r),i=0,n=r;n>i;i++)e=t[i],"exports"===e?(this.hasExportsAsDep=!0,a[i]=this.module.exports):"require"===e?a[i]=this.makeRequire():"module"===e?a[i]=this.module:a[i]=u(c(e,this.name),this.name).module.exports;return a},s.prototype.makeRequire=function(){var e=this.name;return this._require||(this._require=function(t){return a(c(t,e))})},s.prototype.build=function(){this.state!==y&&(this.state=y,this.exports(this.reify()),this.state=v)},t=function(e,t,r){arguments.length<2&&o(arguments.length),p(t)||(r=t,t=[]),f[e]=new s(e,t,r)},t.petal={},t.alias=function(e){return new d(e)},i=a=r=function(e){return u(e,"(require)").module.exports},i.entries=i._eak_seen=f,i.unsee=function(e){u(e,"(unsee)").unsee()},i.clear=function(){i.entries=i._eak_seen=f={},m={}}}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.JSONAPIAdapter=t["default"],e.RESTAdapter=r["default"]}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){var r=t["default"].get;e["default"]=t["default"].Mixin.create({buildURL:function(e,t,r,a,i){switch(a){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(i,e);case"queryRecord":return this.urlForQueryRecord(i,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var a,i=[],n=r(this,"host"),o=this.urlPrefix();return e&&(a=this.pathForType(e),a&&i.push(a)),t&&i.push(encodeURIComponent(t)),o&&i.unshift(o),i=i.join("/"),!n&&i&&"/"!==i.charAt(0)&&(i="/"+i),i},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var a=r(this,"host"),i=r(this,"namespace");if(a&&"/"!==a||(a=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+a+e:t+"/"+e;var n=[];return a&&n.push(a),i&&n.push(i),n.join("/")},pathForType:function(e){var r=t["default"].String.camelize(e);return t["default"].String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){var a=t["default"].Namespace.create({VERSION:r["default"]});t["default"].libraries&&t["default"].libraries.registerCoreLibrary("Ember Data",a.VERSION),e["default"]=a}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t["default"].assert.apply(t["default"],arguments)}function a(){return t["default"].debug.apply(t["default"],arguments)}function i(){return t["default"].deprecate.apply(t["default"],arguments)}function n(){return t["default"].info.apply(t["default"],arguments)}function o(){return t["default"].runInDebug.apply(t["default"],arguments)}function s(){return t["default"].warn.apply(t["default"],arguments)}function d(){return t["default"].debugSeal.apply(t["default"],arguments)}function l(e,r){return e.__isMixin?e.__mixin.detect(r.type.PrototypeMixin):(t["default"].MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r.type))}function u(e,t,a){var i=a.type.modelName,n=e.type.modelName,o=t.key,s=e.store.modelFor(t.type),d="You cannot add a record of type '"+i+"' to the '"+n+"."+o+"' relationship (only '"+s.modelName+"' allowed)";r(d,l(s,a))}e.assert=r,e.debug=a,e.deprecate=i,e.info=n,e.runInDebug=o,e.warn=s,e.debugSeal=d,e.assertPolymorphicType=u}),t("ember-data/-private/ext/date",["exports","ember"],function(e,t){t["default"].Date=t["default"].Date||{};var r=Date.parse,a=[1,4,5,6,7,10,11];t["default"].Date.parse=function(e){var t,i,n=0;if(i=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,"Z"!==i[8]&&void 0!==i[9]&&(n=60*i[10]+i[11],"+"===i[9]&&(n=0-n)),t=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7])}else t=r?r(e):NaN;return t},(t["default"].EXTEND_PROTOTYPES===!0||t["default"].EXTEND_PROTOTYPES.Date)&&(Date.parse=t["default"].Date.parse)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t["default"].FEATURES).isEnabled.apply(e,arguments)}e["default"]=r}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t["default"])}e["default"]=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e["default"]=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,a){function i(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",a.RESTAdapter),e.register("adapter:-json-api",a.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),i(e,"service:store")||e.register("service:store",t["default"])}e["default"]=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e["default"]=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports"],function(e){function t(e){var t=e.lookup?e:e.container;t.lookup("service:store")}e["default"]=t}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,a){e.JSONAPISerializer=t["default"],e.JSONSerializer=r["default"],e.RESTSerializer=a["default"]}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t["default"];for(var a in e)r[a]=e[a];return r}e["default"]=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null==e||""===e?null:e+""}e["default"]=t}),t("ember-data/-private/system/container-proxy",["exports","ember-data/-private/debug"],function(e,t){function r(e){this.container=e}e["default"]=r,r.prototype.aliasedFactory=function(e,t){var r=this;return{create:function(){return t&&t(),r.container.lookup(e)}}},r.prototype.registerAlias=function(e,t,r){var a=this.aliasedFactory(t,r);return this.container.register(e,a)},r.prototype.registerDeprecation=function(e,t){var r=function(){};return this.registerAlias(e,t,r)},r.prototype.registerDeprecations=function(e){var t,r,a,i;for(t=e.length;t>0;t--)r=e[t-1],a=r.deprecated,i=r.valid,this.registerDeprecation(a,i)}}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e["default"]=t["default"]}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){var a=t["default"].get,i=t["default"].String.capitalize,n=t["default"].String.underscore,o=t["default"].assert;e["default"]=t["default"].DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r["default"]&&r["default"].detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,o=this;return a(e,"attributes").forEach(function(e,a){if(r++>o.attributeLimit)return!1;var s=i(n(a).replace("_"," "));t.push({name:a,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var a=r.match(/model:(.*)/);a&&(t=a[1])}}return o("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:a(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;var o=a(e,n);i[n]=o}),i},getRecordKeywords:function(e){var r=[],i=t["default"].A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(a(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var a=t["default"].A(),i=t["default"].A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return i.push(e)});var n=this;i.forEach(function(i){var o=function(){r(n.wrapRecord(e))};t["default"].addObserver(e,i,o),a.push(function(){t["default"].removeObserver(e,i,o)})});var o=function(){a.forEach(function(e){return e()})};return o}})}),t("ember-data/-private/system/debug/debug-info",["exports","ember"],function(e,t){e["default"]=t["default"].Mixin.create({_debugInfo:function(){var e=["id"],t={belongsTo:[],hasMany:[]},r=[];this.eachAttribute(function(t,r){return e.push(t)}),this.eachRelationship(function(e,a){t[a.kind].push(e),r.push(e)});var a=[{name:"Attributes",properties:e,expand:!0},{name:"Belongs To",properties:t.belongsTo,expand:!0},{name:"Has Many",properties:t.hasMany,expand:!0},{name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}];return{propertyInfo:{includeOtherProperties:!0,groups:a,expensiveProperties:r}}}})}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e["default"]=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t["default"].Array.detect(e))return!0;var r=t["default"].typeOf(e);return"array"===r?!0:void 0!==e.length&&"object"===r?!0:!1}e["default"]=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common"],function(e,t,r,a,i){var n=t["default"].get,o=t["default"].set;e["default"]=t["default"].Object.extend(t["default"].MutableArray,t["default"].Evented,{init:function(){this._super.apply(this,arguments),this.currentState=t["default"].A([])},record:null,canonicalState:null,currentState:null,length:0,objectAt:function(e){return this.currentState[e]?this.currentState[e].getRecord():void 0},flushCanonical:function(){var e=this.canonicalState.filter(function(e){return!e.isDeleted()}),t=this.currentState.filter(function(t){return t.isNew()&&-1===e.indexOf(t)});e=e.concat(t);var r=this.length;this.arrayContentWillChange(0,this.length,e.length),(0,i._objectIsAlive)(this)&&this.set("length",e.length),this.currentState=e,this.arrayContentDidChange(0,r,this.length),this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},isPolymorphic:!1,isLoaded:!1,relationship:null,meta:null,internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length),r&&this.relationship.notifyHasManyChanged(),this.record.updateRecordArrays()},internalRemoveRecords:function(e){for(var t,r=0;r<e.length;r++)t=this.currentState.indexOf(e[r]),this.internalReplace(t,1)},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var a;t>0&&(a=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(a)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},promise:null,loadingRecordsCount:function(e){this.loadingRecordsCount=e},loadedRecord:function(){this.loadingRecordsCount--,0===this.loadingRecordsCount&&(o(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+n(this,"type"),i=t["default"].RSVP.all(this.invoke("save"),r).then(function(t){return e},null,"DS: ManyArray#save return ManyArray");return a.PromiseArray.create({promise:i})},createRecord:function(e){var t,r=n(this,"store"),a=n(this,"type");return t=r.createRecord(a.modelName,e),this.pushObject(t),t}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,a,i){e.RootState=a["default"],e.attr=r["default"],e.Errors=i["default"],e["default"]=t["default"]}),t("ember-data/-private/system/model/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t["default"].get,i=t["default"].Map,n=t["default"].Mixin.create({attributes:t["default"].computed(function(){var e=i.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t["default"].computed(function(){var e=i.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){a(this,"attributes").forEach(function(r,a){e.call(t,a,r)})},eachTransformedAttribute:function(e,t){a(this,"transformedAttributes").forEach(function(r,a){e.call(t,a,r)})}});e.AttrClassMethodsMixin=n;var o=t["default"].Mixin.create({eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});e.AttrInstanceMethodsMixin=o}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){var a=t["default"].get,i=t["default"].set,n=t["default"].isEmpty,o=t["default"].makeArray,s=t["default"].MapWithDefault;e["default"]=t["default"].ArrayProxy.extend(t["default"].Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t["default"].computed(function(){return s.create({defaultValue:function(){return t["default"].A()}})}),errorsFor:function(e){return a(this,"errorsByAttributeName").get(e)},messages:t["default"].computed.mapBy("content","message"),content:t["default"].computed(function(){return t["default"].A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t["default"].computed.not("length").readOnly(),add:function(e,t){var r=a(this,"isEmpty");this._add(e,t),r&&!a(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),a(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),a=o(t),i=new Array(a.length),n=0;n<a.length;n++){var s=a[n],d=r.findBy("message",s);d?i[n]=d:i[n]={attribute:e,message:s}}return i},remove:function(e){a(this,"isEmpty")||(this._remove(e),a(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!a(this,"isEmpty")){var t=this.rejectBy("attribute",e);i(this,"content",t),a(this,"errorsByAttributeName")["delete"](e),this.notifyPropertyChange(e)}},clear:function(){a(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!a(this,"isEmpty")){var e=a(this,"errorsByAttributeName"),r=t["default"].A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t["default"].ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,a,i,n,o,s,d,l){function u(e){return _[e]||(_[e]=e.split("."))}function c(e){return R[e]||(R[e]=u(e)[0])}function h(e){return function(){return y(this.currentState,e)}}function p(e,r,n,s,d){this.type=e,this.id=r,this.store=n,this._data=d||new o["default"],this.modelName=e.modelName,this.dataHasInitialized=!1,this._deferredTriggers=[],this._attributes=new o["default"],this._inFlightAttributes=new o["default"],this._relationships=new i["default"](this),this._recordArrays=void 0,this.currentState=a["default"].empty,this.recordReference=new l.RecordReference(n,this),this.references={},this.isReloading=!1,this.isError=!1,this.error=null,this.__ember_meta__=null,this[t["default"].GUID_KEY]=A++ +"internal-model",this._implicitRelationships=new o["default"]}var f=function(){function e(e,t){var r=[],a=!0,i=!1,n=void 0;try{for(var o,s=e[Symbol.iterator]();!(a=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);a=!0);}catch(d){i=!0,n=d}finally{try{!a&&s["return"]&&s["return"]()}finally{if(i)throw n}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e["default"]=p;var m=t["default"].RSVP.Promise,y=t["default"].get,v=t["default"].set,b=t["default"].copy,g=t["default"].assign||t["default"].merge,R=new o["default"],_=new o["default"],A=0;p.prototype={isEmpty:h("isEmpty"),isLoading:h("isLoading"),isLoaded:h("isLoaded"),hasDirtyAttributes:h("hasDirtyAttributes"),isSaving:h("isSaving"),isDeleted:h("isDeleted"),isNew:h("isNew"),isValid:h("isValid"),dirtyType:h("dirtyType"),constructor:p,materializeRecord:function(){var e={store:this.store,_internalModel:this,id:this.id,currentState:y(this,"currentState"),isError:this.isError,adapterError:this.error};t["default"].setOwner?t["default"].setOwner(e,(0,d.getOwner)(this.store)):e.container=this.store.container,this.record=this.type._create(e),this._triggerDeferredTriggers()},recordObjectWillDestroy:function(){this.record=null},deleteRecord:function(){this.send("deleteRecord")},save:function(e){var r="DS: Model#save "+this,a=t["default"].RSVP.defer(r);return this.store.scheduleSave(this,a,e),a.promise},startedReloading:function(){this.isReloading=!0,this.record&&v(this.record,"isReloading",!0)},finishedReloading:function(){this.isReloading=!1,this.record&&v(this.record,"isReloading",!1)},reload:function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new m(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags")["finally"](function(){e.finishedReloading(),e.updateRecordArrays()})},getRecord:function(){return this.record||this.materializeRecord(),this.record},unloadRecord:function(){this.send("unloadRecord")},eachRelationship:function(e,t){return this.type.eachRelationship(e,t)},eachAttribute:function(e,t){return this.type.eachAttribute(e,t)},inverseFor:function(e){return this.type.inverseFor(e)},setupData:function(e){var t=this._changedKeys(e.attributes);g(this._data,e.attributes),this.pushedData(),this.record&&this.record._notifyProperties(t),this.didInitalizeData()},becameReady:function(){t["default"].run.schedule("actions",this.store.recordArrayManager,this.store.recordArrayManager.recordWasLoaded,this)},didInitalizeData:function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},destroy:function(){return this.record?this.record.destroy():void 0},createSnapshot:function(e){return new n["default"](this,e)},loadingData:function(e){this.send("loadingData",e)},loadedData:function(){this.send("loadedData"),this.didInitalizeData()},notFound:function(){this.send("notFound")},pushedData:function(){this.send("pushedData")},flushChangedAttributes:function(){this._inFlightAttributes=this._attributes,this._attributes=new o["default"]},hasChangedAttributes:function(){return Object.keys(this._attributes).length>0},updateChangedAttributes:function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=0,a=t.length;a>r;r++){var i=t[r],n=f(e[i],2),o=n[0],s=n[1];o===s&&delete this._attributes[i]}},changedAttributes:function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,a=g(b(r),t),i=new o["default"],n=Object.keys(a),s=0,d=n.length;d>s;s++){var l=n[s];i[l]=[e[l],a[l]]}return i},adapterWillCommit:function(){this.send("willCommit")},adapterDidDirty:function(){this.send("becomeDirty"),this.updateRecordArraysLater()},send:function(e,t){var r=y(this,"currentState");return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},notifyHasManyAdded:function(e,t,r){this.record&&this.record.notifyHasManyAdded(e,t,r)},notifyHasManyRemoved:function(e,t,r){this.record&&this.record.notifyHasManyRemoved(e,t,r)},notifyBelongsToChanged:function(e,t){this.record&&this.record.notifyBelongsToChanged(e,t)},notifyPropertyChange:function(e){this.record&&this.record.notifyPropertyChange(e)},rollbackAttributes:function(){var e=Object.keys(this._attributes);this._attributes=new o["default"],y(this,"isError")&&(this._inFlightAttributes=new o["default"],this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o["default"]),this.send("rolledBack"),this.record._notifyProperties(e)},transitionTo:function(e){var t=c(e),r=y(this,"currentState"),a=r;do a.exit&&a.exit(this),a=a.parentState;while(!a.hasOwnProperty(t));var i,n,o=u(e),s=[],d=[];for(i=0,n=o.length;n>i;i++)a=a[o[i]],a.enter&&d.push(a),a.setup&&s.push(a);for(i=0,n=d.length;n>i;i++)d[i].enter(this);for(v(this,"currentState",a),this.record&&v(this.record,"currentState",a),i=0,n=s.length;n>i;i++)s[i].setup(this);this.updateRecordArraysLater()},_unhandledEvent:function(e,r,a){var i="Attempted to handle event `"+r+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==a&&(i+="Called with "+t["default"].inspect(a)+"."),new t["default"].Error(i)},triggerLater:function(){for(var e=arguments.length,r=new Array(e),a=0;e>a;a++)r[a]=arguments[a];1===this._deferredTriggers.push(r)&&t["default"].run.scheduleOnce("actions",this,"_triggerDeferredTriggers")},_triggerDeferredTriggers:function(){if(this.record){for(var e=0,t=this._deferredTriggers.length;t>e;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},clearRelationships:function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var a=e._relationships.get(t);a.clear(),a.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},_preloadData:function(e){var t=this;Object.keys(e).forEach(function(r){var a=y(e,r),i=t.type.metaForProperty(r);i.isRelationship?t._preloadRelationship(r,a):t._data[r]=a})},_preloadRelationship:function(e,t){var r=this.type.metaForProperty(e),a=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,a):this._preloadBelongsTo(e,t,a)},_preloadHasMany:function(e,t,r){for(var a=new Array(t.length),i=0;i<t.length;i++){var n=t[i];a[i]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(a)},_preloadBelongsTo:function(e,t,r){var a=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(a)},_convertStringOrNumberIntoInternalModel:function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},updateRecordArrays:function(){this._updatingRecordArraysLater=!1,this.store.dataWasUpdated(this.type,this)},setId:function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},didError:function(e){this.error=e,this.isError=!0,this.record&&this.record.setProperties({isError:!0,adapterError:e})},didCleanError:function(){this.error=null,this.isError=!1,this.record&&this.record.setProperties({isError:!1,adapterError:null})},adapterDidCommit:function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);g(this._data,this._inFlightAttributes),e&&g(this._data,e),this._inFlightAttributes=new o["default"],this.send("didCommit"),this.updateRecordArraysLater(),e&&this.record._notifyProperties(t)},updateRecordArraysLater:function(){this._updatingRecordArraysLater||(this._updatingRecordArraysLater=!0,t["default"].run.schedule("actions",this,this.updateRecordArrays))},addErrorMessageToAttribute:function(e,t){var r=this.getRecord();y(r,"errors")._add(e,t)},removeErrorMessageFromAttribute:function(e){var t=this.getRecord();y(t,"errors")._remove(e)},clearErrorMessages:function(){var e=this.getRecord();y(e,"errors")._clear()},hasErrors:function(){var e=this.getRecord(),r=y(e,"errors");return!t["default"].isEmpty(r)},adapterDidInvalidate:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},adapterDidError:function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},_saveWasRejected:function(){for(var e=Object.keys(this._inFlightAttributes),t=0;t<e.length;t++)void 0===this._attributes[e[t]]&&(this._attributes[e[t]]=this._inFlightAttributes[e[t]]);this._inFlightAttributes=new o["default"]},_changedKeys:function(e){var r=[];if(e){var a,i,n,s,d=Object.keys(e),l=d.length;for(a=g(new o["default"],this._data),a=g(a,this._inFlightAttributes),i=0;l>i;i++)s=d[i],n=e[s],void 0===this._attributes[s]&&(t["default"].isEqual(a[s],n)||r.push(s))}return r},toString:function(){return this.record?this.record.toString():"<"+this.modelName+":"+this.id+">"}},p.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var a=this._relationships.get(t);"belongsTo"===e?r=new l.BelongsToReference(this.store,this,a):"hasMany"===e&&(r=new l.HasManyReference(this.store,this,a)),this.references[t]=r}return r}}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/debug/debug-info","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/system/relationships/ext","ember-data/-private/system/model/attr"],function(e,t,r,a,i,n,o,s,d,l,u){var c=t["default"].get,h=t["default"].computed("currentState",function(e){return c(this._internalModel.currentState,e)}).readOnly(),p=t["default"].Object.extend(t["default"].Evented,{_internalModel:null,store:null,isEmpty:h,isLoading:h,isLoaded:h,hasDirtyAttributes:t["default"].computed("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:h,isDeleted:h,isNew:h,isValid:h,dirtyType:h,isError:!1,isReloading:!1,id:null,errors:t["default"].computed(function(){var e=i["default"].create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this.store.serialize(this,e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:t["default"].K,didLoad:t["default"].K,didUpdate:t["default"].K,didCreate:t["default"].K,didDelete:t["default"].K,becameInvalid:t["default"].K,becameError:t["default"].K,rolledBack:t["default"].K,data:t["default"].computed.readOnly("_internalModel._data"),send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t["default"].beginPropertyChanges();for(var r,a=0,i=e.length;i>a;a++)r=e[a],this.notifyPropertyChange(r);t["default"].endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return c(this,"id")},save:function(e){var t=this;return a.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return a.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,a=new Array(r-1),i=1;r>i;i++)a[i-1]=arguments[i];t["default"].tryInvoke(this,e,a),this._super.apply(this,arguments)},willDestroy:function(){this._super.apply(this,arguments),this._internalModel.clearRelationships(),this._internalModel.recordObjectWillDestroy()},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(){},hasMany:function(){},setId:t["default"].observer("id",function(){this._internalModel.setId(this.get("id"))})});p.reopenClass({_create:p.create,create:function(){
2
+ throw new t["default"].Error("You should not call `create` on a model. Instead, call `store.createRecord` with the attributes you would like to set.")},modelName:null}),t["default"].setOwner&&Object.defineProperty(p.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),p.reopen({belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)}}),p.reopenClass(l.RelationshipsClassMethodsMixin),p.reopenClass(u.AttrClassMethodsMixin),e["default"]=p.extend(o["default"],s.BelongsToMixin,l.DidDefinePropertyMixin,l.RelationshipsInstanceMethodsMixin,d.HasManyMixin,u.AttrInstanceMethodsMixin)}),t("ember-data/-private/system/model/states",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArraysLater()}function i(e){var t,r={};for(var a in e)t=e[a],t&&"object"==typeof t?r[a]=i(t):r[a]=t;return r}function n(e,t){for(var r in t)e[r]=t[r];return e}function o(e){var t=i(c);return n(t,e)}function s(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function d(e){}function l(e,t,r){e=n(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var a in e)e.hasOwnProperty(a)&&"parentState"!==a&&"stateName"!==a&&"object"==typeof e[a]&&(e[a]=l(e[a],e,r+"."+a));return e}var u=t["default"].get,c={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:a,loadingData:t["default"].K,propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:t["default"].K,willCommit:function(e){e.transitionTo("inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},rolledBack:function(e){e.transitionTo("loaded.saved")},becameInvalid:function(e){e.transitionTo("invalid")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")}},inFlight:{isSaving:!0,didSetProperty:a,becomeDirty:t["default"].K,pushedData:t["default"].K,unloadRecord:d,willCommit:t["default"].K,didCommit:function(e){var t=u(this,"dirtyType");e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",t)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t["default"].K,becomeDirty:t["default"].K,pushedData:t["default"].K,willCommit:function(e){e.clearErrorMessages(),e.transitionTo("inFlight")},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")},invokeLifecycleCallbacks:function(e){e.triggerLater("becameInvalid",e)}}},h=o({dirtyType:"created",isNew:!0});h.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},h.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var p=o({dirtyType:"updated"});h.uncommitted.deleteRecord=s,h.invalid.deleteRecord=s,h.uncommitted.rollback=function(e){c.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},h.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},h.uncommitted.propertyWasReset=t["default"].K,p.inFlight.unloadRecord=d,p.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var f={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:t["default"].K,unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},propertyWasReset:t["default"].K,empty:{isEmpty:!0,loadingData:function(e,t){e._loadingPromise=t,e.transitionTo("loading")},loadedData:function(e){e.transitionTo("loaded.created.uncommitted"),e.triggerLater("ready")},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready")}},loading:{isLoading:!0,exit:function(e){e._loadingPromise=null},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready"),e.didCleanError()},becameError:function(e){e.triggerLater("becameError",e)},notFound:function(e){e.transitionTo("empty")}},loaded:{initialState:"saved",isLoaded:!0,loadingData:t["default"].K,saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:a,pushedData:t["default"].K,becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store.reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){e.clearRelationships(),e.transitionTo("deleted.saved")},didCommit:function(e){e.send("invokeLifecycleCallbacks",u(e,"lastDirtyType"))},notFound:t["default"].K},created:h,updated:p},deleted:{initialState:"uncommitted",dirtyType:"deleted",isDeleted:!0,isLoaded:!0,isDirty:!0,setup:function(e){e.updateRecordArrays()},uncommitted:{willCommit:function(e){e.transitionTo("inFlight")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")},pushedData:t["default"].K,becomeDirty:t["default"].K,deleteRecord:t["default"].K,rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:d,willCommit:t["default"].K,didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships();var t=e.store;t._dematerializeRecord(e)},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:t["default"].K,didCommit:t["default"].K},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),a(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:t["default"].K,becomeDirty:t["default"].K,deleteRecord:t["default"].K,willCommit:t["default"].K,rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")}}},invokeLifecycleCallbacks:function(e,t){"created"===t?e.triggerLater("didCreate",e):e.triggerLater("didUpdate",e),e.triggerLater("didCommit",e)}};f=l(f,null,"root"),e["default"]=f}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e["default"]=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t["default"].String.dasherize(e)}e["default"]=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e["default"]=r;var a=t["default"].OrderedSet,i=t["default"].guidFor;r.create=function(){var e=this;return new e},r.prototype=Object.create(a.prototype),r.prototype.constructor=r,r.prototype._super$constructor=a,r.prototype.addWithIndex=function(e,t){var r=i(e),a=this.presenceSet,n=this.list;return a[r]!==!0?(a[r]=!0,void 0===t||null==t?n.push(e):n.splice(t,0,e),this.size+=1,this):void 0}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){return function(){var t=n(this,"content");return t[e].apply(t,arguments)}}var i=t["default"].RSVP.Promise,n=t["default"].get,o=t["default"].ArrayProxy.extend(t["default"].PromiseProxyMixin),s=t["default"].ObjectProxy.extend(t["default"].PromiseProxyMixin),d=function(e,t){return s.create({promise:i.resolve(e,t)})},l=function(e,t){return o.create({promise:i.resolve(e,t)})},u=o.extend({reload:function(){return u.create({promise:n(this,"content").reload()})},createRecord:a("createRecord"),on:a("on"),one:a("one"),trigger:a("trigger"),off:a("off"),has:a("has")}),c=function(e,t){return u.create({promise:i.resolve(e,t)})};e.PromiseArray=o,e.PromiseObject=s,e.PromiseManyArray=u,e.promiseArray=l,e.promiseObject=d,e.promiseManyArray=c}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e){e.destroy()}function n(e){for(var r=e.length,a=t["default"].A(),i=0;r>i;i++)a=a.concat(e[i]);return a}function o(e,t){var r=e.indexOf(t);return-1!==r?(e.splice(r,1),!0):!1}var s=t["default"].MapWithDefault,d=t["default"].get;e["default"]=t["default"].Object.extend({init:function(){var e=this;this.filteredRecordArrays=s.create({defaultValue:function(){return[]}}),this.liveRecordArrays=s.create({defaultValue:function(t){return e.createRecordArray(t)}}),this.changedRecords=[],this._adapterPopulatedRecordArrays=[]},recordDidChange:function(e){1===this.changedRecords.push(e)&&t["default"].run.schedule("actions",this,this.updateRecordArrays)},recordArraysForRecord:function(e){return e._recordArrays=e._recordArrays||a["default"].create(),e._recordArrays},updateRecordArrays:function(){var e=this;this.changedRecords.forEach(function(t){d(t,"record.isDestroyed")||d(t,"record.isDestroying")||"root.deleted.saved"===d(t,"currentState.stateName")?e._recordWasDeleted(t):e._recordWasChanged(t)}),this.changedRecords.length=0},_recordWasDeleted:function(e){var t=e._recordArrays;t&&(t.forEach(function(t){return t.removeInternalModel(e)}),e._recordArrays=null)},_recordWasChanged:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)})},recordWasLoaded:function(e){var t,r=this,a=e.type,i=this.filteredRecordArrays.get(a);if(i.forEach(function(i){t=d(i,"filterFunction"),r.updateFilterRecordArray(i,t,a,e)}),this.liveRecordArrays.has(a)){var n=this.liveRecordArrays.get(a);this._addRecordToRecordArray(n,e)}},updateFilterRecordArray:function(e,t,r,a){var i=t(a.getRecord()),n=this.recordArraysForRecord(a);i?this._addRecordToRecordArray(e,a):(n["delete"](e),e.removeInternalModel(a))},_addRecordToRecordArray:function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e.addInternalModel(t),r.add(e))},populateLiveRecordArray:function(e,t){for(var r,a=this.store.typeMapFor(t),i=a.records,n=0;n<i.length;n++)r=i[n],r.isDeleted()||r.isEmpty()||this._addRecordToRecordArray(e,r)},updateFilter:function(e,t,r){for(var a,i=this.store.typeMapFor(t),n=i.records,o=0;o<n.length;o++)a=n[o],a.isDeleted()||a.isEmpty()||this.updateFilterRecordArray(e,r,t,a)},liveRecordArrayFor:function(e){return this.liveRecordArrays.get(e)},createRecordArray:function(e){var a=r.RecordArray.create({type:e,content:t["default"].A(),store:this.store,isLoaded:!0,manager:this});return a},createFilteredRecordArray:function(e,a,i){var n=r.FilteredRecordArray.create({query:i,type:e,content:t["default"].A(),store:this.store,manager:this,filterFunction:a});return this.registerFilteredRecordArray(n,e,a),n},createAdapterPopulatedRecordArray:function(e,a){var i=r.AdapterPopulatedRecordArray.create({type:e,query:a,content:t["default"].A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(i),i},registerFilteredRecordArray:function(e,t,r){var a=this.filteredRecordArrays.get(t);a.push(e),this.updateFilter(e,t,r)},unregisterRecordArray:function(e){var t=e.type,r=this.filteredRecordArrays.get(t),a=o(r,e),i=o(this._adapterPopulatedRecordArrays,e);if(!a&&!i&&this.liveRecordArrays.has(t)){var n=this.liveRecordArrayFor(t);e===n&&this.liveRecordArrays["delete"](t)}},willDestroy:function(){this._super.apply(this,arguments),this.filteredRecordArrays.forEach(function(e){return n(e).forEach(i)}),this.liveRecordArrays.forEach(i),this._adapterPopulatedRecordArrays.forEach(i)}})}),t("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,a){e.RecordArray=t["default"],e.FilteredRecordArray=r["default"],e.AdapterPopulatedRecordArray=a["default"]}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null","ember-data/-private/features"],function(e,t,r,a,i){var n=t["default"].get;e["default"]=r["default"].extend({query:null,replace:function(){var e=n(this,"type").toString();throw new Error("The result of a server query (on "+e+") is immutable.")},_update:function(){var e=n(this,"store"),t=n(this,"type.modelName"),r=n(this,"query");return e._query(t,r,this)},loadRecords:function(e,r){var i=this,n=t["default"].A(e).mapBy("_internalModel");this.setProperties({content:t["default"].A(n),isLoaded:!0,isUpdating:!1,meta:(0,a["default"])(r.meta)}),n.forEach(function(e){i.manager.recordArraysForRecord(e).add(i)}),t["default"].run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){var a=t["default"].get;e["default"]=r["default"].extend({filterFunction:null,isLoaded:!0,replace:function(){var e=a(this,"type").toString();throw new Error("The result of a client-side filter (on "+e+") is immutable.")},_updateFilter:function(){var e=a(this,"manager");e.updateFilter(this,a(this,"type"),a(this,"filterFunction"))},updateFilter:t["default"].observer("filterFunction",function(){t["default"].run.once(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,a){var i=t["default"].get,n=t["default"].set;e["default"]=t["default"].ArrayProxy.extend(t["default"].Evented,{type:null,content:null,isLoaded:!1,isUpdating:!1,store:null,objectAtContent:function(e){var t=i(this,"content"),r=t.objectAt(e);return r&&r.getRecord()},update:function(){return i(this,"isUpdating")?void 0:(this.set("isUpdating",!0),this._update())},_update:function(){var e=i(this,"store"),t=i(this,"type.modelName");return e.findAll(t,{reload:!0})},addInternalModel:function(e,t){var r=i(this,"content");void 0===t?r.addObject(e):r.contains(e)||r.insertAt(t,e)},removeInternalModel:function(e){i(this,"content").removeObject(e)},save:function(){var e=this,a="DS: RecordArray#save "+i(this,"type"),n=t["default"].RSVP.all(this.invoke("save"),a).then(function(t){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:n})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t._recordArrays;r&&r["delete"](e)})},_unregisterFromManager:function(){var e=i(this,"manager");e.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),n(this,"content",void 0),this._super.apply(this,arguments)},createSnapshot:function(e){var t=this.get("meta");return new a["default"](this,t,e)}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,a){e.RecordReference=t["default"],e.BelongsToReference=r["default"],e.HasManyReference=a["default"]}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,a,i){var n=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(a["default"].prototype),n.prototype.constructor=n,n.prototype._super$constructor=a["default"],n.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},n.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},n.prototype.link=function(){return this.belongsToRelationship.link},n.prototype.meta=function(){return this.belongsToRelationship.meta},n.prototype.push=function(e){var a=this;return r["default"].RSVP.resolve(e).then(function(e){var r;return r=e instanceof t["default"]?e:a.store.push(e),a.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},n.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.record?e.record:null},n.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},n.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e["default"]=n}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug"],function(e,t,r,a){var i=t["default"].get,n=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};n.prototype=Object.create(r["default"].prototype),n.prototype.constructor=n,n.prototype._super$constructor=r["default"],n.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},n.prototype.link=function(){return this.hasManyRelationship.link},n.prototype.ids=function(){var e=this.hasManyRelationship.members,t=e.toArray().map(function(e){return e.id});return t},n.prototype.meta=function(){return this.hasManyRelationship.manyArray.meta},n.prototype.push=function(e){var r=this;return t["default"].RSVP.resolve(e).then(function(e){var t=e;"object"==typeof e&&e.data&&(t=e.data);var a=t.map(function(e){var t=r.store.push(e);return t._internalModel});return r.hasManyRelationship.computeChanges(a),r.hasManyRelationship.manyArray})},n.prototype._isLoaded=function(){var e=i(this.hasManyRelationship,"hasData");if(!e)return!1;var t=this.hasManyRelationship.members.toArray(),r=t.every(function(e){return e.isLoaded()===!0});return r},n.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},n.prototype.load=function(){if(!this._isLoaded())return this.hasManyRelationship.getRecords();var e=this.hasManyRelationship.manyArray;return t["default"].RSVP.resolve(e)},n.prototype.reload=function(){return this.hasManyRelationship.reload()},e["default"]=n}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){var a=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};a.prototype=Object.create(r["default"].prototype),a.prototype.constructor=a,a.prototype._super$constructor=r["default"],a.prototype.id=function(){return this._id},a.prototype.remoteType=function(){return"identity"},a.prototype.push=function(e){var r=this;return t["default"].RSVP.resolve(e).then(function(e){var t=r.store.push(e);return t})},a.prototype.value=function(){return this.internalModel.record},a.prototype.load=function(){return this.store.findRecord(this.type,this._id)},a.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e["default"]=a}),t("ember-data/-private/system/references/reference",["exports"],function(e){var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e["default"]=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function a(e){var a;return a=e.type||e.key,"hasMany"===e.kind&&(a=(0,t.singularize)((0,r["default"])(a))),a}function i(e){return{key:e.key,kind:e.kind,type:a(e),options:e.options,parentType:e.parentType,isRelationship:!0}}e.typeForRelationshipMeta=a,e.relationshipFromMeta=i}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,a){function i(e,r){var i,n;"object"==typeof e?(i=e,n=void 0):(i=r,n=e),"string"==typeof n&&(n=(0,a["default"])(n)),i=i||{};var o={type:n,isRelationship:!0,options:i,kind:"belongsTo",key:null};return t["default"].computed({get:function(e){return i.hasOwnProperty("serialize"),i.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e["default"]=i;var n=t["default"].Mixin.create({notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)}});e.BelongsToMixin=n}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta","ember-data/-private/system/empty-object"],function(e,t,r,a,i){var n=t["default"].get,o=t["default"].Map,s=t["default"].MapWithDefault,d=t["default"].computed(function(){t["default"].testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=new s({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=e.get((0,a.typeForRelationshipMeta)(r));i.push({name:t,kind:r.kind})}}),e}).readOnly(),l=t["default"].computed(function(){t["default"].testing===!0&&l._cacheable===!0&&(l._cacheable=!1);var e,r=t["default"].A();return this.eachComputedProperty(function(t,i){i.isRelationship&&(i.key=t,e=(0,a.typeForRelationshipMeta)(i),r.contains(e)||r.push(e))}),r}).readOnly(),u=t["default"].computed(function(){t["default"].testing===!0&&u._cacheable===!0&&(u._cacheable=!1);var e=o.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var i=(0,a.relationshipFromMeta)(r);i.type=(0,a.typeForRelationshipMeta)(r),e.set(t,i)}}),e}).readOnly(),c=t["default"].Mixin.create({didDefineProperty:function(e,r,a){if(a instanceof t["default"].ComputedProperty){var i=a.meta();i.parentType=e.constructor}}});e.DidDefinePropertyMixin=c;var h=t["default"].Mixin.create({typeForRelationship:function(e,t){var r=n(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t["default"].computed(function(){return new i["default"]}),inverseFor:function(e,t){var r=n(this,"inverseMap");if(r[e])return r[e];var a=this._findInverseFor(e,t);return r[e]=a,a},_findInverseFor:function(e,r){function a(t,r,i){var o=i||[],s=n(r,"relationships");if(!s)return o;var d=s.get(t.modelName);return d=d.filter(function(t){var a=r.metaForProperty(t.name).options;return a.inverse?e===a.inverse:!0}),d&&o.push.apply(o,d),t.superclass&&a(t.superclass,r,o),o}var i=this.typeForRelationship(e,r);if(!i)return null;var o=this.metaForProperty(e),s=o.options;if(null===s.inverse)return null;var d,l,u;if(s.inverse)d=s.inverse,u=t["default"].get(i,"relationshipsByName").get(d),l=u.kind;else{o.type===o.parentType.modelName;var c=a(this,i);if(0===c.length)return null;var h=c.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===h.length&&(c=h),d=c[0].name,l=c[0].kind}return{type:i,name:d,kind:l}},relationships:d,relationshipNames:t["default"].computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:l,relationshipsByName:u,fields:t["default"].computed(function(){var e=o.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){n(this,"relationshipsByName").forEach(function(r,a){e.call(t,a,r)})},eachRelatedType:function(e,t){for(var r=n(this,"relatedTypes"),a=0;a<r.length;a++){var i=r[a];e.call(t,i)}},determineRelationshipType:function(e,t){var r=e.key,a=e.kind,i=this.inverseFor(r,t),n=void 0,o=void 0;return i?(n=i.name,o=i.kind,"belongsTo"===o?"belongsTo"===a?"oneToOne":"manyToOne":"belongsTo"===a?"oneToMany":"manyToMany"):"belongsTo"===a?"oneToNone":"manyToNone"}});e.RelationshipsClassMethodsMixin=h;var p=t["default"].Mixin.create({eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return n(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)}});e.RelationshipsInstanceMethodsMixin=p}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,a,i){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,a["default"])(e));var i={type:e,isRelationship:!0,options:r,kind:"hasMany",key:null};return t["default"].computed({get:function(e){var t=this._internalModel._relationships.get(e);return t.getRecords()},set:function(e,r){var a=this._internalModel._relationships.get(e);return a.clear(),a.addRecords(t["default"].A(r).mapBy("_internalModel")),a.getRecords()}}).meta(i)}e["default"]=n;var o=t["default"].Mixin.create({notifyHasManyAdded:function(e){this.notifyPropertyChange(e)}});e.HasManyMixin=o}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i){function n(e,t,r,a){this._super$constructor(e,t,r,a),this.record=t,this.key=a.key,this.inverseRecord=null,this.canonicalState=null}e["default"]=n,n.prototype=Object.create(i["default"].prototype),n.prototype.constructor=n,n.prototype._super$constructor=i["default"],n.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.setHasData(!0),this.setHasLoaded(!0)},n.prototype._super$addCanonicalRecord=i["default"].prototype.addCanonicalRecord,n.prototype.addCanonicalRecord=function(e){this.canonicalMembers.has(e)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=e,this._super$addCanonicalRecord(e))},n.prototype._super$flushCanonical=i["default"].prototype.flushCanonical,n.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord=this.canonicalState,this.record.notifyBelongsToChanged(this.key),this._super$flushCanonical())},n.prototype._super$addRecord=i["default"].prototype.addRecord,n.prototype.addRecord=function(e){this.members.has(e)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=e,this._super$addRecord(e),this.record.notifyBelongsToChanged(this.key))},n.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},n.prototype._super$removeRecordFromOwn=i["default"].prototype.removeRecordFromOwn,n.prototype.removeRecordFromOwn=function(e){this.members.has(e)&&(this.inverseRecord=null,this._super$removeRecordFromOwn(e),this.record.notifyBelongsToChanged(this.key))},n.prototype._super$removeCanonicalRecordFromOwn=i["default"].prototype.removeCanonicalRecordFromOwn,n.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.has(e)&&(this.canonicalState=null,this._super$removeCanonicalRecordFromOwn(e))},n.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t["default"].RSVP.Promise.resolve(null)},n.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.record,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},n.prototype.getRecord=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),a.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}if(null===this.inverseRecord)return null;var r=this.inverseRecord.getRecord();return r},n.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.record?this.inverseRecord.record.reload():this.findRecord()}}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object"],function(e,t,r,a,i){function n(e){var t=e.options;return!(t&&null===t.inverse)}function o(e,t,i){var o=void 0,s=null;return n(t)&&(s=e.type.inverseFor(t.key,i)),s&&(o=s.name),"hasMany"===t.kind?new r["default"](i,e,o,t):new a["default"](i,e,o,t)}function s(e){this.record=e,this.initializedRelationships=new i["default"]}e["default"]=s;var d=t["default"].get;s.prototype.has=function(e){return!!this.initializedRelationships[e]},s.prototype.get=function(e){var t=this.initializedRelationships,r=d(this.record.type,"relationshipsByName");return!t[e]&&r.get(e)&&(t[e]=o(this.record,r.get(e),this.record.store)),t[e]}}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,a,i,n){function o(e,t,r,a){this._super$constructor(e,t,r,a),this.belongsToType=a.type,this.canonicalState=[],this.manyArray=n["default"].create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:t}),this.isPolymorphic=a.options.polymorphic,this.manyArray.isPolymorphic=this.isPolymorphic}function s(e){var t=new i["default"];if(e)for(var r=0,a=e.length;a>r;r++)t.add(e[r]);return t}e["default"]=o,o.prototype=Object.create(a["default"].prototype),o.prototype.constructor=o,o.prototype._super$constructor=a["default"],o.prototype.destroy=function(){this.manyArray.destroy()},o.prototype._super$updateMeta=a["default"].prototype.updateMeta,o.prototype.updateMeta=function(e){this._super$updateMeta(e),this.manyArray.set("meta",e)},o.prototype._super$addCanonicalRecord=a["default"].prototype.addCanonicalRecord,o.prototype.addCanonicalRecord=function(e,t){this.canonicalMembers.has(e)||(void 0!==t?this.canonicalState.splice(t,0,e):this.canonicalState.push(e),this._super$addCanonicalRecord(e,t))},o.prototype._super$addRecord=a["default"].prototype.addRecord,o.prototype.addRecord=function(e,t){this.members.has(e)||(this._super$addRecord(e,t),this.manyArray.internalAddRecords([e],t))},o.prototype._super$removeCanonicalRecordFromOwn=a["default"].prototype.removeCanonicalRecordFromOwn,o.prototype.removeCanonicalRecordFromOwn=function(e,t){var r=t;this.canonicalMembers.has(e)&&(void 0===r&&(r=this.canonicalState.indexOf(e)),r>-1&&this.canonicalState.splice(r,1),this._super$removeCanonicalRecordFromOwn(e,t))},o.prototype._super$flushCanonical=a["default"].prototype.flushCanonical,o.prototype.flushCanonical=function(){this.manyArray.flushCanonical(),this._super$flushCanonical()},o.prototype._super$removeRecordFromOwn=a["default"].prototype.removeRecordFromOwn,o.prototype.removeRecordFromOwn=function(e,t){this.members.has(e)&&(this._super$removeRecordFromOwn(e,t),
3
+ void 0!==t?this.manyArray.currentState.removeAt(t):this.manyArray.internalRemoveRecords([e]))},o.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},o.prototype.reload=function(){var e=this,t=this.manyArray.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&this.manyArray.set("isLoaded",t)}return this.link?(this._loadingPromise=(0,r.promiseManyArray)(this.fetchLink(),"Reload with link"),this._loadingPromise):(this._loadingPromise=(0,r.promiseManyArray)(this.store.scheduleFetchMany(this.manyArray.toArray()).then(function(){return e.manyArray}),"Reload with ids"),this._loadingPromise)},o.prototype.computeChanges=function(e){var t,r,a,i=this.canonicalMembers,n=[];for(e=s(e),i.forEach(function(t){e.has(t)||n.push(t)}),this.removeCanonicalRecords(n),e=e.toArray(),t=e.length,a=0;t>a;a++)r=e[a],this.removeCanonicalRecord(r),this.addCanonicalRecord(r,a)},o.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},o.prototype.findRecords=function(){for(var e=this,t=this.manyArray.toArray(),r=new Array(t.length),a=0;a<t.length;a++)r[a]=t[a]._internalModel;return this.store.findMany(r).then(function(){return e.manyArray.get("isDestroyed")||e.manyArray.set("isLoaded",!0),e.manyArray})},o.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},o.prototype.getRecords=function(){var e=this;if(this.isAsync){var t;return t=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._loadingPromise=r.PromiseManyArray.create({content:this.manyArray,promise:t}),this._loadingPromise}return this.manyArray.get("isDestroyed")||this.manyArray.set("isLoaded",!0),this.manyArray}}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember","ember-data/-private/debug","ember-data/-private/system/ordered-set"],function(e,t,r,a){function i(e,t,r,i){var n=i.options.async;this.members=new a["default"],this.canonicalMembers=new a["default"],this.store=e,this.key=i.key,this.inverseKey=r,this.record=t,this.isAsync="undefined"==typeof n?!0:n,this.relationshipMeta=i,this.inverseKeyForImplicit=this.record.constructor.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}e["default"]=i,i.prototype={constructor:i,destroy:t["default"].K,updateMeta:function(e){this.meta=e},clear:function(){for(var e,t=this.members.list;t.length>0;)e=t[0],this.removeRecord(e)},removeRecords:function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},addRecords:function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},addCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},addCanonicalRecord:function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.inverseKey?e._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},removeCanonicalRecords:function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},removeCanonicalRecord:function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},addRecord:function(e,t){this.members.has(e)||(this.members.addWithIndex(e,t),this.notifyRecordRelationshipAdded(e,t),this.inverseKey?e._relationships.get(this.inverseKey).addRecord(this.record):(e._implicitRelationships[this.inverseKeyForImplicit]||(e._implicitRelationships[this.inverseKeyForImplicit]=new i(this.store,e,this.key,{options:{}})),e._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArraysLater()),this.setHasData(!0)},removeRecord:function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},removeRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},removeRecordFromOwn:function(e){this.members["delete"](e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},removeCanonicalRecordFromInverse:function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},removeCanonicalRecordFromOwn:function(e){this.canonicalMembers["delete"](e),this.flushCanonicalLater()},flushCanonical:function(){this.willSync=!1;for(var e=[],t=0;t<this.members.list.length;t++)this.members.list[t].isNew()&&e.push(this.members.list[t]);for(this.members=this.canonicalMembers.copy(),t=0;t<e.length;t++)this.members.add(e[t])},flushCanonicalLater:function(){var e=this;this.willSync||(this.willSync=!0,this.store._backburner.join(function(){return e.store._backburner.schedule("syncRelationships",e,e.flushCanonical)}))},updateLink:function(e){e!==this.link&&(this.link=e,this.linkPromise=null,this.setHasLoaded(!1),this.record.notifyPropertyChange(this.key))},findLink:function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},updateRecordsFromAdapter:function(e){this.computeChanges(e),this.setHasData(!0),this.setHasLoaded(!0)},notifyRecordRelationshipAdded:t["default"].K,notifyRecordRelationshipRemoved:t["default"].K,setHasData:function(e){this.hasData=e},setHasLoaded:function(e){this.hasLoaded=e}}}),t("ember-data/-private/system/snapshot-record-array",["exports","ember-data/-private/features"],function(e,t){function r(e,t){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e["default"]=r,r.prototype.snapshots=function(){if(this._snapshots)return this._snapshots;var e=this._recordArray;return this._snapshots=e.invoke("createSnapshot"),this._snapshots}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,a){function i(e){var t=this,a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];this._attributes=new r["default"],this._belongsToRelationships=new r["default"],this._belongsToIds=new r["default"],this._hasManyRelationships=new r["default"],this._hasManyIds=new r["default"];var i=e.getRecord();this.record=i,i.eachAttribute(function(e){return t._attributes[e]=n(i,e)}),this.id=e.id,this._internalModel=e,this.type=e.type,this.modelName=e.type.modelName,this.adapterOptions=a.adapterOptions,this.include=a.include,this._changedAttributes=i.changedAttributes()}e["default"]=i;var n=t["default"].get;i.prototype={constructor:i,id:null,record:null,type:null,modelName:null,attr:function(e){if(e in this._attributes)return this._attributes[e];throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no attribute named '"+e+"' defined.")},attributes:function(){return t["default"].copy(this._attributes)},changedAttributes:function(){for(var e=new r["default"],a=Object.keys(this._changedAttributes),i=0,n=a.length;n>i;i++){var o=a[i];e[o]=t["default"].copy(this._changedAttributes[o])}return e},belongsTo:function(e,r){var a,i,o,s,d=r&&r.id;if(d&&e in this._belongsToIds)return this._belongsToIds[e];if(!d&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"belongsTo"!==a.relationshipMeta.kind)throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return o=n(a,"hasData"),i=n(a,"inverseRecord"),o&&(s=i&&!i.isDeleted()?d?n(i,"id"):i.createSnapshot():null),d?this._belongsToIds[e]=s:this._belongsToRelationships[e]=s,s},hasMany:function(e,r){var a,i,o,s,d=r&&r.ids;if(d&&e in this._hasManyIds)return this._hasManyIds[e];if(!d&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(a=this._internalModel._relationships.get(e),!a||"hasMany"!==a.relationshipMeta.kind)throw new t["default"].Error("Model '"+t["default"].inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return o=n(a,"hasData"),i=n(a,"members"),o&&(s=[],i.forEach(function(e){e.isDeleted()||(d?s.push(e.id):s.push(e.createSnapshot()))})),d?this._hasManyIds[e]=s:this._hasManyRelationships[e]=s,s},eachAttribute:function(e,t){this.record.eachAttribute(e,t)},eachRelationship:function(e,t){this.record.eachRelationship(e,t)},serialize:function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)}}}),t("ember-data/-private/system/store",["exports","ember","ember-data/model","ember-data/-private/debug","ember-data/-private/system/normalize-link","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function g(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function R(e,t,r,a){return D(a)?void 0:e._internalModelForId(a.type,a.id)}function _(e,t,r,a){if(!D(a)){for(var i=new Array(a.length),n=0;n<a.length;n++)i[n]=R(e,t,r,a[n]);return i}}function A(e){return e.serializerFor("application")}function z(e,t,r,a){var i=a._internalModel,n=a.modelName,s=t.modelFor(n),c=e[r](t,s,a),h=(0,u.serializerForAdapter)(t,e,n),p="DS: Extract and notify about "+r+" completion of "+i;return c=O.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,i)),c.then(function(e){return t._adapterRun(function(){var n,o;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,a.id,r),n.included&&t.push({data:n.included}),o=n.data),t.didSaveRecord(i,{data:o})}),i},function(e){if(e instanceof o.InvalidError){var r=h.extractErrors(t,s,e,a.id);t.recordWasInvalid(i,r)}else t.recordWasError(i,e);throw e},p)}function F(e,t,r){r.relationships&&t.type.eachRelationship(function(a,n){var o=n.kind;if(r.relationships[a]){var s;if(r.relationships[a].links&&r.relationships[a].links.related){var d=(0,i["default"])(r.relationships[a].links.related);d&&d.href&&(s=t._relationships.get(a),s.updateLink(d.href))}r.relationships[a].meta&&(s=t._relationships.get(a),s.updateMeta(r.relationships[a].meta)),M(e,a,n,r.relationships[a]);var l=r.relationships[a].data;void 0!==l&&("belongsTo"===o?(s=t._relationships.get(a),s.setCanonicalRecord(l)):"hasMany"===o&&(s=t._relationships.get(a),s.updateRecordsFromAdapter(l)))}})}function M(e,t,r,a){var i=a.data;if(i){var n=r.kind;"belongsTo"===n?a.data=R(e,t,r,i):"hasMany"===n&&(a.data=_(e,t,r,i))}}var S="`id` has to be non-empty string or number";e.badIdFormatAssertion=S;var x,T=t["default"]._Backburner,k=t["default"].Map,E=t["default"].get,w=t["default"].set,P=t["default"].run.once,D=t["default"].isNone,O=(t["default"].isPresent,t["default"].RSVP.Promise),C=t["default"].copy,I=t["default"].Service;e.Store=x=I.extend({init:function(){this._super.apply(this,arguments),this._backburner=new T(["normalizeRelationships","syncRelationships","finished"]),this.typeMaps={},this.recordArrayManager=f["default"].create({store:this}),this._pendingSave=[],this._instanceCache=new m["default"]((0,h.getOwner)(this)),this._pendingFetch=k.create()},adapter:"-json-api",serialize:function(e,t){var r=e._internalModel.createSnapshot();return r.serialize(t)},defaultAdapter:t["default"].computed("adapter",function(){var e=E(this,"adapter");return e=this.retrieveManagedInstance("adapter",e)}),createRecord:function(e,t){var r=this.modelFor(e),a=C(t)||new v["default"];D(a.id)&&(a.id=this._generateId(e,a)),a.id=(0,p["default"])(a.id);var i=this.buildInternalModel(r,a.id),n=i.getRecord();return i.loadedData(),n.setProperties(a),i.eachRelationship(function(e,t){i._relationships.get(e).setHasData(!0)}),n},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,r,a){return 1===arguments.length,"object"===t["default"].typeOf(r),this.findRecord(e,r)},findRecord:function(e,t,r){var a=this._internalModelForId(e,t);if(r=r||{},!this.hasRecordForId(e,t))return this._findByInternalModel(a,r);var i=this._findRecord(a,r);return g(i,"DS: Store#findRecord "+a.typeKey+" with id: "+E(a,"id"))},_findRecord:function(e,t){if(t.reload)return this.scheduleFetch(e,t);var r=e.createSnapshot(t),a=e.type,i=this.adapterFor(a.modelName);return i.shouldReloadRecord(this,r)?this.scheduleFetch(e,t):(i.shouldBackgroundReloadRecord(this,r)&&this.scheduleFetch(e,t),O.resolve(e))},_findByInternalModel:function(e,t){t=t||{},t.preload&&e._preloadData(t.preload);var r=this._findEmptyInternalModel(e,t);return g(r,"DS: Store#findRecord "+e.typeKey+" with id: "+E(e,"id"))},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this.scheduleFetch(e,t):e.isLoading()?e._loadingPromise:O.resolve(e)},findByIds:function(e,r){for(var a=new Array(r.length),i=0;i<r.length;i++)a[i]=this.findRecord(e,r[i]);return(0,s.promiseArray)(t["default"].RSVP.all(a).then(t["default"].A,null,"DS: Store#findByIds of "+e+" complete"))},fetchRecord:function(e,t){var r=e.type,a=e.id,i=this.adapterFor(r.modelName),n=(0,c._find)(i,this,r,a,e,t);return n},scheduleFetchMany:function(e){for(var r=new Array(e.length),a=new Array(e.length),i=0;i<e.length;i++)r[i]=e[i]._internalModel;for(var i=0;i<r.length;i++)a[i]=this.scheduleFetch(r[i]);return t["default"].RSVP.Promise.all(a)},scheduleFetch:function(e,r){var a=e.type;if(e._loadingPromise)return e._loadingPromise;var i=t["default"].RSVP.defer("Fetching "+a+"with id: "+e.id),n={record:e,resolver:i,options:r},o=i.promise;return e.loadingData(o),this._pendingFetch.get(a)?this._pendingFetch.get(a).push(n):this._pendingFetch.set(a,[n]),t["default"].run.scheduleOnce("afterRender",this,this.flushAllPendingFetches),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch=k.create())},_flushPendingFetchForType:function(e,r){function a(e){e.resolver.resolve(d.fetchRecord(e.record,e.options))}function i(r){return r.forEach(function(r){var a=t["default"].A(e).findBy("record",r);if(a){var i=a.resolver;i.resolve(r)}}),r}function n(e){return function(r){r=t["default"].A(r);var a=e.reject(function(e){return r.contains(e)});a.length,s(a)}}function o(e){return function(t){s(e,t)}}function s(r,a){r.forEach(function(r){var i=t["default"].A(e).findBy("record",r);if(i){var n=i.resolver;n.reject(a)}})}var d=this,l=d.adapterFor(r.modelName),u=!!l.findMany&&l.coalesceFindRequests,h=t["default"].A(e).mapBy("record");if(1===e.length)a(e[0]);else if(u){var p=t["default"].A(h).invoke("createSnapshot"),f=l.groupRecordsForFindMany(this,p);f.forEach(function(s){var u=t["default"].A(s).mapBy("_internalModel"),h=t["default"].A(u),p=h.mapBy("id");if(p.length>1)(0,c._findMany)(l,d,r,p,h).then(i).then(n(h)).then(null,o(h));else if(1===p.length){var f=t["default"].A(e).findBy("record",u[0]);a(f)}})}else e.forEach(a)},peekRecord:function(e,t){return this.hasRecordForId(e,t)?this._internalModelForId(e,t).getRecord():null},reloadRecord:function(e){var t=e.type.modelName;this.adapterFor(t),e.id;return this.scheduleFetch(e)},hasRecordForId:function(e,t){var r=this.modelFor(e),a=(0,p["default"])(t),i=this.typeMapFor(r).idToRecord[a];return!!i&&i.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=this.modelFor(e),a=(0,p["default"])(t),i=this.typeMapFor(r).idToRecord,n=i[a];return n&&i[a]||(n=this.buildInternalModel(r,a)),n},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findByInternalModel(e[r]);return O.all(t)},findHasMany:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findHasMany)(a,this,e,t,r)},findBelongsTo:function(e,t,r){var a=this.adapterFor(e.type.modelName);return(0,c._findBelongsTo)(a,this,e,t,r)},query:function(e,t){return this._query(e,t)},_query:function(e,t,r){var a=this.modelFor(e);r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(a,t);var i=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(i,this,a,t,r))},queryRecord:function(e,t){var r=this.modelFor(e),a=this.adapterFor(e);return(0,s.promiseObject)((0,c._queryRecord)(a,this,r,t))},findAll:function(e,t){var r=this.modelFor(e);return this._fetchAll(r,this.peekAll(e),t)},_fetchAll:function(e,t,r){r=r||{};var a=this.adapterFor(e.modelName),i=this.typeMapFor(e).metadata.since;if(r.reload)return(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r));var n=t.createSnapshot(r);return a.shouldReloadAll(this,n)?(0,s.promiseArray)((0,c._findAll)(a,this,e,i,r)):(a.shouldBackgroundReloadAll(this,n)&&(0,c._findAll)(a,this,e,i,r),(0,s.promiseArray)(O.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);w(t,"isUpdating",!1)},peekAll:function(e){var t=this.modelFor(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.populateLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length){for(var t=this.typeMaps,r=Object.keys(t),a=new Array(r.length),i=0;i<r.length;i++)a[i]=t[r[i]].type.modelName;a.forEach(this.unloadAll,this)}else{for(var n=this.modelFor(e),o=this.typeMapFor(n),s=o.records.slice(),d=void 0,i=0;i<s.length;i++)d=s[i],d.unloadRecord(),d.destroy();o.metadata=new v["default"]}},filter:function(e,r,a){!t["default"].ENV.ENABLE_DS_FILTER;var i,n,o=arguments.length,d=3===o;return d?i=this.query(e,r):2===arguments.length&&(a=r),e=this.modelFor(e),n=d?this.recordArrayManager.createFilteredRecordArray(e,a,r):this.recordArrayManager.createFilteredRecordArray(e,a),i=i||O.resolve(n),(0,s.promiseArray)(i.then(function(){return n},null,"DS: Store#filter of "+e))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},dataWasUpdated:function(e,t){this.recordArrayManager.recordDidChange(t)},scheduleSave:function(e,t,r){var a=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:a,resolver:t}),P(this,"flushPendingSave")},flushPendingSave:function(){var e=this,t=this._pendingSave.slice();this._pendingSave=[],t.forEach(function(t){var r,a=t.snapshot,i=t.resolver,n=a._internalModel,o=e.adapterFor(n.type.modelName);return"root.deleted.saved"===E(n,"currentState.stateName")?i.resolve():(r=n.isNew()?"createRecord":n.isDeleted()?"deleteRecord":"updateRecord",void i.resolve(z(o,e,r,a)))})},didSaveRecord:function(e,t){var r;t&&(r=t.data),r&&(this._backburner.schedule("normalizeRelationships",this,"_setupRelationships",e,r),this.updateId(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=(e.id,(0,p["default"])(t.id));this.typeMapFor(e.type).idToRecord[r]=e,e.setId(r)},typeMapFor:function(e){var r=E(this,"typeMaps"),a=t["default"].guidFor(e),i=r[a];return i?i:(i={idToRecord:new v["default"],records:[],metadata:new v["default"],type:e},r[a]=i,i)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,n["default"])(e),a=(0,h.getOwner)(this),i=a._lookupFactory("mixin:"+t);i&&a.register("model:"+t,r["default"].extend(i));var o=this.modelFactoryFor(t);return o&&(o.__isMixin=!0,o.__mixin=i),o},modelFor:function(e){var r=this.modelFactoryFor(e);if(r||(r=this._modelForMixin(e)),!r)throw new t["default"].Error("No model was found for '"+e+"'");return r.modelName=r.modelName||(0,n["default"])(e),r},modelFactoryFor:function(e){var t=(0,n["default"])(e),r=(0,h.getOwner)(this);return r._lookupFactory("model:"+t)},push:function(e){var t,r,a=e.included;if(a)for(t=0,r=a.length;r>t;t++)this._pushInternalModel(a[t]);if(Array.isArray(e.data)){r=e.data.length;var i=new Array(r);for(t=0;r>t;t++)i[t]=this._pushInternalModel(e.data[t]).getRecord();return i}if(null===e.data)return null;var n=this._pushInternalModel(e.data);return n.getRecord()},_hasModelFor:function(e){return!!(0,h.getOwner)(this)._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=this,r=(e.type,this._load(e));return this._backburner.join(function(){t._backburner.schedule("normalizeRelationships",t,"_setupRelationships",r,e)}),r},_setupRelationships:function(e,t){F(this,e,t)},pushPayload:function(e,t){var r,a,i=this;t?(a=t,r=this.serializerFor(e)):(a=e,r=A(this)),this._adapterRun(function(){return r.pushPayload(i,a)})},normalize:function(e,t){var r=this.serializerFor(e),a=this.modelFor(e);return r.normalize(a,t)},buildInternalModel:function(e,t,r){var a=this.typeMapFor(e),i=a.idToRecord,n=new y["default"](e,t,this,null,r);return t&&(i[t]=n),a.records.push(n),n},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_dematerializeRecord:function(e){var t=e.type,r=this.typeMapFor(t),a=e.id;e.updateRecordArrays(),a&&delete r.idToRecord[a];var i=r.records.indexOf(e);r.records.splice(i,1)},adapterFor:function(e){return this.lookupAdapter(e)},_adapterRun:function(e){return this._backburner.run(e)},serializerFor:function(e){var t=["application",this.adapterFor(e).get("defaultSerializer"),"-default"],r=this.lookupSerializer(e,t);return r},retrieveManagedInstance:function(e,t,r){var a=(0,n["default"])(t),i=this._instanceCache.get(e,a,r);return w(i,"store",this),i},lookupAdapter:function(e){return this.retrieveManagedInstance("adapter",e,this.get("_adapterFallbacks"))},_adapterFallbacks:t["default"].computed("adapter",function(){var e=this.get("adapter");return["application",e,"-json-api"]}),lookupSerializer:function(e,t){return this.retrieveManagedInstance("serializer",e,t)},willDestroy:function(){this._super.apply(this,arguments),this.recordArrayManager.destroy(),this.unloadAll()}}),x.reopen({getReference:function(e,t){return this._internalModelForId(e,t).recordReference}}),e.Store=x,e["default"]=x}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(void 0,t)}}function a(e,t){var r=e["finally"](function(){t()||(r._subscribers.length=0)});return r}function i(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e._bind=r,e._guard=a,e._objectIsAlive=i;var n=t["default"].get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){function a(e){this._owner=e,this._cache=new r["default"]}e["default"]=a;var i=t["default"].assign||t["default"].merge;a.prototype=new r["default"],i(a.prototype,{get:function(e,t,r){var a=this._cache,i=e+":"+t;if(!(i in a)){var n=this.instanceFor(i)||this._findInstance(e,r);n&&(a[i]=n)}return a[i]},_findInstance:function(e,t){for(var r=0,a=t.length;a>r;r++){var i=t[r],n=e+":"+i,o=this.instanceFor(n);if(o)return o}},instanceFor:function(e){var t=this._cache;if(!t[e]){var r=this._owner.lookup(e);r&&(t[e]=r)}return t[e]},destroy:function(){for(var e=this._cache,t=Object.keys(e),r=0,a=t.length;a>r;r++){var i=t[r],n=e[i];n&&n.destroy()}this._owner=null},constructor:a,toString:function(){return"ContainerInstanceCache"}})}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,a,i,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=e.findRecord(t,r,o,l),c=(0,n.serializerForAdapter)(t,e,s.type.modelName),h="DS: Handle Adapter#findRecord of "+r+" with id: "+o;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(c,t,r,e,o,"findRecord"),n=t.push(a);return n._internalModel})},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+r+"'")}function s(e,r,o,s,d){var l=t["default"].A(d).invoke("createSnapshot"),u=e.findMany(r,o,s,l),c=(0,n.serializerForAdapter)(r,e,o.modelName),h="DS: Handle Adapter#findMany of "+o;if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return r._adapterRun(function(){for(var t=(0,i.normalizeResponseHelper)(c,r,o,e,null,"findMany"),a=r.push(t),n=new Array(a.length),s=0;s<a.length;s++)n[s]=a[s]._internalModel;return n})},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),a=t.push(r),n=a.map(function(e){return e._internalModel});return n.meta=r.meta,n})},null,"DS: Extract payload of "+r+" : hasMany "+s.type)}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r+" : "+s.type;return u=p.resolve(u,h),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,t)),u=(0,a._guard)(u,(0,a._bind)(a._objectIsAlive,r)),u.then(function(e){return t._adapterRun(function(){var r=(0,i.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");if(!r.data)return null;var a=t.push(r);return a._internalModel})},null,"DS: Extract payload of "+r+" : "+s.type)}function u(e,t,r,o,s){var d=r.modelName,l=t.peekAll(d),u=l.createSnapshot(s),c=e.findAll(t,r,o,u),h=(0,n.serializerForAdapter)(t,e,d),f="DS: Handle Adapter#findAll of "+r;return c=p.resolve(c,f),c=(0,a._guard)(c,(0,a._bind)(a._objectIsAlive,t)),c.then(function(e){return t._adapterRun(function(){var a=(0,i.normalizeResponseHelper)(h,t,r,e,null,"findAll");t.push(a)}),t.didUpdateAll(r),t.peekAll(d)},null,"DS: Extract payload of findAll "+r)}function c(e,t,r,o,s){var d=r.modelName,l=e.query(t,r,o,s),u=(0,n.serializerForAdapter)(t,e,d),c="DS: Handle Adapter#query of "+r;return l=p.resolve(l,c),l=(0,a._guard)(l,(0,a._bind)(a._objectIsAlive,t)),l.then(function(e){var a,n;return t._adapterRun(function(){n=(0,i.normalizeResponseHelper)(u,t,r,e,null,"query"),a=t.push(n)}),s.loadRecords(a,n),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=r.modelName,d=e.queryRecord(t,r,o),l=(0,n.serializerForAdapter)(t,e,s),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,a._guard)(d,(0,a._bind)(a._objectIsAlive,t)),d.then(function(e){var a;return t._adapterRun(function(){var n=(0,i.normalizeResponseHelper)(l,t,r,e,null,"queryRecord");a=t.push(n)}),a},null,"DS: Extract payload of queryRecord "+r)}e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t["default"].RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function i(e,t,r,a,i,n){var o=e.normalizeResponse(t,r,a,i,n);return o}e.validateDocumentStructure=a,e.normalizeResponseHelper=i}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var a=t.serializer;return void 0===a&&(a=e.serializerFor(r)),(null===a||void 0===a)&&(a={extract:function(e,t,r){return r}}),a}e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,a,i,n){e.Transform=t["default"],e.NumberTransform=r["default"],e.DateTransform=a["default"],e.StringTransform=i["default"],e.BooleanTransform=n["default"]}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform","ember-data/-private/features"],function(e,t,r,a){t["default"].isNone;e["default"]=r["default"].extend({deserialize:function(e,t){var r=typeof e;return"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r?1===e:!1},serialize:function(e,t){return Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r,a){e["default"]=a["default"].extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date(t["default"].Date.parse(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function a(e){return e===e&&e!==1/0&&e!==-(1/0)}var i=t["default"].isEmpty;e["default"]=r["default"].extend({deserialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)},serialize:function(e){var t;return i(e)?null:(t=Number(e),a(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){var a=t["default"].isNone;e["default"]=r["default"].extend({deserialize:function(e){return a(e)?null:String(e)},serialize:function(e){return a(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return i(e,"attributes").has("type")||i(e,"relationshipsByName").has("type")}function a(e){var r;return t["default"].getOwner&&(r=t["default"].getOwner(e)),!r&&e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;
4
+ return e.register.apply(e,arguments)}),r}var i=t["default"].get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=a}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function a(e){var a=new t["default"];if(!e)return a;var n=e.split(i);return n.forEach(function(e){var t=e.split(":"),i=r(t),n=i[0],o=i.slice(1);n=n.trim(),o=o.join(":").trim(),o&&(a[n]=o)}),a}e["default"]=a;var i="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){var r=t["default"].get;e["default"]=t["default"].Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return r(e.record,"store").serializerFor(e.modelName).serialize(e,t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,a){function i(e){var t=arguments.length<=1||void 0===arguments[1]?"Adapter operation failed":arguments[1];this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],r=t.message;return o(e,r)}}function o(e,t){var r=function(r,a){e.call(this,r,a||t)};return r.prototype=Object.create(e.prototype),p&&(r.extend=n(r)),r}function s(e){var r=[];return t["default"].isPresent(e)&&Object.keys(e).forEach(function(a){for(var i=t["default"].makeArray(e[a]),n=0;n<i.length;n++){var o="Invalid Attribute",s="/data/attributes/"+a;a===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:i[n],source:{pointer:s}})}}),r}function d(e){var r={};return t["default"].isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:-1!==e.source.pointer.search(c)&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.AdapterError=i,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t["default"].Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",p=!1;i.prototype=Object.create(l.prototype),p&&(i.extend=n(i));var f=o(i,"The adapter rejected the commit because it was invalid");e.InvalidError=f;var m=o(i,"The adapter operation timed out");e.TimeoutError=m;var y=o(i,"The adapter operation was aborted");e.AbortError=y;var v=p?o(i,"The adapter operation is unauthorized"):null;e.UnauthorizedError=v;var b=p?o(i,"The adapter operation is forbidden"):null;e.ForbiddenError=b;var g=p?o(i,"The adapter could not find the resource"):null;e.NotFoundError=g;var R=p?o(i,"The adapter operation failed due to a conflict"):null;e.ConflictError=R;var _=p?o(i,"The adapter operation failed due to a server error"):null;e.ServerError=_}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features"],function(e,t,r,a){var i=r["default"].extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var a=this._super.apply(this,arguments);a.contentType&&(a.contentType="application/vnd.api+json");var i=a.beforeSend;return a.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),i&&i(e)},a},coalesceFindRequests:!1,findMany:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(i,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t["default"].String.dasherize(e);return t["default"].String.pluralize(r)},updateRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName);i.serializeIntoHash(a,t,r,{includeId:!0});var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PATCH",{data:a})}});e["default"]=i}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,a,i,n,o,s){function d(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}var l=t["default"].MapWithDefault,u=t["default"].get,c=r["default"].extend(i["default"],{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(2>r)return e;for(var a={},i=t.sort(),n=0;r>n;n++)a[i[n]]=e[i[n]];return a},coalesceFindRequests:!1,findRecord:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findRecord"),n=this.buildQuery(a);return this.ajax(i,"GET",{data:n})},findAll:function(e,t,r,a){var i=this.buildQuery(a),n=this.buildURL(t.modelName,null,a,"findAll");return r&&(i.since=r),this.ajax(n,"GET",{data:i})},query:function(e,t,r){var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,a){var i=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(i,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,a){var i=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,i,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,a){var i=t.id,n=t.modelName;return r=this.urlPrefix(r,this.buildURL(n,i,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName),n=this.buildURL(t.modelName,null,r,"createRecord");return i.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(n,"POST",{data:a})},updateRecord:function(e,t,r){var a={},i=e.serializerFor(t.modelName);i.serializeIntoHash(a,t,r);var n=r.id,o=this.buildURL(t.modelName,n,r,"updateRecord");return this.ajax(o,"PUT",{data:a})},deleteRecord:function(e,t,r){var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),a=r.split("/"),i=a[a.length-1],n=t.id;return i===n?a[a.length-1]="":d(i,"?id="+n)&&(a[a.length-1]=i.substring(0,i.length-n.length-1)),a.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,a){var n=i._stripIDFromURL(e,t[0]),o=0,s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+a;n.length+o+t>=r&&(o=0,s.push([])),o+=t;var i=s.length-1;s[i].push(e)}),s}var a=l.create({defaultValue:function(){return[]}}),i=this,n=this.maxURLLength;t.forEach(function(t){var r=i._stripIDFromURL(e,t);a.get(r).push(t)});var o=[];return a.forEach(function(e,t){var a="&ids%5B%5D=".length,i=r(e,n,a);i.forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,i){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new a.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,i);return new a.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&300>e||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var n=this,o={url:e,method:r};return new t["default"].RSVP.Promise(function(d,l){var u=n.ajaxOptions(e,r,i);u.success=function(e,r,a){var i=n.handleResponse(a.status,(0,s["default"])(a.getAllResponseHeaders()),e,o);i&&i.isAdapterError?t["default"].run.join(null,l,i):t["default"].run.join(null,d,i)},u.error=function(e,r,i){var d=void 0;d=i instanceof Error?i:"timeout"===r?new a.TimeoutError:"abort"===r?new a.AbortError:n.handleResponse(e.status,(0,s["default"])(e.getAllResponseHeaders()),n.parseErrorResponse(e.responseText)||i,o),t["default"].run.join(null,l,d)},n._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t["default"].$.ajax(e)},ajaxOptions:function(e,t,r){var a=r||{};a.url=e,a.type=t,a.dataType="json",a.context=this,a.data&&"GET"!==t&&(a.contentType="application/json; charset=utf-8",a.data=JSON.stringify(a.data));var i=u(this,"headers");return void 0!==i&&(a.beforeSend=function(e){Object.keys(i).forEach(function(t){return e.setRequestHeader(t,i[t])})}),a},parseErrorResponse:function(e){var r=e;try{r=t["default"].$.parseJSON(e)}catch(a){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,a){var i,n=t["Content-Type"]||"Empty Content-Type";i="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r;var o=a.method+" "+a.url,s="Payload ("+n+")";return["Ember Data Request "+o+" returned a "+e,s,i].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t}});e["default"]=c}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function a(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var a=t.defaultValue;return a}function i(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t["default"].computed({get:function(e){var t=this._internalModel;return i(t,e)?n(t,e):a(this,r,e)},set:function(e,t){var r=this._internalModel,a=n(r,e);return t!==a&&(r._attributes[e]=t,this._internalModel.send("didSetProperty",{name:e,oldValue:a,originalValue:r._data[e],value:t})),t}}).meta(o)}e["default"]=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/-private/system/debug","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-inflector","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/container-proxy","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,a,i,n,o,s,d,l,u,c,h,p,f,m,y,v,b,g,R,_,A,z,F,M,S,x,T,k){if(t["default"].VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t["default"].Error("Ember Data requires at least Ember 1.13.0, but you have "+t["default"].VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");i["default"].Store=d.Store,i["default"].PromiseArray=s.PromiseArray,i["default"].PromiseObject=s.PromiseObject,i["default"].PromiseManyArray=s.PromiseManyArray,i["default"].Model=u["default"],i["default"].RootState=l.RootState,i["default"].attr=l.attr,i["default"].Errors=l.Errors,i["default"].InternalModel=o["default"],i["default"].Snapshot=c["default"],i["default"].Adapter=h["default"],i["default"].AdapterError=m.AdapterError,i["default"].InvalidError=m.InvalidError,i["default"].TimeoutError=m.TimeoutError,i["default"].AbortError=m.AbortError,i["default"].errorsHashToArray=m.errorsHashToArray,i["default"].errorsArrayToHash=m.errorsArrayToHash,i["default"].Serializer=p["default"],i["default"].DebugAdapter=f["default"],i["default"].RecordArray=y.RecordArray,i["default"].FilteredRecordArray=y.FilteredRecordArray,i["default"].AdapterPopulatedRecordArray=y.AdapterPopulatedRecordArray,i["default"].ManyArray=v["default"],i["default"].RecordArrayManager=b["default"],i["default"].RESTAdapter=g.RESTAdapter,i["default"].BuildURLMixin=R["default"],i["default"].RESTSerializer=_.RESTSerializer,i["default"].JSONSerializer=_.JSONSerializer,i["default"].JSONAPIAdapter=g.JSONAPIAdapter,i["default"].JSONAPISerializer=_.JSONAPISerializer,i["default"].Transform=F.Transform,i["default"].DateTransform=F.DateTransform,i["default"].StringTransform=F.StringTransform,i["default"].NumberTransform=F.NumberTransform,i["default"].BooleanTransform=F.BooleanTransform,i["default"].EmbeddedRecordsMixin=z["default"],i["default"].belongsTo=M.belongsTo,i["default"].hasMany=M.hasMany,i["default"].Relationship=k["default"],i["default"].ContainerProxy=T["default"],i["default"]._setupContainer=S["default"],i["default"]._initializeStoreService=x["default"],Object.defineProperty(i["default"],"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:n["default"]}),t["default"].lookup.DS=i["default"],e["default"]=i["default"]}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e["default"]=t["default"]}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.belongsTo=t["default"],e.hasMany=r["default"]}),t("ember-data/serializer",["exports","ember"],function(e,t){e["default"]=t["default"].Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,a){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var n=t["default"].get,o=t["default"].set,s=t["default"].String.camelize;e["default"]=t["default"].Mixin.create({normalize:function(e,t,r){var a=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,a)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);var i,n=this.hasSerializeIdsOption(a),o=this.hasSerializeRecordsOption(a),s=e.belongsTo(a);n?(i=this.keyForRelationship(a,r.kind,"serialize"),s?(t[i]=s.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null):o&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var a=e.belongsTo(r.key),i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),a?(t[i]=a.record.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,a,r,t[i]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[i]=null},serializeHasMany:function(e,t,r){var a=r.key;if(this.noSerializeOptionSpecified(a))return void this._super(e,t,r);if(this.hasSerializeIdsOption(a)){var i=this.keyForRelationship(a,r.kind,"serialize");t[i]=e.hasMany(a,{ids:!0})}else this.hasSerializeRecordsOption(a)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(a)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,a){var i=this.keyForAttribute(a.key,"serialize"),n=e.hasMany(a.key);r[i]=t["default"].A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var a=e.hasMany(r.key),i=t["default"].A(a),n=new Array(i.length),o=0;o<i.length;o++){var s=i[o],d=s.record.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,a){if("hasMany"!==r.kind&&"belongsTo"===r.kind){var i=e.type.inverseFor(r.key,this.store);if(i){var n=i.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,i.kind,"deserialize");s&&delete a[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[s(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,a){var i=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&i._extractEmbeddedHasMany(t,r,a,n),"belongsTo"===n.kind&&i._extractEmbeddedBelongsTo(t,r,a,n))}),a},_extractEmbeddedHasMany:function(e,t,r,a){var s=n(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,a,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,i(p))}d[l]={id:h.id,type:h.type}}var m={data:d};o(r,"data.relationships."+t,m)}},_extractEmbeddedBelongsTo:function(e,t,r,a){var s=n(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,a,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}var h={id:l.id,type:l.type},p={data:h};o(r,"data.relationships."+t,p)}},_normalizeEmbeddedRelationship:function(e,t,r){var a=t.type;t.options.polymorphic&&(a=r.type);var i=e.modelFor(a),n=e.serializerFor(a);return n.normalize(i,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/features"],function(e,t,r,a,i,n,o){var s=t["default"].String.dasherize,d=a["default"].extend({_normalizeDocumentHelper:function(e){if("object"===t["default"].typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeResourceHelper(i)}e.data=r}if(Array.isArray(e.included)){for(var r=new Array(e.included.length),a=0;a<e.included.length;a++){var n=e.included[a];r[a]=this._normalizeResourceHelper(n)}e.included=r}return e},_normalizeRelationshipDataHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);return e.type=t,e},_normalizeResourceHelper:function(e){var t=this.modelNameFromPayloadKey(e.type);if(!this.store._hasModelFor(t))return null;var r=this.store.modelFor(t),a=this.store.serializerFor(t),i=a.normalize(r,e),n=i.data;return n},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);e.push(r)},_normalizeResponse:function(e,t,r,a,i,n){var o=this._normalizeDocumentHelper(r);return o},extractAttributes:function(e,t){var r=this,a={};return t.attributes&&e.eachAttribute(function(e){var i=r.keyForAttribute(e,"deserialize");t.attributes.hasOwnProperty(i)&&(a[e]=t.attributes[i])}),a},extractRelationship:function(e){if("object"===t["default"].typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),a=0;a<e.data.length;a++){var i=e.data[a];r[a]=this._normalizeRelationshipDataHelper(i)}e.data=r}return e},extractRelationships:function(e,t){var r=this,a={};return t.relationships&&e.eachRelationship(function(e,i){var n=r.keyForRelationship(e,i.kind,"deserialize");if(t.relationships.hasOwnProperty(n)){var o=t.relationships[n];a[e]=r.extractRelationship(o)}}),a},_extractType:function(e,t){return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i["default"])(e))},payloadKeyFromModelName:function(e){return(0,n.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments);return r.type=this.payloadKeyFromModelName(e.modelName),{data:r}},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n)}var s=this._getMappedKey(r,e.type);s===r&&(s=this.keyForAttribute(r,"serialize")),t.attributes[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a);if(void 0!==i){t.relationships=t.relationships||{};var n=this._getMappedKey(a,e.type);n===a&&(n=this.keyForRelationship(a,"belongsTo","serialize"));var o=null;i&&(o={type:this.payloadKeyFromModelName(i.modelName),id:i.id}),t.relationships[n]={data:o}}}},serializeHasMany:function(e,t,r){var a=r.key;if(this._shouldSerializeHasMany(e,a,r)){var i=e.hasMany(a);if(void 0!==i){t.relationships=t.relationships||{};var n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"hasMany","serialize"));for(var o=new Array(i.length),s=0;s<i.length;s++){var d=i[s];o[s]={type:this.payloadKeyFromModelName(d.modelName),id:d.id}}t.relationships[n]={data:o}}}}});e["default"]=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/adapters/errors","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t["default"].get,c=t["default"].isNone,h=t["default"].assign||t["default"].merge;e["default"]=a["default"].extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,a=void 0;return a=u(e,"attributes"),e.eachTransformedAttribute(function(e,i){if(e in t){var n=r.transformFor(i),o=a.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,a,i){switch(i){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,a,i){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,a,i){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,a,i){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!0)},normalizeArrayResponse:function(e,t,r,a,i){return this._normalizeResponse(e,t,r,a,i,!1)},_normalizeResponse:function(e,t,r,a,i,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;f>p;p++){var m=r[p],y=this.normalize(t,m),u=y.data,c=y.included;if(c){var v;(v=o.included).push.apply(v,l(c))}h[p]=u}o.data=h}return o},normalize:function(e,r){var a=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t["default"].typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),a={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,a.attributes)),{data:a}},extractId:function(e,t){var r=u(this,"primaryKey"),a=t[r];return(0,i["default"])(a)},extractAttributes:function(e,t){var r,a=this,i={};return e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),t.hasOwnProperty(r)&&(i[e]=t[r])}),i},extractRelationship:function(e,r){if(t["default"].isNone(r))return null;if("object"===t["default"].typeOf(r)){r.id&&(r.id=(0,i["default"])(r.id));var a=this.store.modelFor(e);return r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(a)&&(r.type=this.modelNameFromPayloadKey(r.type)),r}return{id:(0,i["default"])(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var a=this,i={};return e.eachRelationship(function(e,n){var o=null,s=a.keyForRelationship(e,n.kind,"deserialize");if(r.hasOwnProperty(s)){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?a.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):a.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t["default"].isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;c>u;u++){var h=l[u];d[u]=a.extractRelationship(n.type,h)}}o={data:d}}var p=a.keyForLink(e,n.kind);if(r.links&&r.links.hasOwnProperty(p)){var f=r.links[p];o=o||{},o.links={related:f}}o&&(i[e]=o)}),i},modelNameFromPayloadKey:function(e){return(0,n["default"])(e)},normalizeAttributes:function(e,t){var r,a=this;this.keyForAttribute&&e.eachAttribute(function(e){r=a.keyForAttribute(e,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeRelationships:function(e,t){var r,a=this;this.keyForRelationship&&e.eachRelationship(function(e,i){r=a.keyForRelationship(e,i.kind,"deserialize"),e!==r&&t.hasOwnProperty(r)&&(t[e]=t[r],delete t[r])})},normalizeUsingDeclaredMapping:function(e,t){var r,a,i,n=u(this,"attrs");if(n)for(i in n)r=a=this._getMappedKey(i,e),t.hasOwnProperty(a)&&(u(e,"attributes").has(i)&&(r=this.keyForAttribute(i)),u(e,"relationshipsByName").has(i)&&(r=this.keyForRelationship(i)),a!==r&&(t[r]=t[a],delete t[a]))},_getMappedKey:function(e,t){var r,a=u(this,"attrs");return a&&a[e]&&(r=a[e],r.key&&(r=r.key),"string"==typeof r&&(e=r)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},_shouldSerializeHasMany:function(e,t,r){var a=e.type.determineRelationshipType(r,this.store);return this._mustSerialize(t)?!0:this._canSerialize(t)&&("manyToNone"===a||"manyToMany"===a)},serialize:function(e,t){var r=this,a={};if(t&&t.includeId){var i=e.id;i&&(a[u(this,"primaryKey")]=i)}return e.eachAttribute(function(t,i){r.serializeAttribute(e,a,t,i)}),e.eachRelationship(function(t,i){"belongsTo"===i.kind?r.serializeBelongsTo(e,a,i):"hasMany"===i.kind&&r.serializeHasMany(e,a,i)}),a},serializeIntoHash:function(e,t,r,a){h(e,this.serialize(r,a))},serializeAttribute:function(e,t,r,a){var i=a.type;if(this._canSerialize(r)){var n=e.attr(r);if(i){var o=this.transformFor(i);n=o.serialize(n,a.options)}var s=this._getMappedKey(r,e.type);s===r&&this.keyForAttribute&&(s=this.keyForAttribute(r,"serialize")),t[s]=n}},serializeBelongsTo:function(e,t,r){var a=r.key;if(this._canSerialize(a)){var i=e.belongsTo(a,{id:!0}),n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"belongsTo","serialize")),c(i)?t[n]=null:t[n]=i,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var a=r.key;if(this._shouldSerializeHasMany(e,a,r)){var i=e.hasMany(a,{ids:!0});if(void 0!==i){var n=this._getMappedKey(a,e.type);n===a&&this.keyForRelationship&&(n=this.keyForRelationship(a,"hasMany","serialize")),t[n]=i}}},serializePolymorphicType:t["default"].K,extractMeta:function(e,t,r){if(r&&r.hasOwnProperty("meta")){var a=r.meta;return delete r.meta,a}},extractErrors:function(e,t,r,a){var i=this;return r&&"object"==typeof r&&r.errors&&(r=(0,s.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=i.keyForAttribute(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=i.keyForRelationship(e,"deserialize");t!==e&&r.hasOwnProperty(t)&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var r=(0,o.getOwner)(this).lookup("transform:"+e);return r}})}),t("ember-data/serializers/rest",["exports","ember","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-inflector","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,a,i,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var u=t["default"].String.camelize,c=a["default"].extend({keyForPolymorphicType:function(e,t,r){var a=this.keyForRelationship(e);return a+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,a,i){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t["default"].makeArray(a).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,i,s,d),a=r.data,u=r.included;if(o.data.push(a),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,a,i){var n=void 0,o=void 0,d=(0,s.modelHasAttributeOrRelationshipNamedType)(a);return!d&&t.type&&e._hasModelFor(this.modelNameFromPayloadKey(t.type))?(n=e.serializerFor(this.modelNameFromPayloadKey(t.type)),o=e.modelFor(this.modelNameFromPayloadKey(t.type))):(n=i,o=a),n.normalize(o,t,r)},_normalizeResponse:function(e,r,a,i,n,s){var d={data:null,included:[]},u=this.extractMeta(e,r,a);u&&(d.meta=u);for(var c=Object.keys(a),h=0,p=c.length;p>h;h++){var f=c[h],m=f,y=!1;"_"===f.charAt(0)&&(y=!0,m=f.substr(1));var v=this.modelNameFromPayloadKey(m);if(e.modelFactoryFor(v)){var b=!y&&this.isPrimaryType(e,v,r),g=a[f];if(null!==g)if(b&&"array"!==t["default"].typeOf(g)){
5
+ var R=this._normalizePolymorphicRecord(e,g,f,r,this),_=R.data,A=R.included;if(d.data=_,A){var z;(z=d.included).push.apply(z,l(A))}}else{var F=this._normalizeArray(e,v,g,f),M=F.data,S=F.included;if(S){var x;(x=d.included).push.apply(x,l(S))}if(s)M.forEach(function(e){var t=b&&(0,o["default"])(e.id)===i,r=b&&!i&&!d.data;r||t?d.data=e:d.included.push(e)});else if(b)d.data=M;else if(M){var T;(T=d.included).push.apply(T,l(M))}}}}return d},isPrimaryType:function(e,t,r){var a=e.modelFor(t);return a.modelName===r.modelName},pushPayload:function(e,r){var a={data:[],included:[]};for(var i in r){var n=this.modelNameFromPayloadKey(i);if(e.modelFactoryFor(n)){var o=e.modelFor(n),s=e.serializerFor(o.modelName);t["default"].makeArray(r[i]).forEach(function(e){var t=s.normalize(o,e,i),r=t.data,n=t.included;if(a.data.push(r),n){var d;(d=a.included).push.apply(d,l(n))}})}}e.push(a)},modelNameFromPayloadKey:function(e){return(0,n.singularize)((0,i["default"])(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,a){var i=this.payloadKeyFromModelName(t.modelName);e[i]=this.serialize(r,a)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,a){var i=a.key,n=e.belongsTo(i),o=this.keyForPolymorphicType(i,a.type,"serialize");i=this.keyForAttribute?this.keyForAttribute(i,"serialize"):i,i+="Type",i!==o&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(o=i),t["default"].isNone(n)?r[o]=null:r[o]=u(n.modelName)},extractPolymorphicRelationship:function(e,t,r){var a=r.key,i=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(a,e,"deserialize");if(o&&i.hasOwnProperty(s)&&"object"!=typeof t){var d=this.modelNameFromPayloadKey(i[s]);return{id:t,type:d}}return this._super.apply(this,arguments)}});e["default"]=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,a,i){function n(e){(0,i["default"])(e),(0,r["default"])(e),(0,a["default"])(e),(0,t["default"])(e)}e["default"]=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e["default"]=t["default"]}),t("ember-data/transform",["exports","ember"],function(e,t){e["default"]=t["default"].Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e["default"]="2.6.0-beta.1"}),t("ember-inflector",["exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,a,i){a.Inflector.defaultRules=a.defaultRules,r["default"].Inflector=a.Inflector,r["default"].String.pluralize=a.pluralize,r["default"].String.singularize=a.singularize,e["default"]=a.Inflector,e.pluralize=a.pluralize,e.singularize=a.singularize,e.defaultRules=a.defaultRules,"undefined"!=typeof t&&t.amd?t("ember-inflector",["exports"],function(e){return e["default"]=a.Inflector,a.Inflector}):"undefined"!=typeof module&&module.exports&&(module.exports=a.Inflector)}),t("ember-inflector/lib/ext/string",["exports","ember","ember-inflector/lib/system/string"],function(e,t,r){(t["default"].EXTEND_PROTOTYPES===!0||t["default"].EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,r.pluralize)(this)},String.prototype.singularize=function(){return(0,r.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e["default"]=(0,r["default"])(function(e){var r=void 0,a=void 0;return 1===e.length?(a=e[0],(0,t.pluralize)(a)):(r=e[0],a=e[1],1!==parseFloat(r)&&(a=(0,t.pluralize)(a)),r+" "+a)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e["default"]=(0,r["default"])(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,a){t["default"].inflector=new t["default"](a["default"]),e.Inflector=t["default"],e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=a["default"]}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e["default"]={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,a=t.length;a>r;r++)e.uncountable[t[r].toLowerCase()]=!0}function a(e,t){for(var r,a=0,i=t.length;i>a;a++)r=t[a],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function i(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),a(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}var o=t["default"].String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");i.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),a(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var a,i,n,c,h,p,f,m,y,v,b;if(m=!e||s.test(e),y=u.test(e),p="",m)return e;if(c=e.toLowerCase(),h=d.exec(e)||l.exec(e),h&&(p=h[1],f=h[2].toLowerCase()),b=this.rules.uncountable[c]||this.rules.uncountable[f])return e;for(v in this.rules.irregular)if(c.match(v+"$"))return i=r[v],y&&r[f]&&(i=o(i),v=o(v)),e.replace(v,i);for(var g=t.length,R=0;g>R&&(a=t[g-1],v=a[0],!v.test(e));g--);return a=a||[],v=a[0],i=a[1],n=e.replace(v,i)}},e["default"]=i}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t["default"].inflector.pluralize(e)}function a(e){return t["default"].inflector.singularize(e)}e.pluralize=r,e.singularize=a}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t["default"].Helper?t["default"].Helper.helper(e):t["default"].HTMLBars?t["default"].HTMLBars.makeBoundHelper(e):t["default"].Handlebars.makeBoundHelper(e)}e["default"]=r}),t("ember",[],function(){return{"default":Ember}}),a("ember-data")}(),function(){function e(){var e={"ember-data":{"default":DS},"ember-data/model":{"default":DS.Model},"ember-data/mixins/embedded-records":{"default":DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{"default":DS.RESTSerializer},"ember-data/serializers/active-model":{"default":DS.ActiveModelSerializer},"ember-data/serializers/json":{"default":DS.JSONSerializer},"ember-data/serializers/json-api":{"default":DS.JSONAPISerializer},"ember-data/serializer":{"default":DS.Serializer},"ember-data/adapters/json-api":{"default":DS.JSONAPIAdapter},"ember-data/adapters/rest":{"default":DS.RESTAdapter},"ember-data/adapter":{"default":DS.Adapter},"ember-data/adapters/active-model":{"default":DS.ActiveModelAdapter},"ember-data/store":{"default":DS.Store},"ember-data/transform":{"default":DS.Transform},"ember-data/attr":{"default":DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in e)t(r,e[r])}function t(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&e()}(),function(){var e=Ember.K;Ember.onLoad("Ember.Application",function(t){t.initializer({name:"ember-data",initialize:DS._setupContainer}),t.instanceInitializer({name:"ember-data",initialize:DS._initializeStoreService}),t.initializer({name:"store",after:"ember-data",initialize:e}),t.initializer({name:"transforms",before:"store",initialize:e}),t.initializer({name:"data-adapter",before:"store",initialize:e}),t.initializer({name:"injectStore",before:"store",initialize:e})})}();
@@ -6,17 +6,44 @@
6
6
  * @copyright Copyright 2011-2016 Tilde Inc. and contributors.
7
7
  * Portions Copyright 2011 LivingSocial Inc.
8
8
  * @license Licensed under MIT license (see license.js)
9
- * @version 2.5.5
9
+ * @version 2.6.0-beta.1
10
10
  */
11
11
 
12
- var define, requireModule, require, requirejs;
12
+ var loader, define, requireModule, require, requirejs;
13
13
 
14
- (function() {
14
+ (function(global) {
15
+ 'use strict';
16
+
17
+ // Save off the original values of these globals, so we can restore them if someone asks us to
18
+ var oldGlobals = {
19
+ loader: loader,
20
+ define: define,
21
+ requireModule: requireModule,
22
+ require: require,
23
+ requirejs: requirejs
24
+ };
25
+
26
+ loader = {
27
+ noConflict: function(aliases) {
28
+ var oldName, newName;
29
+
30
+ for (oldName in aliases) {
31
+ if (aliases.hasOwnProperty(oldName)) {
32
+ if (oldGlobals.hasOwnProperty(oldName)) {
33
+ newName = aliases[oldName];
34
+
35
+ global[newName] = global[oldName];
36
+ global[oldName] = oldGlobals[oldName];
37
+ }
38
+ }
39
+ }
40
+ }
41
+ };
15
42
 
16
43
  var _isArray;
17
44
  if (!Array.isArray) {
18
45
  _isArray = function (x) {
19
- return Object.prototype.toString.call(x) === "[object Array]";
46
+ return Object.prototype.toString.call(x) === '[object Array]';
20
47
  };
21
48
  } else {
22
49
  _isArray = Array.isArray;
@@ -25,33 +52,83 @@ var define, requireModule, require, requirejs;
25
52
  var registry = {};
26
53
  var seen = {};
27
54
  var FAILED = false;
55
+ var LOADED = true;
28
56
 
29
57
  var uuid = 0;
30
58
 
31
- function tryFinally(tryable, finalizer) {
32
- try {
33
- return tryable();
34
- } finally {
35
- finalizer();
36
- }
37
- }
38
-
39
59
  function unsupportedModule(length) {
40
- throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `" + length + "` arguments to define`");
60
+ throw new Error('an unsupported module was defined, expected `define(name, deps, module)` instead got: `' +
61
+ length + '` arguments to define`');
41
62
  }
42
63
 
43
64
  var defaultDeps = ['require', 'exports', 'module'];
44
65
 
45
- function Module(name, deps, callback, exports) {
46
- this.id = uuid++;
47
- this.name = name;
48
- this.deps = !deps.length && callback.length ? defaultDeps : deps;
49
- this.exports = exports || { };
50
- this.callback = callback;
51
- this.state = undefined;
66
+ function Module(name, deps, callback) {
67
+ this.id = uuid++;
68
+ this.name = name;
69
+ this.deps = !deps.length && callback.length ? defaultDeps : deps;
70
+ this.module = { exports: {} };
71
+ this.callback = callback;
72
+ this.state = undefined;
52
73
  this._require = undefined;
74
+ this.finalized = false;
75
+ this.hasExportsAsDep = false;
53
76
  }
54
77
 
78
+ Module.prototype.makeDefaultExport = function() {
79
+ var exports = this.module.exports;
80
+ if (exports !== null &&
81
+ (typeof exports === 'object' || typeof exports === 'function') &&
82
+ exports['default'] === undefined) {
83
+ exports['default'] = exports;
84
+ }
85
+ };
86
+
87
+ Module.prototype.exports = function(reifiedDeps) {
88
+ if (this.finalized) {
89
+ return this.module.exports;
90
+ } else {
91
+ if (loader.wrapModules) {
92
+ this.callback = loader.wrapModules(this.name, this.callback);
93
+ }
94
+ var result = this.callback.apply(this, reifiedDeps);
95
+ if (!(this.hasExportsAsDep && result === undefined)) {
96
+ this.module.exports = result;
97
+ }
98
+ this.makeDefaultExport();
99
+ this.finalized = true;
100
+ return this.module.exports;
101
+ }
102
+ };
103
+
104
+ Module.prototype.unsee = function() {
105
+ this.finalized = false;
106
+ this.state = undefined;
107
+ this.module = { exports: {}};
108
+ };
109
+
110
+ Module.prototype.reify = function() {
111
+ var deps = this.deps;
112
+ var length = deps.length;
113
+ var reified = new Array(length);
114
+ var dep;
115
+
116
+ for (var i = 0, l = length; i < l; i++) {
117
+ dep = deps[i];
118
+ if (dep === 'exports') {
119
+ this.hasExportsAsDep = true;
120
+ reified[i] = this.module.exports;
121
+ } else if (dep === 'require') {
122
+ reified[i] = this.makeRequire();
123
+ } else if (dep === 'module') {
124
+ reified[i] = this.module;
125
+ } else {
126
+ reified[i] = findModule(resolve(dep, this.name), this.name).module.exports;
127
+ }
128
+ }
129
+
130
+ return reified;
131
+ };
55
132
 
56
133
  Module.prototype.makeRequire = function() {
57
134
  var name = this.name;
@@ -59,7 +136,14 @@ var define, requireModule, require, requirejs;
59
136
  return this._require || (this._require = function(dep) {
60
137
  return require(resolve(dep, name));
61
138
  });
62
- }
139
+ };
140
+
141
+ Module.prototype.build = function() {
142
+ if (this.state === FAILED) { return; }
143
+ this.state = FAILED;
144
+ this.exports(this.reify());
145
+ this.state = LOADED;
146
+ };
63
147
 
64
148
  define = function(name, deps, callback) {
65
149
  if (arguments.length < 2) {
@@ -87,91 +171,27 @@ var define, requireModule, require, requirejs;
87
171
  return new Alias(path);
88
172
  };
89
173
 
90
- function reify(mod, name, seen) {
91
- var deps = mod.deps;
92
- var length = deps.length;
93
- var reified = new Array(length);
94
- var dep;
95
- // TODO: new Module
96
- // TODO: seen refactor
97
- var module = { };
98
-
99
- for (var i = 0, l = length; i < l; i++) {
100
- dep = deps[i];
101
- if (dep === 'exports') {
102
- module.exports = reified[i] = seen;
103
- } else if (dep === 'require') {
104
- reified[i] = mod.makeRequire();
105
- } else if (dep === 'module') {
106
- mod.exports = seen;
107
- module = reified[i] = mod;
108
- } else {
109
- reified[i] = requireFrom(resolve(dep, name), name);
110
- }
111
- }
112
-
113
- return {
114
- deps: reified,
115
- module: module
116
- };
117
- }
118
-
119
- function requireFrom(name, origin) {
120
- var mod = registry[name];
121
- if (!mod) {
122
- throw new Error('Could not find module `' + name + '` imported from `' + origin + '`');
123
- }
124
- return require(name);
174
+ function missingModule(name, referrer) {
175
+ throw new Error('Could not find module `' + name + '` imported from `' + referrer + '`');
125
176
  }
126
177
 
127
- function missingModule(name) {
128
- throw new Error('Could not find module ' + name);
129
- }
130
178
  requirejs = require = requireModule = function(name) {
131
- var mod = registry[name];
132
-
133
- if (mod && mod.callback instanceof Alias) {
134
- mod = registry[mod.callback.name];
135
- }
136
-
137
- if (!mod) { missingModule(name); }
138
-
139
- if (mod.state !== FAILED &&
140
- seen.hasOwnProperty(name)) {
141
- return seen[name];
142
- }
143
-
144
- var reified;
145
- var module;
146
- var loaded = false;
147
-
148
- seen[name] = { }; // placeholder for run-time cycles
179
+ return findModule(name, '(require)').module.exports;
180
+ };
149
181
 
150
- tryFinally(function() {
151
- reified = reify(mod, name, seen[name]);
152
- module = mod.callback.apply(this, reified.deps);
153
- loaded = true;
154
- }, function() {
155
- if (!loaded) {
156
- mod.state = FAILED;
157
- }
158
- });
182
+ function findModule(name, referrer) {
183
+ var mod = registry[name] || registry[name + '/index'];
159
184
 
160
- var obj;
161
- if (module === undefined && reified.module.exports) {
162
- obj = reified.module.exports;
163
- } else {
164
- obj = seen[name] = module;
185
+ while (mod && mod.callback instanceof Alias) {
186
+ name = mod.callback.name;
187
+ mod = registry[name];
165
188
  }
166
189
 
167
- if (obj !== null &&
168
- (typeof obj === 'object' || typeof obj === 'function') &&
169
- obj['default'] === undefined) {
170
- obj['default'] = obj;
171
- }
190
+ if (!mod) { missingModule(name, referrer); }
172
191
 
173
- return (seen[name] = obj);
174
- };
192
+ mod.build();
193
+ return mod;
194
+ }
175
195
 
176
196
  function resolve(child, name) {
177
197
  if (child.charAt(0) !== '.') { return child; }
@@ -198,14 +218,14 @@ var define, requireModule, require, requirejs;
198
218
 
199
219
  requirejs.entries = requirejs._eak_seen = registry;
200
220
  requirejs.unsee = function(moduleName) {
201
- delete seen[moduleName];
221
+ findModule(moduleName, '(unsee)').unsee();
202
222
  };
203
223
 
204
224
  requirejs.clear = function() {
205
225
  requirejs.entries = requirejs._eak_seen = registry = {};
206
- seen = state = {};
226
+ seen = {};
207
227
  };
208
- })();
228
+ })(this);
209
229
 
210
230
  define("ember-data/-private/adapters", ["exports", "ember-data/adapters/json-api", "ember-data/adapters/rest"], function (exports, _emberDataAdaptersJsonApi, _emberDataAdaptersRest) {
211
231
  exports.JSONAPIAdapter = _emberDataAdaptersJsonApi.default;
@@ -389,7 +409,7 @@ define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember'], fun
389
409
  },
390
410
 
391
411
  /**
392
- * @method urlForFindBelongTo
412
+ * @method urlForFindBelongsTo
393
413
  * @param {String} id
394
414
  * @param {String} modelName
395
415
  * @param {DS.Snapshot} snapshot
@@ -498,188 +518,6 @@ define('ember-data/-private/adapters/build-url-mixin', ['exports', 'ember'], fun
498
518
  }
499
519
  });
500
520
  });
501
- define('ember-data/-private/adapters/errors', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
502
- exports.AdapterError = AdapterError;
503
- exports.InvalidError = InvalidError;
504
- exports.TimeoutError = TimeoutError;
505
- exports.AbortError = AbortError;
506
- exports.errorsHashToArray = errorsHashToArray;
507
- exports.errorsArrayToHash = errorsArrayToHash;
508
-
509
- var EmberError = _ember.default.Error;
510
-
511
- var SOURCE_POINTER_REGEXP = /^\/?data\/(attributes|relationships)\/(.*)/;
512
- var SOURCE_POINTER_PRIMARY_REGEXP = /^\/?data/;
513
- var PRIMARY_ATTRIBUTE_KEY = 'base';
514
-
515
- /**
516
- @class AdapterError
517
- @namespace DS
518
- */
519
-
520
- function AdapterError(errors) {
521
- var message = arguments.length <= 1 || arguments[1] === undefined ? 'Adapter operation failed' : arguments[1];
522
-
523
- this.isAdapterError = true;
524
- EmberError.call(this, message);
525
-
526
- this.errors = errors || [{
527
- title: 'Adapter Error',
528
- detail: message
529
- }];
530
- }
531
-
532
- AdapterError.prototype = Object.create(EmberError.prototype);
533
-
534
- /**
535
- A `DS.InvalidError` is used by an adapter to signal the external API
536
- was unable to process a request because the content was not
537
- semantically correct or meaningful per the API. Usually this means a
538
- record failed some form of server side validation. When a promise
539
- from an adapter is rejected with a `DS.InvalidError` the record will
540
- transition to the `invalid` state and the errors will be set to the
541
- `errors` property on the record.
542
-
543
- For Ember Data to correctly map errors to their corresponding
544
- properties on the model, Ember Data expects each error to be
545
- a valid json-api error object with a `source/pointer` that matches
546
- the property name. For example if you had a Post model that
547
- looked like this.
548
-
549
- ```app/models/post.js
550
- import DS from 'ember-data';
551
-
552
- export default DS.Model.extend({
553
- title: DS.attr('string'),
554
- content: DS.attr('string')
555
- });
556
- ```
557
-
558
- To show an error from the server related to the `title` and
559
- `content` properties your adapter could return a promise that
560
- rejects with a `DS.InvalidError` object that looks like this:
561
-
562
- ```app/adapters/post.js
563
- import Ember from 'ember';
564
- import DS from 'ember-data';
565
-
566
- export default DS.RESTAdapter.extend({
567
- updateRecord: function() {
568
- // Fictional adapter that always rejects
569
- return Ember.RSVP.reject(new DS.InvalidError([
570
- {
571
- detail: 'Must be unique',
572
- source: { pointer: '/data/attributes/title' }
573
- },
574
- {
575
- detail: 'Must not be blank',
576
- source: { pointer: '/data/attributes/content'}
577
- }
578
- ]));
579
- }
580
- });
581
- ```
582
-
583
- Your backend may use different property names for your records the
584
- store will attempt extract and normalize the errors using the
585
- serializer's `extractErrors` method before the errors get added to
586
- the the model. As a result, it is safe for the `InvalidError` to
587
- wrap the error payload unaltered.
588
-
589
- @class InvalidError
590
- @namespace DS
591
- */
592
-
593
- function InvalidError(errors) {
594
- AdapterError.call(this, errors, 'The adapter rejected the commit because it was invalid');
595
- }
596
-
597
- InvalidError.prototype = Object.create(AdapterError.prototype);
598
-
599
- /**
600
- @class TimeoutError
601
- @namespace DS
602
- */
603
-
604
- function TimeoutError() {
605
- AdapterError.call(this, null, 'The adapter operation timed out');
606
- }
607
-
608
- TimeoutError.prototype = Object.create(AdapterError.prototype);
609
-
610
- /**
611
- @class AbortError
612
- @namespace DS
613
- */
614
-
615
- function AbortError() {
616
- AdapterError.call(this, null, 'The adapter operation was aborted');
617
- }
618
-
619
- AbortError.prototype = Object.create(AdapterError.prototype);
620
-
621
- /**
622
- @method errorsHashToArray
623
- @private
624
- */
625
-
626
- function errorsHashToArray(errors) {
627
- var out = [];
628
-
629
- if (_ember.default.isPresent(errors)) {
630
- Object.keys(errors).forEach(function (key) {
631
- var messages = _ember.default.makeArray(errors[key]);
632
- for (var i = 0; i < messages.length; i++) {
633
- var title = 'Invalid Attribute';
634
- var pointer = '/data/attributes/' + key;
635
- if (key === PRIMARY_ATTRIBUTE_KEY) {
636
- title = 'Invalid Document';
637
- pointer = '/data';
638
- }
639
- out.push({
640
- title: title,
641
- detail: messages[i],
642
- source: {
643
- pointer: pointer
644
- }
645
- });
646
- }
647
- });
648
- }
649
-
650
- return out;
651
- }
652
-
653
- /**
654
- @method errorsArrayToHash
655
- @private
656
- */
657
-
658
- function errorsArrayToHash(errors) {
659
- var out = {};
660
-
661
- if (_ember.default.isPresent(errors)) {
662
- errors.forEach(function (error) {
663
- if (error.source && error.source.pointer) {
664
- var key = error.source.pointer.match(SOURCE_POINTER_REGEXP);
665
-
666
- if (key) {
667
- key = key[2];
668
- } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {
669
- key = PRIMARY_ATTRIBUTE_KEY;
670
- }
671
-
672
- if (key) {
673
- out[key] = out[key] || [];
674
- out[key].push(error.detail || error.title);
675
- }
676
- }
677
- });
678
- }
679
-
680
- return out;
681
- }
682
- });
683
521
  define('ember-data/-private/core', ['exports', 'ember', 'ember-data/version'], function (exports, _ember, _emberDataVersion) {
684
522
 
685
523
  /**
@@ -1387,7 +1225,11 @@ define("ember-data/-private/system/many-array", ["exports", "ember", "ember-data
1387
1225
 
1388
1226
  //a hack for not removing new records
1389
1227
  //TODO remove once we have proper diffing
1390
- var newRecords = this.currentState.filter(function (internalModel) {
1228
+ var newRecords = this.currentState.filter(
1229
+ // only add new records which are not yet in the canonical state of this
1230
+ // relationship (a new record can be in the canonical state if it has
1231
+ // been 'acknowleged' to be in the relationship via a store.push)
1232
+ function (internalModel) {
1391
1233
  return internalModel.isNew() && toSet.indexOf(internalModel) === -1;
1392
1234
  });
1393
1235
  toSet = toSet.concat(newRecords);
@@ -2989,26 +2831,23 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
2989
2831
  }
2990
2832
  };
2991
2833
 
2992
- if (true) {
2834
+ InternalModel.prototype.referenceFor = function (type, name) {
2835
+ var reference = this.references[name];
2993
2836
 
2994
- InternalModel.prototype.referenceFor = function (type, name) {
2995
- var reference = this.references[name];
2837
+ if (!reference) {
2838
+ var relationship = this._relationships.get(name);
2996
2839
 
2997
- if (!reference) {
2998
- var relationship = this._relationships.get(name);
2999
-
3000
- if (type === "belongsTo") {
3001
- reference = new _emberDataPrivateSystemReferences.BelongsToReference(this.store, this, relationship);
3002
- } else if (type === "hasMany") {
3003
- reference = new _emberDataPrivateSystemReferences.HasManyReference(this.store, this, relationship);
3004
- }
3005
-
3006
- this.references[name] = reference;
2840
+ if (type === "belongsTo") {
2841
+ reference = new _emberDataPrivateSystemReferences.BelongsToReference(this.store, this, relationship);
2842
+ } else if (type === "hasMany") {
2843
+ reference = new _emberDataPrivateSystemReferences.HasManyReference(this.store, this, relationship);
3007
2844
  }
3008
2845
 
3009
- return reference;
3010
- };
3011
- }
2846
+ this.references[name] = reference;
2847
+ }
2848
+
2849
+ return reference;
2850
+ };
3012
2851
  });
3013
2852
  define("ember-data/-private/system/model/model", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/model/errors", "ember-data/-private/features", "ember-data/-private/system/debug/debug-info", "ember-data/-private/system/relationships/belongs-to", "ember-data/-private/system/relationships/has-many", "ember-data/-private/system/relationships/ext", "ember-data/-private/system/model/attr"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemModelErrors, _emberDataPrivateFeatures, _emberDataPrivateSystemDebugDebugInfo, _emberDataPrivateSystemRelationshipsBelongsTo, _emberDataPrivateSystemRelationshipsHasMany, _emberDataPrivateSystemRelationshipsExt, _emberDataPrivateSystemModelAttr) {
3014
2853
 
@@ -3757,108 +3596,105 @@ define("ember-data/-private/system/model/model", ["exports", "ember", "ember-dat
3757
3596
  });
3758
3597
  }
3759
3598
 
3760
- if (true) {
3599
+ Model.reopen({
3761
3600
 
3762
- Model.reopen({
3763
-
3764
- /**
3765
- Get the reference for the specified belongsTo relationship.
3766
- Example
3767
- ```javascript
3768
- // models/blog.js
3769
- export default DS.Model.extend({
3770
- user: DS.belongsTo({ async: true })
3771
- });
3772
- store.push({
3773
- type: 'blog',
3774
- id: 1,
3775
- relationships: {
3776
- user: { type: 'user', id: 1 }
3777
- }
3778
- });
3779
- var userRef = blog.belongsTo('user');
3780
- // check if the user relationship is loaded
3781
- var isLoaded = userRef.value() !== null;
3782
- // get the record of the reference (null if not yet available)
3783
- var user = userRef.value();
3784
- // get the identifier of the reference
3785
- if (userRef.remoteType() === "id") {
3786
- var id = userRef.id();
3787
- } else if (userRef.remoteType() === "link") {
3788
- var link = userRef.link();
3789
- }
3790
- // load user (via store.findRecord or store.findBelongsTo)
3791
- userRef.load().then(...)
3792
- // or trigger a reload
3793
- userRef.reload().then(...)
3794
- // provide data for reference
3795
- userRef.push({
3796
- type: 'user',
3797
- id: 1,
3798
- attributes: {
3799
- username: "@user"
3800
- }
3801
- }).then(function(user) {
3802
- userRef.value() === user;
3803
- });
3804
- ```
3805
- @method belongsTo
3806
- @param {String} name of the relationship
3807
- @return {BelongsToReference} reference for this relationship
3808
- */
3809
- belongsTo: function (name) {
3810
- return this._internalModel.referenceFor('belongsTo', name);
3811
- },
3601
+ /**
3602
+ Get the reference for the specified belongsTo relationship.
3603
+ Example
3604
+ ```javascript
3605
+ // models/blog.js
3606
+ export default DS.Model.extend({
3607
+ user: DS.belongsTo({ async: true })
3608
+ });
3609
+ store.push({
3610
+ type: 'blog',
3611
+ id: 1,
3612
+ relationships: {
3613
+ user: { type: 'user', id: 1 }
3614
+ }
3615
+ });
3616
+ var userRef = blog.belongsTo('user');
3617
+ // check if the user relationship is loaded
3618
+ var isLoaded = userRef.value() !== null;
3619
+ // get the record of the reference (null if not yet available)
3620
+ var user = userRef.value();
3621
+ // get the identifier of the reference
3622
+ if (userRef.remoteType() === "id") {
3623
+ var id = userRef.id();
3624
+ } else if (userRef.remoteType() === "link") {
3625
+ var link = userRef.link();
3626
+ }
3627
+ // load user (via store.findRecord or store.findBelongsTo)
3628
+ userRef.load().then(...)
3629
+ // or trigger a reload
3630
+ userRef.reload().then(...)
3631
+ // provide data for reference
3632
+ userRef.push({
3633
+ type: 'user',
3634
+ id: 1,
3635
+ attributes: {
3636
+ username: "@user"
3637
+ }
3638
+ }).then(function(user) {
3639
+ userRef.value() === user;
3640
+ });
3641
+ ```
3642
+ @method belongsTo
3643
+ @param {String} name of the relationship
3644
+ @return {BelongsToReference} reference for this relationship
3645
+ */
3646
+ belongsTo: function (name) {
3647
+ return this._internalModel.referenceFor('belongsTo', name);
3648
+ },
3812
3649
 
3813
- /**
3814
- Get the reference for the specified hasMany relationship.
3815
- Example
3816
- ```javascript
3817
- // models/blog.js
3818
- export default DS.Model.extend({
3819
- comments: DS.hasMany({ async: true })
3820
- });
3821
- store.push({
3822
- type: 'blog',
3823
- id: 1,
3824
- relationships: {
3825
- comments: {
3826
- data: [
3827
- { type: 'comment', id: 1 },
3828
- { type: 'comment', id: 2 }
3829
- ]
3830
- }
3650
+ /**
3651
+ Get the reference for the specified hasMany relationship.
3652
+ Example
3653
+ ```javascript
3654
+ // models/blog.js
3655
+ export default DS.Model.extend({
3656
+ comments: DS.hasMany({ async: true })
3657
+ });
3658
+ store.push({
3659
+ type: 'blog',
3660
+ id: 1,
3661
+ relationships: {
3662
+ comments: {
3663
+ data: [
3664
+ { type: 'comment', id: 1 },
3665
+ { type: 'comment', id: 2 }
3666
+ ]
3831
3667
  }
3832
- });
3833
- var commentsRef = blog.hasMany('comments');
3834
- // check if the comments are loaded already
3835
- var isLoaded = commentsRef.value() !== null;
3836
- // get the records of the reference (null if not yet available)
3837
- var comments = commentsRef.value();
3838
- // get the identifier of the reference
3839
- if (commentsRef.remoteType() === "ids") {
3840
- var ids = commentsRef.ids();
3841
- } else if (commentsRef.remoteType() === "link") {
3842
- var link = commentsRef.link();
3843
- }
3844
- // load comments (via store.findMany or store.findHasMany)
3845
- commentsRef.load().then(...)
3846
- // or trigger a reload
3847
- commentsRef.reload().then(...)
3848
- // provide data for reference
3849
- commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
3850
- commentsRef.value() === comments;
3851
- });
3852
- ```
3853
- @method hasMany
3854
- @param {String} name of the relationship
3855
- @return {HasManyReference} reference for this relationship
3856
- */
3857
- hasMany: function (name) {
3858
- return this._internalModel.referenceFor('hasMany', name);
3668
+ }
3669
+ });
3670
+ var commentsRef = blog.hasMany('comments');
3671
+ // check if the comments are loaded already
3672
+ var isLoaded = commentsRef.value() !== null;
3673
+ // get the records of the reference (null if not yet available)
3674
+ var comments = commentsRef.value();
3675
+ // get the identifier of the reference
3676
+ if (commentsRef.remoteType() === "ids") {
3677
+ var ids = commentsRef.ids();
3678
+ } else if (commentsRef.remoteType() === "link") {
3679
+ var link = commentsRef.link();
3859
3680
  }
3860
- });
3861
- }
3681
+ // load comments (via store.findMany or store.findHasMany)
3682
+ commentsRef.load().then(...)
3683
+ // or trigger a reload
3684
+ commentsRef.reload().then(...)
3685
+ // provide data for reference
3686
+ commentsRef.push([{ type: 'comment', id: 1 }, { type: 'comment', id: 2 }]).then(function(comments) {
3687
+ commentsRef.value() === comments;
3688
+ });
3689
+ ```
3690
+ @method hasMany
3691
+ @param {String} name of the relationship
3692
+ @return {HasManyReference} reference for this relationship
3693
+ */
3694
+ hasMany: function (name) {
3695
+ return this._internalModel.referenceFor('hasMany', name);
3696
+ }
3697
+ });
3862
3698
 
3863
3699
  Model.reopenClass(_emberDataPrivateSystemRelationshipsExt.RelationshipsClassMethodsMixin);
3864
3700
  Model.reopenClass(_emberDataPrivateSystemModelAttr.AttrClassMethodsMixin);
@@ -5191,7 +5027,7 @@ define("ember-data/-private/system/record-arrays", ["exports", "ember-data/-priv
5191
5027
  /**
5192
5028
  @module ember-data
5193
5029
  */
5194
- define("ember-data/-private/system/record-arrays/adapter-populated-record-array", ["exports", "ember", "ember-data/-private/system/record-arrays/record-array", "ember-data/-private/system/clone-null"], function (exports, _ember, _emberDataPrivateSystemRecordArraysRecordArray, _emberDataPrivateSystemCloneNull) {
5030
+ define("ember-data/-private/system/record-arrays/adapter-populated-record-array", ["exports", "ember", "ember-data/-private/system/record-arrays/record-array", "ember-data/-private/system/clone-null", "ember-data/-private/features"], function (exports, _ember, _emberDataPrivateSystemRecordArraysRecordArray, _emberDataPrivateSystemCloneNull, _emberDataPrivateFeatures) {
5195
5031
 
5196
5032
  /**
5197
5033
  @module ember-data
@@ -6851,9 +6687,17 @@ define("ember-data/-private/system/relationships/state/create", ["exports", "emb
6851
6687
 
6852
6688
  var get = _ember.default.get;
6853
6689
 
6690
+ function shouldFindInverse(relationshipMeta) {
6691
+ var options = relationshipMeta.options;
6692
+ return !(options && options.inverse === null);
6693
+ }
6694
+
6854
6695
  function createRelationshipFor(record, relationshipMeta, store) {
6855
- var inverseKey;
6856
- var inverse = record.type.inverseFor(relationshipMeta.key, store);
6696
+ var inverseKey = undefined;
6697
+ var inverse = null;
6698
+ if (shouldFindInverse(relationshipMeta)) {
6699
+ inverse = record.type.inverseFor(relationshipMeta.key, store);
6700
+ }
6857
6701
 
6858
6702
  if (inverse) {
6859
6703
  inverseKey = inverse.name;
@@ -7425,9 +7269,7 @@ define('ember-data/-private/system/snapshot-record-array', ['exports', 'ember-da
7425
7269
  */
7426
7270
  this.adapterOptions = options.adapterOptions;
7427
7271
 
7428
- if (true) {
7429
- this.include = options.include;
7430
- }
7272
+ this.include = options.include;
7431
7273
  }
7432
7274
 
7433
7275
  /**
@@ -7490,9 +7332,7 @@ define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-
7490
7332
  */
7491
7333
  this.adapterOptions = options.adapterOptions;
7492
7334
 
7493
- if (true) {
7494
- this.include = options.include;
7495
- }
7335
+ this.include = options.include;
7496
7336
 
7497
7337
  this._changedAttributes = record.changedAttributes();
7498
7338
  }
@@ -7776,13 +7616,12 @@ define('ember-data/-private/system/snapshot', ['exports', 'ember', 'ember-data/-
7776
7616
  /**
7777
7617
  @module ember-data
7778
7618
  */
7779
- define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/model', 'ember-data/-private/debug', 'ember-data/-private/system/normalize-link', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/adapters/errors', 'ember-data/-private/system/promise-proxies', 'ember-data/-private/system/store/common', 'ember-data/-private/system/store/serializer-response', 'ember-data/-private/system/store/serializers', 'ember-data/-private/system/store/finders', 'ember-data/-private/utils', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/record-array-manager', 'ember-data/-private/system/store/container-instance-cache', 'ember-data/-private/system/model/internal-model', 'ember-data/-private/system/empty-object', 'ember-data/-private/features'], function (exports, _ember, _emberDataModel, _emberDataPrivateDebug, _emberDataPrivateSystemNormalizeLink, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateAdaptersErrors, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStoreCommon, _emberDataPrivateSystemStoreSerializerResponse, _emberDataPrivateSystemStoreSerializers, _emberDataPrivateSystemStoreFinders, _emberDataPrivateUtils, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateSystemStoreContainerInstanceCache, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemEmptyObject, _emberDataPrivateFeatures) {
7619
+ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/model', 'ember-data/-private/debug', 'ember-data/-private/system/normalize-link', 'ember-data/-private/system/normalize-model-name', 'ember-data/adapters/errors', 'ember-data/-private/system/promise-proxies', 'ember-data/-private/system/store/common', 'ember-data/-private/system/store/serializer-response', 'ember-data/-private/system/store/serializers', 'ember-data/-private/system/store/finders', 'ember-data/-private/utils', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/record-array-manager', 'ember-data/-private/system/store/container-instance-cache', 'ember-data/-private/system/model/internal-model', 'ember-data/-private/system/empty-object', 'ember-data/-private/features'], function (exports, _ember, _emberDataModel, _emberDataPrivateDebug, _emberDataPrivateSystemNormalizeLink, _emberDataPrivateSystemNormalizeModelName, _emberDataAdaptersErrors, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStoreCommon, _emberDataPrivateSystemStoreSerializerResponse, _emberDataPrivateSystemStoreSerializers, _emberDataPrivateSystemStoreFinders, _emberDataPrivateUtils, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateSystemStoreContainerInstanceCache, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemEmptyObject, _emberDataPrivateFeatures) {
7780
7620
  var badIdFormatAssertion = '`id` has to be non-empty string or number';
7781
7621
 
7782
7622
  exports.badIdFormatAssertion = badIdFormatAssertion;
7783
7623
  var Backburner = _ember.default._Backburner;
7784
7624
  var Map = _ember.default.Map;
7785
- var isArray = Array.isArray || _ember.default.isArray;
7786
7625
 
7787
7626
  //Get the materialized model from the internalModel/promise that returns
7788
7627
  //an internal model and return it in a promiseObject. Useful for returning
@@ -8606,8 +8445,6 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
8606
8445
  var adapter = this.adapterFor(typeClass.modelName);
8607
8446
  var sinceToken = this.typeMapFor(typeClass).metadata.since;
8608
8447
 
8609
- set(array, 'isUpdating', true);
8610
-
8611
8448
  if (options.reload) {
8612
8449
  return (0, _emberDataPrivateSystemPromiseProxies.promiseArray)((0, _emberDataPrivateSystemStoreFinders._findAll)(adapter, this, typeClass, sinceToken, options));
8613
8450
  }
@@ -9192,7 +9029,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9192
9029
  }
9193
9030
  }
9194
9031
 
9195
- if (isArray(data.data)) {
9032
+ if (Array.isArray(data.data)) {
9196
9033
  length = data.data.length;
9197
9034
  var internalModels = new Array(length);
9198
9035
  for (i = 0; i < length; i++) {
@@ -9219,13 +9056,6 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9219
9056
 
9220
9057
  var modelName = data.type;
9221
9058
 
9222
- var type = this.modelFor(modelName);
9223
-
9224
- // If Ember.ENV.DS_WARN_ON_UNKNOWN_KEYS is set to true and the payload
9225
- // contains unknown keys, log a warning.
9226
-
9227
- if (_ember.default.ENV.DS_WARN_ON_UNKNOWN_KEYS) {}
9228
-
9229
9059
  // Actually load the record into the store.
9230
9060
  var internalModel = this._load(data);
9231
9061
 
@@ -9298,15 +9128,10 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9298
9128
 
9299
9129
  serializer = this.serializerFor(modelName);
9300
9130
  }
9301
- if (false) {
9302
- return this._adapterRun(function () {
9303
- return serializer.pushPayload(_this3, payload);
9304
- });
9305
- } else {
9306
- this._adapterRun(function () {
9307
- return serializer.pushPayload(_this3, payload);
9308
- });
9309
- }
9131
+
9132
+ this._adapterRun(function () {
9133
+ return serializer.pushPayload(_this3, payload);
9134
+ });
9310
9135
  },
9311
9136
 
9312
9137
  /**
@@ -9317,7 +9142,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9317
9142
  socket.on('message', function(message) {
9318
9143
  var modelName = message.model;
9319
9144
  var data = message.data;
9320
- store.push(modelName, store.normalize(modelName, data));
9145
+ store.push(store.normalize(modelName, data));
9321
9146
  });
9322
9147
  ```
9323
9148
  @method normalize
@@ -9490,41 +9315,38 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9490
9315
 
9491
9316
  });
9492
9317
 
9493
- if (true) {
9494
-
9495
- Store.reopen({
9496
- /**
9497
- Get the reference for the specified record.
9498
- Example
9499
- ```javascript
9500
- var userRef = store.getReference('user', 1);
9501
- // check if the user is loaded
9502
- var isLoaded = userRef.value() !== null;
9503
- // get the record of the reference (null if not yet available)
9504
- var user = userRef.value();
9505
- // get the identifier of the reference
9506
- if (userRef.remoteType() === "id") {
9507
- var id = userRef.id();
9508
- }
9509
- // load user (via store.find)
9510
- userRef.load().then(...)
9511
- // or trigger a reload
9512
- userRef.reload().then(...)
9513
- // provide data for reference
9514
- userRef.push({ id: 1, username: "@user" }).then(function(user) {
9515
- userRef.value() === user;
9516
- });
9517
- ```
9518
- @method getReference
9519
- @param {String} type
9520
- @param {String|Integer} id
9521
- @return {RecordReference}
9522
- */
9523
- getReference: function (type, id) {
9524
- return this._internalModelForId(type, id).recordReference;
9525
- }
9526
- });
9527
- }
9318
+ Store.reopen({
9319
+ /**
9320
+ Get the reference for the specified record.
9321
+ Example
9322
+ ```javascript
9323
+ var userRef = store.getReference('user', 1);
9324
+ // check if the user is loaded
9325
+ var isLoaded = userRef.value() !== null;
9326
+ // get the record of the reference (null if not yet available)
9327
+ var user = userRef.value();
9328
+ // get the identifier of the reference
9329
+ if (userRef.remoteType() === "id") {
9330
+ var id = userRef.id();
9331
+ }
9332
+ // load user (via store.find)
9333
+ userRef.load().then(...)
9334
+ // or trigger a reload
9335
+ userRef.reload().then(...)
9336
+ // provide data for reference
9337
+ userRef.push({ id: 1, username: "@user" }).then(function(user) {
9338
+ userRef.value() === user;
9339
+ });
9340
+ ```
9341
+ @method getReference
9342
+ @param {String} type
9343
+ @param {String|Integer} id
9344
+ @return {RecordReference}
9345
+ */
9346
+ getReference: function (type, id) {
9347
+ return this._internalModelForId(type, id).recordReference;
9348
+ }
9349
+ });
9528
9350
 
9529
9351
  function deserializeRecordId(store, key, relationship, id) {
9530
9352
  if (isNone(id)) {
@@ -9582,7 +9404,7 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9582
9404
 
9583
9405
  return internalModel;
9584
9406
  }, function (error) {
9585
- if (error instanceof _emberDataPrivateAdaptersErrors.InvalidError) {
9407
+ if (error instanceof _emberDataAdaptersErrors.InvalidError) {
9586
9408
  var errors = serializer.extractErrors(store, typeClass, error, snapshot.id);
9587
9409
  store.recordWasInvalid(internalModel, errors);
9588
9410
  } else {
@@ -9657,6 +9479,13 @@ define('ember-data/-private/system/store', ['exports', 'ember', 'ember-data/mode
9657
9479
  /**
9658
9480
  @module ember-data
9659
9481
  */
9482
+
9483
+ // If Ember.ENV.DS_WARN_ON_UNKNOWN_KEYS is set to true and the payload
9484
+ // contains unknown attributes or relationships, log a warning.
9485
+
9486
+ // Check unknown attributes
9487
+
9488
+ // Check unknown relationships
9660
9489
  define('ember-data/-private/system/store/common', ['exports', 'ember'], function (exports, _ember) {
9661
9490
  exports._bind = _bind;
9662
9491
  exports._guard = _guard;
@@ -9787,7 +9616,7 @@ define("ember-data/-private/system/store/finders", ["exports", "ember", "ember-d
9787
9616
  var Promise = _ember.default.RSVP.Promise;
9788
9617
 
9789
9618
  function payloadIsNotBlank(adapterPayload) {
9790
- if (_ember.default.isArray(adapterPayload)) {
9619
+ if (Array.isArray(adapterPayload)) {
9791
9620
  return true;
9792
9621
  } else {
9793
9622
  return Object.keys(adapterPayload || {}).length;
@@ -9996,7 +9825,7 @@ define('ember-data/-private/system/store/serializer-response', ['exports', 'embe
9996
9825
  }
9997
9826
  }
9998
9827
  if ('data' in doc) {
9999
- if (!(doc.data === null || _ember.default.isArray(doc.data) || typeof doc.data === 'object')) {
9828
+ if (!(doc.data === null || Array.isArray(doc.data) || typeof doc.data === 'object')) {
10000
9829
  errors.push('data must be null, an object, or an array');
10001
9830
  }
10002
9831
  }
@@ -10006,7 +9835,7 @@ define('ember-data/-private/system/store/serializer-response', ['exports', 'embe
10006
9835
  }
10007
9836
  }
10008
9837
  if ('errors' in doc) {
10009
- if (!_ember.default.isArray(doc.errors)) {
9838
+ if (!Array.isArray(doc.errors)) {
10010
9839
  errors.push('errors must be an array');
10011
9840
  }
10012
9841
  }
@@ -10078,7 +9907,8 @@ define("ember-data/-private/transforms", ["exports", "ember-data/transform", "em
10078
9907
  exports.StringTransform = _emberDataPrivateTransformsString.default;
10079
9908
  exports.BooleanTransform = _emberDataPrivateTransformsBoolean.default;
10080
9909
  });
10081
- define("ember-data/-private/transforms/boolean", ["exports", "ember-data/transform"], function (exports, _emberDataTransform) {
9910
+ define('ember-data/-private/transforms/boolean', ['exports', 'ember', 'ember-data/transform', 'ember-data/-private/features'], function (exports, _ember, _emberDataTransform, _emberDataPrivateFeatures) {
9911
+ var isNone = _ember.default.isNone;
10082
9912
 
10083
9913
  /**
10084
9914
  The `DS.BooleanTransform` class is used to serialize and deserialize
@@ -10103,7 +9933,7 @@ define("ember-data/-private/transforms/boolean", ["exports", "ember-data/transfo
10103
9933
  @namespace DS
10104
9934
  */
10105
9935
  exports.default = _emberDataTransform.default.extend({
10106
- deserialize: function (serialized) {
9936
+ deserialize: function (serialized, options) {
10107
9937
  var type = typeof serialized;
10108
9938
 
10109
9939
  if (type === "boolean") {
@@ -10117,7 +9947,8 @@ define("ember-data/-private/transforms/boolean", ["exports", "ember-data/transfo
10117
9947
  }
10118
9948
  },
10119
9949
 
10120
- serialize: function (deserialized) {
9950
+ serialize: function (deserialized, options) {
9951
+
10121
9952
  return Boolean(deserialized);
10122
9953
  }
10123
9954
  });
@@ -10425,9 +10256,9 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
10425
10256
  /**
10426
10257
  The `findRecord()` method is invoked when the store is asked for a record that
10427
10258
  has not previously been loaded. In response to `findRecord()` being called, you
10428
- should query your persistence layer for a record with the given ID. Once
10429
- found, you can asynchronously call the store's `push()` method to push
10430
- the record into the store.
10259
+ should query your persistence layer for a record with the given ID. The `findRecord`
10260
+ method should return a promise that will resolve to a JavaScript object that will be
10261
+ normalized by the serializer.
10431
10262
  Here is an example `findRecord` implementation:
10432
10263
  ```app/adapters/application.js
10433
10264
  import DS from 'ember-data';
@@ -10697,123 +10528,354 @@ define('ember-data/adapter', ['exports', 'ember'], function (exports, _ember) {
10697
10528
  });
10698
10529
  }
10699
10530
  });
10700
- ```
10701
- @method deleteRecord
10702
- @param {DS.Store} store
10703
- @param {DS.Model} type the DS.Model class of the record
10704
- @param {DS.Snapshot} snapshot
10705
- @return {Promise} promise
10706
- */
10707
- deleteRecord: null,
10708
-
10709
- /**
10710
- By default the store will try to coalesce all `fetchRecord` calls within the same runloop
10711
- into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.
10712
- You can opt out of this behaviour by either not implementing the findMany hook or by setting
10713
- coalesceFindRequests to false.
10714
- @property coalesceFindRequests
10715
- @type {boolean}
10716
- */
10717
- coalesceFindRequests: true,
10531
+ ```
10532
+ @method deleteRecord
10533
+ @param {DS.Store} store
10534
+ @param {DS.Model} type the DS.Model class of the record
10535
+ @param {DS.Snapshot} snapshot
10536
+ @return {Promise} promise
10537
+ */
10538
+ deleteRecord: null,
10539
+
10540
+ /**
10541
+ By default the store will try to coalesce all `fetchRecord` calls within the same runloop
10542
+ into as few requests as possible by calling groupRecordsForFindMany and passing it into a findMany call.
10543
+ You can opt out of this behaviour by either not implementing the findMany hook or by setting
10544
+ coalesceFindRequests to false.
10545
+ @property coalesceFindRequests
10546
+ @type {boolean}
10547
+ */
10548
+ coalesceFindRequests: true,
10549
+
10550
+ /**
10551
+ Find multiple records at once if coalesceFindRequests is true.
10552
+ @method findMany
10553
+ @param {DS.Store} store
10554
+ @param {DS.Model} type the DS.Model class of the records
10555
+ @param {Array} ids
10556
+ @param {Array} snapshots
10557
+ @return {Promise} promise
10558
+ */
10559
+ findMany: null,
10560
+
10561
+ /**
10562
+ Organize records into groups, each of which is to be passed to separate
10563
+ calls to `findMany`.
10564
+ For example, if your api has nested URLs that depend on the parent, you will
10565
+ want to group records by their parent.
10566
+ The default implementation returns the records as a single group.
10567
+ @method groupRecordsForFindMany
10568
+ @param {DS.Store} store
10569
+ @param {Array} snapshots
10570
+ @return {Array} an array of arrays of records, each of which is to be
10571
+ loaded separately by `findMany`.
10572
+ */
10573
+ groupRecordsForFindMany: function (store, snapshots) {
10574
+ return [snapshots];
10575
+ },
10576
+
10577
+ /**
10578
+ This method is used by the store to determine if the store should
10579
+ reload a record from the adapter when a record is requested by
10580
+ `store.findRecord`.
10581
+ If this method returns true, the store will re-fetch a record from
10582
+ the adapter. If this method returns false, the store will resolve
10583
+ immediately using the cached record.
10584
+ @method shouldReloadRecord
10585
+ @param {DS.Store} store
10586
+ @param {DS.Snapshot} snapshot
10587
+ @return {Boolean}
10588
+ */
10589
+ shouldReloadRecord: function (store, snapshot) {
10590
+ return false;
10591
+ },
10592
+
10593
+ /**
10594
+ This method is used by the store to determine if the store should
10595
+ reload all records from the adapter when records are requested by
10596
+ `store.findAll`.
10597
+ If this method returns true, the store will re-fetch all records from
10598
+ the adapter. If this method returns false, the store will resolve
10599
+ immediately using the cached record.
10600
+ @method shouldReloadAll
10601
+ @param {DS.Store} store
10602
+ @param {DS.SnapshotRecordArray} snapshotRecordArray
10603
+ @return {Boolean}
10604
+ */
10605
+ shouldReloadAll: function (store, snapshotRecordArray) {
10606
+ return !snapshotRecordArray.length;
10607
+ },
10608
+
10609
+ /**
10610
+ This method is used by the store to determine if the store should
10611
+ reload a record after the `store.findRecord` method resolves a
10612
+ cached record.
10613
+ This method is *only* checked by the store when the store is
10614
+ returning a cached record.
10615
+ If this method returns true the store will re-fetch a record from
10616
+ the adapter.
10617
+ @method shouldBackgroundReloadRecord
10618
+ @param {DS.Store} store
10619
+ @param {DS.Snapshot} snapshot
10620
+ @return {Boolean}
10621
+ */
10622
+ shouldBackgroundReloadRecord: function (store, snapshot) {
10623
+ return true;
10624
+ },
10625
+
10626
+ /**
10627
+ This method is used by the store to determine if the store should
10628
+ reload a record array after the `store.findAll` method resolves
10629
+ with a cached record array.
10630
+ This method is *only* checked by the store when the store is
10631
+ returning a cached record array.
10632
+ If this method returns true the store will re-fetch all records
10633
+ from the adapter.
10634
+ @method shouldBackgroundReloadAll
10635
+ @param {DS.Store} store
10636
+ @param {DS.SnapshotRecordArray} snapshotRecordArray
10637
+ @return {Boolean}
10638
+ */
10639
+ shouldBackgroundReloadAll: function (store, snapshotRecordArray) {
10640
+ return true;
10641
+ }
10642
+ });
10643
+ });
10644
+ /**
10645
+ @module ember-data
10646
+ */
10647
+ define('ember-data/adapters/errors', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures) {
10648
+ exports.AdapterError = AdapterError;
10649
+ exports.errorsHashToArray = errorsHashToArray;
10650
+ exports.errorsArrayToHash = errorsArrayToHash;
10651
+
10652
+ var EmberError = _ember.default.Error;
10653
+
10654
+ var SOURCE_POINTER_REGEXP = /^\/?data\/(attributes|relationships)\/(.*)/;
10655
+ var SOURCE_POINTER_PRIMARY_REGEXP = /^\/?data/;
10656
+ var PRIMARY_ATTRIBUTE_KEY = 'base';
10657
+
10658
+ /**
10659
+ @class AdapterError
10660
+ @namespace DS
10661
+ */
10662
+
10663
+ function AdapterError(errors) {
10664
+ var message = arguments.length <= 1 || arguments[1] === undefined ? 'Adapter operation failed' : arguments[1];
10665
+
10666
+ this.isAdapterError = true;
10667
+ EmberError.call(this, message);
10668
+
10669
+ this.errors = errors || [{
10670
+ title: 'Adapter Error',
10671
+ detail: message
10672
+ }];
10673
+ }
10674
+
10675
+ var extendedErrorsEnabled = false;
10676
+
10677
+ function extendFn(ErrorClass) {
10678
+ return function () {
10679
+ var _ref = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
10680
+
10681
+ var defaultMessage = _ref.message;
10682
+
10683
+ return extend(ErrorClass, defaultMessage);
10684
+ };
10685
+ }
10686
+
10687
+ function extend(ParentErrorClass, defaultMessage) {
10688
+ var ErrorClass = function (errors, message) {
10689
+ ParentErrorClass.call(this, errors, message || defaultMessage);
10690
+ };
10691
+ ErrorClass.prototype = Object.create(ParentErrorClass.prototype);
10692
+
10693
+ if (extendedErrorsEnabled) {
10694
+ ErrorClass.extend = extendFn(ErrorClass);
10695
+ }
10696
+
10697
+ return ErrorClass;
10698
+ }
10699
+
10700
+ AdapterError.prototype = Object.create(EmberError.prototype);
10701
+
10702
+ if (extendedErrorsEnabled) {
10703
+ AdapterError.extend = extendFn(AdapterError);
10704
+ }
10705
+
10706
+ /**
10707
+ A `DS.InvalidError` is used by an adapter to signal the external API
10708
+ was unable to process a request because the content was not
10709
+ semantically correct or meaningful per the API. Usually this means a
10710
+ record failed some form of server side validation. When a promise
10711
+ from an adapter is rejected with a `DS.InvalidError` the record will
10712
+ transition to the `invalid` state and the errors will be set to the
10713
+ `errors` property on the record.
10714
+
10715
+ For Ember Data to correctly map errors to their corresponding
10716
+ properties on the model, Ember Data expects each error to be
10717
+ a valid json-api error object with a `source/pointer` that matches
10718
+ the property name. For example if you had a Post model that
10719
+ looked like this.
10720
+
10721
+ ```app/models/post.js
10722
+ import DS from 'ember-data';
10723
+
10724
+ export default DS.Model.extend({
10725
+ title: DS.attr('string'),
10726
+ content: DS.attr('string')
10727
+ });
10728
+ ```
10729
+
10730
+ To show an error from the server related to the `title` and
10731
+ `content` properties your adapter could return a promise that
10732
+ rejects with a `DS.InvalidError` object that looks like this:
10733
+
10734
+ ```app/adapters/post.js
10735
+ import Ember from 'ember';
10736
+ import DS from 'ember-data';
10737
+
10738
+ export default DS.RESTAdapter.extend({
10739
+ updateRecord: function() {
10740
+ // Fictional adapter that always rejects
10741
+ return Ember.RSVP.reject(new DS.InvalidError([
10742
+ {
10743
+ detail: 'Must be unique',
10744
+ source: { pointer: '/data/attributes/title' }
10745
+ },
10746
+ {
10747
+ detail: 'Must not be blank',
10748
+ source: { pointer: '/data/attributes/content'}
10749
+ }
10750
+ ]));
10751
+ }
10752
+ });
10753
+ ```
10754
+
10755
+ Your backend may use different property names for your records the
10756
+ store will attempt extract and normalize the errors using the
10757
+ serializer's `extractErrors` method before the errors get added to
10758
+ the the model. As a result, it is safe for the `InvalidError` to
10759
+ wrap the error payload unaltered.
10760
+
10761
+ @class InvalidError
10762
+ @namespace DS
10763
+ */
10764
+ var InvalidError = extend(AdapterError, 'The adapter rejected the commit because it was invalid');
10765
+
10766
+ exports.InvalidError = InvalidError;
10767
+ /**
10768
+ @class TimeoutError
10769
+ @namespace DS
10770
+ */
10771
+ var TimeoutError = extend(AdapterError, 'The adapter operation timed out');
10772
+
10773
+ exports.TimeoutError = TimeoutError;
10774
+ /**
10775
+ @class AbortError
10776
+ @namespace DS
10777
+ */
10778
+ var AbortError = extend(AdapterError, 'The adapter operation was aborted');
10779
+
10780
+ exports.AbortError = AbortError;
10781
+ /**
10782
+ @class UnauthorizedError
10783
+ @namespace DS
10784
+ */
10785
+ var UnauthorizedError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation is unauthorized') : null;
10786
+
10787
+ exports.UnauthorizedError = UnauthorizedError;
10788
+ /**
10789
+ @class ForbiddenError
10790
+ @namespace DS
10791
+ */
10792
+ var ForbiddenError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation is forbidden') : null;
10793
+
10794
+ exports.ForbiddenError = ForbiddenError;
10795
+ /**
10796
+ @class NotFoundError
10797
+ @namespace DS
10798
+ */
10799
+ var NotFoundError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter could not find the resource') : null;
10800
+
10801
+ exports.NotFoundError = NotFoundError;
10802
+ /**
10803
+ @class ConflictError
10804
+ @namespace DS
10805
+ */
10806
+ var ConflictError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation failed due to a conflict') : null;
10807
+
10808
+ exports.ConflictError = ConflictError;
10809
+ /**
10810
+ @class ServerError
10811
+ @namespace DS
10812
+ */
10813
+ var ServerError = extendedErrorsEnabled ? extend(AdapterError, 'The adapter operation failed due to a server error') : null;
10814
+
10815
+ exports.ServerError = ServerError;
10816
+ /**
10817
+ @method errorsHashToArray
10818
+ @private
10819
+ */
10820
+
10821
+ function errorsHashToArray(errors) {
10822
+ var out = [];
10823
+
10824
+ if (_ember.default.isPresent(errors)) {
10825
+ Object.keys(errors).forEach(function (key) {
10826
+ var messages = _ember.default.makeArray(errors[key]);
10827
+ for (var i = 0; i < messages.length; i++) {
10828
+ var title = 'Invalid Attribute';
10829
+ var pointer = '/data/attributes/' + key;
10830
+ if (key === PRIMARY_ATTRIBUTE_KEY) {
10831
+ title = 'Invalid Document';
10832
+ pointer = '/data';
10833
+ }
10834
+ out.push({
10835
+ title: title,
10836
+ detail: messages[i],
10837
+ source: {
10838
+ pointer: pointer
10839
+ }
10840
+ });
10841
+ }
10842
+ });
10843
+ }
10718
10844
 
10719
- /**
10720
- Find multiple records at once if coalesceFindRequests is true.
10721
- @method findMany
10722
- @param {DS.Store} store
10723
- @param {DS.Model} type the DS.Model class of the records
10724
- @param {Array} ids
10725
- @param {Array} snapshots
10726
- @return {Promise} promise
10727
- */
10728
- findMany: null,
10845
+ return out;
10846
+ }
10729
10847
 
10730
- /**
10731
- Organize records into groups, each of which is to be passed to separate
10732
- calls to `findMany`.
10733
- For example, if your api has nested URLs that depend on the parent, you will
10734
- want to group records by their parent.
10735
- The default implementation returns the records as a single group.
10736
- @method groupRecordsForFindMany
10737
- @param {DS.Store} store
10738
- @param {Array} snapshots
10739
- @return {Array} an array of arrays of records, each of which is to be
10740
- loaded separately by `findMany`.
10741
- */
10742
- groupRecordsForFindMany: function (store, snapshots) {
10743
- return [snapshots];
10744
- },
10848
+ /**
10849
+ @method errorsArrayToHash
10850
+ @private
10851
+ */
10745
10852
 
10746
- /**
10747
- This method is used by the store to determine if the store should
10748
- reload a record from the adapter when a record is requested by
10749
- `store.findRecord`.
10750
- If this method returns true, the store will re-fetch a record from
10751
- the adapter. If this method returns false, the store will resolve
10752
- immediately using the cached record.
10753
- @method shouldReloadRecord
10754
- @param {DS.Store} store
10755
- @param {DS.Snapshot} snapshot
10756
- @return {Boolean}
10757
- */
10758
- shouldReloadRecord: function (store, snapshot) {
10759
- return false;
10760
- },
10853
+ function errorsArrayToHash(errors) {
10854
+ var out = {};
10761
10855
 
10762
- /**
10763
- This method is used by the store to determine if the store should
10764
- reload all records from the adapter when records are requested by
10765
- `store.findAll`.
10766
- If this method returns true, the store will re-fetch all records from
10767
- the adapter. If this method returns false, the store will resolve
10768
- immediately using the cached record.
10769
- @method shouldReloadAll
10770
- @param {DS.Store} store
10771
- @param {DS.SnapshotRecordArray} snapshotRecordArray
10772
- @return {Boolean}
10773
- */
10774
- shouldReloadAll: function (store, snapshotRecordArray) {
10775
- return !snapshotRecordArray.length;
10776
- },
10856
+ if (_ember.default.isPresent(errors)) {
10857
+ errors.forEach(function (error) {
10858
+ if (error.source && error.source.pointer) {
10859
+ var key = error.source.pointer.match(SOURCE_POINTER_REGEXP);
10777
10860
 
10778
- /**
10779
- This method is used by the store to determine if the store should
10780
- reload a record after the `store.findRecord` method resolves a
10781
- cached record.
10782
- This method is *only* checked by the store when the store is
10783
- returning a cached record.
10784
- If this method returns true the store will re-fetch a record from
10785
- the adapter.
10786
- @method shouldBackgroundReloadRecord
10787
- @param {DS.Store} store
10788
- @param {DS.Snapshot} snapshot
10789
- @return {Boolean}
10790
- */
10791
- shouldBackgroundReloadRecord: function (store, snapshot) {
10792
- return true;
10793
- },
10861
+ if (key) {
10862
+ key = key[2];
10863
+ } else if (error.source.pointer.search(SOURCE_POINTER_PRIMARY_REGEXP) !== -1) {
10864
+ key = PRIMARY_ATTRIBUTE_KEY;
10865
+ }
10794
10866
 
10795
- /**
10796
- This method is used by the store to determine if the store should
10797
- reload a record array after the `store.findAll` method resolves
10798
- with a cached record array.
10799
- This method is *only* checked by the store when the store is
10800
- returning a cached record array.
10801
- If this method returns true the store will re-fetch all records
10802
- from the adapter.
10803
- @method shouldBackgroundReloadAll
10804
- @param {DS.Store} store
10805
- @param {DS.SnapshotRecordArray} snapshotRecordArray
10806
- @return {Boolean}
10807
- */
10808
- shouldBackgroundReloadAll: function (store, snapshotRecordArray) {
10809
- return true;
10867
+ if (key) {
10868
+ out[key] = out[key] || [];
10869
+ out[key].push(error.detail || error.title);
10870
+ }
10871
+ }
10872
+ });
10810
10873
  }
10811
- });
10874
+
10875
+ return out;
10876
+ }
10812
10877
  });
10813
- /**
10814
- @module ember-data
10815
- */
10816
- define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters/rest'], function (exports, _ember, _emberDataAdaptersRest) {
10878
+ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters/rest', 'ember-data/-private/features'], function (exports, _ember, _emberDataAdaptersRest, _emberDataPrivateFeatures) {
10817
10879
 
10818
10880
  /**
10819
10881
  @class JSONAPIAdapter
@@ -10821,7 +10883,7 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
10821
10883
  @namespace DS
10822
10884
  @extends DS.RESTAdapter
10823
10885
  */
10824
- exports.default = _emberDataAdaptersRest.default.extend({
10886
+ var JSONAPIAdapter = _emberDataAdaptersRest.default.extend({
10825
10887
  defaultSerializer: '-json-api',
10826
10888
 
10827
10889
  /**
@@ -10931,11 +10993,13 @@ define('ember-data/adapters/json-api', ['exports', 'ember', 'ember-data/adapters
10931
10993
  return this.ajax(url, 'PATCH', { data: data });
10932
10994
  }
10933
10995
  });
10996
+
10997
+ exports.default = JSONAPIAdapter;
10934
10998
  });
10935
10999
  /**
10936
11000
  @module ember-data
10937
11001
  */
10938
- define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'ember-data/-private/adapters/errors', 'ember-data/-private/adapters/build-url-mixin', 'ember-data/-private/features', 'ember-data/-private/utils/parse-response-headers'], function (exports, _ember, _emberDataAdapter, _emberDataPrivateAdaptersErrors, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateFeatures, _emberDataPrivateUtilsParseResponseHeaders) {
11002
+ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'ember-data/adapters/errors', 'ember-data/-private/adapters/build-url-mixin', 'ember-data/-private/features', 'ember-data/-private/debug', 'ember-data/-private/utils/parse-response-headers'], function (exports, _ember, _emberDataAdapter, _emberDataAdaptersErrors, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateFeatures, _emberDataPrivateDebug, _emberDataPrivateUtilsParseResponseHeaders) {
10939
11003
  var MapWithDefault = _ember.default.MapWithDefault;
10940
11004
  var get = _ember.default.get;
10941
11005
 
@@ -11149,7 +11213,7 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11149
11213
  @extends DS.Adapter
11150
11214
  @uses DS.BuildURLMixin
11151
11215
  */
11152
- exports.default = _emberDataAdapter.default.extend(_emberDataPrivateAdaptersBuildUrlMixin.default, {
11216
+ var RESTAdapter = _emberDataAdapter.default.extend(_emberDataPrivateAdaptersBuildUrlMixin.default, {
11153
11217
  defaultSerializer: '-rest',
11154
11218
 
11155
11219
  /**
@@ -11315,9 +11379,14 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11315
11379
  @return {Promise} promise
11316
11380
  */
11317
11381
  findAll: function (store, type, sinceToken, snapshotRecordArray) {
11318
- var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
11319
11382
  var query = this.buildQuery(snapshotRecordArray);
11320
11383
 
11384
+ var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
11385
+
11386
+ if (sinceToken) {
11387
+ query.since = sinceToken;
11388
+ }
11389
+
11321
11390
  return this.ajax(url, 'GET', { data: query });
11322
11391
  },
11323
11392
 
@@ -11643,13 +11712,13 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11643
11712
  if (this.isSuccess(status, headers, payload)) {
11644
11713
  return payload;
11645
11714
  } else if (this.isInvalid(status, headers, payload)) {
11646
- return new _emberDataPrivateAdaptersErrors.InvalidError(payload.errors);
11715
+ return new _emberDataAdaptersErrors.InvalidError(payload.errors);
11647
11716
  }
11648
11717
 
11649
11718
  var errors = this.normalizeErrorResponse(status, headers, payload);
11650
11719
  var detailedMessage = this.generatedDetailedMessage(status, headers, payload, requestData);
11651
11720
 
11652
- return new _emberDataPrivateAdaptersErrors.AdapterError(errors, detailedMessage);
11721
+ return new _emberDataAdaptersErrors.AdapterError(errors, detailedMessage);
11653
11722
  },
11654
11723
 
11655
11724
  /**
@@ -11721,14 +11790,15 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11721
11790
  };
11722
11791
 
11723
11792
  hash.error = function (jqXHR, textStatus, errorThrown) {
11793
+
11724
11794
  var error = undefined;
11725
11795
 
11726
11796
  if (errorThrown instanceof Error) {
11727
11797
  error = errorThrown;
11728
11798
  } else if (textStatus === 'timeout') {
11729
- error = new _emberDataPrivateAdaptersErrors.TimeoutError();
11799
+ error = new _emberDataAdaptersErrors.TimeoutError();
11730
11800
  } else if (textStatus === 'abort') {
11731
- error = new _emberDataPrivateAdaptersErrors.AbortError();
11801
+ error = new _emberDataAdaptersErrors.AbortError();
11732
11802
  } else {
11733
11803
  error = adapter.handleResponse(jqXHR.status, (0, _emberDataPrivateUtilsParseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), adapter.parseErrorResponse(jqXHR.responseText) || errorThrown, requestData);
11734
11804
  }
@@ -11847,13 +11917,11 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11847
11917
  buildQuery: function (snapshot) {
11848
11918
  var query = {};
11849
11919
 
11850
- if (true) {
11851
- if (snapshot) {
11852
- var include = snapshot.include;
11920
+ if (snapshot) {
11921
+ var include = snapshot.include;
11853
11922
 
11854
- if (include) {
11855
- query.include = include;
11856
- }
11923
+ if (include) {
11924
+ query.include = include;
11857
11925
  }
11858
11926
  }
11859
11927
 
@@ -11869,11 +11937,85 @@ define('ember-data/adapters/rest', ['exports', 'ember', 'ember-data/adapter', 'e
11869
11937
  return string.endsWith(suffix);
11870
11938
  }
11871
11939
  }
11940
+
11941
+ exports.default = RESTAdapter;
11872
11942
  });
11873
11943
  /**
11874
11944
  @module ember-data
11875
11945
  */
11876
- define("ember-data/attr", ["exports", "ember", "ember-data/-private/debug"], function (exports, _ember, _emberDataPrivateDebug) {
11946
+
11947
+ /**
11948
+ * Get the data (body or query params) for a request.
11949
+ *
11950
+ * @public
11951
+ * @method dataForRequest
11952
+ * @param {Object} params
11953
+ * @return {Object} data
11954
+ */
11955
+
11956
+ // type is not passed to findBelongsTo and findHasMany
11957
+
11958
+ /**
11959
+ * Get the HTTP method for a request.
11960
+ *
11961
+ * @public
11962
+ * @method methodForRequest
11963
+ * @param {Object} params
11964
+ * @return {String} HTTP method
11965
+ */
11966
+
11967
+ /**
11968
+ * Get the URL for a request.
11969
+ *
11970
+ * @public
11971
+ * @method urlForRequest
11972
+ * @param {Object} params
11973
+ * @return {String} URL
11974
+ */
11975
+
11976
+ // type and id are not passed from updateRecord and deleteRecord, hence they
11977
+ // are defined if not set
11978
+
11979
+ /**
11980
+ * Get the headers for a request.
11981
+ *
11982
+ * By default the value of the `headers` property of the adapter is
11983
+ * returned.
11984
+ *
11985
+ * @public
11986
+ * @method headersForRequest
11987
+ * @param {Object} params
11988
+ * @return {Object} headers
11989
+ */
11990
+
11991
+ /**
11992
+ * Get an object which contains all properties for a request which should
11993
+ * be made.
11994
+ *
11995
+ * @private
11996
+ * @method _requestFor
11997
+ * @param {Object} params
11998
+ * @return {Object} request object
11999
+ */
12000
+
12001
+ /**
12002
+ * Convert a request object into a hash which can be passed to `jQuery.ajax`.
12003
+ *
12004
+ * @private
12005
+ * @method _requestToJQueryAjaxHash
12006
+ * @param {Object} request
12007
+ * @return {Object} jQuery ajax hash
12008
+ */
12009
+
12010
+ /**
12011
+ * Make a request using `jQuery.ajax`.
12012
+ *
12013
+ * @private
12014
+ * @method _makeRequest
12015
+ * @param {Object} request
12016
+ * @return {Promise} promise
12017
+ */
12018
+ define('ember-data/attr', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
11877
12019
  exports.default = attr;
11878
12020
 
11879
12021
  /**
@@ -11881,7 +12023,7 @@ define("ember-data/attr", ["exports", "ember", "ember-data/-private/debug"], fun
11881
12023
  */
11882
12024
 
11883
12025
  function getDefaultValue(record, options, key) {
11884
- if (typeof options.defaultValue === "function") {
12026
+ if (typeof options.defaultValue === 'function') {
11885
12027
  return options.defaultValue.apply(null, arguments);
11886
12028
  } else {
11887
12029
  var defaultValue = options.defaultValue;
@@ -12032,7 +12174,7 @@ define("ember-data/attr", ["exports", "ember", "ember-data/-private/debug"], fun
12032
12174
  // *
12033
12175
  // */
12034
12176
  });
12035
- define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/-private/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/container-proxy", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataPrivateAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemContainerProxy, _emberDataPrivateSystemRelationshipsStateRelationship) {
12177
+ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-data/-private/features", "ember-data/-private/core", "ember-data/-private/system/normalize-model-name", "ember-data/-private/system/model/internal-model", "ember-data/-private/system/promise-proxies", "ember-data/-private/system/store", "ember-data/-private/system/model", "ember-data/model", "ember-data/-private/system/snapshot", "ember-data/adapter", "ember-data/serializer", "ember-data/-private/system/debug", "ember-data/adapters/errors", "ember-data/-private/system/record-arrays", "ember-data/-private/system/many-array", "ember-data/-private/system/record-array-manager", "ember-data/-private/adapters", "ember-data/-private/adapters/build-url-mixin", "ember-data/-private/serializers", "ember-inflector", "ember-data/serializers/embedded-records-mixin", "ember-data/-private/transforms", "ember-data/relationships", "ember-data/setup-container", "ember-data/-private/instance-initializers/initialize-store-service", "ember-data/-private/system/container-proxy", "ember-data/-private/system/relationships/state/relationship"], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures, _emberDataPrivateCore, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateSystemModelInternalModel, _emberDataPrivateSystemPromiseProxies, _emberDataPrivateSystemStore, _emberDataPrivateSystemModel, _emberDataModel, _emberDataPrivateSystemSnapshot, _emberDataAdapter, _emberDataSerializer, _emberDataPrivateSystemDebug, _emberDataAdaptersErrors, _emberDataPrivateSystemRecordArrays, _emberDataPrivateSystemManyArray, _emberDataPrivateSystemRecordArrayManager, _emberDataPrivateAdapters, _emberDataPrivateAdaptersBuildUrlMixin, _emberDataPrivateSerializers, _emberInflector, _emberDataSerializersEmbeddedRecordsMixin, _emberDataPrivateTransforms, _emberDataRelationships, _emberDataSetupContainer, _emberDataPrivateInstanceInitializersInitializeStoreService, _emberDataPrivateSystemContainerProxy, _emberDataPrivateSystemRelationshipsStateRelationship) {
12036
12178
  /**
12037
12179
  Ember Data
12038
12180
  @module ember-data
@@ -12043,8 +12185,6 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
12043
12185
  throw new _ember.default.Error("Ember Data requires at least Ember 1.13.0, but you have " + _ember.default.VERSION + ". Please upgrade your version of Ember, then upgrade Ember Data.");
12044
12186
  }
12045
12187
 
12046
- if (_ember.default.VERSION.match(/^1\.13\./)) {}
12047
-
12048
12188
  _emberDataPrivateCore.default.Store = _emberDataPrivateSystemStore.Store;
12049
12189
  _emberDataPrivateCore.default.PromiseArray = _emberDataPrivateSystemPromiseProxies.PromiseArray;
12050
12190
  _emberDataPrivateCore.default.PromiseObject = _emberDataPrivateSystemPromiseProxies.PromiseObject;
@@ -12061,13 +12201,13 @@ define("ember-data", ["exports", "ember", "ember-data/-private/debug", "ember-da
12061
12201
 
12062
12202
  _emberDataPrivateCore.default.Adapter = _emberDataAdapter.default;
12063
12203
 
12064
- _emberDataPrivateCore.default.AdapterError = _emberDataPrivateAdaptersErrors.AdapterError;
12065
- _emberDataPrivateCore.default.InvalidError = _emberDataPrivateAdaptersErrors.InvalidError;
12066
- _emberDataPrivateCore.default.TimeoutError = _emberDataPrivateAdaptersErrors.TimeoutError;
12067
- _emberDataPrivateCore.default.AbortError = _emberDataPrivateAdaptersErrors.AbortError;
12204
+ _emberDataPrivateCore.default.AdapterError = _emberDataAdaptersErrors.AdapterError;
12205
+ _emberDataPrivateCore.default.InvalidError = _emberDataAdaptersErrors.InvalidError;
12206
+ _emberDataPrivateCore.default.TimeoutError = _emberDataAdaptersErrors.TimeoutError;
12207
+ _emberDataPrivateCore.default.AbortError = _emberDataAdaptersErrors.AbortError;
12068
12208
 
12069
- _emberDataPrivateCore.default.errorsHashToArray = _emberDataPrivateAdaptersErrors.errorsHashToArray;
12070
- _emberDataPrivateCore.default.errorsArrayToHash = _emberDataPrivateAdaptersErrors.errorsArrayToHash;
12209
+ _emberDataPrivateCore.default.errorsHashToArray = _emberDataAdaptersErrors.errorsHashToArray;
12210
+ _emberDataPrivateCore.default.errorsArrayToHash = _emberDataAdaptersErrors.errorsArrayToHash;
12071
12211
 
12072
12212
  _emberDataPrivateCore.default.Serializer = _emberDataSerializer.default;
12073
12213
 
@@ -12208,7 +12348,7 @@ define('ember-data/serializer', ['exports', 'ember'], function (exports, _ember)
12208
12348
  /**
12209
12349
  @module ember-data
12210
12350
  */
12211
- define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'ember-data/-private/debug'], function (exports, _ember, _emberDataPrivateDebug) {
12351
+ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataPrivateFeatures) {
12212
12352
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
12213
12353
 
12214
12354
  var get = _ember.default.get;
@@ -12433,7 +12573,7 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12433
12573
  },
12434
12574
 
12435
12575
  /**
12436
- Serialize `hasMany` relationship when it is configured as embedded objects.
12576
+ Serializes `hasMany` relationships when it is configured as embedded objects.
12437
12577
  This example of a post model has many comments:
12438
12578
  ```js
12439
12579
  Post = DS.Model.extend({
@@ -12474,7 +12614,7 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12474
12614
  }
12475
12615
  ```
12476
12616
  The attrs options object can use more specific instruction for extracting and
12477
- serializing. When serializing, an option to embed `ids` or `records` can be set.
12617
+ serializing. When serializing, an option to embed `ids`, `ids-and-types` or `records` can be set.
12478
12618
  When extracting the only option is `records`.
12479
12619
  So `{ embedded: 'always' }` is shorthand for:
12480
12620
  `{ serialize: 'records', deserialize: 'records' }`
@@ -12497,6 +12637,47 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12497
12637
  }
12498
12638
  }
12499
12639
  ```
12640
+ To embed the relationship as a collection of objects with `id` and `type` keys, set
12641
+ `ids-and-types` for the related object.
12642
+ This is particularly useful for polymorphic relationships where records don't share
12643
+ the same table and the `id` is not enough information.
12644
+ By example having a user that has many pets:
12645
+ ```js
12646
+ User = DS.Model.extend({
12647
+ name: DS.attr('string'),
12648
+ pets: DS.hasMany('pet', { polymorphic: true })
12649
+ });
12650
+ Pet = DS.Model.extend({
12651
+ name: DS.attr('string'),
12652
+ });
12653
+ Cat = Pet.extend({
12654
+ // ...
12655
+ });
12656
+ Parrot = Pet.extend({
12657
+ // ...
12658
+ });
12659
+ ```
12660
+ ```app/serializers/user.js
12661
+ import DS from 'ember-data;
12662
+ export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
12663
+ attrs: {
12664
+ pets: { serialize: 'ids-and-types', deserialize: 'records' }
12665
+ }
12666
+ });
12667
+ ```
12668
+ ```js
12669
+ {
12670
+ "user": {
12671
+ "id": "1"
12672
+ "name": "Bertin Osborne",
12673
+ "pets": [
12674
+ { "id": "1", "type": "Cat" },
12675
+ { "id": "1", "type": "Parrot"}
12676
+ ]
12677
+ }
12678
+ }
12679
+ ```
12680
+ Note that the `ids-and-types` strategy is still behind the `ds-serialize-ids-and-types` feature flag.
12500
12681
  @method serializeHasMany
12501
12682
  @param {DS.Snapshot} snapshot
12502
12683
  @param {Object} json
@@ -12508,16 +12689,39 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12508
12689
  this._super(snapshot, json, relationship);
12509
12690
  return;
12510
12691
  }
12511
- var includeIds = this.hasSerializeIdsOption(attr);
12512
- var includeRecords = this.hasSerializeRecordsOption(attr);
12513
- if (includeIds) {
12692
+
12693
+ if (this.hasSerializeIdsOption(attr)) {
12514
12694
  var serializedKey = this.keyForRelationship(attr, relationship.kind, 'serialize');
12515
12695
  json[serializedKey] = snapshot.hasMany(attr, { ids: true });
12516
- } else if (includeRecords) {
12696
+ } else if (this.hasSerializeRecordsOption(attr)) {
12517
12697
  this._serializeEmbeddedHasMany(snapshot, json, relationship);
12698
+ } else {
12699
+ if (this.hasSerializeIdsAndTypesOption(attr)) {
12700
+ this._serializeHasManyAsIdsAndTypes(snapshot, json, relationship);
12701
+ }
12518
12702
  }
12519
12703
  },
12520
12704
 
12705
+ /**
12706
+ Serializes a hasMany relationship as an array of objects containing only `id` and `type`
12707
+ keys.
12708
+ This has its use case on polymorphic hasMany relationships where the server is not storing
12709
+ all records in the same table using STI, and therefore the `id` is not enough information
12710
+ TODO: Make the default in Ember-data 3.0??
12711
+ */
12712
+ _serializeHasManyAsIdsAndTypes: function (snapshot, json, relationship) {
12713
+ var serializedKey = this.keyForAttribute(relationship.key, 'serialize');
12714
+ var hasMany = snapshot.hasMany(relationship.key);
12715
+
12716
+ json[serializedKey] = _ember.default.A(hasMany).map(function (recordSnapshot) {
12717
+ //
12718
+ // I'm sure I'm being utterly naive here. Propably id is a configurate property and
12719
+ // type too, and the modelName has to be normalized somehow.
12720
+ //
12721
+ return { id: recordSnapshot.id, type: recordSnapshot.modelName };
12722
+ });
12723
+ },
12724
+
12521
12725
  _serializeEmbeddedHasMany: function (snapshot, json, relationship) {
12522
12726
  var serializedKey = this._getMappedKey(relationship.key, snapshot.type);
12523
12727
  if (serializedKey === relationship.key && this.keyForRelationship) {
@@ -12593,6 +12797,12 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12593
12797
  return option && (option.serialize === 'ids' || option.serialize === 'id');
12594
12798
  },
12595
12799
 
12800
+ // checks config for attrs option to serialize records as objects containing id and types
12801
+ hasSerializeIdsAndTypesOption: function (attr) {
12802
+ var option = this.attrsOption(attr);
12803
+ return option && (option.serialize === 'ids-and-types' || option.serialize === 'id-and-type');
12804
+ },
12805
+
12596
12806
  // checks config for attrs option to serialize records
12597
12807
  noSerializeOptionSpecified: function (attr) {
12598
12808
  var option = this.attrsOption(attr);
@@ -12711,7 +12921,8 @@ define('ember-data/serializers/embedded-records-mixin', ['exports', 'ember', 'em
12711
12921
  var serializer = store.serializerFor(modelName);
12712
12922
 
12713
12923
  return serializer.normalize(modelClass, relationshipHash, null);
12714
- }
12924
+ },
12925
+ isEmbeddedRecordsMixin: true
12715
12926
  });
12716
12927
  });
12717
12928
  define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/serializers/json', 'ember-data/-private/system/normalize-model-name', 'ember-inflector', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataSerializersJson, _emberDataPrivateSystemNormalizeModelName, _emberInflector, _emberDataPrivateFeatures) {
@@ -12884,11 +13095,8 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
12884
13095
  */
12885
13096
  pushPayload: function (store, payload) {
12886
13097
  var normalizedPayload = this._normalizeDocumentHelper(payload);
12887
- if (false) {
12888
- return store.push(normalizedPayload);
12889
- } else {
12890
- store.push(normalizedPayload);
12891
- }
13098
+
13099
+ store.push(normalizedPayload);
12892
13100
  },
12893
13101
 
12894
13102
  /**
@@ -13202,7 +13410,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember', 'ember-data/-priv
13202
13410
  /**
13203
13411
  @module ember-data
13204
13412
  */
13205
- define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/serializer', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/utils', 'ember-data/-private/adapters/errors', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataSerializer, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateUtils, _emberDataPrivateAdaptersErrors, _emberDataPrivateFeatures) {
13413
+ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/debug', 'ember-data/serializer', 'ember-data/-private/system/coerce-id', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/utils', 'ember-data/adapters/errors', 'ember-data/-private/features'], function (exports, _ember, _emberDataPrivateDebug, _emberDataSerializer, _emberDataPrivateSystemCoerceId, _emberDataPrivateSystemNormalizeModelName, _emberDataPrivateUtils, _emberDataAdaptersErrors, _emberDataPrivateFeatures) {
13206
13414
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
13207
13415
 
13208
13416
  var get = _ember.default.get;
@@ -13364,22 +13572,18 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
13364
13572
  var _this = this;
13365
13573
 
13366
13574
  var attributes = undefined;
13367
- if (true) {
13368
- attributes = get(typeClass, 'attributes');
13369
- }
13575
+
13576
+ attributes = get(typeClass, 'attributes');
13370
13577
 
13371
13578
  typeClass.eachTransformedAttribute(function (key, typeClass) {
13372
- if (!data.hasOwnProperty(key)) {
13579
+ if (!(key in data)) {
13373
13580
  return;
13374
13581
  }
13375
13582
 
13376
13583
  var transform = _this.transformFor(typeClass);
13377
- if (true) {
13378
- var transformMeta = attributes.get(key);
13379
- data[key] = transform.deserialize(data[key], transformMeta.options);
13380
- } else {
13381
- data[key] = transform.deserialize(data[key]);
13382
- }
13584
+
13585
+ var transformMeta = attributes.get(key);
13586
+ data[key] = transform.deserialize(data[key], transformMeta.options);
13383
13587
  });
13384
13588
 
13385
13589
  return data;
@@ -14219,11 +14423,8 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
14219
14423
  var value = snapshot.attr(key);
14220
14424
  if (type) {
14221
14425
  var transform = this.transformFor(type);
14222
- if (true) {
14223
- value = transform.serialize(value, attribute.options);
14224
- } else {
14225
- value = transform.serialize(value);
14226
- }
14426
+
14427
+ value = transform.serialize(value, attribute.options);
14227
14428
  }
14228
14429
 
14229
14430
  // if provided, use the mapping provided by `attrs` in
@@ -14460,7 +14661,7 @@ define('ember-data/serializers/json', ['exports', 'ember', 'ember-data/-private/
14460
14661
  var _this7 = this;
14461
14662
 
14462
14663
  if (payload && typeof payload === 'object' && payload.errors) {
14463
- payload = (0, _emberDataPrivateAdaptersErrors.errorsArrayToHash)(payload.errors);
14664
+ payload = (0, _emberDataAdaptersErrors.errorsArrayToHash)(payload.errors);
14464
14665
 
14465
14666
  this.normalizeUsingDeclaredMapping(typeClass, payload);
14466
14667
 
@@ -14563,8 +14764,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
14563
14764
 
14564
14765
  /**
14565
14766
  Normally, applications will use the `RESTSerializer` by implementing
14566
- the `normalize` method and individual normalizations under
14567
- `normalizeHash`.
14767
+ the `normalize` method.
14568
14768
 
14569
14769
  This allows you to do whatever kind of munging you need, and is
14570
14770
  especially useful if your server is inconsistent and you need to
@@ -14577,7 +14777,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
14577
14777
  There are also a number of hooks that you might find useful to define
14578
14778
  across-the-board rules for your payload. These rules will be useful
14579
14779
  if your server is consistent, or if you're building an adapter for
14580
- an infrastructure service, like Parse, and want to encode service
14780
+ an infrastructure service, like Firebase, and want to encode service
14581
14781
  conventions.
14582
14782
 
14583
14783
  For example, if all of your keys are underscored and all-caps, but
@@ -14661,25 +14861,25 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
14661
14861
  * With `App.Comment`, `"comments"` and `{ id: 1, body: "FIRST" }`
14662
14862
  * With `App.Comment`, `"comments"` and `{ id: 2, body: "Rails is unagi" }`
14663
14863
  You can use this method, for example, to normalize underscored keys to camelized
14664
- or other general-purpose normalizations.
14665
- If you want to do normalizations specific to some part of the payload, you
14666
- can specify those under `normalizeHash`.
14864
+ or other general-purpose normalizations. You will only need to implement
14865
+ `normalize` and manipulate the payload as desired.
14667
14866
  For example, if the `IDs` under `"comments"` are provided as `_id` instead of
14668
14867
  `id`, you can specify how to normalize just the comments:
14669
14868
  ```app/serializers/post.js
14670
14869
  import DS from 'ember-data';
14671
14870
  export default DS.RESTSerializer.extend({
14672
- normalizeHash: {
14673
- comments: function(hash) {
14871
+ normalize(model, hash, prop) {
14872
+ if (prop === 'comments') {
14674
14873
  hash.id = hash._id;
14675
- delete hash._id;
14676
- return hash;
14874
+ delete hash._id;
14677
14875
  }
14876
+ return this._super(...arguments);
14678
14877
  }
14679
14878
  });
14680
14879
  ```
14681
- The key under `normalizeHash` is just the original key that was in the original
14682
- payload.
14880
+ On each call to the `normalize` method, the third parameter (`prop`) is always
14881
+ one of the keys that were in the original payload or in the result of another
14882
+ normalization as `normalizeResponse`.
14683
14883
  @method normalize
14684
14884
  @param {DS.Model} modelClass
14685
14885
  @param {Object} resourceHash
@@ -14690,7 +14890,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
14690
14890
  if (this.normalizeHash && this.normalizeHash[prop]) {
14691
14891
  this.normalizeHash[prop](resourceHash);
14692
14892
  }
14693
- return this._super(modelClass, resourceHash, prop);
14893
+ return this._super(modelClass, resourceHash);
14694
14894
  },
14695
14895
 
14696
14896
  /**
@@ -14945,11 +15145,7 @@ define("ember-data/serializers/rest", ["exports", "ember", "ember-data/-private/
14945
15145
  });
14946
15146
  }
14947
15147
 
14948
- if (false) {
14949
- return store.push(documentHash);
14950
- } else {
14951
- store.push(documentHash);
14952
- }
15148
+ store.push(documentHash);
14953
15149
  },
14954
15150
 
14955
15151
  /**
@@ -15360,7 +15556,7 @@ define('ember-data/transform', ['exports', 'ember'], function (exports, _ember)
15360
15556
  });
15361
15557
  });
15362
15558
  define("ember-data/version", ["exports"], function (exports) {
15363
- exports.default = "2.5.5";
15559
+ exports.default = "2.6.0-beta.1";
15364
15560
  });
15365
15561
  define("ember-inflector", ["exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (exports, _ember, _emberInflectorLibSystem, _emberInflectorLibExtString) {
15366
15562
 
@@ -15755,7 +15951,7 @@ define('ember-inflector/lib/system/inflector', ['exports', 'ember'], function (e
15755
15951
  return word;
15756
15952
  }
15757
15953
 
15758
- for (rule in irregular) {
15954
+ for (rule in this.rules.irregular) {
15759
15955
  if (lowercase.match(rule + "$")) {
15760
15956
  substitution = irregular[rule];
15761
15957
 
@@ -15764,7 +15960,7 @@ define('ember-inflector/lib/system/inflector', ['exports', 'ember'], function (e
15764
15960
  rule = capitalize(rule);
15765
15961
  }
15766
15962
 
15767
- return word.replace(new RegExp(rule, 'i'), substitution);
15963
+ return word.replace(rule, substitution);
15768
15964
  }
15769
15965
  }
15770
15966