ember-data-source 2.18.3 → 3.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- (function(){"use strict";var e,t,r,i,n;!function(a){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(id, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.uuid=b++,this.id=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(){}function u(e){this.id=e}function c(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function h(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.id];return i||c(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function p(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),n=i.slice(0,-1),a=0,o=r.length;a<o;a++){var s=r[a];if(".."===s){if(0===n.length)throw new Error("Cannot access parent module of root");n.pop()}else{if("."===s)continue;n.push(s)}}return n.join("/")}function f(e){return!(!y[e]&&!y[e+"/index"])}var m={loader:e,define:t,requireModule:r,require:i,requirejs:n};n=i=r=function(e){for(var t=[],r=h(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&m.hasOwnProperty(t)&&(r=e[t],a[r]=a[t],a[t]=m[t])},makeDefaultExport:!0};var y=o(),v=o(),b=0,_=["require","exports","module"];l.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},l.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.id,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.reified.length=0,this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),e.makeDefaultExport&&this.makeDefaultExport(),this.module.exports},l.prototype.unsee=function(){this.state="new",this.module={exports:{}}},l.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},l.prototype._reify=function(){for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},l.prototype.findDeps=function(e){if("new"===this.state){this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],n=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,n.exports=this.module.exports):"require"===i?n.exports=this.makeRequire():"module"===i?n.exports=this.module:n.module=h(p(i,this.id),this.id,e)}}},l.prototype.makeRequire=function(){var e=this.id,t=function(t){return i(p(t,e))};return t.default=t,t.moduleId=e,t.has=function(t){return f(p(t,e))},t},t=function(e,t,r){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),Array.isArray(t)||(r=t,t=[]),y[e]=r instanceof u?new l(r.id,t,r,!0):new l(e,t,r,!1))},t.exports=function(e,t){var r=y[e];if(!r||"new"===r.state)return r=new l(e,[],d,null),r.module.exports=t,r.state="finalized",y[e]=r,r},t.alias=function(e,r){return 2===arguments.length?t(r,new u(e)):new u(e)},n.entries=n._eak_seen=y,n.has=f,n.unsee=function(e){h(e,"(unsee)",!1).unsee()},n.clear=function(){n.entries=n._eak_seen=y=o(),v=o()},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t.alias("foo","foo/qux"),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),t.exports("foo/exports",{}),i("foo/exports"),i("foo/main"),i.unsee("foo/bar"),n.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-debug",["exports"],function(e){function t(e){return e()}e.__esModule=!0,e.instrument=t;var r=void 0;e.assertPolymorphicType=r}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember-inflector"],function(e,t){e.__esModule=!0;var r=Ember.String.camelize,i=Ember.Mixin,n=Ember.get;e.default=i.create({buildURL:function(e,t,r,i,n){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(n,e);case"queryRecord":return this.urlForQueryRecord(n,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 r=void 0,i=[],a=n(this,"host"),o=this.urlPrefix();return e&&(r=this.pathForType(e))&&i.push(r),t&&i.push(encodeURIComponent(t)),o&&i.unshift(o),i=i.join("/"),!a&&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 r=n(this,"host"),i=n(this,"namespace");if(r&&"/"!==r||(r=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+r+e:t+"/"+e;var a=[];return r&&a.push(r),i&&a.push(i),a.join("/")},pathForType:function(e){var i=r(e);return(0,t.pluralize)(i)}})}),t("ember-data/-private/adapters/errors",["exports"],function(e){function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function r(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.message;return i(e,r)}}function i(e,t){var i=function(r,i){e.call(this,r,i||t)};return i.prototype=Object.create(e.prototype),i.extend=r(i),i}function n(e){var t=[];return s(e)&&Object.keys(e).forEach(function(r){for(var i=o(e[r]),n=0;n<i.length;n++){var a="Invalid Attribute",s="/data/attributes/"+r;r===c&&(a="Invalid Document",s="/data"),t.push({title:a,detail:i[n],source:{pointer:s}})}}),t}function a(e){var t={};return s(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var r=e.source.pointer.match(d);r?r=r[2]:-1!==e.source.pointer.search(u)&&(r=c),r&&(t[r]=t[r]||[],t[r].push(e.detail||e.title))}}),t}e.__esModule=!0,e.AdapterError=t,e.errorsHashToArray=n,e.errorsArrayToHash=a;var o=Ember.makeArray,s=Ember.isPresent,l=Ember.Error,d=/^\/?data\/(attributes|relationships)\/(.*)/,u=/^\/?data/,c="base";t.prototype=Object.create(l.prototype),t.extend=r(t);e.InvalidError=i(t,"The adapter rejected the commit because it was invalid"),e.TimeoutError=i(t,"The adapter operation timed out"),e.AbortError=i(t,"The adapter operation was aborted"),e.UnauthorizedError=i(t,"The adapter operation is unauthorized"),e.ForbiddenError=i(t,"The adapter operation is forbidden"),e.NotFoundError=i(t,"The adapter could not find the resource"),e.ConflictError=i(t,"The adapter operation failed due to a conflict"),e.ServerError=i(t,"The adapter operation failed due to a server error")}),t("ember-data/-private/core",["exports","ember-data/version"],function(e,t){e.__esModule=!0;var r=Ember.Namespace.create({VERSION:t.default,name:"DS"});Ember.libraries&&Ember.libraries.registerCoreLibrary("Ember Data",r.VERSION),e.default=r}),t("ember-data/-private/features",["exports"],function(e){function t(){var e;return(e=Ember.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=t}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!0,e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private",["exports","ember-data/-private/system/model/model","ember-data/-private/system/model/errors","ember-data/-private/system/store","ember-data/-private/core","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/adapters/build-url-mixin","ember-data/-private/system/snapshot","ember-data/-private/adapters/errors","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/utils/parse-response-headers","ember-data/-private/global","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/model/internal-model","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/promise-proxies","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/debug/debug-adapter","ember-data/-private/system/diff-array","ember-data/-private/system/relationships/relationship-payloads-manager","ember-data/-private/system/relationships/relationship-payloads","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m,y,v,b,_,g,M,R,A,F,E,z,I,S){e.__esModule=!0,Object.defineProperty(e,"Model",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Errors",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DS",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BuildURLMixin",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"Snapshot",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return d.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return d.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return d.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return d.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return d.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return d.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return d.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return d.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return d.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return d.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return d.errorsArrayToHash}}),Object.defineProperty(e,"normalizeModelName",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getOwner",{enumerable:!0,get:function(){return c.getOwner}}),Object.defineProperty(e,"modelHasAttributeOrRelationshipNamedType",{enumerable:!0,get:function(){return c.modelHasAttributeOrRelationshipNamedType}}),Object.defineProperty(e,"coerceId",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"parseResponseHeaders",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"isEnabled",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"RootState",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"InternalModel",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"ContainerInstanceCache",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"PromiseArray",{enumerable:!0,get:function(){return _.PromiseArray}}),Object.defineProperty(e,"PromiseObject",{enumerable:!0,get:function(){return _.PromiseObject}}),Object.defineProperty(e,"PromiseManyArray",{enumerable:!0,get:function(){return _.PromiseManyArray}}),Object.defineProperty(e,"RecordArray",{enumerable:!0,get:function(){return g.RecordArray}}),Object.defineProperty(e,"FilteredRecordArray",{enumerable:!0,get:function(){return g.FilteredRecordArray}}),Object.defineProperty(e,"AdapterPopulatedRecordArray",{enumerable:!0,get:function(){return g.AdapterPopulatedRecordArray}}),Object.defineProperty(e,"ManyArray",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"RecordArrayManager",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"Relationship",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"DebugAdapter",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"diffArray",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"RelationshipPayloadsManager",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"RelationshipPayloads",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(e,"SnapshotRecordArray",{enumerable:!0,get:function(){return S.default}})}),t("ember-data/-private/system/clone-null",["exports"],function(e){function t(e){var t=Object.create(null);for(var r in e)t[r]=e[r];return t}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:"string"==typeof e?e:""+e}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember-data/-private/system/model/model"],function(e,t){e.__esModule=!0;var r=Ember.addObserver,i=Ember.removeObserver,n=Ember.A,a=Ember.DataAdapter,o=Ember.String.capitalize,s=Ember.String.underscore,l=Ember.get;e.default=a.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==t.default&&t.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,i=this;return l(e,"attributes").forEach(function(e,n){if(r++>i.attributeLimit)return!1;var a=o(s(n).replace("_"," "));t.push({name:n,desc:a})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);null!==i&&(t=i[1])}}return this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:l(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;i[n]=l(e,n)}),i},getRecordKeywords:function(e){var t=[],r=n(["id"]);return e.eachAttribute(function(e){return r.push(e)}),r.forEach(function(r){return t.push(l(e,r))}),t},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,t){var a=n(),o=n(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return o.push(e)});var s=this;return o.forEach(function(n){var o=function(){t(s.wrapRecord(e))};r(e,n,o),a.push(function(){i(e,n,o)})}),function(){a.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,n=Math.min(r,i),a=null,o=0;o<n;o++)if(e[o]!==t[o]){a=o;break}null===a&&i!==r&&(a=n);var s=0,l=0;if(null!==a){for(var d=n-a,u=1;u<=n;u++)if(e[r-u]!==t[i-u]){d=u-1;break}s=i-d-a,l=r-d-a}return{firstChangeIndex:a,addedCount:s,removedCount:l}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return void 0===r&&(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/system/model/internal-model"],function(e,t){e.__esModule=!0;var r=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),i=function(){function e(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){delete this._idToModel[t];var r=this._models.indexOf(e);-1!==r&&this._models.splice(r,1)},e.prototype.contains=function(e){return-1!==this._models.indexOf(e)},e.prototype.clear=function(){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}this._metadata=null},r(e,[{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),e}();e.default=i}),t("ember-data/-private/system/is-array-like",["exports"],function(e){function t(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(i.detect(e))return!0;var t=r(e);return"array"===t||void 0!==e.length&&"object"===t}e.__esModule=!0,e.default=t;var r=Ember.typeOf,i=Ember.Array}),t("ember-data/-private/system/many-array",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i){e.__esModule=!0;var n=Ember.RSVP.all,a=Ember.Evented,o=Ember.MutableArray,s=Ember.Object,l=Ember.get;e.default=s.extend(o,a,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,r._objectIsAlive)(this)){var t=this.canonicalState,n=this.currentState.filter(function(e){return e.isNew()&&-1===t.indexOf(e)});t=t.concat(n);var a=(0,i.default)(this.currentState,t);null!==a.firstChangeIndex&&(this.arrayContentWillChange(a.firstChangeIndex,a.removedCount,a.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(a.firstChangeIndex,a.removedCount,a.addedCount),e&&a.addedCount>0&&this.relationship.notifyHasManyChanged())}},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)},_removeInternalModels:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},_addInternalModels:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeInternalModels(i)),r&&this.get("relationship").addInternalModels(r.map(function(e){return e._internalModel}),e)},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+l(this,"type"),i=n(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return t.PromiseArray.create({promise:i})},createRecord:function(e){var t=l(this,"store"),r=l(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model/errors",["exports"],function(e){e.__esModule=!0;var t=Ember.computed.mapBy,r=Ember.computed.not,i=Ember.Evented,n=Ember.ArrayProxy,a=Ember.set,o=Ember.get,s=Ember.computed,l=Ember.isEmpty,d=Ember.makeArray,u=Ember.A,c=Ember.MapWithDefault;e.default=n.extend(i,{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:s(function(){return c.create({defaultValue:function(){return u()}})}),errorsFor:function(e){return o(this,"errorsByAttributeName").get(e)},messages:t("content","message"),content:s(function(){return u()}),unknownProperty:function(e){var t=this.errorsFor(e);return l(t)?null:t},isEmpty:r("length").readOnly(),add:function(e,t){var r=o(this,"isEmpty");this._add(e,t),r&&!o(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),o(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=d(t),n=new Array(i.length),a=0;a<i.length;a++){var o=i[a],s=r.findBy("message",o);n[a]=s||{attribute:e,message:o}}return n},remove:function(e){o(this,"isEmpty")||(this._remove(e),o(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!o(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),o(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e),this.notifyPropertyChange("length")}},clear:function(){o(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!o(this,"isEmpty")){var e=o(this,"errorsByAttributeName"),t=u();e.forEach(function(e,r){t.push(r)}),e.clear(),t.forEach(function(e){this.notifyPropertyChange(e)},this),n.prototype.clear.call(this)}},has:function(e){return!l(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,n,a,o,s){function l(e){return k[e]||(k[e]=e.split("."))}function d(e){return S[e]||(S[e]=l(e)[0])}function u(e){for(var t=0;t<e.length;++t){var r=e[t]._record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}function c(e){e.internalModelDidDematerialize(),e._inverseIsSync()&&(e.removeAllInternalModelsFromOwn(),e.removeAllCanonicalInternalModelsFromOwn())}e.__esModule=!0;var h=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),p=Ember.assign,f=Ember.merge,m=Ember.set,y=Ember.get,v=Ember.copy,b=Ember.Error,_=Ember.isEqual,g=Ember.isEmpty,M=Ember.setOwner,R=Ember.run,A=Ember.RSVP,F=Ember.RSVP.Promise,E=Ember.inspect,z=p||f,I=Object.create(null),S=Object.create(null),k=Object.create(null),P=1,T=1,x=function(){function e(e,t,r,i){this.id=t,this[Ember.GUID_KEY]=P+++"internal-model",this.store=r,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this._scheduledDestroy=null,this.resetRecord(),i&&(this.__data=i),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isHiddenFromRecordArrays=function(){return this._isDematerializing||this.isDestroyed||"root.deleted.saved"===this.currentState.stateName||this.isEmpty()},e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(e){if(!this._record&&!this._isDematerializing){var t={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};"object"==typeof e&&null!==e&&z(t,e),M?M(t,(0,o.getOwner)(this.store)):t.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(t),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.isReloading=!1,this.error=null,this.currentState=t.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this._record&&(this._isDematerializing=!0,this._record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=A.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&m(this._record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&m(this._record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new F(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()})},e.prototype._directlyRelatedInternalModels=function(){var e=[];return this._relationships.forEach(function(t,r){e=e.concat(r.members.list,r.canonicalMembers.list)}),e},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=T++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var n=i._directlyRelatedInternalModels(),a=0;a<n.length;++a){var o=n[a];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.isDestroyed||(this.send("unloadRecord"),this.dematerializeRecord(),null===this._scheduledDestroy&&(R.currentRunLoop,this._scheduledDestroy=R.backburner.schedule("destroy",this,"_checkForOrphanedInternalModels")))},e.prototype.hasScheduledDestroy=function(){return!!this._scheduledDestroy},e.prototype.cancelDestroy=function(){this._isDematerializing=!1,R.cancel(this._scheduledDestroy),this._scheduledDestroy=null},e.prototype.destroySync=function(){this._isDematerializing&&this.cancelDestroy(),this._checkForOrphanedInternalModels(),this.isDestroyed||this.isDestroying||this.destroy()},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this._scheduledDestroy=null,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(u(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._internalModelDestroyed(this),this._relationships.forEach(function(e,t){return t.destroy()}),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships);var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),z(this._data,e.attributes),this.pushedData(),this.hasRecord&&this._record._notifyProperties(t)},e.prototype.createSnapshot=function(e){return new i.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData")},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=null},e.prototype.hasChangedAttributes=function(){return null!==this.__attributes&&Object.keys(this.__attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,n=t.length;i<n;i++){var a=t[i],o=e[a];o[0]===o[1]&&delete r[a]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=z(v(r),t),n=Object.create(null),a=Object.keys(i),o=0,s=a.length;o<s;o++){var l=a[o];n[l]=[e[l],i[l]]}return n},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this._record.notifyHasManyAdded(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this._record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this._record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=void 0;this.hasChangedAttributes()&&(e=Object.keys(this._attributes),this._attributes=null),y(this,"isError")&&(this._inFlightAttributes=null,this.didCleanError()),this.isNew()&&this.removeFromInverseRelationships(!0),this.isValid()&&(this._inFlightAttributes=null),this.send("rolledBack"),e&&e.length>0&&this._record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=d(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var n=void 0,a=void 0,o=void 0,s=void 0,u=I[i];if(u)n=u.setups,a=u.enters,r=u.state;else{n=[],a=[];var c=l(e);for(o=0,s=c.length;o<s;o++)r=r[c[o]],r.enter&&a.push(r),r.setup&&n.push(r);I[i]={setups:n,enters:a,state:r}}for(o=0,s=a.length;o<s;o++)a[o].enter(this);for(this.currentState=r,this.hasRecord&&m(this._record,"currentState",r),o=0,s=n.length;o<s;o++)n[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+E(r)+"."),new b(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=this._deferredTriggers,t=this._record,r=t.trigger,i=0,n=e.length;i<n;i++)r.apply(t,e[i])
2
- ;e.length=0}},e.prototype.removeFromInverseRelationships=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this._relationships.forEach(function(t,r){r.removeCompletelyFromInverse(),!0===e&&r.clear()});var t=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(t).forEach(function(r){var i=t[r];i.removeCompletelyFromInverse(),!0===e&&i.clear()})},e.prototype.destroyRelationships=function(){this._relationships.forEach(function(e,t){return c(t)});var e=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(e).forEach(function(t){c(e[t])})},e.prototype.preloadData=function(e){var t=this;Object.keys(e).forEach(function(r){var i=y(e,r);t.modelClass.metaForProperty(r).isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},e.prototype._preloadRelationship=function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),n=0;n<t.length;n++){var a=t[n];i[n]=this._convertStringOrNumberIntoInternalModel(a,r)}this._relationships.get(e).updateInternalModelsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setInternalModel(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this.store.recordArrayManager.recordDidChange(this)},e.prototype.setId=function(e){this.id=e,this._record.get("id")!==e&&this._record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this._record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this._record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships),e=e.attributes),this.didCleanError();var t=this._changedKeys(e);z(this._data,this._inFlightAttributes),e&&z(this._data,e),this._inFlightAttributes=null,this.send("didCommit"),this.updateRecordArrays(),e&&this._record._notifyProperties(t)},e.prototype.addErrorMessageToAttribute=function(e,t){y(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){y(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){y(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){var e=y(this.getRecord(),"errors");return!g(e)},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){var e=Object.keys(this._inFlightAttributes);if(e.length>0)for(var t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=null},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,n=void 0,a=void 0,o=Object.keys(e),s=o.length,l=this.hasChangedAttributes(),d=void 0;for(l&&(d=this._attributes),r=z(Object.create(null),this._data),r=z(r,this._inFlightAttributes),i=0;i<s;i++)a=o[i],n=e[a],!0===l&&void 0!==d[a]||_(r[a],n)||t.push(a)}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new s.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new s.HasManyReference(this.store,this,i)),this.references[t]=r}return r},h(e,[{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new s.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=a.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=Object.create(null)),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=Object.create(null)),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new r.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=Object.create(null)),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=Object.create(null)),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=Object.create(null)),this.__implicitRelationships}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=x,(0,n.default)("ds-rollback-attribute")&&(x.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/relationships/ext"],function(e,t,r,i,n,a){function o(e,t,r,i){var n=i||[],a=c(t,"relationships");if(!a)return n;var s=a.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return s&&n.push.apply(n,s),e.superclass&&o(e.superclass,t,r,n),n}e.__esModule=!0;var s=(Ember.ComputedProperty,Ember.setOwner),l=(Ember.isNone,Ember.Error,Ember.Evented),d=Ember.Object,u=Ember.computed,c=Ember.get,h=Ember.observer,p=Ember.Map,f=u("currentState",function(e){return c(this._internalModel.currentState,e)}).readOnly(),m=d.extend(l,{_internalModel:null,store:null,__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},isEmpty:f,isLoading:f,isLoaded:f,hasDirtyAttributes:u("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:f,isDeleted:f,isNew:f,isValid:f,dirtyType:f,isError:!1,isReloading:!1,id:null,currentState:n.default.empty,errors:u(function(){var e=r.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this._internalModel.createSnapshot().serialize(e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:null,didLoad:null,didUpdate:null,didCreate:null,didDelete:null,becameInvalid:null,becameError:null,rolledBack:null,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){Ember.beginPropertyChanges();for(var t=void 0,r=0,i=e.length;r<i;r++)t=e[r],this.notifyPropertyChange(t);Ember.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 r=this;return t.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return r})})},reload:function(){var e=this;return t.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){var t=this[e];if("function"==typeof t){for(var r=arguments.length,i=new Array(r-1),n=1;n<r;n++)i[n-1]=arguments[n];t.apply(this,i)}this._super.apply(this,arguments)},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:h("id",function(){this._internalModel.setId(this.get("id"))}),_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,n){var a=t[n.kind];void 0===a&&(a=t[n.kind]=[],i.push({name:n.name,properties:a,expand:!0})),a.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}},notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return c(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)},notifyHasManyAdded:function(e){this.notifyPropertyChange(e)},eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});Object.defineProperty(m.prototype,"data",{get:function(){return this._internalModel._data}}),m.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=c(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:u(function(){return Object.create(null)}),inverseFor:function(e,t){var r=c(this,"inverseMap");if(void 0!==r[e])return r[e];var i=c(this,"relationshipsByName").get(e);if(!i)return r[e]=null,null;var n=i.options;return n&&null===n.inverse?(r[e]=null,null):r[e]=this._findInverseFor(e,t)},_findInverseFor:function(e,t){var r=this.typeForRelationship(e,t);if(!r)return null;var i=this.metaForProperty(e),n=i.options;if(null===n.inverse)return null;var a=void 0,s=void 0,l=void 0;if(n.inverse)a=n.inverse,l=c(r,"relationshipsByName").get(a),s=l.kind;else{i.parentType&&(i.type,i.parentType.modelName);var d=o(this,r,e);if(0===d.length)return null;var u=d.filter(function(t){var i=r.metaForProperty(t.name).options;return e===i.inverse});1===u.length&&(d=u),a=d[0].name,s=d[0].kind}return{type:r,name:a,kind:s}},relationships:a.relationshipsDescriptor,relationshipNames:u(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:a.relatedTypesDescriptor,relationshipsByName:a.relationshipsByNameDescriptor,fields:u(function(){var e=p.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){c(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=c(this,"relatedTypes"),i=0;i<r.length;i++){var n=r[i];e.call(t,n)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,n=this.inverseFor(r,t),a=void 0;return n?(a=n.kind,"belongsTo"===a?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:u(function(){var e=p.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:u(function(){var e=p.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){c(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){c(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),s&&Object.defineProperty(m.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,i.default)("ds-rollback-attribute")&&m.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=m}),t("ember-data/-private/system/model/states",["exports"],function(e){function t(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function r(e){var t={},i=void 0;for(var n in e)i=e[n],t[n]=i&&"object"==typeof i?r(i):i;return t}function i(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return i(r(l),e)}function a(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function o(e){}function s(e,t,r){e=i(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var n in e)e.hasOwnProperty(n)&&"parentState"!==n&&"stateName"!==n&&"object"==typeof e[n]&&(e[n]=s(e[n],e,r+"."+n));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:t,loadingData:function(){},propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:function(){},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:t,becomeDirty:function(){},pushedData:function(){},unloadRecord:o,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",this.dirtyType)},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,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},pushedData:function(){},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)}}},d=n({dirtyType:"created",isNew:!0});d.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},d.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var u=n({dirtyType:"updated"});d.uncommitted.deleteRecord=a,d.invalid.deleteRecord=a,d.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},d.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},d.uncommitted.propertyWasReset=function(){},u.invalid.becameValid=function(e){e.transitionTo("loaded.saved")},u.inFlight.unloadRecord=o,u.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var c={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},propertyWasReset:function(){},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:function(){},saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:t,pushedData:function(){},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){},didCommit:function(){},notFound:function(){}},created:d,updated:u},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:function(){},becomeDirty:function(){},deleteRecord:function(){},rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:o,willCommit:function(){},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.removeFromInverseRelationships()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},deleteRecord:function(){},willCommit:function(){},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)}};e.default=s(c,null,"root")}),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.__esModule=!0,e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports"],function(e){function t(e){return r(e)}e.__esModule=!0,e.default=t;var r=Ember.String.dasherize}),t("ember-data/-private/system/ordered-set",["exports"],function(e){function t(){this._super$constructor()}e.__esModule=!0,e.default=t;var r=Ember.guidFor,i=Ember.OrderedSet;t.create=function(){return new this},t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.prototype._super$constructor=i,t.prototype.addWithIndex=function(e,t){var i=r(e),n=this.presenceSet,a=this.list;if(!0!==n[i])return n[i]=!0,void 0===t||null===t?a.push(e):a.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports"],function(e){function t(e,t){return h.create({promise:u.resolve(e,t)})}function r(e,t){return c.create({promise:u.resolve(e,t)})}function i(e){return function(){var t;return(t=l(this,"content"))[e].apply(t,arguments)}}function n(e,t){return p.create({promise:u.resolve(e,t)})}e.__esModule=!0,e.promiseObject=t,e.promiseArray=r,e.proxyToContent=i,e.promiseManyArray=n;var a=Ember.ObjectProxy,o=Ember.PromiseProxyMixin,s=Ember.ArrayProxy,l=Ember.get,d=Ember.computed.reads,u=Ember.RSVP.Promise,c=e.PromiseArray=s.extend(o,{meta:d("content.meta")}),h=e.PromiseObject=a.extend(o),p=e.PromiseManyArray=c.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:i("createRecord"),on:i("on"),one:i("one"),trigger:i("trigger"),off:i("off"),has:i("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember-data/-private/system/record-arrays","ember-data/-private/system/clone-null"],function(e,t,r){function i(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function a(e,t){var r=e.indexOf(t);return-1!==r&&(e.splice(r,1),!0)}function o(e,t){for(var r=[],i=[],n=0;n<t.length;n++){var a=t[n],o=a.isHiddenFromRecordArrays(),s=a._recordArrays;o||a.isEmpty()||s.has(e)||(r.push(a),s.add(e)),o&&(i.push(a),s.delete(e))}r.length>0&&e._pushInternalModels(r),i.length>0&&e._removeInternalModels(i)}function s(e){for(var t=0;t<e.length;t++){for(var r=e[t],i=r._recordArrays.list,n=0;n<i.length;n++)i[n]._removeInternalModels([r]);r._recordArrays.clear()}}function l(e,t){for(var r=0,i=e.length;r<i;r++){e[r]._recordArrays.add(t)}}e.__esModule=!0,e.associateWithRecordArray=l;var d=Ember.A,u=Ember.set,c=Ember.get,h=Ember.run,p=function(){function e(e){this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this._filteredRecordArrays=Object.create(null),this._liveRecordArrays=Object.create(null),this._pending=Object.create(null),this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){this.internalModelDidChange(e)},e.prototype.recordWasLoaded=function(e){this.internalModelDidChange(e)},e.prototype.internalModelDidChange=function(e){var t=e.modelName;if(!e._pendingRecordArrayManagerFlush){e._pendingRecordArrayManagerFlush=!0;var r=this._pending;1===(r[t]=r[t]||[]).push(e)&&h.schedule("actions",this,this._flush)}},e.prototype._flush=function(){var e=this._pending;this._pending=Object.create(null);var t=[];for(var r in e){for(var i=e[r],n=0;n<i.length;n++){var a=i[n];a._pendingRecordArrayManagerFlush=!1,a.isHiddenFromRecordArrays()&&t.push(a)}if(this._filteredRecordArrays[r])for(var o=this.filteredRecordArraysFor(r),l=0;l<o.length;l++)this.updateFilterRecordArray(o[l],r,i);var d=this._liveRecordArrays[r];d&&this.updateLiveRecordArray(d,i),t.length>0&&s(t)}},e.prototype.updateLiveRecordArray=function(e,t){return o(e,t)},e.prototype.updateFilterRecordArray=function(e,t,r){for(var i=c(e,"filterFunction"),n=[],a=[],o=0;o<r.length;o++){var s=r[o];if(!1===s.isHiddenFromRecordArrays()&&i(s.getRecord())){if(s._recordArrays.has(e))continue;n.push(s),s._recordArrays.add(e)}else s._recordArrays.delete(e)&&a.push(s)}n.length>0&&e._pushInternalModels(n),a.length>0&&e._removeInternalModels(a)},e.prototype._syncLiveRecordArray=function(e,t){var r=0===Object.keys(this._pending).length,i=this.store._internalModelsFor(t),n=c(i,"length")===c(e,"length");if(!r||!n){for(var a=this._visibleInternalModelsByType(t),o=[],s=0;s<a.length;s++){var l=a[s],d=l._recordArrays;!1===d.has(e)&&(d.add(e),o.push(l))}e._pushInternalModels(o)}},e.prototype.updateFilter=function(e,t,r){var i=this.store._internalModelsFor(t),n=i.models;this.updateFilterRecordArray(e,r,n)},e.prototype._didUpdateAll=function(e){var t=this._liveRecordArrays[e];t&&u(t,"isUpdating",!1)},e.prototype.liveRecordArrayFor=function(e){var t=this._liveRecordArrays[e];if(t)this._syncLiveRecordArray(t,e);else{var r=this._visibleInternalModelsByType(e);t=this.createRecordArray(e,r),this._liveRecordArrays[e]=t}return t},e.prototype._visibleInternalModelsByType=function(e){for(var t=this.store._internalModelsFor(e)._models,r=[],i=0;i<t.length;i++){var n=t[i];!1===n.isHiddenFromRecordArrays()&&r.push(n)}return r},e.prototype.filteredRecordArraysFor=function(e){return this._filteredRecordArrays[e]||(this._filteredRecordArrays[e]=[])},e.prototype.createRecordArray=function(e,r){var i=t.RecordArray.create({modelName:e,content:d(r||[]),store:this.store,isLoaded:!0,manager:this});return Array.isArray(r)&&l(r,i),i},e.prototype.createFilteredRecordArray=function(e,r,i){var n=t.FilteredRecordArray.create({query:i,modelName:e,content:d(),store:this.store,manager:this,filterFunction:r});return this.registerFilteredRecordArray(n,e,r),n},e.prototype.createAdapterPopulatedRecordArray=function(e,i,n,a){var o=void 0;return Array.isArray(n)?(o=t.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:d(n),store:this.store,manager:this,isLoaded:!0,isUpdating:!1,meta:(0,r.default)(a.meta),links:(0,r.default)(a.links)}),l(n,o)):o=t.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:d(),store:this.store,manager:this}),this._adapterPopulatedRecordArrays.push(o),o},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArraysFor(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArraysFor(t),i=a(r,e),n=a(this._adapterPopulatedRecordArrays,e);if(!i&&!n){var o=this._liveRecordArrays[t];o&&e===o&&delete this._liveRecordArrays[t]}},e.prototype.willDestroy=function(){var e=this;Object.keys(this._filteredRecordArrays).forEach(function(t){return n(e._filteredRecordArrays[t]).forEach(i)}),Object.keys(this._liveRecordArrays).forEach(function(t){return e._liveRecordArrays[t].destroy()}),this._adapterPopulatedRecordArrays.forEach(i),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,h.schedule("actions",this,this.willDestroy)},e}();e.default=p}),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,i){e.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null","ember-data/-private/system/record-array-manager"],function(e,t,r,i){e.__esModule=!0;var n=Ember.run.once,a=Ember.A,o=Ember.get;e.default=t.default.extend({init:function(){this.set("content",this.get("content")||a()),this._super.apply(this,arguments),this.query=this.query||null,this.links=null},replace:function(){throw new Error("The result of a server query (on "+this.modelName+") is immutable.")},_update:function(){var e=o(this,"store"),t=o(this,"query");return e._query(this.modelName,t,this)},_setInternalModels:function(e,t){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,r.default)(t.meta),links:(0,r.default)(t.links)}),(0,i.associateWithRecordArray)(e,this),n(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember-data/-private/system/record-arrays/record-array"],function(e,t){e.__esModule=!0;var r=Ember.run.once,i=Ember.get,n=Ember.observer;e.default=t.default.extend({init:function(){this._super.apply(this,arguments),this.set("filterFunction",this.get("filterFunction")||null),this.isLoaded=!0},replace:function(){throw new Error("The result of a client-side filter (on "+this.modelName+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,this.modelName,i(this,"filterFunction"))},updateFilter:n("filterFunction",function(){r(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r){e.__esModule=!0;var i=Ember.Evented,n=Ember.ArrayProxy,a=Ember.set,o=Ember.get,s=Ember.computed,l=Ember.RSVP.Promise;e.default=n.extend(i,{init:function(){this._super.apply(this,arguments),this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){throw new Error("The result of a server query (for all "+this.modelName+" types) is immutable. To modify contents, use toArray()")},type:s("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=o(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(o(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){o(this,"content").pushObjects(e)},_removeInternalModels:function(e){o(this,"content").removeObjects(e)},save:function(){var e=this,r="DS: RecordArray#save "+this.modelName,i=l.all(this.invoke("save"),r).then(function(){return e},null,"DS: RecordArray#save return RecordArray");return t.PromiseArray.create({promise:i})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t.__recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){this.manager.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),a(this,"content",null),a(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new r.default(this,this.get("meta"),e)},_takeSnapshot:function(){return o(this,"content").map(function(e){return e.createSnapshot()})}})}),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,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/-private/system/model/model","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i){e.__esModule=!0;var n=Ember.RSVP.resolve,a=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};a.prototype=Object.create(r.default.prototype),a.prototype.constructor=a,a.prototype._super$constructor=r.default,a.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},a.prototype.id=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.id},a.prototype.link=function(){return this.belongsToRelationship.link},a.prototype.meta=function(){return this.belongsToRelationship.meta},a.prototype.push=function(e){var r=this;return n(e).then(function(e){var n=void 0;return e instanceof t.default?((0,i.default)("ds-overhaul-references"),n=e):n=r.store.push(e),r.belongsToRelationship.setCanonicalInternalModel(n._internalModel),n})},a.prototype.value=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.isLoaded()?e.getRecord():null},a.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},a.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=a}),t("ember-data/-private/system/references/has-many",["exports","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r){e.__esModule=!0;var i=Ember.A,n=Ember.RSVP.resolve,a=Ember.get,o=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(t.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=t.default,o.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},o.prototype.link=function(){
3
- return this.hasManyRelationship.link},o.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},o.prototype.meta=function(){return this.hasManyRelationship.meta},o.prototype.push=function(e){var t=this;return n(e).then(function(e){var n=e;(0,r.default)("ds-overhaul-references");var a=!0;"object"==typeof e&&e.data&&(n=e.data,a=n.length&&n[0].data,(0,r.default)("ds-overhaul-references")),(0,r.default)("ds-overhaul-references")||(a=!0);var o=void 0;if(a)o=n.map(function(e){var r=t.store.push(e);return r._internalModel});else{var s=t.store.push(e);o=i(s).mapBy("_internalModel")}return t.hasManyRelationship.computeChanges(o),t.hasManyRelationship.manyArray})},o.prototype._isLoaded=function(){return!!a(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return!0===e.isLoaded()})},o.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},o.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},o.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=o}),t("ember-data/-private/system/references/record",["exports","ember-data/-private/system/references/reference"],function(e,t){e.__esModule=!0;var r=Ember.RSVP.resolve,i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(t.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=t.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var t=this;return r(e).then(function(e){return t.store.push(e)})},i.prototype.value=function(){return this.internalModel.hasRecord?this.internalModel.getRecord():null},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){e.__esModule=!0;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 i(e){var i=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function n(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0}}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=n}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember-data/-private/system/normalize-model-name"],function(e,t){function r(e,r){var n=void 0,a=void 0;"object"==typeof e?(n=e,a=void 0):(n=r,a=e),"string"==typeof a&&(a=(0,t.default)(a)),n=n||{};var o={type:a,isRelationship:!0,options:n,kind:"belongsTo",name:"Belongs To",key:null};return i({get:function(e){return n.hasOwnProperty("serialize"),n.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).setInternalModel(t._internalModel):this._internalModel._relationships.get(e).setInternalModel(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=r;var i=Ember.computed;Ember.inspect}),t("ember-data/-private/system/relationships/ext",["exports","ember-data/-private/system/relationship-meta"],function(e,t){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var r=Ember.A,i=Ember.computed,n=Ember.MapWithDefault,a=Ember.Map,o=e.relationshipsDescriptor=i(function(){!0===Ember.testing&&!0===o._cacheable&&(o._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(r,i){if(i.isRelationship){i.key=r;e.get((0,t.typeForRelationshipMeta)(i)).push({name:r,kind:i.kind})}}),e}).readOnly(),s=e.relatedTypesDescriptor=i(function(){!0===Ember.testing&&!0===s._cacheable&&(s._cacheable=!1);var e=void 0,i=r();return this.eachComputedProperty(function(r,n){n.isRelationship&&(n.key=r,e=(0,t.typeForRelationshipMeta)(n),i.includes(e)||i.push(e))}),i}).readOnly();e.relationshipsByNameDescriptor=i(function(){var e=a.create();return this.eachComputedProperty(function(r,i){if(i.isRelationship){i.key=r;var n=(0,t.relationshipFromMeta)(i);n.type=(0,t.typeForRelationshipMeta)(i),e.set(r,n)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r){function i(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,t.default)(e));var i={type:e,options:r,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return a({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addInternalModels(t.map(function(e){return n(e,"_internalModel")})),r.getRecords()}}).meta(i)}e.__esModule=!0,e.default=i;var n=(Ember.A,Ember.get),a=Ember.computed;Ember.inspect}),t("ember-data/-private/system/relationships/relationship-payloads-manager",["exports","ember-data/-private/system/relationships/relationship-payloads"],function(e,t){e.__esModule=!0;var r=Ember.get,i=function(){function e(e){this._store=e,this._cache=Object.create(null),this._inverseLookupCache=new t.TypeCache}return e.prototype.get=function(e,t,r){var i=this._getRelationshipPayloads(e,r,!1);return i&&i.get(e,t,r)},e.prototype.push=function(e,t,r){var i=this;r&&Object.keys(r).forEach(function(n){var a=i._getRelationshipPayloads(e,n,!0);a&&a.push(e,t,n,r[n])})},e.prototype.unload=function(e,t){var i=this,n=this._store._modelFor(e);r(n,"relationshipsByName").forEach(function(r,n){var a=i._getRelationshipPayloads(e,n,!1);a&&a.unload(e,t,n)})},e.prototype._getRelationshipPayloads=function(e,t,r){var i=this.getRelationshipInfo(e,t);if(null!==i){var n=this._cache[i.lhs_key];return!n&&r?this._initializeRelationshipPayloads(i):n}},e.prototype.getRelationshipInfo=function(e,t){var i=this._inverseLookupCache,n=this._store,a=i.get(e,t);if(void 0!==a)return a;var o=n._modelFor(e),s=r(o,"relationshipsByName");if(!s.has(t))return i.set(e,t,null),null;var l=o.inverseFor(t,n),d=s.get(t),u=void 0!==d.options&&!0===d.options.polymorphic,c=d.type;if(!l){var h={lhs_key:e+":"+t,lhs_modelNames:[e],lhs_baseModelName:e,lhs_relationshipName:t,lhs_relationshipMeta:d,lhs_isPolymorphic:u,rhs_key:"",rhs_modelNames:[],rhs_baseModelName:c,rhs_relationshipName:"",rhs_relationshipMeta:null,rhs_isPolymorphic:!1,hasInverse:!1,isSelfReferential:!1,isReflexive:!1};return i.set(e,t,h),h}var p=l.name,f=r(l.type,"relationshipsByName").get(p),m=f.type,y=m===c;if(a=i.get(m,t)||i.get(c,p)){return(a.lhs_baseModelName===m?a.lhs_modelNames:a.rhs_modelNames).push(e),i.set(e,t,a),a}var v={lhs_key:m+":"+t,lhs_modelNames:[e],lhs_baseModelName:m,lhs_relationshipName:t,lhs_relationshipMeta:d,lhs_isPolymorphic:u,rhs_key:c+":"+p,rhs_modelNames:[],rhs_baseModelName:c,rhs_relationshipName:p,rhs_relationshipMeta:f,rhs_isPolymorphic:void 0!==f.options&&!0===f.options.polymorphic,hasInverse:!0,isSelfReferential:y,isReflexive:y&&t===p};return i.set(m,t,v),i.set(e,t,v),i.set(c,p,v),v},e.prototype._initializeRelationshipPayloads=function(e){var r=e.lhs_key,i=e.rhs_key,n=this._cache[r];if(!0===e.hasInverse&&!0===e.rhs_isPolymorphic&&void 0!==(n=this._cache[i]))return this._cache[r]=n,n;var a=this._cache[r]=new t.default(e);return!0===e.hasInverse&&(this._cache[i]=a),a},e}();e.default=i}),t("ember-data/-private/system/relationships/relationship-payloads",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=e.TypeCache=function(){function e(){this.types=Object.create(null)}return e.prototype.get=function(e,t){var r=this.types;if(void 0!==r[e])return r[e][t]},e.prototype.set=function(e,t,r){var i=this.types,n=i[e];void 0===n&&(n=i[e]=Object.create(null)),n[t]=r},e.prototype.delete=function(e,t){var r=this.types;void 0!==r[e]&&delete r[e][t]},e}(),i=function(){function e(e){this._relInfo=e,this.lhs_payloads=new r,this.rhs_payloads=e.isReflexive?this.lhs_payloads:new r,this._pendingPayloads=[]}return e.prototype.get=function(e,t,r){return this._flushPending(),this._isLHS(e,r)?this.lhs_payloads.get(e,t):this.rhs_payloads.get(e,t)},e.prototype.push=function(e,t,r,i){this._pendingPayloads.push([e,t,r,i])},e.prototype.unload=function(e,t,r){this._flushPending(),this._isLHS(e,r)?this.lhs_payloads.delete(e,t):this.rhs_payloads.delete(e,t)},e.prototype._isLHS=function(e,t){var r=this._relInfo,i=r.isSelfReferential;return!0==(t===r.lhs_relationshipName)&&(!0===i||e===r.lhs_baseModelName||-1!==r.lhs_modelNames.indexOf(e))},e.prototype._isRHS=function(e,t){var r=this._relInfo,i=r.isSelfReferential;return!0==(t===r.rhs_relationshipName)&&(!0===i||e===r.rhs_baseModelName||-1!==r.rhs_modelNames.indexOf(e))},e.prototype._flushPending=function(){if(0!==this._pendingPayloads.length)for(var e=this._pendingPayloads.splice(0,this._pendingPayloads.length),t=0;t<e.length;++t){var r=e[t][0],i=e[t][1],n=e[t][2],a=e[t][3],o={data:{id:i,type:r}},s=void 0,l=void 0,d=void 0,u=void 0;this._isLHS(r,n)?(s=this.lhs_payloads.get(r,i),l=this.lhs_payloads,d=this.rhs_payloads,u=this._rhsRelationshipIsMany):(s=this.rhs_payloads.get(r,i),l=this.rhs_payloads,d=this.lhs_payloads,u=this._lhsRelationshipIsMany),void 0!==a.data&&this._removeInverse(i,s,d),l.set(r,i,a),this._populateInverse(a,o,d,u)}},e.prototype._populateInverse=function(e,t,r,i){if(e.data)if(Array.isArray(e.data))for(var n=0;n<e.data.length;++n){var a=e.data[n];this._addToInverse(t,a,r,i)}else{var o=e.data;this._addToInverse(t,o,r,i)}},e.prototype._addToInverse=function(e,t,r,i){if(!this._relInfo.isReflexive||e.data.id!==t.id){var n=r.get(t.type,t.id),a=n&&n.data;a?Array.isArray(a)?a.push(e.data):r.set(t.type,t.id,e):i?r.set(t.type,t.id,{data:[e.data]}):r.set(t.type,t.id,e)}},e.prototype._removeInverse=function(e,t,r){var i=t&&t.data;if(i)if(Array.isArray(i))for(var n=0;n<i.length;++n){var a=i[n];this._removeFromInverse(e,a,r)}else this._removeFromInverse(e,i,r)},e.prototype._removeFromInverse=function(e,t,r){var i=r.get(t.type,t.id),n=i&&i.data;n&&(Array.isArray(n)?i.data=n.filter(function(t){return t.id!==e}):r.set(t.type,t.id,{data:null}))},t(e,[{key:"_lhsRelationshipIsMany",get:function(){var e=this._relInfo.lhs_relationshipMeta;return null!==e&&"hasMany"===e.kind}},{key:"_rhsRelationshipIsMany",get:function(){var e=this._relInfo.rhs_relationshipMeta;return null!==e&&"hasMany"===e.kind}}]),e}();e.default=i}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r){function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.__esModule=!0;var a=Ember.RSVP.Promise,o=(Ember.inspect,function(e){function r(t,r,n,a){var o=i(this,e.call(this,t,r,n,a));return o.internalModel=r,o.key=a.key,o.inverseInternalModel=null,o.canonicalState=null,o}return n(r,e),r.prototype.setInternalModel=function(e){e?this.addInternalModel(e):this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.setHasData(!0),this.setHasLoaded(!0)},r.prototype.setCanonicalInternalModel=function(e){e?this.addCanonicalInternalModel(e):this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.flushCanonicalLater()},r.prototype.setInitialCanonicalInternalModel=function(e){e&&(this.canonicalMembers.add(e),this.members.add(e),this.inverseInternalModel=this.canonicalState=e,this.setupInverseRelationship(e))},r.prototype.addCanonicalInternalModel=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalInternalModel.call(this,t))},r.prototype.inverseDidDematerialize=function(){e.prototype.inverseDidDematerialize.call(this,this.inverseInternalModel),this.notifyBelongsToChanged()},r.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t),this.canonicalState===t&&(this.canonicalState=null),this.inverseInternalModel===t&&(this.inverseInternalModel=null,this.notifyBelongsToChanged())},r.prototype.removeCompletelyFromInverse=function(){e.prototype.removeCompletelyFromInverse.call(this),this.inverseInternalModel=null},r.prototype.flushCanonical=function(){this.inverseInternalModel&&this.inverseInternalModel.isNew()&&!this.canonicalState||(this.inverseInternalModel!==this.canonicalState&&(this.inverseInternalModel=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},r.prototype.addInternalModel=function(t){this.members.has(t)||(this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.inverseInternalModel=t,e.prototype.addInternalModel.call(this,t),this.notifyBelongsToChanged())},r.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setInternalModel(t?t._internalModel:t)},r.prototype.removeInternalModelFromOwn=function(t){this.members.has(t)&&(this.inverseInternalModel=null,e.prototype.removeInternalModelFromOwn.call(this,t),this.notifyBelongsToChanged())},r.prototype.removeAllInternalModelsFromOwn=function(){e.prototype.removeAllInternalModelsFromOwn.call(this),this.inverseInternalModel=null,this.notifyBelongsToChanged()},r.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},r.prototype.removeCanonicalInternalModelFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalInternalModelFromOwn.call(this,t))},r.prototype.removeAllCanonicalInternalModelsFromOwn=function(){e.prototype.removeAllCanonicalInternalModelsFromOwn.call(this),this.canonicalState=null},r.prototype.findRecord=function(){return this.inverseInternalModel?this.store._findByInternalModel(this.inverseInternalModel):a.resolve(null)},r.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addInternalModel(t),t})},r.prototype.getRecord=function(){var e=this;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),t.PromiseObject.create({promise:r,content:this.inverseInternalModel?this.inverseInternalModel.getRecord():null})}if(null===this.inverseInternalModel)return null;var i=this.inverseInternalModel.getRecord();return i},r.prototype.reload=function(){return this.link?this.fetchLink():this.inverseInternalModel&&this.inverseInternalModel.hasRecord?this.inverseInternalModel.getRecord().reload():this.findRecord()},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifier(this,e);t?this.setInitialCanonicalInternalModel(r):this.setCanonicalInternalModel(r)},r}(r.default));e.default=o}),t("ember-data/-private/system/relationships/state/create",["exports","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to"],function(e,t,r){function i(e){var t=e.options;return!(t&&null===t.inverse)}function n(e,n,a){var o=void 0,s=null;return i(n)&&(s=e.type.inverseFor(n.key,a)),s&&(o=s.name),"hasMany"===n.kind?new t.default(a,e,o,n):new r.default(a,e,o,n)}e.__esModule=!0;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),o=Ember.get,s=function(){function e(e){this.internalModel=e,this.initializedRelationships=Object.create(null)}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.forEach=function(e){var t=this.initializedRelationships;Object.keys(t).forEach(function(r){e(r,t[r])})},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e],i=this.internalModel;if(!r){var a=o(i.type,"relationshipsByName"),s=a.get(e);if(!s)return;var l=i.store._relationshipsPayloads.get(i.modelName,i.id,e);r=t[e]=n(i,s,i.store),l&&r.push(l,!0)}return r},a(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=s}),t("ember-data/-private/system/relationships/state/has-many",["exports","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,i,n){function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=new i.default;if(e)for(var r=0,n=e.length;r<n;r++)t.add(e[r]);return t}e.__esModule=!0;var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),d=function(e){function r(t,r,i,n){var o=a(this,e.call(this,t,r,i,n));return o.belongsToType=n.type,o.canonicalState=[],o.isPolymorphic=n.options.polymorphic,o._manyArray=null,o._retainedManyArray=null,o.__loadingPromise=null,o}return o(r,e),r.prototype._updateLoadingPromise=function(e,r){return this.__loadingPromise?(r&&this.__loadingPromise.set("content",r),this.__loadingPromise.set("promise",e)):this.__loadingPromise=t.PromiseManyArray.create({promise:e,content:r}),this.__loadingPromise},r.prototype.removeInverseRelationships=function(){e.prototype.removeInverseRelationships.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},r.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},r.prototype.addCanonicalInternalModel=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalInternalModel.call(this,t,r))},r.prototype.inverseDidDematerialize=function(t){e.prototype.inverseDidDematerialize.call(this,t),this.isAsync&&(this._manyArray&&(this._retainedManyArray=this._manyArray,this._manyArray=null),this._removeInternalModelFromManyArray(this._retainedManyArray,t)),this.notifyHasManyChanged()},r.prototype.addInternalModel=function(t,r){this.members.has(t)||(e.prototype.addInternalModel.call(this,t,r),this.manyArray._addInternalModels([t],r))},r.prototype.removeCanonicalInternalModelFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalInternalModelFromOwn.call(this,t,r))},r.prototype.removeAllCanonicalInternalModelsFromOwn=function(){e.prototype.removeAllCanonicalInternalModelsFromOwn.call(this),this.canonicalMembers.clear(),this.canonicalState.splice(0,this.canonicalState.length)},r.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t);var r=this.canonicalState.indexOf(t);-1!==r&&this.canonicalState.splice(r,1);var i=this._manyArray;if(i){var n=i.currentState.indexOf(t);-1!==n&&i.internalReplace(n,1)}},r.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},r.prototype.removeInternalModelFromOwn=function(t,r){this.members.has(t)&&(e.prototype.removeInternalModelFromOwn.call(this,t,r),this._removeInternalModelFromManyArray(this.manyArray,t,r),this._removeInternalModelFromManyArray(this._retainedManyArray,t,r))},r.prototype.removeAllInternalModelsFromOwn=function(){e.prototype.removeAllInternalModelsFromOwn.call(this),this.manyArray.clear(),this._retainedManyArray&&this._retainedManyArray.clear()},r.prototype._removeInternalModelFromManyArray=function(e,t,r){null!==e&&(void 0!==r?e.currentState.removeAt(r):e._removeInternalModels([t]))},r.prototype.notifyRecordRelationshipAdded=function(e,t){this.internalModel.notifyHasManyAdded(this.key,e,t)},r.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},r.prototype.computeChanges=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.canonicalMembers,r=[],i=s(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalInternalModels(r);for(var n=0,a=e.length;n<a;n++){var o=e[n];this.removeCanonicalInternalModel(o),this.addCanonicalInternalModel(o,n)}},r.prototype.setInitialInternalModels=function(e){if(!1!==Array.isArray(e)&&0!==e.length){for(var t=0;t<e.length;t++){var r=e[t];this.canonicalMembers.has(r)||(this.canonicalMembers.add(r),this.members.add(r),this.setupInverseRelationship(r))}this.canonicalState=this.canonicalMembers.toArray()}},r.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateInternalModelsFromAdapter(t),e.manyArray.set("isLoaded",!0),e.setHasData(!0)}),e.manyArray})},r.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},r.prototype.notifyHasManyChanged=function(){this.internalModel.notifyHasManyAdded(this.key)},r.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifiers(this,e);t?this.setInitialInternalModels(r):this.updateInternalModelsFromAdapter(r)},r.prototype.destroy=function(){e.prototype.destroy.call(this);var t=this._manyArray;t&&(t.destroy(),this._manyArray=null);var r=this.__loadingPromise;r&&(r.destroy(),this.__loadingPromise=null)},l(r,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get:function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.internalModel,meta:this.meta,isPolymorphic:this.isPolymorphic}),null!==this._retainedManyArray&&(this._retainedManyArray.destroy(),this._retainedManyArray=null)),this._manyArray}}]),r}(r.default);e.default=d}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r){e.__esModule=!0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),n=Ember.guidFor,a=Ember.get,o=function(){function e(e,r,i,n){var a=n.options.async,o=n.options.polymorphic;this.members=new t.default,this.canonicalMembers=new t.default,this.store=e,this.key=n.key,this.inverseKey=i,this.internalModel=r,this.isAsync=void 0===a||a,this.isPolymorphic=void 0===o||o,this.relationshipMeta=n,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1,this.__inverseMeta=void 0}return e.prototype._inverseIsAsync=function(){var e=this._inverseMeta;if(!e)return!1;var t=e.options.async;return void 0===t||t},e.prototype._inverseIsSync=function(){var e=this._inverseMeta;if(!e)return!1;var t=e.options.async;return void 0!==t&&!t},e.prototype.internalModelDidDematerialize=function(){var e=this;this.inverseKey&&this.forAllMembers(function(t){t._relationships.get(e.inverseKey).inverseDidDematerialize(e.internalModel)})},e.prototype.inverseDidDematerialize=function(e){this.isAsync||(this.removeInternalModelFromOwn(e),this.removeCanonicalInternalModelFromOwn(e))},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeInternalModel(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalInternalModel(i)}},e.prototype.removeAllInternalModelsFromOwn=function(){this.members.clear(),this.internalModel.updateRecordArrays()},e.prototype.removeAllCanonicalInternalModelsFromOwn=function(){this.canonicalMembers.clear(),this.flushCanonicalLater()},e.prototype.removeInternalModels=function(e){var t=this;e.forEach(function(e){return t.removeInternalModel(e)})},e.prototype.addInternalModels=function(e,t){var r=this;e.forEach(function(e){r.addInternalModel(e,t),void 0!==t&&t++})},e.prototype.addCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalInternalModel(e[r],r+t):this.addCanonicalInternalModel(e[r])},e.prototype.addCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.setupInverseRelationship(e)),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.setupInverseRelationship=function(t){if(this.inverseKey){var r=t._relationships,i=r.has(this.inverseKey),n=r.get(this.inverseKey);(i||this.isPolymorphic)&&n.addCanonicalInternalModel(this.internalModel)}else{var a=t._implicitRelationships,o=a[this.inverseKeyForImplicit];o||(o=a[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync},type:this.parentType})),o.addCanonicalInternalModel(this.internalModel)}},e.prototype.removeCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalInternalModel(e[r],r+t):this.removeCanonicalInternalModel(e[r])},e.prototype.removeCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalInternalModelFromOwn(e),this.inverseKey?this.removeCanonicalInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalInternalModel(this.internalModel)),this.flushCanonicalLater()},e.prototype.addInternalModel=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addInternalModel(this.internalModel):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync},type:this.parentType})),t._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel)),this.internalModel.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeInternalModel=function(e){this.members.has(e)&&(this.removeInternalModelFromOwn(e),this.inverseKey?this.removeInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeInternalModel(this.internalModel))},e.prototype.removeInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeInternalModelFromOwn(this.internalModel)},e.prototype.removeInternalModelFromOwn=function(e){this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.removeCanonicalInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalInternalModelFromOwn(this.internalModel)},e.prototype.removeCanonicalInternalModelFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.removeCompletelyFromInverse=function(){var e=this;if(this.inverseKey){var t=Object.create(null),r=this.internalModel,i=function(i){var a=n(i);if(void 0===t[a]){i._relationships.get(e.inverseKey).removeCompletelyFromOwn(r),t[a]=!0}};this.members.forEach(i),this.canonicalMembers.forEach(i),this.isAsync||this.clear()}},e.prototype.forAllMembers=function(e){for(var t=Object.create(null),r=0;r<this.members.list.length;r++){var i=this.members.list[r],a=n(i);t[a]||(t[a]=!0,e(i))}for(var o=0;o<this.canonicalMembers.list.length;o++){var s=this.canonicalMembers.list[o],l=n(s);t[l]||(t[l]=!0,e(s))}},e.prototype.removeCompletelyFromOwn=function(e){this.canonicalMembers.delete(e),this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e,t){this.link=e,this.linkPromise=null,t||this.internalModel.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateInternalModelsFromAdapter=function(e){this.setHasData(!0),this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e,t){var i=!1,n=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(i=!0,this.updateData(e.data,t)),e.links&&e.links.related){var a=(0,r.default)(e.links.related);a&&a.href&&a.href!==this.link&&(n=!0,this.updateLink(a.href,t))}i?(this.setHasData(!0),this.setHasLoaded(!0)):n&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},e.prototype.destroy=function(){},i(e,[{key:"_inverseMeta",get:function(){if(void 0===this.__inverseMeta){var e=null;if(this.inverseKey){var t=this.store.modelFor(this.relationshipMeta.type);e=a(t,"relationshipsByName").get(this.inverseKey)}this.__inverseMeta=e}return this.__inverseMeta}},{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=o}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=function(){function e(e,t){
4
- var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this._type=null,this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}return e.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)},t(e,[{key:"type",get:function(){return this._type||(this._type=this._recordArray.get("type"))}}]),e}();e.default=r}),t("ember-data/-private/system/snapshot",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=Ember.copy,i=Ember.inspect,n=Ember.Error,a=Ember.get,o=function(){function e(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=Object.create(null),this._belongsToRelationships=Object.create(null),this._belongsToIds=Object.create(null),this._hasManyRelationships=Object.create(null),this._hasManyIds=Object.create(null),this._internalModel=e;var i=e.getRecord();this.record=i,i.eachAttribute(function(e){return t._attributes[e]=a(i,e)}),this.id=e.id,this.adapterOptions=r.adapterOptions,this.include=r.include,this.modelName=e.modelName,this._changedAttributes=i.changedAttributes()}return e.prototype.attr=function(e){if(e in this._attributes)return this._attributes[e];throw new n("Model '"+i(this.record)+"' has no attribute named '"+e+"' defined.")},e.prototype.attributes=function(){return r(this._attributes)},e.prototype.changedAttributes=function(){for(var e=Object.create(null),t=Object.keys(this._changedAttributes),i=0,n=t.length;i<n;i++){var a=t[i];e[a]=r(this._changedAttributes[a])}return e},e.prototype.belongsTo=function(e,t){var r=t&&t.id,o=void 0,s=void 0,l=void 0,d=void 0;if(r&&e in this._belongsToIds)return this._belongsToIds[e];if(!r&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(o=this._internalModel._relationships.get(e))||"belongsTo"!==o.relationshipMeta.kind)throw new n("Model '"+i(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return l=a(o,"hasData"),s=a(o,"inverseInternalModel"),l&&(d=s&&!s.isDeleted()?r?a(s,"id"):s.createSnapshot():null),r?this._belongsToIds[e]=d:this._belongsToRelationships[e]=d,d},e.prototype.hasMany=function(e,t){var r=t&&t.ids,o=void 0,s=void 0,l=void 0,d=void 0;if(r&&e in this._hasManyIds)return this._hasManyIds[e];if(!r&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(o=this._internalModel._relationships.get(e))||"hasMany"!==o.relationshipMeta.kind)throw new n("Model '"+i(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return l=a(o,"hasData"),s=a(o,"members"),l&&(d=[],s.forEach(function(e){e.isDeleted()||(r?d.push(e.id):d.push(e.createSnapshot()))})),r?this._hasManyIds[e]=d:this._hasManyRelationships[e]=d,d},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},t(e,[{key:"type",get:function(){return this._internalModel.modelClass}}]),e}();e.default=o}),t("ember-data/-private/system/store",["exports","ember-data/-private/adapters/errors","ember-data/-private/system/model/model","ember-data/-private/system/normalize-model-name","ember-data/-private/system/identity-map","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/relationships/relationship-payloads-manager","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/features"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m,y){function v(e,t){var r=e.then(function(e){return e.getRecord()});return(0,a.promiseObject)(r,t)}function b(e){return e.serializerFor("application")}function _(e,r,i,n){var a=n._internalModel,d=n.modelName,u=r._modelFor(d),c=e[i](r,u,n),h=(0,l.serializerForAdapter)(r,e,d),p="DS: Extract and notify about "+i+" completion of "+a;return c=D.resolve(c,p),c=(0,o._guard)(c,(0,o._bind)(o._objectIsAlive,r)),c=(0,o._guard)(c,(0,o._bind)(o._objectIsAlive,a)),c.then(function(e){return r._backburner.join(function(){var t=void 0,o=void 0;e&&(t=(0,s.normalizeResponseHelper)(h,r,u,e,n.id,i),t.included&&r._push({data:null,included:t.included}),o=t.data),r.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof t.InvalidError){var i=h.extractErrors(r,u,e,n.id);r.recordWasInvalid(a,i)}else r.recordWasError(a,e);throw e},p)}function g(e,t,r,i,n){var a=r.relationships[i].data;if(!a)return!1;var o=n[t.modelName];o||(o=n[t.modelName]=S(t.type,"inverseMap"));var s=o[i];if(void 0===s&&(s=t.type.inverseFor(i,e)),!s)return!1;var l=s,d=l.name;if(Array.isArray(a)){for(var u=0;u<a.length;++u){var c=e._internalModelsFor(a[u].type).get(a[u].id);if(c&&c._relationships.has(d))return!0}return!1}var h=e._internalModelsFor(a.type).get(a.id);return h&&h._relationships.has(d)}function M(e,t,r,i){Object.keys(r.relationships).forEach(function(n){var a=t._relationships;if(a.has(n)||g(e,t,r,n,i)){var o=r.relationships[n];a.get(n).push(o,!1)}})}e.__esModule=!0,e.Store=void 0;var R=Ember.A,A=Ember.copy,F=Ember.Error,E=Ember.MapWithDefault,z=Ember.run,I=Ember.set,S=Ember.get,k=Ember.computed,P=Ember.RSVP,T=Ember.Service,x=(Ember.typeOf,Ember.isPresent,Ember.isNone),O=(Ember.inspect,Ember._Backburner),j=Ember.ENV,D=P.Promise,N=void 0;e.Store=N=T.extend({init:function(){this._super.apply(this,arguments),this._backburner=new O(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new p.default({store:this}),this._identityMap=new n.default,this._pendingSave=[],this._instanceCache=new f.default((0,c.getOwner)(this),this),this._modelFactoryCache=Object.create(null),this._relationshipsPayloads=new d.default(this),this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=E.create({defaultValue:function(){return[]}}),this._instanceCache=new f.default((0,c.getOwner)(this),this)},adapter:"-json-api",serialize:function(e,t){return e._internalModel.createSnapshot().serialize(t)},defaultAdapter:k("adapter",function(){var e=S(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,i.default)(e),n=A(t)||Object.create(null);x(n.id)&&(n.id=this._generateId(r,n)),n.id=(0,h.default)(n.id);var a=this._buildInternalModel(r,n.id);a.loadedData();var o=a.getRecord(n);return a.eachRelationship(function(e,t){void 0!==n[e]&&a._relationships.get(e).setHasData(!0)}),o},_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,t,r){var n=(0,i.default)(e);return this.findRecord(n,t)},findRecord:function(e,t,r){var n=(0,i.default)(e),a=this._internalModelForId(n,t);return r=r||{},this.hasRecordForId(n,t)?v(this._findRecord(a,r),"DS: Store#findRecord "+n+" with id: "+t):this._findByInternalModel(a,r)},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):!1===t.backgroundReload?D.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),D.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),v(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:D.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),n=(0,i.default)(e),o=0;o<t.length;o++)r[o]=this.findRecord(n,t[o]);return(0,a.promiseArray)(P.all(r).then(R,null,"DS: Store#findByIds of "+n+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,u._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return D.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,n=P.defer("Fetching "+i+"' with id: "+r),a={internalModel:e,resolver:n,options:t},o=n.promise;return e.loadingData(o),0===this._pendingFetch.size&&z.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(a),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=a._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=Object.create(null),i=0,a=e.length;i<a;i++){var o=e[i],s=c[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var l=[],d=0,u=t.length;d<u;d++){var h=t[d];r[h.id]||l.push(h)}l.length&&n(l)}function n(e,t){for(var r=0,i=e.length;r<i;r++){var n=e[r],a=c[n.id];a&&a.resolver.reject(t||new Error("Expected: '"+n+"' to be present in the adapter provided payload, but it was not found."))}}for(var a=this,o=a.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,l=e.length,d=new Array(l),c=Object.create(null),h=0;h<l;h++){var p=e[h],f=p.internalModel;d[h]=f,c[f.id]=p}if(s){for(var m=new Array(l),y=0;y<l;y++)m[y]=d[y].createSnapshot();for(var v=o.groupRecordsForFindMany(this,m),b=0,_=v.length;b<_;b++){for(var g=v[b],M=v[b].length,R=new Array(M),A=new Array(M),F=0;F<M;F++){var E=g[F]._internalModel;A[F]=E,R[F]=E.id}if(M>1)!function(e){(0,u._findMany)(o,a,t,R,e).then(function(t){i(t,e)}).catch(function(t){n(e,t)})}(A);else if(1===R.length){var z=c[A[0].id];r(z)}}}else for(var I=0;I<l;I++)r(e[I])},getReference:function(e,t){var r=(0,i.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,i.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,i.default)(e),n=(0,h.default)(t),a=this._internalModelsFor(r).get(n);return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,h.default)(t),i=this._internalModelsFor(e).get(r);return i?i.hasScheduledDestroy()?(i.destroySync(),this._buildInternalModel(e,r)):i:this._buildInternalModel(e,r)},_internalModelDidReceiveRelationshipData:function(e,t,r){this._relationshipsPayloads.push(e,t,r)},_internalModelDestroyed:function(e){this._removeFromIdMap(e),this._relationshipsPayloads.unload(e.modelName,e.id)},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return D.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,u._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,u._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,i.default)(e);return this._query(r,t)},_query:function(e,t,r){var i=this.adapterFor(e);return(0,a.promiseArray)((0,u._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,i.default)(e),n=this.adapterFor(r);return(0,a.promiseObject)((0,u._queryRecord)(n,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,i.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),n=this._internalModelsFor(e).metadata.since;if(r.reload)return I(t,"isUpdating",!0),(0,a.promiseArray)((0,u._findAll)(i,this,e,n,r));var o=t._createSnapshot(r);return i.shouldReloadAll(this,o)?(I(t,"isUpdating",!0),(0,a.promiseArray)((0,u._findAll)(i,this,e,n,r))):!1===r.backgroundReload?(0,a.promiseArray)(D.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,o))&&(I(t,"isUpdating",!0),(0,u._findAll)(i,this,e,n,r)),(0,a.promiseArray)(D.resolve(t)))},_didUpdateAll:function(e){this.recordArrayManager._didUpdateAll(e)},didUpdateAll:function(e){return this._didUpdateAll(e)},peekAll:function(e){var t=(0,i.default)(e);return this.recordArrayManager.liveRecordArrayFor(t)},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=(0,i.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){j.ENABLE_DS_FILTER;var n=void 0,o=arguments.length,s=void 0,l=3===o,d=(0,i.default)(e);return l?n=this.query(d,t):2===arguments.length&&(r=t),s=l?this.recordArrayManager.createFilteredRecordArray(d,r,t):this.recordArrayManager.createFilteredRecordArray(d,r),n=n||D.resolve(s),(0,a.promiseArray)(n.then(function(){return s},null,"DS: Store#filter of "+d))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),z.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this._pendingSave.slice();this._pendingSave=[];for(var t=0,r=e.length;t<r;t++){var i=e[t],n=i.snapshot,a=i.resolver,o=n._internalModel,s=this.adapterFor(o.modelName),l=void 0;"root.deleted.saved"!==o.currentState.stateName?(l=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",a.resolve(_(s,this,l,n))):a.resolve()}},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this.updateId(e,r),this._setupRelationshipsForModel(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,i=e.modelName,n=(0,h.default)(t.id);if(null===r||null!==n){this._existingInternalModelForId(i,n);this._internalModelsFor(e.modelName).set(n,e),e.setId(n)}},_internalModelsFor:function(e){return this._identityMap.retrieve(e)},_load:function(e){var t=(0,i.default)(e.type),r=this._internalModelForId(t,e.id),n=!1===r.currentState.isEmpty;return r.setupData(e),n?this.recordArrayManager.recordDidChange(r):this.recordArrayManager.recordWasLoaded(r),r},_modelForMixin:function(e){var t=(0,c.getOwner)(this),i=void 0;if(t.factoryFor){var n=t.factoryFor("mixin:"+e);i=n&&n.class}else i=t._lookupFactory("mixin:"+e);if(i){var a=r.default.extend(i);a.reopenClass({__isMixin:!0,__mixin:i}),t.register("model:"+e,a)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,i.default)(e);return this._modelFor(t)},_modelFor:function(e){var t=this._modelFactoryFor(e);return t.class?t.class:t},_modelFactoryFor:function(e){var t=this._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new F("No model was found for '"+e+"'");var r=(0,c.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,i.default)(e),r=(0,c.getOwner)(this);return r.factoryFor?r.factoryFor("model:"+t):r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){return t.map(function(e){return e.getRecord()})}return null===t?null:t.getRecord()},_push:function(e){var t=this;return this._backburner.join(function(){var r=e.included,i=void 0,n=void 0;if(r)for(i=0,n=r.length;i<n;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){n=e.data.length;var a=new Array(n);for(i=0;i<n;i++)a[i]=t._pushInternalModel(e.data[i]);return a}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,c.getOwner)(this);return e=(0,i.default)(e),t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=(e.type,this._load(e));return this._setupRelationshipsForModel(t,e),t},_setupRelationshipsForModel:function(e,t){void 0!==t.relationships&&2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=void 0,r=0,i=e.length;r<i;r+=2){t=t||Object.create(null);M(this,e[r],e[r+1],t)}e.length=0},pushPayload:function(e,t){var r=void 0,n=void 0;if(t){n=t;var a=(0,i.default)(e);r=this.serializerFor(a)}else n=e,r=b(this);if((0,y.default)("ds-pushpayload-return"))return r.pushPayload(this,n);r.pushPayload(this,n)},normalize:function(e,t){var r=(0,i.default)(e),n=this.serializerFor(r),a=this._modelFor(r);return n.normalize(a,t)},_buildInternalModel:function(e,t,r){var i=(this._existingInternalModelForId(e,t),new m.default(e,t,this,r));return this._internalModelsFor(e).add(i,t),i},_existingInternalModelForId:function(e,t){var r=this._internalModelsFor(e).get(t);return r&&r.hasScheduledDestroy()&&(r.destroySync(),r=null),r},buildInternalModel:function(e,t,r){return this._buildInternalModel(e,t,r)},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,i.default)(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=(0,i.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&z.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!x(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!x(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=N,e.default=N}),t("ember-data/-private/system/store/common",["exports"],function(e){function t(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){return e.apply(void 0,r)}}function r(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.__esModule=!0,e._bind=t,e._guard=r,e._objectIsAlive=i;var n=Ember.get}),t("ember-data/-private/system/store/container-instance-cache",["exports"],function(e){e.__esModule=!0;var t=Ember.set,r=function(){function e(e,t){this.isDestroying=!1,this.isDestroyed=!1,this._owner=e,this._store=t,this._namespaces={adapter:Object.create(null),serializer:Object.create(null)}}return e.prototype.get=function(e,r){var i=this._namespaces[e];if(i[r])return i[r];var n=e+":"+r,a=this._instanceFor(n)||this._findInstance(e,this._fallbacksFor(e,r));return a&&(i[r]=a,t(a,"store",this._store)),i[r]},e.prototype._fallbacksFor=function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]},e.prototype._findInstance=function(e,t){for(var r=this._namespaces[e],i=0,n=t.length;i<n;i++){var a=t[i];if(r[a])return r[a];var o=e+":"+a,s=this._instanceFor(o);if(s)return r[a]=s,s}},e.prototype._instanceFor=function(e){return this._owner.lookup(e)},e.prototype.destroyCache=function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var n=t[r],a=e[n];a&&a.destroy()}},e.prototype.destroy=function(){this.isDestroying=!0,this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this.isDestroyed=!0},e.prototype.toString=function(){return"ContainerInstanceCache"},e}();e.default=r}),t("ember-data/-private/system/store/finders",["exports","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i){function n(e,n,a,o,s,l){var d=s.createSnapshot(l),u=s.modelName,c=e.findRecord(n,a,o,d),p="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=h.resolve(c,p),c=(0,t._guard)(c,(0,t._bind)(t._objectIsAlive,n)),c.then(function(t){var s=(0,i.serializerForAdapter)(n,e,u),l=(0,r.normalizeResponseHelper)(s,n,a,t,o,"findRecord");return n._push(l)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function a(e,n,a,o,s){var l=c(s).invoke("createSnapshot"),d=n.modelFor(a),u=e.findMany(n,d,o,l),p="DS: Handle Adapter#findMany of '"+a+"'";if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=h.resolve(u,p),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),s=(0,r.normalizeResponseHelper)(o,n,d,t,null,"findMany");return n._push(s)},null,"DS: Extract payload of "+a)}function o(e,n,a,o,s){var l=a.createSnapshot(),d=n.modelFor(s.type),u=e.findHasMany(n,l,o,s),c="DS: Handle Adapter#findHasMany of '"+a.modelName+"' : '"+s.type+"'";return u=h.resolve(u,c),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,a)),u.then(function(t){var a=(0,i.serializerForAdapter)(n,e,s.type),o=(0,r.normalizeResponseHelper)(a,n,d,t,null,"findHasMany"),l=n._push(o);return l.meta=o.meta,l},null,"DS: Extract payload of '"+a.modelName+"' : hasMany '"+s.type+"'")}function s(e,n,a,o,s){var l=a.createSnapshot(),d=n.modelFor(s.type),u=e.findBelongsTo(n,l,o,s),c="DS: Handle Adapter#findBelongsTo of "+a.modelName+" : "+s.type;return u=h.resolve(u,c),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,a)),u.then(function(t){var a=(0,i.serializerForAdapter)(n,e,s.type),o=(0,r.normalizeResponseHelper)(a,n,d,t,null,"findBelongsTo");return o.data?n._push(o):null},null,"DS: Extract payload of "+a.modelName+" : "+s.type)}function l(e,n,a,o,s){var l=n.modelFor(a),d=n.peekAll(a),u=d._createSnapshot(s),c=e.findAll(n,l,o,u),p="DS: Handle Adapter#findAll of "+l;return c=h.resolve(c,p),c=(0,t._guard)(c,(0,t._bind)(t._objectIsAlive,n)),c.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),s=(0,r.normalizeResponseHelper)(o,n,l,t,null,"findAll");return n._push(s),n._didUpdateAll(a),d},null,"DS: Extract payload of findAll ${modelName}")}function d(e,n,a,o,s){var l=n.modelFor(a),d=void 0;e.query.length>3?(s=s||n.recordArrayManager.createAdapterPopulatedRecordArray(a,o),d=e.query(n,l,o,s)):d=e.query(n,l,o);var u="DS: Handle Adapter#query of "+l;return d=h.resolve(d,u),d=(0,t._guard)(d,(0,t._bind)(t._objectIsAlive,n)),d.then(function(t){var d=(0,i.serializerForAdapter)(n,e,a),u=(0,r.normalizeResponseHelper)(d,n,l,t,null,"query"),c=n._push(u);return s?s._setInternalModels(c,u):s=n.recordArrayManager.createAdapterPopulatedRecordArray(a,o,c,u),s},null,"DS: Extract payload of query "+a)}function u(e,n,a,o){var s=n.modelFor(a),l=e.queryRecord(n,s,o),d="DS: Handle Adapter#queryRecord of "+a;return l=h.resolve(l,d),l=(0,t._guard)(l,(0,t._bind)(t._objectIsAlive,n)),l.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),l=(0,r.normalizeResponseHelper)(o,n,s,t,null,"queryRecord");return n._push(l)},null,"DS: Extract payload of queryRecord "+a)}e.__esModule=!0,e._find=n,e._findMany=a,e._findHasMany=o,e._findBelongsTo=s,e._findAll=l,e._query=d,e._queryRecord=u;var c=Ember.A,h=Ember.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports"],function(e){function t(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 r(e,t,r,i,n,a){var o=e.normalizeResponse(t,r,i,n,a);return o}e.__esModule=!0,e.validateDocumentStructure=t,e.normalizeResponseHelper=r;Ember.isEmpty}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/utils",["exports"],function(e){function t(e){return n(e,"attributes").has("type")||n(e,"relationshipsByName").has("type")}function r(e){var t=void 0;return i?t=i(e):e.container&&(t=e.container),t&&t.lookupFactory&&!t._lookupFactory&&(t._lookupFactory=function(){var e;return(e=t).lookupFactory.apply(e,arguments)},t.register=function(){var e=t.registry||t._registry||t;return e.register.apply(e,arguments)}),t}e.__esModule=!0;var i=Ember.getOwner,n=Ember.get;e.modelHasAttributeOrRelationshipNamedType=t,e.getOwner=r}),t("ember-data/-private/utils/parse-response-headers",["exports"],function(e){function t(e){var t=Object.create(null);if(!e)return t;for(var i=e.split(r),n=0;n<i.length;n++){for(var a=i[n],o=0,s=!1;o<a.length;o++)if(58===a.charCodeAt(o)){s=!0;break}if(!1!==s){var l=a.substring(0,o).trim(),d=a.substring(o+1,a.length).trim();d&&(t[l]=d)}}return t}e.__esModule=!0,e.default=t;var r="\r\n"}),t("ember-data/adapter",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(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-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return t.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return t.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return t.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return t.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return t.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return t.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return t.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return t.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return t.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return t.errorsArrayToHash}})}),t("ember-data/adapters/json-api",["exports","ember-data/adapters/rest","ember-data/-private","ember-inflector"],function(e,t,r,i){e.__esModule=!0;var n=Ember.String.dasherize,a=(Ember.$,t.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var n=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),n&&n(e)},i},coalesceFindRequests:!1,findMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a=this.buildURL(t.modelName,i,n,"findMany");return this.ajax(a,"GET",{data:{filter:{id:i.join(",")}}})},pathForType:function(e){var t=n(e);return(0,i.pluralize)(t)},updateRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var n={};e.serializerFor(t.modelName).serializeIntoHash(n,t,i,{includeId:!0});var a=this.buildURL(t.modelName,i.id,i,"updateRecord");return this.ajax(a,"PATCH",{data:n})},_hasCustomizedAjax:function(){return this.ajax!==a.prototype.ajax||this.ajaxOptions!==a.prototype.ajaxOptions}}));(0,r.isEnabled)("ds-improved-ajax")&&a.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,n=e.type,a=e.snapshot,o={};return i.serializerFor(n.modelName).serializeIntoHash(o,n,a,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=a}),t("ember-data/adapters/rest",["exports","ember-data/adapter","ember-data/-private"],function(e,t,r){function i(e,t,i,n){var a=void 0;try{a=e.handleResponse(t.status,(0,r.parseResponseHeaders)(t.getAllResponseHeaders()),i,n)}catch(e){return c.reject(e)}return a&&a.isAdapterError?c.reject(a):a}function n(e,t,i,n){var a=void 0;if(n.errorThrown instanceof Error)a=n.errorThrown;else if("timeout"===n.textStatus)a=new r.TimeoutError;else if("abort"===n.textStatus||0===t.status)a=new r.AbortError;else try{a=e.handleResponse(t.status,(0,r.parseResponseHeaders)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||n.errorThrown,i)}catch(e){a=e}return a}function a(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}e.__esModule=!0;var o=Ember.$,s=Ember.RSVP.Promise,l=Ember.MapWithDefault,d=Ember.get,u=Ember.run,c=s,h=t.default.extend(r.BuildURLMixin,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},n=t.sort(),a=0;a<r;a++)i[n[a]]=e[n[a]];return i},coalesceFindRequests:!1,findRecord:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:i,snapshot:n,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,i,n,"findRecord"),s=this.buildQuery(n);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,i,n){var a=this.buildQuery(n);if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:i,
5
- query:a,snapshots:n,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,n,"findAll");return i&&(a.since=i),this.ajax(s,"GET",{data:a})},query:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:i,requestType:"query"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"query",i);return this.sortQueryParams&&(i=this.sortQueryParams(i)),this.ajax(a,"GET",{data:i})},queryRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:i,requestType:"queryRecord"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"queryRecord",i);return this.sortQueryParams&&(i=this.sortQueryParams(i)),this.ajax(a,"GET",{data:i})},findMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:i,snapshots:n,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,i,n,"findMany");return this.ajax(o,"GET",{data:{ids:i}})},findHasMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:i,relationship:n,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return i=this.urlPrefix(i,this.buildURL(s,o,t,"findHasMany")),this.ajax(i,"GET")},findBelongsTo:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:i,relationship:n,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return i=this.urlPrefix(i,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(i,"GET")},createRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"createRecord"});return this._makeRequest(n)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,i,"createRecord");return o.serializeIntoHash(a,t,i,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"updateRecord"});return this._makeRequest(n)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,i);var o=i.id,s=this.buildURL(t.modelName,o,i,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"deleteRecord"});return this._makeRequest(n)}var a=i.id;return this.ajax(this.buildURL(t.modelName,a,i,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),n=i[i.length-1],o=t.id;return decodeURIComponent(n)===o?i[i.length-1]="":a(n,"?id="+o)&&(i[i.length-1]=n.substring(0,n.length-o.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var a=0,o=n._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+a+t>=r&&(a=0,s.push([])),a+=t;var n=s.length-1;s[n].push(e)}),s}var i=l.create({defaultValue:function(){return[]}}),n=this,a=this.maxURLLength;t.forEach(function(t){var r=n._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,a,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,i,n){if(this.isSuccess(e,t,i))return i;if(this.isInvalid(e,t,i))return new r.InvalidError(i.errors);var a=this.normalizeErrorResponse(e,t,i),o=this.generatedDetailedMessage(e,t,i,n);switch(e){case 401:return new r.UnauthorizedError(a,o);case 403:return new r.ForbiddenError(a,o);case 404:return new r.NotFoundError(a,o);case 409:return new r.ConflictError(a,o);default:if(e>=500)return new r.ServerError(a,o)}return new r.AdapterError(a,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,t,r){var a=this,o={url:e,method:t};return new c(function(s,l){var d=a.ajaxOptions(e,t,r);d.success=function(e,t,r){var n=i(a,r,e,o);u.join(null,s,n)},d.error=function(e,t,r){var i={textStatus:t,errorThrown:r},s=n(a,e,o,i);u.join(null,l,s)},a._ajaxRequest(d)},"DS: RESTAdapter#ajax "+t+" to "+e)},_ajaxRequest:function(e){o.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var n=d(this,"headers");return void 0!==n&&(i.beforeSend=function(e){Object.keys(n).forEach(function(t){return e.setRequestHeader(t,n[t])})}),i},parseErrorResponse:function(e){var t=e;try{t=o.parseJSON(e)}catch(e){}return t},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,i){var n=void 0,a=t["Content-Type"]||"Empty Content-Type";return n="text/html"===a&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+a+")",n].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==h.prototype.ajax||this.ajaxOptions!==h.prototype.ajaxOptions}});(0,r.isEnabled)("ds-improved-ajax")&&h.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,n=e.requestType,a=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(n){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(a=a||{},a.since=e.sinceToken),s=a;break;case"query":case"queryRecord":this.sortQueryParams&&(a=this.sortQueryParams(a)),s=a;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,n=e.snapshot,a=e.snapshots,o=e.requestType,s=e.query;switch(t=t||n&&n.type,r=r||n&&n.id,o){case"findAll":return this.buildURL(t.modelName,null,a,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,a,o);case"findHasMany":case"findBelongsTo":var l=this.buildURL(t.modelName,r,n,o);return this.urlPrefix(e.url,l)}return this.buildURL(t.modelName,r,n,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var t=this,r=this._requestToJQueryAjaxHash(e),a=e.method,o=e.url,s={method:a,url:o};return new c(function(e,a){r.success=function(r,n,a){var o=i(t,a,r,s);u.join(null,e,o)},r.error=function(e,r,i){var o={textStatus:r,errorThrown:i},l=n(t,e,s,o);u.join(null,a,l)},t._ajaxRequest(r)},"DS: RESTAdapter#makeRequest: "+a+" "+o)}}),e.default=h}),t("ember-data/attr",["exports"],function(e){function t(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function r(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function i(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function n(e,n){"object"==typeof e?(n=e,e=void 0):n=n||{};var o={type:e,isAttribute:!0,options:n};return a({get:function(e){var a=this._internalModel;return r(a,e)?i(a,e):t(this,n,e)},set:function(e,t){var r=this._internalModel,n=i(r,e),a=void 0;return t!==n&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:n,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=n;var a=Ember.computed}),t("ember-data",["exports","ember-data/-private","ember-data/setup-container","ember-data/initialize-store-service","ember-data/transforms/transform","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean","ember-data/adapter","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/serializer","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/serializers/embedded-records-mixin","ember-data/attr","ember-inflector"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m,y,v){e.__esModule=!0;var b=Ember.Error;if(Ember.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new b("Ember Data requires at least Ember 1.13.0, but you have "+Ember.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");t.DS.Store=t.Store,t.DS.PromiseArray=t.PromiseArray,t.DS.PromiseObject=t.PromiseObject,t.DS.PromiseManyArray=t.PromiseManyArray,t.DS.Model=t.Model,t.DS.RootState=t.RootState,t.DS.attr=v.default,t.DS.Errors=t.Errors,t.DS.InternalModel=t.InternalModel,t.DS.Snapshot=t.Snapshot,t.DS.Adapter=d.default,t.DS.AdapterError=t.AdapterError,t.DS.InvalidError=t.InvalidError,t.DS.TimeoutError=t.TimeoutError,t.DS.AbortError=t.AbortError,t.DS.UnauthorizedError=t.UnauthorizedError,t.DS.ForbiddenError=t.ForbiddenError,t.DS.NotFoundError=t.NotFoundError,t.DS.ConflictError=t.ConflictError,t.DS.ServerError=t.ServerError,t.DS.errorsHashToArray=t.errorsHashToArray,t.DS.errorsArrayToHash=t.errorsArrayToHash,t.DS.Serializer=h.default,t.DS.DebugAdapter=t.DebugAdapter,t.DS.RecordArray=t.RecordArray,t.DS.FilteredRecordArray=t.FilteredRecordArray,t.DS.AdapterPopulatedRecordArray=t.AdapterPopulatedRecordArray,t.DS.ManyArray=t.ManyArray,t.DS.RecordArrayManager=t.RecordArrayManager,t.DS.RESTAdapter=c.default,t.DS.BuildURLMixin=t.BuildURLMixin,t.DS.RESTSerializer=m.default,t.DS.JSONSerializer=f.default,t.DS.JSONAPIAdapter=u.default,t.DS.JSONAPISerializer=p.default,t.DS.Transform=n.default,t.DS.DateTransform=o.default,t.DS.StringTransform=s.default,t.DS.NumberTransform=a.default,t.DS.BooleanTransform=l.default,t.DS.EmbeddedRecordsMixin=y.default,t.DS.belongsTo=t.belongsTo,t.DS.hasMany=t.hasMany,t.DS.Relationship=t.Relationship,t.DS._setupContainer=r.default,t.DS._initializeStoreService=i.default,Object.defineProperty(t.DS,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:t.normalizeModelName}),Object.defineProperty(t.global,"DS",{configurable:!0,get:function(){return t.DS}}),e.default=t.DS}),t("ember-data/initialize-store-service",["exports"],function(e){function t(e){(e.lookup?e:e.container).lookup("service:store")}e.__esModule=!0,e.default=t}),t("ember-data/initializers/data-adapter",["exports"],function(e){e.__esModule=!0,e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports"],function(e){e.__esModule=!0,e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports"],function(e){e.__esModule=!0,e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports"],function(e){e.__esModule=!0,e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Model}})}),t("ember-data/relationships",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return t.belongsTo}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return t.hasMany}})}),t("ember-data/serializer",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports"],function(e){function t(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)}e.__esModule=!0;var r=(Ember.typeOf,Ember.A),i=Ember.Mixin,n=Ember.String.camelize,a=Ember.set,o=Ember.get;e.default=i.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},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 i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var n=this.hasSerializeIdsOption(i),a=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(n){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else a&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[n]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[n]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[n]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),t[n]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,t,i){var n=this.keyForAttribute(i.key,"serialize"),a=e.hasMany(i.key);t[n]=r(a).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,t){for(var i=e.hasMany(t.key),n=r(i),a=new Array(n.length),o=0;o<n.length;o++){var s=n[o],l=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,t,l),a[o]=l}return a},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var n=e.type.inverseFor(r.key,this.store);if(n){var a=n.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(a,n.kind,"deserialize");s&&delete i[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[n(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var n=this;return r.eachRelationship(function(r,a){e.hasDeserializeRecordsOption(r)&&("hasMany"===a.kind&&n._extractEmbeddedHasMany(t,r,i,a),"belongsTo"===a.kind&&n._extractEmbeddedBelongsTo(t,r,i,a))}),i},_extractEmbeddedHasMany:function(e,r,i,n){var s=o(i,"data.relationships."+r+".data");if(s){for(var l=new Array(s.length),d=0;d<s.length;d++){var u=s[d],c=this._normalizeEmbeddedRelationship(e,n,u),h=c.data,p=c.included;if(i.included=i.included||[],i.included.push(h),p){var f;(f=i.included).push.apply(f,t(p))}l[d]={id:h.id,type:h.type}}a(i,"data.relationships."+r,{data:l})}},_extractEmbeddedBelongsTo:function(e,r,i,n){var s=o(i,"data.relationships."+r+".data");if(s){var l=this._normalizeEmbeddedRelationship(e,n,s),d=l.data,u=l.included;if(i.included=i.included||[],i.included.push(d),u){var c;(c=i.included).push.apply(c,t(u))}var h={id:d.id,type:d.type};a(i,"data.relationships."+r,{data:h})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var n=e.modelFor(i);return e.serializerFor(i).normalize(n,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i){e.__esModule=!0;var n=Ember.typeOf,a=(Ember.isNone,Ember.String.dasherize),o=r.default.extend({_normalizeDocumentHelper:function(e){if("object"===n(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var t=new Array(e.data.length),r=0;r<e.data.length;r++){var i=e.data[r];t[r]=this._normalizeResourceHelper(i)}e.data=t}if(Array.isArray(e.included)){for(var a=new Array,o=0;o<e.included.length;o++){var s=e.included[o],l=this._normalizeResourceHelper(s);null!==l&&a.push(l)}e.included=a}return e},_normalizeRelationshipDataHelper:function(e){if((0,i.isEnabled)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var n=this.store._modelFor(t);return this.store.serializerFor(t).normalize(n,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,i.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,n,a){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var n=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[n]&&(i[e]=t.attributes[n])}),i},extractRelationship:function(e){if("object"===n(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var t=new Array(e.data.length),r=0;r<e.data.length;r++){var i=e.data[r];t[r]=this._normalizeRelationshipDataHelper(i)}e.data=t}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,n){var a=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t.relationships[a]){var o=t.relationships[a];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,i.isEnabled)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),n=this.modelNameFromPayloadKey(t.type);return r!==n&&this._hasCustomModelNameFromPayloadKey()&&(r=n),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadKeyFromModelName:function(e){return(0,t.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 a(e)},keyForRelationship:function(e,t,r){return a(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),n=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){n=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);n!==a&&this._hasCustomPayloadKeyFromModelName()&&(n=a)}else n=this.payloadKeyFromModelName(e.modelName);return r.type=n,{data:r}},serializeAttribute:function(e,t,r,i){var n=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=a}},serializeBelongsTo:function(e,t,r){var n=r.key;if(this._canSerialize(n)){var a=e.belongsTo(n);if(void 0!==a){t.relationships=t.relationships||{};var o=this._getMappedKey(n,e.type);o===n&&(o=this.keyForRelationship(n,"belongsTo","serialize"));var s=null;if(a){var l=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){l=this.payloadTypeFromModelName(a.modelName);var d=this.payloadKeyFromModelName(a.modelName);l!==d&&this._hasCustomPayloadKeyFromModelName()&&(l=d)}else l=this.payloadKeyFromModelName(a.modelName);s={type:l,id:a.id}}t.relationships[o]={data:s}}}},serializeHasMany:function(e,t,r){var n=r.key,a="_shouldSerializeHasMany";if((0,i.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,n,r)){var o=e.hasMany(n);if(void 0!==o){t.relationships=t.relationships||{};var s=this._getMappedKey(n,e.type);s===n&&this.keyForRelationship&&(s=this.keyForRelationship(n,"hasMany","serialize"));for(var l=new Array(o.length),d=0;d<o.length;d++){var u=o[d],c=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){c=this.payloadTypeFromModelName(u.modelName);var h=this.payloadKeyFromModelName(u.modelName);c!==h&&this._hasCustomPayloadKeyFromModelName()&&(c=h)}else c=this.payloadKeyFromModelName(u.modelName);l[d]={type:c,id:u.id}}t.relationships[s]={data:l}}}}});(0,i.isEnabled)("ds-payload-type-hooks")&&o.reopen({modelNameFromPayloadType:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return(0,t.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==o.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==o.prototype.payloadKeyFromModelName}}),e.default=o}),t("ember-data/serializers/json",["exports","ember-data/serializer","ember-data/-private"],function(e,t,r){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)}e.__esModule=!0;var n=Ember.assign,a=Ember.merge,o=Ember.isNone,s=Ember.typeOf,l=Ember.get,d=n||a,u=t.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=l(e,"attributes");return e.eachTransformedAttribute(function(e,n){if(void 0!==t[e]){var a=r.transformFor(n),o=i.get(e);t[e]=a.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,n){switch(n){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,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!0)},normalizeArrayResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!1)},_normalizeResponse:function(e,t,r,n,a,o){var s={data:null,included:[]},l=this.extractMeta(e,t,r);if(l&&(s.meta=l),o){var d=this.normalize(t,r),u=d.data,c=d.included;s.data=u,c&&(s.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),v=y.data,b=y.included;if(b){var _;(_=s.included).push.apply(_,i(b))}h[p]=v}s.data=h}return s},normalize:function(e,t){var r=null;return t&&(this.normalizeUsingDeclaredMapping(e,t),"object"===s(t.links)&&this.normalizeUsingDeclaredMapping(e,t.links),r={id:this.extractId(e,t),type:e.modelName,attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)},this.applyTransforms(e,r.attributes)),{data:r}},extractId:function(e,t){var i=l(this,"primaryKey"),n=t[i];return(0,r.coerceId)(n)},extractAttributes:function(e,t){var r=this,i=void 0,n={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(n[e]=t[i])}),n},extractRelationship:function(e,t){if(o(t))return null;if("object"===s(t)){t.id&&(t.id=(0,r.coerceId)(t.id));var i=this.store.modelFor(e);if(t.type&&!(0,r.modelHasAttributeOrRelationshipNamedType)(i))if((0,r.isEnabled)("ds-payload-type-hooks")){var n=this.modelNameFromPayloadType(t.type),a=this.modelNameFromPayloadKey(t.type);n!==a&&this._hasCustomModelNameFromPayloadKey()&&(n=a),t.type=n}else t.type=this.modelNameFromPayloadKey(t.type);return t}return{id:(0,r.coerceId)(t),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,t){var r=this,i={};return e.eachRelationship(function(e,n){var a=null,s=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t[s]){var l=null,d=t[s];if("belongsTo"===n.kind)l=n.options.polymorphic?r.extractPolymorphicRelationship(n.type,d,{key:e,resourceHash:t,relationshipMeta:n}):r.extractRelationship(n.type,d);else if("hasMany"===n.kind&&!o(d)){l=new Array(d.length);for(var u=0,c=d.length;u<c;u++){var h=d[u];l[u]=r.extractRelationship(n.type,h)}}a={data:l}}var p=r.keyForLink(e,n.kind);if(t.links&&void 0!==t.links[p]){var f=t.links[p];a=a||{},a.links={related:f}}a&&(i[e]=a)}),i},modelNameFromPayloadKey:function(e){return(0,r.normalizeModelName)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,n){i=r.keyForRelationship(e,n.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=l(this,"attrs"),i=void 0,n=void 0;if(r)for(var a in r)i=n=this._getMappedKey(a,e),void 0!==t[n]&&(l(e,"attributes").has(a)&&(i=this.keyForAttribute(a)),l(e,"relationshipsByName").has(a)&&(i=this.keyForRelationship(a)),n!==i&&(t[i]=t[n],delete t[n]))},_getMappedKey:function(e,t){var r=l(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=l(this,"attrs");return!t||!t[e]||!1!==t[e].serialize},_mustSerialize:function(e){var t=l(this,"attrs");return t&&t[e]&&!0===t[e].serialize},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany,u.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var i=this,n={};if(t&&t.includeId)if((0,r.isEnabled)("ds-serialize-id"))this.serializeId(e,n,l(this,"primaryKey"));else{var a=e.id;a&&(n[l(this,"primaryKey")]=a)}return e.eachAttribute(function(t,r){i.serializeAttribute(e,n,t,r)}),e.eachRelationship(function(t,r){"belongsTo"===r.kind?i.serializeBelongsTo(e,n,r):"hasMany"===r.kind&&i.serializeHasMany(e,n,r)}),n},serializeIntoHash:function(e,t,r,i){d(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var n=i.type,a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=a}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var n=e.belongsTo(i,{id:!0}),a=this._getMappedKey(i,e.type);a===i&&this.keyForRelationship&&(a=this.keyForRelationship(i,"belongsTo","serialize")),o(n)?t[a]=null:t[a]=n,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,i){var n=i.key,a="_shouldSerializeHasMany";if((0,r.isEnabled)("ds-check-should-serialize-relationships")&&(a="shouldSerializeHasMany"),this[a](e,n,i)){var o=e.hasMany(n,{ids:!0});if(void 0!==o){var s=this._getMappedKey(n,e.type);s===n&&this.keyForRelationship&&(s=this.keyForRelationship(n,"hasMany","serialize")),t[s]=o}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,i,n){var a=this;return i&&"object"==typeof i&&i.errors&&(i=(0,r.errorsArrayToHash)(i.errors),this.normalizeUsingDeclaredMapping(t,i),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==i[t]&&(i[e]=i[t],delete i[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==i[t]&&(i[e]=i[t],delete i[t])})),i},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var i=(0,r.getOwner)(this).lookup("transform:"+e);return i}});(0,r.isEnabled)("ds-payload-type-hooks")&&u.reopen({modelNameFromPayloadType:function(e){return(0,r.normalizeModelName)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==u.prototype.modelNameFromPayloadKey}}),(0,r.isEnabled)("ds-serialize-id")&&u.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=u}),t("ember-data/serializers/rest",["exports","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i){function n(e){
6
- 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)}e.__esModule=!0;var a=(Ember.typeOf,Ember.isNone),o=Ember.makeArray,s=Ember.String.camelize,l=r.default.extend({keyForPolymorphicType:function(e,t,r){return this.keyForRelationship(e)+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,t,r,i){var a=this,s={data:[],included:[]},l=e.modelFor(t),d=e.serializerFor(t);return o(r).forEach(function(t){var r=a._normalizePolymorphicRecord(e,t,i,l,d),o=r.data,u=r.included;if(s.data.push(o),u){var c;(c=s.included).push.apply(c,n(u))}}),s},_normalizePolymorphicRecord:function(e,t,r,n,a){var o=a,s=n;if(!(0,i.modelHasAttributeOrRelationshipNamedType)(n)&&t.type){var l=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var d=this.modelNameFromPayloadKey(t.type);l!==d&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=d)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(o=e.serializerFor(l),s=e.modelFor(l))}return o.normalize(s,t,r)},_normalizeResponse:function(e,t,r,a,o,s){var l={data:null,included:[]},d=this.extractMeta(e,t,r);d&&(l.meta=d);for(var u=Object.keys(r),c=0,h=u.length;c<h;c++){var p=u[c],f=p,m=!1;"_"===p.charAt(0)&&(m=!0,f=p.substr(1));var y=this.modelNameFromPayloadKey(f);if(e.modelFactoryFor(y)){var v=!m&&this.isPrimaryType(e,y,t),b=r[p];if(null!==b){if(!v||Array.isArray(b)){var _=this._normalizeArray(e,y,b,p),g=_.data,M=_.included;if(M){var R;(R=l.included).push.apply(R,n(M))}if(s)g.forEach(function(e){var t=v&&(0,i.coerceId)(e.id)===a;v&&!a&&!l.data||t?l.data=e:l.included.push(e)});else if(v)l.data=g;else if(g){var A;(A=l.included).push.apply(A,n(g))}}else{var F=this._normalizePolymorphicRecord(e,b,p,t,this),E=F.data,z=F.included;if(l.data=E,z){var I;(I=l.included).push.apply(I,n(z))}}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,t){var r={data:[],included:[]};for(var a in t){var s=this.modelNameFromPayloadKey(a);if(e.modelFactoryFor(s)){var l=e.modelFor(s),d=e.serializerFor(l.modelName);o(t[a]).forEach(function(e){var t=d.normalize(l,e,a),i=t.data,o=t.included;if(r.data.push(i),o){var s;(s=r.included).push.apply(s,n(o))}})}}if((0,i.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},modelNameFromPayloadKey:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){e[this.payloadKeyFromModelName(t.modelName)]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return s(e)},serializePolymorphicType:function(e,t,r){var n=r.key,o=this.keyForPolymorphicType(n,r.type,"serialize"),d=e.belongsTo(n);n=this.keyForAttribute?this.keyForAttribute(n,"serialize"):n,n+="Type",n!==o&&this.keyForPolymorphicType===l.prototype.keyForPolymorphicType&&(o=n),a(d)?t[o]=null:(0,i.isEnabled)("ds-payload-type-hooks")?t[o]=this.payloadTypeFromModelName(d.modelName):t[o]=s(d.modelName)},extractPolymorphicRelationship:function(e,t,r){var n=r.key,a=r.resourceHash,o=r.relationshipMeta,s=o.options.polymorphic,l=this.keyForPolymorphicType(n,e,"deserialize");if(s&&void 0!==a[l]&&"object"!=typeof t){if((0,i.isEnabled)("ds-payload-type-hooks")){var d=a[l],u=this.modelNameFromPayloadType(d),c=this.modelNameFromPayloadKey(d);return d!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[l])}}return this._super.apply(this,arguments)}});(0,i.isEnabled)("ds-payload-type-hooks")&&l.reopen({modelNameFromPayloadType:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return s(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==l.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){return this.modelNameFromPayloadType!==l.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==l.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==l.prototype.payloadKeyFromModelName}}),e.default=l}),t("ember-data/setup-container",["exports","ember-data/-private","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean"],function(e,t,r,i,n,a,o,s,l,d,u){function c(e,t){return e.has?e.has(t):e.hasRegistration(t)}function h(e){var s=e.registerOptionsForType||e.optionsForType;s.call(e,"serializer",{singleton:!1}),s.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",i.default),e.register("serializer:-rest",n.default),e.register("adapter:-rest",o.default),e.register("adapter:-json-api",a.default),e.register("serializer:-json-api",r.default),c(e,"service:store")||e.register("service:store",t.Store)}function p(e){e.register("data-adapter:main",t.DebugAdapter)}function f(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")}function m(e){e.register("transform:boolean",u.default),e.register("transform:date",l.default),e.register("transform:number",s.default),e.register("transform:string",d.default)}function y(e){p(e),m(e),f(e),h(e)}e.__esModule=!0,e.default=y}),t("ember-data/store",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Store}})}),t("ember-data/transform",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),t("ember-data/transforms/boolean",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0;var r=Ember.isNone;e.default=t.default.extend({deserialize:function(e,t){if(r(e)&&!0===t.allowNull)return null;var i=typeof e;return"boolean"===i?e:"string"===i?/^(true|t|1)$/i.test(e):"number"===i&&1===e},serialize:function(e,t){return r(e)&&!0===t.allowNull?null:Boolean(e)}})}),t("ember-data/transforms/date",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,Ember.Date=Ember.Date||{},Ember.Date.parse=function(e){return Date.parse(e)},e.default=t.default.extend({deserialize:function(e){var t=typeof e;if("string"===t){var r=e.indexOf("+");return-1!==r&&e.length-3===r?new Date(e+":00"):-1!==r&&e.length-5===r?(r+=3,new Date(e.slice(0,r)+":"+e.slice(r))):new Date(e)}return"number"===t?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/transforms/number",["exports","ember-data/transforms/transform"],function(e,t){function r(e){return e===e&&e!==1/0&&e!==-1/0}e.__esModule=!0;var i=Ember.isEmpty;e.default=t.default.extend({deserialize:function(e){var t=void 0;return i(e)?null:(t=Number(e),r(t)?t:null)},serialize:function(e){var t=void 0;return i(e)?null:(t=Number(e),r(t)?t:null)}})}),t("ember-data/transforms/string",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0;var r=Ember.isNone;e.default=t.default.extend({deserialize:function(e){return r(e)?null:String(e)},serialize:function(e){return r(e)?null:String(e)}})}),t("ember-data/transforms/transform",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="2.18.3"}),t("ember-inflector",["module","exports","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,i.Inflector.defaultRules=i.defaultRules,Ember.Inflector=i.Inflector,Ember.String.pluralize=i.pluralize,Ember.String.singularize=i.singularize,r.default=i.Inflector,r.pluralize=i.pluralize,r.singularize=i.singularize,r.defaultRules=i.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e}):void 0!==e&&e.exports&&(e.exports=i.Inflector,i.Inflector.singularize=i.singularize,i.Inflector.pluralize=i.pluralize)}),t("ember-inflector/lib/ext/string",["ember-inflector/lib/system/string"],function(e){(!0===Ember.EXTEND_PROTOTYPES||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,e.pluralize)(this)},String.prototype.singularize=function(){return(0,e.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e,r){var i=void 0,n=void 0,a=!1;return 1===e.length?(n=e[0],(0,t.pluralize)(n)):(i=e[0],n=e[1],r["without-count"]&&(a=r["without-count"]),1!==parseFloat(i)&&(n=(0,t.pluralize)(n)),a?n:i+" "+n)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,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,i){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.__esModule=!0,e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/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|bonus)(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"],function(e){function t(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function r(e,t){for(var r,i=0,n=t.length;i<n;i++)r=t[i],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 i=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};t(i,e.uncountable),r(i,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;var a=Ember.String.capitalize,o=/^\s*$/,s=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,d=/[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(),t(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),r(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 i,n,u,c,h,p,f,m;if(p=!e||o.test(e),f=d.test(e),"",p)return e;if(u=e.toLowerCase(),c=s.exec(e)||l.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[u]||this.rules.uncountable[h])return e;for(m in r)if(u.match(m+"$"))return n=r[m],f&&r[h]&&(n=a(n),m=a(m)),e.replace(new RegExp(m,"i"),n);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);return i=i||[],m=i[0],n=i[1],e.replace(m,n)}},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 i(e){return t.default.inflector.singularize(e)}e.__esModule=!0,e.singularize=e.pluralize=void 0,e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports"],function(e){function t(e){return Ember.Helper?Ember.Helper.helper(e):Ember.HTMLBars?Ember.HTMLBars.makeBoundHelper(e):Ember.Handlebars.makeBoundHelper(e)}e.__esModule=!0,e.default=t}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function a(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],l=[],d=Object.keys(n._eak_seen),u=0;u<d.length;u++){var c=d[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&l.push(c)}r(e,s),a(e,l)}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}).call(this),function(){function e(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"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 t)e(r,t[r])}()}();
1
+ (function(){"use strict";var e,t,r,i,n;!function(a){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(id, deps, module)` instead got: `"+e+"` arguments to define`")}function l(e,t,r,i){this.uuid=b++,this.id=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function d(){}function u(e){this.id=e}function c(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function h(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.id];return i||c(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function p(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),n=i.slice(0,-1),a=0,o=r.length;a<o;a++){var s=r[a];if(".."===s){if(0===n.length)throw new Error("Cannot access parent module of root");n.pop()}else{if("."===s)continue;n.push(s)}}return n.join("/")}function f(e){return!(!y[e]&&!y[e+"/index"])}var m={loader:e,define:t,requireModule:r,require:i,requirejs:n};n=i=r=function(e){for(var t=[],r=h(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&m.hasOwnProperty(t)&&(r=e[t],a[r]=a[t],a[t]=m[t])},makeDefaultExport:!0};var y=o(),v=o(),b=0,_=["require","exports","module"];l.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},l.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.id,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.reified.length=0,this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),e.makeDefaultExport&&this.makeDefaultExport(),this.module.exports},l.prototype.unsee=function(){this.state="new",this.module={exports:{}}},l.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},l.prototype._reify=function(){for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},l.prototype.findDeps=function(e){if("new"===this.state){this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],n=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,n.exports=this.module.exports):"require"===i?n.exports=this.makeRequire():"module"===i?n.exports=this.module:n.module=h(p(i,this.id),this.id,e)}}},l.prototype.makeRequire=function(){var e=this.id,t=function(t){return i(p(t,e))};return t.default=t,t.moduleId=e,t.has=function(t){return f(p(t,e))},t},t=function(e,t,r){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),Array.isArray(t)||(r=t,t=[]),y[e]=r instanceof u?new l(r.id,t,r,!0):new l(e,t,r,!1))},t.exports=function(e,t){var r=y[e];if(!r||"new"===r.state)return r=new l(e,[],d,null),r.module.exports=t,r.state="finalized",y[e]=r,r},t.alias=function(e,r){return 2===arguments.length?t(r,new u(e)):new u(e)},n.entries=n._eak_seen=y,n.has=f,n.unsee=function(e){h(e,"(unsee)",!1).unsee()},n.clear=function(){n.entries=n._eak_seen=y=o(),v=o()},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t.alias("foo","foo/qux"),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),t.exports("foo/exports",{}),i("foo/exports"),i("foo/main"),i.unsee("foo/bar"),n.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-debug",["exports"],function(e){function t(e){return e()}e.__esModule=!0,e.instrument=t;var r=void 0;e.assertPolymorphicType=r}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember-inflector"],function(e,t){e.__esModule=!0;var r=Ember.String.camelize,i=Ember.Mixin,n=Ember.get;e.default=i.create({buildURL:function(e,t,r,i,n){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(n,e);case"queryRecord":return this.urlForQueryRecord(n,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 r=void 0,i=[],a=n(this,"host"),o=this.urlPrefix();return e&&(r=this.pathForType(e))&&i.push(r),t&&i.push(encodeURIComponent(t)),o&&i.unshift(o),i=i.join("/"),!a&&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 r=n(this,"host"),i=n(this,"namespace");if(r&&"/"!==r||(r=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+r+e:t+"/"+e;var a=[];return r&&a.push(r),i&&a.push(i),a.join("/")},pathForType:function(e){var i=r(e);return(0,t.pluralize)(i)}})}),t("ember-data/-private/adapters/errors",["exports"],function(e){function t(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function r(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.message;return i(e,r)}}function i(e,t){var i=function(r,i){e.call(this,r,i||t)};return i.prototype=Object.create(e.prototype),i.extend=r(i),i}function n(e){var t=[];return s(e)&&Object.keys(e).forEach(function(r){for(var i=o(e[r]),n=0;n<i.length;n++){var a="Invalid Attribute",s="/data/attributes/"+r;r===c&&(a="Invalid Document",s="/data"),t.push({title:a,detail:i[n],source:{pointer:s}})}}),t}function a(e){var t={};return s(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var r=e.source.pointer.match(d);r?r=r[2]:-1!==e.source.pointer.search(u)&&(r=c),r&&(t[r]=t[r]||[],t[r].push(e.detail||e.title))}}),t}e.__esModule=!0,e.AdapterError=t,e.errorsHashToArray=n,e.errorsArrayToHash=a;var o=Ember.makeArray,s=Ember.isPresent,l=Ember.Error,d=/^\/?data\/(attributes|relationships)\/(.*)/,u=/^\/?data/,c="base";t.prototype=Object.create(l.prototype),t.extend=r(t);e.InvalidError=i(t,"The adapter rejected the commit because it was invalid"),e.TimeoutError=i(t,"The adapter operation timed out"),e.AbortError=i(t,"The adapter operation was aborted"),e.UnauthorizedError=i(t,"The adapter operation is unauthorized"),e.ForbiddenError=i(t,"The adapter operation is forbidden"),e.NotFoundError=i(t,"The adapter could not find the resource"),e.ConflictError=i(t,"The adapter operation failed due to a conflict"),e.ServerError=i(t,"The adapter operation failed due to a server error")}),t("ember-data/-private/core",["exports","ember-data/version"],function(e,t){e.__esModule=!0;var r=Ember.Namespace.create({VERSION:t.default,name:"DS"});Ember.libraries&&Ember.libraries.registerCoreLibrary("Ember Data",r.VERSION),e.default=r}),t("ember-data/-private/features",["exports"],function(e){function t(){var e;return(e=Ember.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=t}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!0,e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private",["exports","ember-data/-private/system/model/model","ember-data/-private/system/model/errors","ember-data/-private/system/store","ember-data/-private/core","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many","ember-data/-private/adapters/build-url-mixin","ember-data/-private/system/snapshot","ember-data/-private/adapters/errors","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/utils/parse-response-headers","ember-data/-private/global","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/debug/debug-adapter","ember-data/-private/system/diff-array","ember-data/-private/system/relationships/relationship-payloads-manager","ember-data/-private/system/relationships/relationship-payloads","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m,y,v,b,_,g,R,M,A,F,E,z,k){e.__esModule=!0,Object.defineProperty(e,"Model",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Errors",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"DS",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"BuildURLMixin",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"Snapshot",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return d.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return d.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return d.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return d.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return d.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return d.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return d.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return d.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return d.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return d.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return d.errorsArrayToHash}}),Object.defineProperty(e,"normalizeModelName",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"getOwner",{enumerable:!0,get:function(){return c.getOwner}}),Object.defineProperty(e,"modelHasAttributeOrRelationshipNamedType",{enumerable:!0,get:function(){return c.modelHasAttributeOrRelationshipNamedType}}),Object.defineProperty(e,"coerceId",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"parseResponseHeaders",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"global",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"isEnabled",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(e,"RootState",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"InternalModel",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"PromiseArray",{enumerable:!0,get:function(){return b.PromiseArray}}),Object.defineProperty(e,"PromiseObject",{enumerable:!0,get:function(){return b.PromiseObject}}),Object.defineProperty(e,"PromiseManyArray",{enumerable:!0,get:function(){return b.PromiseManyArray}}),Object.defineProperty(e,"RecordArray",{enumerable:!0,get:function(){return _.RecordArray}}),Object.defineProperty(e,"FilteredRecordArray",{enumerable:!0,get:function(){return _.FilteredRecordArray}}),Object.defineProperty(e,"AdapterPopulatedRecordArray",{enumerable:!0,get:function(){return _.AdapterPopulatedRecordArray}}),Object.defineProperty(e,"ManyArray",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"RecordArrayManager",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"Relationship",{enumerable:!0,get:function(){return M.default}}),Object.defineProperty(e,"DebugAdapter",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"diffArray",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"RelationshipPayloadsManager",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"RelationshipPayloads",{enumerable:!0,get:function(){return z.default}}),Object.defineProperty(e,"SnapshotRecordArray",{enumerable:!0,get:function(){return k.default}})}),t("ember-data/-private/system/clone-null",["exports"],function(e){function t(e){var t=Object.create(null);for(var r in e)t[r]=e[r];return t}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:"string"==typeof e?e:""+e}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember-data/-private/system/model/model"],function(e,t){e.__esModule=!0;var r=Ember.addObserver,i=Ember.removeObserver,n=Ember.A,a=Ember.DataAdapter,o=Ember.String.capitalize,s=Ember.String.underscore,l=Ember.get;e.default=a.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==t.default&&t.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,i=this;return l(e,"attributes").forEach(function(e,n){if(r++>i.attributeLimit)return!1;var a=o(s(n).replace("_"," "));t.push({name:n,desc:a})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);null!==i&&(t=i[1])}}return this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:l(e,"id")};return e.eachAttribute(function(n){if(r++>t.attributeLimit)return!1;i[n]=l(e,n)}),i},getRecordKeywords:function(e){var t=[],r=n(["id"]);return e.eachAttribute(function(e){return r.push(e)}),r.forEach(function(r){return t.push(l(e,r))}),t},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,t){var a=n(),o=n(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return o.push(e)});var s=this;return o.forEach(function(n){var o=function(){t(s.wrapRecord(e))};r(e,n,o),a.push(function(){i(e,n,o)})}),function(){a.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,n=Math.min(r,i),a=null,o=0;o<n;o++)if(e[o]!==t[o]){a=o;break}null===a&&i!==r&&(a=n);var s=0,l=0;if(null!==a){for(var d=n-a,u=1;u<=n;u++)if(e[r-u]!==t[i-u]){d=u-1;break}s=i-d-a,l=r-d-a}return{firstChangeIndex:a,addedCount:s,removedCount:l}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return void 0===r&&(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/system/model/internal-model"],function(e,t){e.__esModule=!0;var r=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),i=function(){function e(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){delete this._idToModel[t];var r=this._models.indexOf(e);-1!==r&&this._models.splice(r,1)},e.prototype.contains=function(e){return-1!==this._models.indexOf(e)},e.prototype.clear=function(){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}this._metadata=null},r(e,[{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),e}();e.default=i}),t("ember-data/-private/system/is-array-like",["exports"],function(e){function t(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(i.detect(e))return!0;var t=r(e);return"array"===t||void 0!==e.length&&"object"===t}e.__esModule=!0,e.default=t;var r=Ember.typeOf,i=Ember.Array}),t("ember-data/-private/system/many-array",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i){e.__esModule=!0;var n=Ember.RSVP.all,a=Ember.Evented,o=Ember.MutableArray,s=Ember.Object,l=Ember.get;e.default=s.extend(o,a,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,r._objectIsAlive)(this)){var t=this.canonicalState,n=this.currentState.filter(function(e){return e.isNew()&&-1===t.indexOf(e)});t=t.concat(n);var a=(0,i.default)(this.currentState,t);null!==a.firstChangeIndex&&(this.arrayContentWillChange(a.firstChangeIndex,a.removedCount,a.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(a.firstChangeIndex,a.removedCount,a.addedCount),e&&a.addedCount>0&&this.relationship.notifyHasManyChanged())}},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)},_removeInternalModels:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},_addInternalModels:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeInternalModels(i)),r&&this.get("relationship").addInternalModels(r.map(function(e){return e._internalModel}),e)},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+l(this,"type"),i=n(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return t.PromiseArray.create({promise:i})},createRecord:function(e){var t=l(this,"store"),r=l(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model/errors",["exports"],function(e){e.__esModule=!0;var t=Ember.computed.mapBy,r=Ember.computed.not,i=Ember.Evented,n=Ember.ArrayProxy,a=Ember.set,o=Ember.get,s=Ember.computed,l=Ember.isEmpty,d=Ember.makeArray,u=Ember.A,c=Ember.MapWithDefault;e.default=n.extend(i,{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:s(function(){return c.create({defaultValue:function(){return u()}})}),errorsFor:function(e){return o(this,"errorsByAttributeName").get(e)},messages:t("content","message"),content:s(function(){return u()}),unknownProperty:function(e){var t=this.errorsFor(e);return l(t)?null:t},isEmpty:r("length").readOnly(),add:function(e,t){var r=o(this,"isEmpty");this._add(e,t),r&&!o(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),o(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=d(t),n=new Array(i.length),a=0;a<i.length;a++){var o=i[a],s=r.findBy("message",o);n[a]=s||{attribute:e,message:o}}return n},remove:function(e){o(this,"isEmpty")||(this._remove(e),o(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!o(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),o(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e),this.notifyPropertyChange("length")}},clear:function(){o(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!o(this,"isEmpty")){var e=o(this,"errorsByAttributeName"),t=u();e.forEach(function(e,r){t.push(r)}),e.clear(),t.forEach(function(e){this.notifyPropertyChange(e)},this),n.prototype.clear.call(this)}},has:function(e){return!l(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,n,a,o,s){function l(e){return S[e]||(S[e]=e.split("."))}function d(e){return I[e]||(I[e]=l(e)[0])}function u(e){for(var t=0;t<e.length;++t){var r=e[t]._record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}function c(e){e._inverseIsAsync()?(e.removeInternalModelFromInverse(e.inverseInternalModel),e.removeInverseRelationships()):e.removeCompletelyFromInverse()}e.__esModule=!0;var h=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),p=Ember.assign,f=Ember.merge,m=Ember.set,y=Ember.get,v=Ember.copy,b=Ember.Error,_=Ember.isEqual,g=Ember.isEmpty,R=Ember.setOwner,M=Ember.run,A=Ember.RSVP,F=Ember.RSVP.Promise,E=Ember.inspect,z=p||f,k=Object.create(null),I=Object.create(null),S=Object.create(null),P=1,T=1,x=function(){function e(e,t,r,i){this.id=t,this[Ember.GUID_KEY]=P+++"internal-model",this.store=r,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this._scheduledDestroy=null,this.resetRecord(),i&&(this.__data=i),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isHiddenFromRecordArrays=function(){return this._isDematerializing||this.isDestroyed||"root.deleted.saved"===this.currentState.stateName||this.isEmpty()},e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(e){if(!this._record&&!this._isDematerializing){var t={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};"object"==typeof e&&null!==e&&z(t,e),R?R(t,(0,o.getOwner)(this.store)):t.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(t),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.isReloading=!1,this.error=null,this.currentState=t.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this._record&&(this._isDematerializing=!0,this._record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=A.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&m(this._record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&m(this._record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new F(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()})},e.prototype._directlyRelatedInternalModels=function(){var e=[];return this._relationships.forEach(function(t,r){e=e.concat(r.members.list,r.canonicalMembers.list)}),e},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=T++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var n=i._directlyRelatedInternalModels(),a=0;a<n.length;++a){var o=n[a];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.isDestroyed||(this.send("unloadRecord"),this.dematerializeRecord(),null===this._scheduledDestroy&&(M.currentRunLoop,this._scheduledDestroy=M.backburner.schedule("destroy",this,"_checkForOrphanedInternalModels")))},e.prototype.hasScheduledDestroy=function(){return!!this._scheduledDestroy},e.prototype.cancelDestroy=function(){this._isDematerializing=!1,M.cancel(this._scheduledDestroy),this._scheduledDestroy=null},e.prototype.destroySync=function(){this._isDematerializing&&this.cancelDestroy(),this._checkForOrphanedInternalModels(),this.isDestroyed||this.isDestroying||this.destroy()},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this._scheduledDestroy=null,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(u(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._internalModelDestroyed(this),this._relationships.forEach(function(e,t){return t.destroy()}),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships);var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),z(this._data,e.attributes),this.pushedData(),this.hasRecord&&this._record._notifyProperties(t)},e.prototype.createSnapshot=function(e){return new i.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData")},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=null},e.prototype.hasChangedAttributes=function(){return null!==this.__attributes&&Object.keys(this.__attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,n=t.length;i<n;i++){var a=t[i],o=e[a];o[0]===o[1]&&delete r[a]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=z(v(r),t),n=Object.create(null),a=Object.keys(i),o=0,s=a.length;o<s;o++){var l=a[o];n[l]=[e[l],i[l]]}return n},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this._record.notifyHasManyAdded(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this._record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this._record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=void 0;this.hasChangedAttributes()&&(e=Object.keys(this._attributes),this._attributes=null),y(this,"isError")&&(this._inFlightAttributes=null,this.didCleanError()),this.isNew()&&this.removeFromInverseRelationships(),this.isValid()&&(this._inFlightAttributes=null),this.send("rolledBack"),e&&e.length>0&&this._record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=d(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var n=void 0,a=void 0,o=void 0,s=void 0,u=k[i];if(u)n=u.setups,a=u.enters,r=u.state;else{n=[],a=[];var c=l(e);for(o=0,s=c.length;o<s;o++)r=r[c[o]],r.enter&&a.push(r),r.setup&&n.push(r);k[i]={setups:n,enters:a,state:r}}for(o=0,s=a.length;o<s;o++)a[o].enter(this);for(this.currentState=r,this.hasRecord&&m(this._record,"currentState",r),o=0,s=n.length;o<s;o++)n[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+E(r)+"."),new b(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=this._deferredTriggers,t=this._record,r=t.trigger,i=0,n=e.length;i<n;i++)r.apply(t,e[i]);e.length=0}},e.prototype.removeFromInverseRelationships=function(){this._relationships.forEach(function(e,t){t.removeCompletelyFromInverse(),t.clear()})
2
+ ;var e=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(e).forEach(function(t){var r=e[t];r.removeCompletelyFromInverse(),r.clear()})},e.prototype.destroyRelationships=function(){this._relationships.forEach(function(e,t){return c(t)});var e=this._implicitRelationships;this.__implicitRelationships=null,Object.keys(e).forEach(function(t){var r=e[t];c(r),r.destroy()})},e.prototype.preloadData=function(e){var t=this;Object.keys(e).forEach(function(r){var i=y(e,r);t.modelClass.metaForProperty(r).isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},e.prototype._preloadRelationship=function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),n=0;n<t.length;n++){var a=t[n];i[n]=this._convertStringOrNumberIntoInternalModel(a,r)}this._relationships.get(e).updateInternalModelsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setInternalModel(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this.store.recordArrayManager.recordDidChange(this)},e.prototype.setId=function(e){this.id=e,this._record.get("id")!==e&&this._record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this._record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this._record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(this.store._internalModelDidReceiveRelationshipData(this.modelName,this.id,e.relationships),e=e.attributes),this.didCleanError();var t=this._changedKeys(e);z(this._data,this._inFlightAttributes),e&&z(this._data,e),this._inFlightAttributes=null,this.send("didCommit"),this.updateRecordArrays(),e&&this._record._notifyProperties(t)},e.prototype.addErrorMessageToAttribute=function(e,t){y(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){y(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){y(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){var e=y(this.getRecord(),"errors");return!g(e)},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){var e=Object.keys(this._inFlightAttributes);if(e.length>0)for(var t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=null},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,n=void 0,a=void 0,o=Object.keys(e),s=o.length,l=this.hasChangedAttributes(),d=void 0;for(l&&(d=this._attributes),r=z(Object.create(null),this._data),r=z(r,this._inFlightAttributes),i=0;i<s;i++)a=o[i],n=e[a],!0===l&&void 0!==d[a]||_(r[a],n)||t.push(a)}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new s.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new s.HasManyReference(this.store,this,i)),this.references[t]=r}return r},h(e,[{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new s.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=a.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=Object.create(null)),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=Object.create(null)),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new r.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=Object.create(null)),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=Object.create(null)),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=Object.create(null)),this.__implicitRelationships}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=x,(0,n.default)("ds-rollback-attribute")&&(x.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/relationships/ext"],function(e,t,r,i,n,a){function o(e,t,r,i){var n=i||[],a=c(t,"relationships");if(!a)return n;var s=a.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse&&null!==i.inverse||r===i.inverse});return s&&n.push.apply(n,s),e.superclass&&o(e.superclass,t,r,n),n}e.__esModule=!0;var s=(Ember.ComputedProperty,Ember.setOwner),l=(Ember.isNone,Ember.Error,Ember.Evented),d=Ember.Object,u=Ember.computed,c=Ember.get,h=Ember.observer,p=Ember.Map,f=u("currentState",function(e){return c(this._internalModel.currentState,e)}).readOnly(),m=d.extend(l,{_internalModel:null,store:null,__defineNonEnumerable:function(e){this[e.name]=e.descriptor.value},isEmpty:f,isLoading:f,isLoaded:f,hasDirtyAttributes:u("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:f,isDeleted:f,isNew:f,isValid:f,dirtyType:f,isError:!1,isReloading:!1,id:null,currentState:n.default.empty,errors:u(function(){var e=r.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this._internalModel.createSnapshot().serialize(e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:null,didLoad:null,didUpdate:null,didCreate:null,didDelete:null,becameInvalid:null,becameError:null,rolledBack:null,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){Ember.beginPropertyChanges();for(var t=void 0,r=0,i=e.length;r<i;r++)t=e[r],this.notifyPropertyChange(t);Ember.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 r=this;return t.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return r})})},reload:function(){var e=this;return t.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){var t=this[e];if("function"==typeof t){for(var r=arguments.length,i=new Array(r-1),n=1;n<r;n++)i[n-1]=arguments[n];t.apply(this,i)}this._super.apply(this,arguments)},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:h("id",function(){this._internalModel.setId(this.get("id"))}),_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,n){var a=t[n.kind];void 0===a&&(a=t[n.kind]=[],i.push({name:n.name,properties:a,expand:!0})),a.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}},notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return c(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)},notifyHasManyAdded:function(e){this.notifyPropertyChange(e)},eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});Object.defineProperty(m.prototype,"data",{get:function(){return this._internalModel._data}}),m.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=c(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:u(function(){return Object.create(null)}),inverseFor:function(e,t){var r=c(this,"inverseMap");if(void 0!==r[e])return r[e];var i=c(this,"relationshipsByName").get(e);if(!i)return r[e]=null,null;var n=i.options;return n&&null===n.inverse?(r[e]=null,null):r[e]=this._findInverseFor(e,t)},_findInverseFor:function(e,t){var r=this.typeForRelationship(e,t);if(!r)return null;var i=this.metaForProperty(e),n=i.options;if(null===n.inverse)return null;var a=void 0,s=void 0,l=void 0;if(n.inverse)a=n.inverse,l=c(r,"relationshipsByName").get(a),s=l.kind;else{i.parentType&&(i.type,i.parentType.modelName);var d=o(this,r,e);if(0===d.length)return null;var u=d.filter(function(t){var i=r.metaForProperty(t.name).options;return e===i.inverse});1===u.length&&(d=u),a=d[0].name,s=d[0].kind}return{type:r,name:a,kind:s}},relationships:a.relationshipsDescriptor,relationshipNames:u(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:a.relatedTypesDescriptor,relationshipsByName:a.relationshipsByNameDescriptor,fields:u(function(){var e=p.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){c(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=c(this,"relatedTypes"),i=0;i<r.length;i++){var n=r[i];e.call(t,n)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,n=this.inverseFor(r,t),a=void 0;return n?(a=n.kind,"belongsTo"===a?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:u(function(){var e=p.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:u(function(){var e=p.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){c(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){c(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),s&&Object.defineProperty(m.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,i.default)("ds-rollback-attribute")&&m.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=m}),t("ember-data/-private/system/model/states",["exports"],function(e){function t(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function r(e){var t={},i=void 0;for(var n in e)i=e[n],t[n]=i&&"object"==typeof i?r(i):i;return t}function i(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return i(r(l),e)}function a(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function o(e){}function s(e,t,r){e=i(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var n in e)e.hasOwnProperty(n)&&"parentState"!==n&&"stateName"!==n&&"object"==typeof e[n]&&(e[n]=s(e[n],e,r+"."+n));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:t,loadingData:function(){},propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:function(){},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:t,becomeDirty:function(){},pushedData:function(){},unloadRecord:o,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",this.dirtyType)},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,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},pushedData:function(){},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)}}},d=n({dirtyType:"created",isNew:!0});d.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},d.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var u=n({dirtyType:"updated"});d.uncommitted.deleteRecord=a,d.invalid.deleteRecord=a,d.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},d.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},d.uncommitted.propertyWasReset=function(){},u.invalid.becameValid=function(e){e.transitionTo("loaded.saved")},u.inFlight.unloadRecord=o,u.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var c={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},propertyWasReset:function(){},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:function(){},saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:t,pushedData:function(){},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){},didCommit:function(){},notFound:function(){}},created:d,updated:u},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:function(){},becomeDirty:function(){},deleteRecord:function(){},rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:o,willCommit:function(){},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.removeFromInverseRelationships()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,r){e.removeErrorMessageFromAttribute(r.name),t(e,r),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},deleteRecord:function(){},willCommit:function(){},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)}};e.default=s(c,null,"root")}),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.__esModule=!0,e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports"],function(e){function t(e){return r(e)}e.__esModule=!0,e.default=t;var r=Ember.String.dasherize}),t("ember-data/-private/system/ordered-set",["exports"],function(e){function t(){this._super$constructor()}e.__esModule=!0,e.default=t;var r=Ember.guidFor,i=Ember.OrderedSet;t.create=function(){return new this},t.prototype=Object.create(i.prototype),t.prototype.constructor=t,t.prototype._super$constructor=i,t.prototype.addWithIndex=function(e,t){var i=r(e),n=this.presenceSet,a=this.list;if(!0!==n[i])return n[i]=!0,void 0===t||null===t?a.push(e):a.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports"],function(e){function t(e,t){return h.create({promise:u.resolve(e,t)})}function r(e,t){return c.create({promise:u.resolve(e,t)})}function i(e){return function(){var t;return(t=l(this,"content"))[e].apply(t,arguments)}}function n(e,t){return p.create({promise:u.resolve(e,t)})}e.__esModule=!0,e.promiseObject=t,e.promiseArray=r,e.proxyToContent=i,e.promiseManyArray=n;var a=Ember.ObjectProxy,o=Ember.PromiseProxyMixin,s=Ember.ArrayProxy,l=Ember.get,d=Ember.computed.reads,u=Ember.RSVP.Promise,c=e.PromiseArray=s.extend(o,{meta:d("content.meta")}),h=e.PromiseObject=a.extend(o),p=e.PromiseManyArray=c.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:i("createRecord"),on:i("on"),one:i("one"),trigger:i("trigger"),off:i("off"),has:i("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember-data/-private/system/record-arrays","ember-data/-private/system/clone-null"],function(e,t,r){function i(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function a(e,t){var r=e.indexOf(t);return-1!==r&&(e.splice(r,1),!0)}function o(e,t){for(var r=[],i=[],n=0;n<t.length;n++){var a=t[n],o=a.isHiddenFromRecordArrays(),s=a._recordArrays;o||a.isEmpty()||s.has(e)||(r.push(a),s.add(e)),o&&(i.push(a),s.delete(e))}r.length>0&&e._pushInternalModels(r),i.length>0&&e._removeInternalModels(i)}function s(e){for(var t=0;t<e.length;t++){for(var r=e[t],i=r._recordArrays.list,n=0;n<i.length;n++)i[n]._removeInternalModels([r]);r._recordArrays.clear()}}function l(e,t){for(var r=0,i=e.length;r<i;r++){e[r]._recordArrays.add(t)}}e.__esModule=!0,e.associateWithRecordArray=l;var d=Ember.A,u=Ember.set,c=Ember.get,h=Ember.run,p=function(){function e(e){this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this._filteredRecordArrays=Object.create(null),this._liveRecordArrays=Object.create(null),this._pending=Object.create(null),this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){this.internalModelDidChange(e)},e.prototype.recordWasLoaded=function(e){this.internalModelDidChange(e)},e.prototype.internalModelDidChange=function(e){var t=e.modelName;if(!e._pendingRecordArrayManagerFlush){e._pendingRecordArrayManagerFlush=!0;var r=this._pending;1===(r[t]=r[t]||[]).push(e)&&h.schedule("actions",this,this._flush)}},e.prototype._flush=function(){var e=this._pending;this._pending=Object.create(null);var t=[];for(var r in e){for(var i=e[r],n=0;n<i.length;n++){var a=i[n];a._pendingRecordArrayManagerFlush=!1,a.isHiddenFromRecordArrays()&&t.push(a)}if(this._filteredRecordArrays[r])for(var o=this.filteredRecordArraysFor(r),l=0;l<o.length;l++)this.updateFilterRecordArray(o[l],r,i);var d=this._liveRecordArrays[r];d&&this.updateLiveRecordArray(d,i),t.length>0&&s(t)}},e.prototype.updateLiveRecordArray=function(e,t){return o(e,t)},e.prototype.updateFilterRecordArray=function(e,t,r){for(var i=c(e,"filterFunction"),n=[],a=[],o=0;o<r.length;o++){var s=r[o];if(!1===s.isHiddenFromRecordArrays()&&i(s.getRecord())){if(s._recordArrays.has(e))continue;n.push(s),s._recordArrays.add(e)}else s._recordArrays.delete(e)&&a.push(s)}n.length>0&&e._pushInternalModels(n),a.length>0&&e._removeInternalModels(a)},e.prototype._syncLiveRecordArray=function(e,t){var r=0===Object.keys(this._pending).length,i=this.store._internalModelsFor(t),n=c(i,"length")===c(e,"length");if(!r||!n){for(var a=this._visibleInternalModelsByType(t),o=[],s=0;s<a.length;s++){var l=a[s],d=l._recordArrays;!1===d.has(e)&&(d.add(e),o.push(l))}e._pushInternalModels(o)}},e.prototype.updateFilter=function(e,t,r){var i=this.store._internalModelsFor(t),n=i.models;this.updateFilterRecordArray(e,r,n)},e.prototype._didUpdateAll=function(e){var t=this._liveRecordArrays[e];t&&u(t,"isUpdating",!1)},e.prototype.liveRecordArrayFor=function(e){var t=this._liveRecordArrays[e];if(t)this._syncLiveRecordArray(t,e);else{var r=this._visibleInternalModelsByType(e);t=this.createRecordArray(e,r),this._liveRecordArrays[e]=t}return t},e.prototype._visibleInternalModelsByType=function(e){for(var t=this.store._internalModelsFor(e)._models,r=[],i=0;i<t.length;i++){var n=t[i];!1===n.isHiddenFromRecordArrays()&&r.push(n)}return r},e.prototype.filteredRecordArraysFor=function(e){return this._filteredRecordArrays[e]||(this._filteredRecordArrays[e]=[])},e.prototype.createRecordArray=function(e,r){var i=t.RecordArray.create({modelName:e,content:d(r||[]),store:this.store,isLoaded:!0,manager:this});return Array.isArray(r)&&l(r,i),i},e.prototype.createFilteredRecordArray=function(e,r,i){var n=t.FilteredRecordArray.create({query:i,modelName:e,content:d(),store:this.store,manager:this,filterFunction:r});return this.registerFilteredRecordArray(n,e,r),n},e.prototype.createAdapterPopulatedRecordArray=function(e,i,n,a){var o=void 0;return Array.isArray(n)?(o=t.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:d(n),store:this.store,manager:this,isLoaded:!0,isUpdating:!1,meta:(0,r.default)(a.meta),links:(0,r.default)(a.links)}),l(n,o)):o=t.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:d(),store:this.store,manager:this}),this._adapterPopulatedRecordArrays.push(o),o},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArraysFor(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArraysFor(t),i=a(r,e),n=a(this._adapterPopulatedRecordArrays,e);if(!i&&!n){var o=this._liveRecordArrays[t];o&&e===o&&delete this._liveRecordArrays[t]}},e.prototype.willDestroy=function(){var e=this;Object.keys(this._filteredRecordArrays).forEach(function(t){return n(e._filteredRecordArrays[t]).forEach(i)}),Object.keys(this._liveRecordArrays).forEach(function(t){return e._liveRecordArrays[t].destroy()}),this._adapterPopulatedRecordArrays.forEach(i),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,h.schedule("actions",this,this.willDestroy)},e}();e.default=p}),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,i){e.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null","ember-data/-private/system/record-array-manager"],function(e,t,r,i){e.__esModule=!0;var n=Ember.run.once,a=Ember.A,o=Ember.get;e.default=t.default.extend({init:function(){this.set("content",this.get("content")||a()),this._super.apply(this,arguments),this.query=this.query||null,this.links=this.links||null},replace:function(){throw new Error("The result of a server query (on "+this.modelName+") is immutable.")},_update:function(){var e=o(this,"store"),t=o(this,"query");return e._query(this.modelName,t,this)},_setInternalModels:function(e,t){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,r.default)(t.meta),links:(0,r.default)(t.links)}),(0,i.associateWithRecordArray)(e,this),n(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember-data/-private/system/record-arrays/record-array"],function(e,t){e.__esModule=!0;var r=Ember.run.once,i=Ember.get,n=Ember.observer;e.default=t.default.extend({init:function(){this._super.apply(this,arguments),this.set("filterFunction",this.get("filterFunction")||null),this.isLoaded=!0},replace:function(){throw new Error("The result of a client-side filter (on "+this.modelName+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,this.modelName,i(this,"filterFunction"))},updateFilter:n("filterFunction",function(){r(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r){e.__esModule=!0;var i=Ember.Evented,n=Ember.ArrayProxy,a=Ember.set,o=Ember.get,s=Ember.computed,l=Ember.RSVP.Promise;e.default=n.extend(i,{init:function(){this._super.apply(this,arguments),this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){throw new Error("The result of a server query (for all "+this.modelName+" types) is immutable. To modify contents, use toArray()")},type:s("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=o(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(o(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){o(this,"content").pushObjects(e)},_removeInternalModels:function(e){o(this,"content").removeObjects(e)},save:function(){var e=this,r="DS: RecordArray#save "+this.modelName,i=l.all(this.invoke("save"),r).then(function(){return e},null,"DS: RecordArray#save return RecordArray");return t.PromiseArray.create({promise:i})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t.__recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){this.manager.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),a(this,"content",null),a(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new r.default(this,this.get("meta"),e)},_takeSnapshot:function(){return o(this,"content").map(function(e){return e.createSnapshot()})}})}),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,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/-private/system/model/model","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r,i){e.__esModule=!0;var n=Ember.RSVP.resolve,a=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};a.prototype=Object.create(r.default.prototype),a.prototype.constructor=a,a.prototype._super$constructor=r.default,a.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},a.prototype.id=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.id},a.prototype.link=function(){return this.belongsToRelationship.link},a.prototype.meta=function(){return this.belongsToRelationship.meta},a.prototype.push=function(e){var r=this;return n(e).then(function(e){var n=void 0;return e instanceof t.default?((0,i.default)("ds-overhaul-references"),n=e):n=r.store.push(e),r.belongsToRelationship.setCanonicalInternalModel(n._internalModel),n})},a.prototype.value=function(){var e=this.belongsToRelationship.inverseInternalModel;return e&&e.isLoaded()?e.getRecord():null},a.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},a.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=a}),t("ember-data/-private/system/references/has-many",["exports","ember-data/-private/system/references/reference","ember-data/-private/features"],function(e,t,r){e.__esModule=!0;var i=Ember.A,n=Ember.RSVP.resolve,a=Ember.get,o=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(t.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=t.default,o.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},o.prototype.link=function(){return this.hasManyRelationship.link},o.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},o.prototype.meta=function(){
3
+ return this.hasManyRelationship.meta},o.prototype.push=function(e){var t=this;return n(e).then(function(e){var n=e;(0,r.default)("ds-overhaul-references");var a=!0;"object"==typeof e&&e.data&&(n=e.data,a=n.length&&n[0].data,(0,r.default)("ds-overhaul-references")),(0,r.default)("ds-overhaul-references")||(a=!0);var o=void 0;if(a)o=n.map(function(e){var r=t.store.push(e);return r._internalModel});else{var s=t.store.push(e);o=i(s).mapBy("_internalModel")}return t.hasManyRelationship.computeChanges(o),t.hasManyRelationship.manyArray})},o.prototype._isLoaded=function(){return!!a(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return!0===e.isLoaded()})},o.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},o.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},o.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=o}),t("ember-data/-private/system/references/record",["exports","ember-data/-private/system/references/reference"],function(e,t){e.__esModule=!0;var r=Ember.RSVP.resolve,i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(t.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=t.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var t=this;return r(e).then(function(e){return t.store.push(e)})},i.prototype.value=function(){return this.internalModel.hasRecord?this.internalModel.getRecord():null},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){e.__esModule=!0;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 i(e){var i=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function n(e){var t={key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0};return t}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=n}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember-data/-private/system/normalize-model-name"],function(e,t){function r(e,r){var n=void 0,a=void 0;"object"==typeof e?(n=e,a=void 0):(n=r,a=e),"string"==typeof a&&(a=(0,t.default)(a)),n=n||{};var o={type:a,isRelationship:!0,options:n,kind:"belongsTo",name:"Belongs To",key:null};return i({get:function(e){return n.hasOwnProperty("serialize"),n.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).setInternalModel(t._internalModel):this._internalModel._relationships.get(e).setInternalModel(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=r;var i=Ember.computed;Ember.inspect}),t("ember-data/-private/system/relationships/ext",["exports","ember-data/-private/system/relationship-meta"],function(e,t){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var r=Ember.A,i=Ember.computed,n=Ember.MapWithDefault,a=Ember.Map,o=e.relationshipsDescriptor=i(function(){!0===Ember.testing&&!0===o._cacheable&&(o._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(r,i){if(i.isRelationship){i.key=r;e.get((0,t.typeForRelationshipMeta)(i)).push({name:r,kind:i.kind})}}),e}).readOnly(),s=e.relatedTypesDescriptor=i(function(){!0===Ember.testing&&!0===s._cacheable&&(s._cacheable=!1);var e=void 0,i=r();return this.eachComputedProperty(function(r,n){n.isRelationship&&(n.key=r,e=(0,t.typeForRelationshipMeta)(n),i.includes(e)||i.push(e))}),i}).readOnly();e.relationshipsByNameDescriptor=i(function(){var e=a.create();return this.eachComputedProperty(function(r,i){if(i.isRelationship){i.key=r;var n=(0,t.relationshipFromMeta)(i);n.type=(0,t.typeForRelationshipMeta)(i),e.set(r,n)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r){function i(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,t.default)(e));var i={type:e,options:r,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return a({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addInternalModels(t.map(function(e){return n(e,"_internalModel")})),r.getRecords()}}).meta(i)}e.__esModule=!0,e.default=i;var n=(Ember.A,Ember.get),a=Ember.computed;Ember.inspect}),t("ember-data/-private/system/relationships/relationship-payloads-manager",["exports","ember-data/-private/system/relationships/relationship-payloads"],function(e,t){e.__esModule=!0;var r=Ember.get,i=function(){function e(e){this._store=e,this._cache=Object.create(null)}return e.prototype.get=function(e,t,i){var n=this._store._modelFor(e),a=r(n,"relationshipsByName"),o=this._getRelationshipPayloads(e,i,n,a,!1);return o&&o.get(e,t,i)},e.prototype.push=function(e,t,i){var n=this;if(i){var a=this._store._modelFor(e),o=r(a,"relationshipsByName");Object.keys(i).forEach(function(r){var s=n._getRelationshipPayloads(e,r,a,o,!0);s&&s.push(e,t,r,i[r])})}},e.prototype.unload=function(e,t){var i=this,n=this._store._modelFor(e),a=r(n,"relationshipsByName");a.forEach(function(r,o){var s=i._getRelationshipPayloads(e,o,n,a,!1);s&&s.unload(e,t,o)})},e.prototype._getRelationshipPayloads=function(e,t,r,i,n){if(i.has(t)){var a=e+":"+t;return!this._cache[a]&&n?this._initializeRelationshipPayloads(e,t,r,i):this._cache[a]}},e.prototype._initializeRelationshipPayloads=function(e,i,n,a){var o=a.get(i),s=n.inverseFor(i,this._store),l=void 0,d=void 0,u=void 0;s?(d=s.name,l=o.type,u=r(s.type,"relationshipsByName").get(d)):(l=d="",u=null);var c=e+":"+i,h=l+":"+d;return this._cache[c]=this._cache[h]=new t.default(this._store,e,i,o,l,d,u)},e}();e.default=i}),t("ember-data/-private/system/relationships/relationship-payloads",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=function(){function e(e,t,r,i,n,a,o){this._store=e,this._lhsModelName=t,this._lhsRelationshipName=r,this._lhsRelationshipMeta=i,this._rhsModelName=n,this._rhsRelationshipName=a,this._rhsRelationshipMeta=o,this._lhsPayloads=Object.create(null),t!==n||r!==a?(this._rhsPayloads=Object.create(null),this._isReflexive=!1):(this._rhsPayloads=this._lhsPayloads,this._isReflexive=!0),this._pendingPayloads=[]}return e.prototype.get=function(e,t,r){return this._flushPending(),this._isLHS(e,r)?this._lhsPayloads[t]:this._rhsPayloads[t]},e.prototype.push=function(e,t,r,i){this._pendingPayloads.push([e,t,r,i])},e.prototype.unload=function(e,t,r){this._flushPending(),this._isLHS(e,r)?delete this._lhsPayloads[t]:delete this._rhsPayloads[t]},e.prototype._isLHS=function(e,t){return e===this._lhsModelName&&t===this._lhsRelationshipName},e.prototype._isRHS=function(e,t){return e===this._rhsModelName&&t===this._rhsRelationshipName},e.prototype._flushPending=function(){if(0!==this._pendingPayloads.length)for(var e=this._pendingPayloads.splice(0,this._pendingPayloads.length),t=0;t<e.length;++t){var r=e[t][0],i=e[t][1],n=e[t][2],a=e[t][3],o={data:{id:i,type:r}},s=void 0,l=void 0,d=void 0,u=void 0;this._isLHS(r,n)?(s=this._lhsPayloads[i],l=this._lhsPayloads,d=this._rhsPayloads,u=this._rhsRelationshipIsMany):(s=this._rhsPayloads[i],l=this._rhsPayloads,d=this._lhsPayloads,u=this._lhsRelationshipIsMany),void 0!==a.data&&this._removeInverse(i,s,d),l[i]=a,this._populateInverse(a,o,d,u)}},e.prototype._populateInverse=function(e,t,r,i){if(e.data)if(Array.isArray(e.data))for(var n=0;n<e.data.length;++n){var a=e.data[n].id;this._addToInverse(t,a,r,i)}else{var o=e.data.id;this._addToInverse(t,o,r,i)}},e.prototype._addToInverse=function(e,t,r,i){if(!this._isReflexive||e.data.id!==t){var n=r[t],a=n&&n.data;a?Array.isArray(a)?a.push(e.data):r[t]=e:r[t]=i?{data:[e.data]}:e}},e.prototype._removeInverse=function(e,t,r){var i=t&&t.data;if(i)if(Array.isArray(i))for(var n=0;n<i.length;++n)this._removeFromInverse(e,i[n].id,r);else this._removeFromInverse(e,i.id,r)},e.prototype._removeFromInverse=function(e,t,r){var i=r[t],n=i&&i.data;n&&(Array.isArray(n)?i.data=n.filter(function(t){return t.id!==e}):r[t]={data:null})},t(e,[{key:"_lhsRelationshipIsMany",get:function(){return this._lhsRelationshipMeta&&"hasMany"===this._lhsRelationshipMeta.kind}},{key:"_rhsRelationshipIsMany",get:function(){return this._rhsRelationshipMeta&&"hasMany"===this._rhsRelationshipMeta.kind}}]),e}();e.default=r}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r){function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.__esModule=!0;var a=Ember.RSVP.Promise,o=(Ember.inspect,function(e){function r(t,r,n,a){var o=i(this,e.call(this,t,r,n,a));return o.internalModel=r,o.key=a.key,o.inverseInternalModel=null,o.canonicalState=null,o}return n(r,e),r.prototype.setInternalModel=function(e){e?this.addInternalModel(e):this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.setHasData(!0),this.setHasLoaded(!0)},r.prototype.setCanonicalInternalModel=function(e){e?this.addCanonicalInternalModel(e):this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.flushCanonicalLater()},r.prototype.setInitialCanonicalInternalModel=function(e){e&&(this.canonicalMembers.add(e),this.members.add(e),this.inverseInternalModel=this.canonicalState=e,this.setupInverseRelationship(e))},r.prototype.addCanonicalInternalModel=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalInternalModel(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalInternalModel.call(this,t))},r.prototype.inverseDidDematerialize=function(){this.notifyBelongsToChanged()},r.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t),this.canonicalState===t&&(this.canonicalState=null),this.inverseInternalModel===t&&(this.inverseInternalModel=null,this.notifyBelongsToChanged())},r.prototype.flushCanonical=function(){this.inverseInternalModel&&this.inverseInternalModel.isNew()&&!this.canonicalState||(this.inverseInternalModel!==this.canonicalState&&(this.inverseInternalModel=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},r.prototype.addInternalModel=function(t){this.members.has(t)||(this.inverseInternalModel&&this.removeInternalModel(this.inverseInternalModel),this.inverseInternalModel=t,e.prototype.addInternalModel.call(this,t),this.notifyBelongsToChanged())},r.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setInternalModel(t?t._internalModel:t)},r.prototype.removeInternalModelFromOwn=function(t){this.members.has(t)&&(this.inverseInternalModel=null,e.prototype.removeInternalModelFromOwn.call(this,t),this.notifyBelongsToChanged())},r.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},r.prototype.removeCanonicalInternalModelFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalInternalModelFromOwn.call(this,t))},r.prototype.findRecord=function(){return this.inverseInternalModel?this.store._findByInternalModel(this.inverseInternalModel):a.resolve(null)},r.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addInternalModel(t),t})},r.prototype.getRecord=function(){var e=this;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),t.PromiseObject.create({promise:r,content:this.inverseInternalModel?this.inverseInternalModel.getRecord():null})}if(null===this.inverseInternalModel)return null;var i=this.inverseInternalModel.getRecord();return i},r.prototype.reload=function(){return this.link?this.fetchLink():this.inverseInternalModel&&this.inverseInternalModel.hasRecord?this.inverseInternalModel.getRecord().reload():this.findRecord()},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifier(this,e);t?this.setInitialCanonicalInternalModel(r):this.setCanonicalInternalModel(r)},r}(r.default));e.default=o}),t("ember-data/-private/system/relationships/state/create",["exports","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to"],function(e,t,r){function i(e){var t=e.options;return!(t&&null===t.inverse)}function n(e,n,a){var o=void 0,s=null;return i(n)&&(s=e.type.inverseFor(n.key,a)),s&&(o=s.name),"hasMany"===n.kind?new t.default(a,e,o,n):new r.default(a,e,o,n)}e.__esModule=!0;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),o=Ember.get,s=function(){function e(e){this.internalModel=e,this.initializedRelationships=Object.create(null)}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.forEach=function(e){var t=this.initializedRelationships;Object.keys(t).forEach(function(r){e(r,t[r])})},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e],i=this.internalModel;if(!r){var a=o(i.type,"relationshipsByName"),s=a.get(e);if(!s)return;var l=i.store._relationshipsPayloads.get(i.modelName,i.id,e);r=t[e]=n(i,s,i.store),l&&r.push(l,!0)}return r},a(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=s}),t("ember-data/-private/system/relationships/state/has-many",["exports","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,i,n){function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function s(e){var t=new i.default;if(e)for(var r=0,n=e.length;r<n;r++)t.add(e[r]);return t}e.__esModule=!0;var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),d=function(e){function r(t,r,i,n){var o=a(this,e.call(this,t,r,i,n));return o.belongsToType=n.type,o.canonicalState=[],o.isPolymorphic=n.options.polymorphic,o._manyArray=null,o.__loadingPromise=null,o}return o(r,e),r.prototype._updateLoadingPromise=function(e,r){return this.__loadingPromise?(r&&this.__loadingPromise.set("content",r),this.__loadingPromise.set("promise",e)):this.__loadingPromise=t.PromiseManyArray.create({promise:e,content:r}),this.__loadingPromise},r.prototype.removeInverseRelationships=function(){e.prototype.removeInverseRelationships.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},r.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},r.prototype.addCanonicalInternalModel=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalInternalModel.call(this,t,r))},r.prototype.inverseDidDematerialize=function(){this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this.notifyHasManyChanged()},r.prototype.addInternalModel=function(t,r){this.members.has(t)||(e.prototype.addInternalModel.call(this,t,r),this.manyArray._addInternalModels([t],r))},r.prototype.removeCanonicalInternalModelFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalInternalModelFromOwn.call(this,t,r))},r.prototype.removeCompletelyFromOwn=function(t){e.prototype.removeCompletelyFromOwn.call(this,t);var r=this.canonicalState.indexOf(t);-1!==r&&this.canonicalState.splice(r,1);var i=this._manyArray;if(i){var n=i.currentState.indexOf(t);-1!==n&&i.internalReplace(n,1)}},r.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},r.prototype.removeInternalModelFromOwn=function(t,r){if(this.members.has(t)){e.prototype.removeInternalModelFromOwn.call(this,t,r);var i=this.manyArray;void 0!==r?i.currentState.removeAt(r):i._removeInternalModels([t])}},r.prototype.notifyRecordRelationshipAdded=function(e,t){this.internalModel.notifyHasManyAdded(this.key,e,t)},r.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},r.prototype.computeChanges=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.canonicalMembers,r=[],i=s(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalInternalModels(r);for(var n=0,a=e.length;n<a;n++){var o=e[n];this.removeCanonicalInternalModel(o),this.addCanonicalInternalModel(o,n)}},r.prototype.setInitialInternalModels=function(e){if(!1!==Array.isArray(e)&&0!==e.length){for(var t=0;t<e.length;t++){var r=e[t];this.canonicalMembers.has(r)||(this.canonicalMembers.add(r),this.members.add(r),this.setupInverseRelationship(r))}this.canonicalState=this.canonicalMembers.toArray()}},r.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateInternalModelsFromAdapter(t),e.manyArray.set("isLoaded",!0),e.setHasData(!0)}),e.manyArray})},r.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},r.prototype.notifyHasManyChanged=function(){this.internalModel.notifyHasManyAdded(this.key)},r.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},r.prototype.updateData=function(e,t){var r=this.store._pushResourceIdentifiers(this,e);t?this.setInitialInternalModels(r):this.updateInternalModelsFromAdapter(r)},r.prototype.destroy=function(){e.prototype.destroy.call(this);var t=this._manyArray;t&&t.destroy();var r=this.__loadingPromise;r&&r.destroy()},l(r,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get:function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.internalModel,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray}}]),r}(r.default);e.default=d}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r){e.__esModule=!0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),n=Ember.guidFor,a=function(){function e(e,r,i,n){var a=n.options.async,o=n.options.polymorphic;this.members=new t.default,this.canonicalMembers=new t.default,this.store=e,this.key=n.key,this.inverseKey=i,this.internalModel=r,this.isAsync=void 0===a||a,this.isPolymorphic=void 0===o||o,this.relationshipMeta=n,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return e.prototype._inverseIsAsync=function(){return!(!this.inverseKey||!this.inverseInternalModel)&&this.inverseInternalModel._relationships.get(this.inverseKey).isAsync},e.prototype.removeInverseRelationships=function(){if(this.inverseKey)for(var e=this.members.list.concat(this.canonicalMembers.list),t=0;t<e.length;t++){var r=e[t],i=r._relationships.get(this.inverseKey);i.inverseDidDematerialize()}},e.prototype.inverseDidDematerialize=function(){},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeInternalModel(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalInternalModel(i)}},e.prototype.removeInternalModels=function(e){var t=this;e.forEach(function(e){return t.removeInternalModel(e)})},e.prototype.addInternalModels=function(e,t){var r=this;e.forEach(function(e){r.addInternalModel(e,t),void 0!==t&&t++})},e.prototype.addCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalInternalModel(e[r],r+t):this.addCanonicalInternalModel(e[r])},e.prototype.addCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)||(this.canonicalMembers.add(e),this.setupInverseRelationship(e)),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.setupInverseRelationship=function(t){if(this.inverseKey){var r=t._relationships,i=r.has(this.inverseKey),n=r.get(this.inverseKey);(i||this.isPolymorphic)&&n.addCanonicalInternalModel(this.internalModel)}else{var a=t._implicitRelationships,o=a[this.inverseKeyForImplicit];o||(o=a[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync}})),o.addCanonicalInternalModel(this.internalModel)}},e.prototype.removeCanonicalInternalModels=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalInternalModel(e[r],r+t):this.removeCanonicalInternalModel(e[r])},e.prototype.removeCanonicalInternalModel=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalInternalModelFromOwn(e),this.inverseKey?this.removeCanonicalInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalInternalModel(this.internalModel)),this.flushCanonicalLater()},e.prototype.addInternalModel=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addInternalModel(this.internalModel):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{async:this.isAsync}})),t._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel)),this.internalModel.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeInternalModel=function(e){this.members.has(e)&&(this.removeInternalModelFromOwn(e),this.inverseKey?this.removeInternalModelFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeInternalModel(this.internalModel))},e.prototype.removeInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeInternalModelFromOwn(this.internalModel)},e.prototype.removeInternalModelFromOwn=function(e){this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.removeCanonicalInternalModelFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalInternalModelFromOwn(this.internalModel)},e.prototype.removeCanonicalInternalModelFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.removeCompletelyFromInverse=function(){var e=this;if(this.inverseKey){var t=Object.create(null),r=this.internalModel,i=function(i){var a=n(i);if(void 0===t[a]){i._relationships.get(e.inverseKey).removeCompletelyFromOwn(r),t[a]=!0}};this.members.forEach(i),this.canonicalMembers.forEach(i)}},e.prototype.removeCompletelyFromOwn=function(e){this.canonicalMembers.delete(e),this.members.delete(e),this.internalModel.updateRecordArrays()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e,t){this.link=e,this.linkPromise=null,t||this.internalModel.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateInternalModelsFromAdapter=function(e){this.setHasData(!0),this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e,t){var i=!1,n=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(i=!0,this.updateData(e.data,t)),e.links&&e.links.related){var a=(0,r.default)(e.links.related);a&&a.href&&a.href!==this.link&&(n=!0,this.updateLink(a.href,t))}i?(this.setHasData(!0),this.setHasLoaded(!0)):n&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},e.prototype.destroy=function(){},i(e,[{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=a}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=function(){function e(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=null,this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}return e.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)},t(e,[{key:"type",get:function(){return this._type||(this._type=this._recordArray.get("type"))}}]),e}();e.default=r}),t("ember-data/-private/system/snapshot",["exports"],function(e){e.__esModule=!0;var t=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),r=Ember.copy,i=Ember.inspect,n=Ember.Error,a=Ember.get,o=function(){function e(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=Object.create(null),this._belongsToRelationships=Object.create(null),this._belongsToIds=Object.create(null),this._hasManyRelationships=Object.create(null),this._hasManyIds=Object.create(null),this._internalModel=e;var i=e.getRecord();this.record=i,i.eachAttribute(function(e){return t._attributes[e]=a(i,e)}),this.id=e.id,this.adapterOptions=r.adapterOptions,this.include=r.include,this.modelName=e.modelName,this._changedAttributes=i.changedAttributes()}return e.prototype.attr=function(e){if(e in this._attributes)return this._attributes[e];throw new n("Model '"+i(this.record)+"' has no attribute named '"+e+"' defined.")},e.prototype.attributes=function(){return r(this._attributes)},e.prototype.changedAttributes=function(){for(var e=Object.create(null),t=Object.keys(this._changedAttributes),i=0,n=t.length;i<n;i++){var a=t[i];e[a]=r(this._changedAttributes[a])}return e},e.prototype.belongsTo=function(e,t){var r=t&&t.id,o=void 0,s=void 0,l=void 0,d=void 0;if(r&&e in this._belongsToIds)return this._belongsToIds[e];if(!r&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(o=this._internalModel._relationships.get(e))||"belongsTo"!==o.relationshipMeta.kind)throw new n("Model '"+i(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return l=a(o,"hasData"),s=a(o,"inverseInternalModel"),l&&(d=s&&!s.isDeleted()?r?a(s,"id"):s.createSnapshot():null),r?this._belongsToIds[e]=d:this._belongsToRelationships[e]=d,d},e.prototype.hasMany=function(e,t){var r=t&&t.ids,o=void 0,s=void 0,l=void 0,d=void 0;if(r&&e in this._hasManyIds)return this._hasManyIds[e];if(!r&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(o=this._internalModel._relationships.get(e))||"hasMany"!==o.relationshipMeta.kind)throw new n("Model '"+i(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return l=a(o,"hasData"),s=a(o,"members"),l&&(d=[],s.forEach(function(e){e.isDeleted()||(r?d.push(e.id):d.push(e.createSnapshot()))})),r?this._hasManyIds[e]=d:this._hasManyRelationships[e]=d,d},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},t(e,[{key:"type",get:function(){return this._internalModel.modelClass}}]),e}();e.default=o}),
4
+ t("ember-data/-private/system/store",["exports","ember-data/-private/adapters/errors","ember-data/-private/system/model/model","ember-data/-private/system/normalize-model-name","ember-data/-private/system/identity-map","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/relationships/relationship-payloads-manager","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/model/internal-model","ember-data/-private/features"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m){function y(e,t){var r=e.then(function(e){return e.getRecord()});return(0,a.promiseObject)(r,t)}function v(e){return e.serializerFor("application")}function b(e,r,i,n){var a=n._internalModel,d=n.modelName,u=r._modelFor(d),c=e[i](r,u,n),h=(0,l.serializerForAdapter)(r,e,d),p="DS: Extract and notify about "+i+" completion of "+a;return c=O.resolve(c,p),c=(0,o._guard)(c,(0,o._bind)(o._objectIsAlive,r)),c=(0,o._guard)(c,(0,o._bind)(o._objectIsAlive,a)),c.then(function(e){return r._backburner.join(function(){var t=void 0,o=void 0;e&&(t=(0,s.normalizeResponseHelper)(h,r,u,e,n.id,i),t.included&&r._push({data:null,included:t.included}),o=t.data),r.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof t.InvalidError){var i=h.extractErrors(r,u,e,n.id);r.recordWasInvalid(a,i)}else r.recordWasError(a,e);throw e},p)}function _(e,t,r,i,n){var a=r.relationships[i].data;if(!a)return!1;var o=n[t.modelName];o||(o=n[t.modelName]=k(t.type,"inverseMap"));var s=o[i];if(void 0===s&&(s=t.type.inverseFor(i,e)),!s)return!1;var l=s,d=l.name;if(Array.isArray(a)){for(var u=0;u<a.length;++u){var c=e._internalModelsFor(a[u].type).get(a[u].id);if(c&&c._relationships.has(d))return!0}return!1}var h=e._internalModelsFor(a.type).get(a.id);return h&&h._relationships.has(d)}function g(e,t,r,i){Object.keys(r.relationships).forEach(function(n){var a=t._relationships;if(a.has(n)||_(e,t,r,n,i)){var o=r.relationships[n];a.get(n).push(o,!1)}})}e.__esModule=!0,e.Store=void 0;var R=Ember.A,M=Ember.copy,A=Ember.Error,F=Ember.MapWithDefault,E=Ember.run,z=Ember.set,k=Ember.get,I=Ember.computed,S=Ember.RSVP,P=Ember.Service,T=(Ember.typeOf,Ember.isPresent,Ember.isNone),x=(Ember.inspect,Ember._Backburner),j=Ember.ENV,O=S.Promise,D=void 0;e.Store=D=P.extend({init:function(){this._super.apply(this,arguments),this._backburner=new x(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new p.default({store:this}),this._identityMap=new n.default,this._pendingSave=[],this._modelFactoryCache=Object.create(null),this._relationshipsPayloads=new d.default(this),this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=F.create({defaultValue:function(){return[]}}),this._adapterCache=Object.create(null),this._serializerCache=Object.create(null)},adapter:"-json-api",serialize:function(e,t){return e._internalModel.createSnapshot().serialize(t)},defaultAdapter:I("adapter",function(){var e=k(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,i.default)(e),n=M(t)||Object.create(null);T(n.id)&&(n.id=this._generateId(r,n)),n.id=(0,h.default)(n.id);var a=this._buildInternalModel(r,n.id);a.loadedData();var o=a.getRecord(n);return a.eachRelationship(function(e,t){void 0!==n[e]&&a._relationships.get(e).setHasData(!0)}),o},_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,t,r){var n=(0,i.default)(e);return this.findRecord(n,t)},findRecord:function(e,t,r){var n=(0,i.default)(e),a=this._internalModelForId(n,t);return r=r||{},this.hasRecordForId(n,t)?y(this._findRecord(a,r),"DS: Store#findRecord "+n+" with id: "+t):this._findByInternalModel(a,r)},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):!1===t.backgroundReload?O.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),O.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),y(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:O.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),n=(0,i.default)(e),o=0;o<t.length;o++)r[o]=this.findRecord(n,t[o]);return(0,a.promiseArray)(S.all(r).then(R,null,"DS: Store#findByIds of "+n+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,u._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return O.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,n=S.defer("Fetching "+i+"' with id: "+r),a={internalModel:e,resolver:n,options:t},o=n.promise;return e.loadingData(o),0===this._pendingFetch.size&&E.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(a),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=a._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=Object.create(null),i=0,a=e.length;i<a;i++){var o=e[i],s=c[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var l=[],d=0,u=t.length;d<u;d++){var h=t[d];r[h.id]||l.push(h)}l.length&&n(l)}function n(e,t){for(var r=0,i=e.length;r<i;r++){var n=e[r],a=c[n.id];a&&a.resolver.reject(t||new Error("Expected: '"+n+"' to be present in the adapter provided payload, but it was not found."))}}for(var a=this,o=a.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,l=e.length,d=new Array(l),c=Object.create(null),h=0;h<l;h++){var p=e[h],f=p.internalModel;d[h]=f,c[f.id]=p}if(s){for(var m=new Array(l),y=0;y<l;y++)m[y]=d[y].createSnapshot();for(var v=o.groupRecordsForFindMany(this,m),b=0,_=v.length;b<_;b++){for(var g=v[b],R=v[b].length,M=new Array(R),A=new Array(R),F=0;F<R;F++){var E=g[F]._internalModel;A[F]=E,M[F]=E.id}if(R>1)!function(e){(0,u._findMany)(o,a,t,M,e).then(function(t){i(t,e)}).catch(function(t){n(e,t)})}(A);else if(1===M.length){var z=c[A[0].id];r(z)}}}else for(var k=0;k<l;k++)r(e[k])},getReference:function(e,t){var r=(0,i.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,i.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,i.default)(e),n=(0,h.default)(t),a=this._internalModelsFor(r).get(n);return!!a&&a.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,h.default)(t),i=this._internalModelsFor(e).get(r);return i?i.hasScheduledDestroy()?(i.destroySync(),this._buildInternalModel(e,r)):i:this._buildInternalModel(e,r)},_internalModelDidReceiveRelationshipData:function(e,t,r){this._relationshipsPayloads.push(e,t,r)},_internalModelDestroyed:function(e){this._removeFromIdMap(e),this._relationshipsPayloads.unload(e.modelName,e.id)},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return O.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,u._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,u._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,i.default)(e);return this._query(r,t)},_query:function(e,t,r){var i=this.adapterFor(e);return(0,a.promiseArray)((0,u._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,i.default)(e),n=this.adapterFor(r);return(0,a.promiseObject)((0,u._queryRecord)(n,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,i.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),n=this._internalModelsFor(e).metadata.since;if(r.reload)return z(t,"isUpdating",!0),(0,a.promiseArray)((0,u._findAll)(i,this,e,n,r));var o=t._createSnapshot(r);return i.shouldReloadAll(this,o)?(z(t,"isUpdating",!0),(0,a.promiseArray)((0,u._findAll)(i,this,e,n,r))):!1===r.backgroundReload?(0,a.promiseArray)(O.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,o))&&(z(t,"isUpdating",!0),(0,u._findAll)(i,this,e,n,r)),(0,a.promiseArray)(O.resolve(t)))},_didUpdateAll:function(e){this.recordArrayManager._didUpdateAll(e)},didUpdateAll:function(e){return this._didUpdateAll(e)},peekAll:function(e){var t=(0,i.default)(e);return this.recordArrayManager.liveRecordArrayFor(t)},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=(0,i.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){j.ENABLE_DS_FILTER;var n=void 0,o=arguments.length,s=void 0,l=3===o,d=(0,i.default)(e);return l?n=this.query(d,t):2===arguments.length&&(r=t),s=l?this.recordArrayManager.createFilteredRecordArray(d,r,t):this.recordArrayManager.createFilteredRecordArray(d,r),n=n||O.resolve(s),(0,a.promiseArray)(n.then(function(){return s},null,"DS: Store#filter of "+d))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),E.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this._pendingSave.slice();this._pendingSave=[];for(var t=0,r=e.length;t<r;t++){var i=e[t],n=i.snapshot,a=i.resolver,o=n._internalModel,s=this.adapterFor(o.modelName),l=void 0;"root.deleted.saved"!==o.currentState.stateName?(l=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",a.resolve(b(s,this,l,n))):a.resolve()}},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this.updateId(e,r),this._setupRelationshipsForModel(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,i=e.modelName,n=(0,h.default)(t.id);if(null===r||null!==n){this._existingInternalModelForId(i,n);this._internalModelsFor(e.modelName).set(n,e),e.setId(n)}},_internalModelsFor:function(e){return this._identityMap.retrieve(e)},_load:function(e){var t=(0,i.default)(e.type),r=this._internalModelForId(t,e.id),n=!1===r.currentState.isEmpty;return r.setupData(e),n?this.recordArrayManager.recordDidChange(r):this.recordArrayManager.recordWasLoaded(r),r},_modelForMixin:function(e){var t=(0,c.getOwner)(this),i=void 0;if(t.factoryFor){var n=t.factoryFor("mixin:"+e);i=n&&n.class}else i=t._lookupFactory("mixin:"+e);if(i){var a=r.default.extend(i);a.reopenClass({__isMixin:!0,__mixin:i}),t.register("model:"+e,a)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,i.default)(e);return this._modelFor(t)},_modelFor:function(e){var t=this._modelFactoryFor(e);return t.class?t.class:t},_modelFactoryFor:function(e){var t=this._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new A("No model was found for '"+e+"'");var r=(0,c.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,i.default)(e),r=(0,c.getOwner)(this);return r.factoryFor?r.factoryFor("model:"+t):r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){return t.map(function(e){return e.getRecord()})}return null===t?null:t.getRecord()},_push:function(e){var t=this;return this._backburner.join(function(){var r=e.included,i=void 0,n=void 0;if(r)for(i=0,n=r.length;i<n;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){n=e.data.length;var a=new Array(n);for(i=0;i<n;i++)a[i]=t._pushInternalModel(e.data[i]);return a}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,c.getOwner)(this);return e=(0,i.default)(e),t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=(e.type,this._load(e));return this._setupRelationshipsForModel(t,e),t},_setupRelationshipsForModel:function(e,t){void 0!==t.relationships&&2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=void 0,r=0,i=e.length;r<i;r+=2){t=t||Object.create(null);g(this,e[r],e[r+1],t)}e.length=0},pushPayload:function(e,t){var r=void 0,n=void 0;if(t){n=t;var a=(0,i.default)(e);r=this.serializerFor(a)}else n=e,r=v(this);if((0,m.default)("ds-pushpayload-return"))return r.pushPayload(this,n);r.pushPayload(this,n)},normalize:function(e,t){var r=(0,i.default)(e),n=this.serializerFor(r),a=this._modelFor(r);return n.normalize(a,t)},_buildInternalModel:function(e,t,r){var i=(this._existingInternalModelForId(e,t),new f.default(e,t,this,r));return this._internalModelsFor(e).add(i,t),i},_existingInternalModelForId:function(e,t){var r=this._internalModelsFor(e).get(t);return r&&r.hasScheduledDestroy()&&(r.destroySync(),r=null),r},buildInternalModel:function(e,t,r){return this._buildInternalModel(e,t,r)},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,i.default)(e),r=this._adapterCache,n=r[t];if(n)return n;var a=(0,c.getOwner)(this);if(void 0!==(n=a.lookup("adapter:"+t)))return z(n,"store",this),r[t]=n,n;if(void 0!==(n=r.application||a.lookup("adapter:application")))return z(n,"store",this),r[t]=n,r.application=n,n;var o=this.get("adapter");return void 0!==(n=r[o]||a.lookup("adapter:"+o))?(z(n,"store",this),r[t]=n,r[o]=n,n):(n=r["-json-api"]||a.lookup("adapter:-json-api"),z(n,"store",this),r[t]=n,r["-json-api"]=n,n)},serializerFor:function(e){var t=(0,i.default)(e),r=this._serializerCache,n=r[t];if(n)return n;var a=(0,c.getOwner)(this);if(void 0!==(n=a.lookup("serializer:"+t)))return z(n,"store",this),r[t]=n,n;if(void 0!==(n=r.application||a.lookup("serializer:application")))return z(n,"store",this),r[t]=n,r.application=n,n;var o=this.adapterFor(e),s=k(o,"defaultSerializer");return void 0!==(n=r[s]||a.lookup("serializer:"+s))?(z(n,"store",this),r[t]=n,r[s]=n,n):(n=r["-default"]||a.lookup("serializer:-default"),z(n,"store",this),r[t]=n,r["-default"]=n,n)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._adapterCache=null,this._serializerCache=null,this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&E.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!T(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!T(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=D,e.default=D}),t("ember-data/-private/system/store/common",["exports"],function(e){function t(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){return e.apply(void 0,r)}}function r(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.__esModule=!0,e._bind=t,e._guard=r,e._objectIsAlive=i;var n=Ember.get}),t("ember-data/-private/system/store/finders",["exports","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i){function n(e,n,a,o,s,l){var d=s.createSnapshot(l),u=s.modelName,c=e.findRecord(n,a,o,d),p="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=h.resolve(c,p),c=(0,t._guard)(c,(0,t._bind)(t._objectIsAlive,n)),c.then(function(t){var s=(0,i.serializerForAdapter)(n,e,u),l=(0,r.normalizeResponseHelper)(s,n,a,t,o,"findRecord");return n._push(l)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function a(e,n,a,o,s){var l=c(s).invoke("createSnapshot"),d=n.modelFor(a),u=e.findMany(n,d,o,l),p="DS: Handle Adapter#findMany of '"+a+"'";if(void 0===u)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return u=h.resolve(u,p),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),s=(0,r.normalizeResponseHelper)(o,n,d,t,null,"findMany");return n._push(s)},null,"DS: Extract payload of "+a)}function o(e,n,a,o,s){var l=a.createSnapshot(),d=n.modelFor(s.type),u=e.findHasMany(n,l,o,s),c="DS: Handle Adapter#findHasMany of '"+a.modelName+"' : '"+s.type+"'";return u=h.resolve(u,c),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,a)),u.then(function(t){var a=(0,i.serializerForAdapter)(n,e,s.type),o=(0,r.normalizeResponseHelper)(a,n,d,t,null,"findHasMany"),l=n._push(o);return l.meta=o.meta,l},null,"DS: Extract payload of '"+a.modelName+"' : hasMany '"+s.type+"'")}function s(e,n,a,o,s){var l=a.createSnapshot(),d=n.modelFor(s.type),u=e.findBelongsTo(n,l,o,s),c="DS: Handle Adapter#findBelongsTo of "+a.modelName+" : "+s.type;return u=h.resolve(u,c),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,n)),u=(0,t._guard)(u,(0,t._bind)(t._objectIsAlive,a)),u.then(function(t){var a=(0,i.serializerForAdapter)(n,e,s.type),o=(0,r.normalizeResponseHelper)(a,n,d,t,null,"findBelongsTo");return o.data?n._push(o):null},null,"DS: Extract payload of "+a.modelName+" : "+s.type)}function l(e,n,a,o,s){var l=n.modelFor(a),d=n.peekAll(a),u=d._createSnapshot(s),c=e.findAll(n,l,o,u),p="DS: Handle Adapter#findAll of "+l;return c=h.resolve(c,p),c=(0,t._guard)(c,(0,t._bind)(t._objectIsAlive,n)),c.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),s=(0,r.normalizeResponseHelper)(o,n,l,t,null,"findAll");return n._push(s),n._didUpdateAll(a),d},null,"DS: Extract payload of findAll ${modelName}")}function d(e,n,a,o,s){var l=n.modelFor(a),d=void 0;e.query.length>3?(s=s||n.recordArrayManager.createAdapterPopulatedRecordArray(a,o),d=e.query(n,l,o,s)):d=e.query(n,l,o);var u="DS: Handle Adapter#query of "+l;return d=h.resolve(d,u),d=(0,t._guard)(d,(0,t._bind)(t._objectIsAlive,n)),d.then(function(t){var d=(0,i.serializerForAdapter)(n,e,a),u=(0,r.normalizeResponseHelper)(d,n,l,t,null,"query"),c=n._push(u);return s?s._setInternalModels(c,u):s=n.recordArrayManager.createAdapterPopulatedRecordArray(a,o,c,u),s},null,"DS: Extract payload of query "+a)}function u(e,n,a,o){var s=n.modelFor(a),l=e.queryRecord(n,s,o),d="DS: Handle Adapter#queryRecord of "+a;return l=h.resolve(l,d),l=(0,t._guard)(l,(0,t._bind)(t._objectIsAlive,n)),l.then(function(t){var o=(0,i.serializerForAdapter)(n,e,a),l=(0,r.normalizeResponseHelper)(o,n,s,t,null,"queryRecord");return n._push(l)},null,"DS: Extract payload of queryRecord "+a)}e.__esModule=!0,e._find=n,e._findMany=a,e._findHasMany=o,e._findBelongsTo=s,e._findAll=l,e._query=d,e._queryRecord=u;var c=Ember.A,h=Ember.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports"],function(e){function t(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 r(e,t,r,i,n,a){var o=e.normalizeResponse(t,r,i,n,a);return o}e.__esModule=!0,e.validateDocumentStructure=t,e.normalizeResponseHelper=r;Ember.isEmpty}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/utils",["exports"],function(e){function t(e){return n(e,"attributes").has("type")||n(e,"relationshipsByName").has("type")}function r(e){var t=void 0;return i?t=i(e):e.container&&(t=e.container),t&&t.lookupFactory&&!t._lookupFactory&&(t._lookupFactory=function(){var e;return(e=t).lookupFactory.apply(e,arguments)},t.register=function(){var e=t.registry||t._registry||t;return e.register.apply(e,arguments)}),t}e.__esModule=!0;var i=Ember.getOwner,n=Ember.get;e.modelHasAttributeOrRelationshipNamedType=t,e.getOwner=r}),t("ember-data/-private/utils/parse-response-headers",["exports"],function(e){function t(e){var t=Object.create(null);if(!e)return t;for(var i=e.split(r),n=0;n<i.length;n++){for(var a=i[n],o=0,s=!1;o<a.length;o++)if(58===a.charCodeAt(o)){s=!0;break}if(!1!==s){var l=a.substring(0,o).trim(),d=a.substring(o+1,a.length).trim();d&&(t[l]=d)}}return t}e.__esModule=!0,e.default=t;var r="\r\n"}),t("ember-data/adapter",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(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-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"AdapterError",{enumerable:!0,get:function(){return t.AdapterError}}),Object.defineProperty(e,"InvalidError",{enumerable:!0,get:function(){return t.InvalidError}}),Object.defineProperty(e,"UnauthorizedError",{enumerable:!0,get:function(){return t.UnauthorizedError}}),Object.defineProperty(e,"ForbiddenError",{enumerable:!0,get:function(){return t.ForbiddenError}}),Object.defineProperty(e,"NotFoundError",{enumerable:!0,get:function(){return t.NotFoundError}}),Object.defineProperty(e,"ConflictError",{enumerable:!0,get:function(){return t.ConflictError}}),Object.defineProperty(e,"ServerError",{enumerable:!0,get:function(){return t.ServerError}}),Object.defineProperty(e,"TimeoutError",{enumerable:!0,get:function(){return t.TimeoutError}}),Object.defineProperty(e,"AbortError",{enumerable:!0,get:function(){return t.AbortError}}),Object.defineProperty(e,"errorsHashToArray",{enumerable:!0,get:function(){return t.errorsHashToArray}}),Object.defineProperty(e,"errorsArrayToHash",{enumerable:!0,get:function(){return t.errorsArrayToHash}})}),t("ember-data/adapters/json-api",["exports","ember-data/adapters/rest","ember-data/-private","ember-inflector"],function(e,t,r,i){e.__esModule=!0;var n=Ember.String.dasherize,a=(Ember.$,t.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var n=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),n&&n(e)},i},coalesceFindRequests:!1,findMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a=this.buildURL(t.modelName,i,n,"findMany");return this.ajax(a,"GET",{data:{filter:{id:i.join(",")}}})},pathForType:function(e){var t=n(e);return(0,i.pluralize)(t)},updateRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var n={};e.serializerFor(t.modelName).serializeIntoHash(n,t,i,{includeId:!0});var a=this.buildURL(t.modelName,i.id,i,"updateRecord");return this.ajax(a,"PATCH",{data:n})},_hasCustomizedAjax:function(){return this.ajax!==a.prototype.ajax||this.ajaxOptions!==a.prototype.ajaxOptions}}));(0,r.isEnabled)("ds-improved-ajax")&&a.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,n=e.type,a=e.snapshot,o={};return i.serializerFor(n.modelName).serializeIntoHash(o,n,a,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=a}),t("ember-data/adapters/rest",["exports","ember-data/adapter","ember-data/-private"],function(e,t,r){function i(e,t,i,n){var a=void 0;try{a=e.handleResponse(t.status,(0,r.parseResponseHeaders)(t.getAllResponseHeaders()),i,n)}catch(e){return c.reject(e)}return a&&a.isAdapterError?c.reject(a):a}function n(e,t,i,n){var a=void 0;if(n.errorThrown instanceof Error)a=n.errorThrown;else if("timeout"===n.textStatus)a=new r.TimeoutError;else if("abort"===n.textStatus||0===t.status)a=new r.AbortError;else try{a=e.handleResponse(t.status,(0,r.parseResponseHeaders)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||n.errorThrown,i)}catch(e){a=e}return a}function a(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}e.__esModule=!0;var o=Ember.$,s=Ember.RSVP.Promise,l=Ember.MapWithDefault,d=Ember.get,u=Ember.run,c=s,h=t.default.extend(r.BuildURLMixin,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},n=t.sort(),a=0;a<r;a++)i[n[a]]=e[n[a]];return i},coalesceFindRequests:!1,findRecord:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:i,snapshot:n,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,i,n,"findRecord"),s=this.buildQuery(n);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,i,n){var a=this.buildQuery(n);if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:i,query:a,snapshots:n,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,n,"findAll");return i&&(a.since=i),this.ajax(s,"GET",{data:a})},query:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:i,requestType:"query"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"query",i);return this.sortQueryParams&&(i=this.sortQueryParams(i)),this.ajax(a,"GET",{data:i})},queryRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,query:i,requestType:"queryRecord"});return this._makeRequest(n)}var a=this.buildURL(t.modelName,null,null,"queryRecord",i);return this.sortQueryParams&&(i=this.sortQueryParams(i)),this.ajax(a,"GET",{data:i})},findMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:i,snapshots:n,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,i,n,"findMany");return this.ajax(o,"GET",{data:{ids:i}})},findHasMany:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:i,relationship:n,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return i=this.urlPrefix(i,this.buildURL(s,o,t,"findHasMany")),this.ajax(i,"GET")},findBelongsTo:function(e,t,i,n){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:i,relationship:n,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return i=this.urlPrefix(i,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(i,"GET")},createRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"createRecord"});return this._makeRequest(n)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,i,"createRecord");return o.serializeIntoHash(a,t,i,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"updateRecord"});return this._makeRequest(n)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,i);var o=i.id,s=this.buildURL(t.modelName,o,i,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,i){if((0,r.isEnabled)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var n=this._requestFor({store:e,type:t,snapshot:i,requestType:"deleteRecord"});return this._makeRequest(n)}var a=i.id;return this.ajax(this.buildURL(t.modelName,a,i,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),n=i[i.length-1],o=t.id;return decodeURIComponent(n)===o?i[i.length-1]="":a(n,"?id="+o)&&(i[i.length-1]=n.substring(0,n.length-o.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var a=0,o=n._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+a+t>=r&&(a=0,s.push([])),a+=t;var n=s.length-1;s[n].push(e)}),s}var i=l.create({defaultValue:function(){return[]}}),n=this,a=this.maxURLLength;t.forEach(function(t){var r=n._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,a,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,i,n){if(this.isSuccess(e,t,i))return i;if(this.isInvalid(e,t,i))return new r.InvalidError(i.errors);var a=this.normalizeErrorResponse(e,t,i),o=this.generatedDetailedMessage(e,t,i,n);switch(e){case 401:return new r.UnauthorizedError(a,o);case 403:return new r.ForbiddenError(a,o);case 404:return new r.NotFoundError(a,o);case 409:
5
+ return new r.ConflictError(a,o);default:if(e>=500)return new r.ServerError(a,o)}return new r.AdapterError(a,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,t,r){var a=this,o={url:e,method:t};return new c(function(s,l){var d=a.ajaxOptions(e,t,r);d.success=function(e,t,r){var n=i(a,r,e,o);u.join(null,s,n)},d.error=function(e,t,r){var i={textStatus:t,errorThrown:r},s=n(a,e,o,i);u.join(null,l,s)},a._ajaxRequest(d)},"DS: RESTAdapter#ajax "+t+" to "+e)},_ajaxRequest:function(e){o.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var n=d(this,"headers");return void 0!==n&&(i.beforeSend=function(e){Object.keys(n).forEach(function(t){return e.setRequestHeader(t,n[t])})}),i},parseErrorResponse:function(e){var t=e;try{t=o.parseJSON(e)}catch(e){}return t},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,i){var n=void 0,a=t["Content-Type"]||"Empty Content-Type";return n="text/html"===a&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+a+")",n].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==h.prototype.ajax||this.ajaxOptions!==h.prototype.ajaxOptions}});(0,r.isEnabled)("ds-improved-ajax")&&h.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,n=e.requestType,a=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(n){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(a=a||{},a.since=e.sinceToken),s=a;break;case"query":case"queryRecord":this.sortQueryParams&&(a=this.sortQueryParams(a)),s=a;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,n=e.snapshot,a=e.snapshots,o=e.requestType,s=e.query;switch(t=t||n&&n.type,r=r||n&&n.id,o){case"findAll":return this.buildURL(t.modelName,null,a,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,a,o);case"findHasMany":case"findBelongsTo":var l=this.buildURL(t.modelName,r,n,o);return this.urlPrefix(e.url,l)}return this.buildURL(t.modelName,r,n,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var t=this,r=this._requestToJQueryAjaxHash(e),a=e.method,o=e.url,s={method:a,url:o};return new c(function(e,a){r.success=function(r,n,a){var o=i(t,a,r,s);u.join(null,e,o)},r.error=function(e,r,i){var o={textStatus:r,errorThrown:i},l=n(t,e,s,o);u.join(null,a,l)},t._ajaxRequest(r)},"DS: RESTAdapter#makeRequest: "+a+" "+o)}}),e.default=h}),t("ember-data/attr",["exports"],function(e){function t(e,t,r){if("function"==typeof t.defaultValue)return t.defaultValue.apply(null,arguments);var i=t.defaultValue;return i}function r(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function i(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function n(e,n){"object"==typeof e?(n=e,e=void 0):n=n||{};var o={type:e,isAttribute:!0,options:n};return a({get:function(e){var a=this._internalModel;return r(a,e)?i(a,e):t(this,n,e)},set:function(e,t){var r=this._internalModel,n=i(r,e),a=void 0;return t!==n&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:n,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=n;var a=Ember.computed}),t("ember-data",["exports","ember-data/-private","ember-data/setup-container","ember-data/initialize-store-service","ember-data/transforms/transform","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean","ember-data/adapter","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/serializer","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/serializers/embedded-records-mixin","ember-data/attr","ember-inflector"],function(e,t,r,i,n,a,o,s,l,d,u,c,h,p,f,m,y,v){e.__esModule=!0;var b=Ember.Error;if(Ember.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new b("Ember Data requires at least Ember 1.13.0, but you have "+Ember.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");t.DS.Store=t.Store,t.DS.PromiseArray=t.PromiseArray,t.DS.PromiseObject=t.PromiseObject,t.DS.PromiseManyArray=t.PromiseManyArray,t.DS.Model=t.Model,t.DS.RootState=t.RootState,t.DS.attr=v.default,t.DS.Errors=t.Errors,t.DS.InternalModel=t.InternalModel,t.DS.Snapshot=t.Snapshot,t.DS.Adapter=d.default,t.DS.AdapterError=t.AdapterError,t.DS.InvalidError=t.InvalidError,t.DS.TimeoutError=t.TimeoutError,t.DS.AbortError=t.AbortError,t.DS.UnauthorizedError=t.UnauthorizedError,t.DS.ForbiddenError=t.ForbiddenError,t.DS.NotFoundError=t.NotFoundError,t.DS.ConflictError=t.ConflictError,t.DS.ServerError=t.ServerError,t.DS.errorsHashToArray=t.errorsHashToArray,t.DS.errorsArrayToHash=t.errorsArrayToHash,t.DS.Serializer=h.default,t.DS.DebugAdapter=t.DebugAdapter,t.DS.RecordArray=t.RecordArray,t.DS.FilteredRecordArray=t.FilteredRecordArray,t.DS.AdapterPopulatedRecordArray=t.AdapterPopulatedRecordArray,t.DS.ManyArray=t.ManyArray,t.DS.RecordArrayManager=t.RecordArrayManager,t.DS.RESTAdapter=c.default,t.DS.BuildURLMixin=t.BuildURLMixin,t.DS.RESTSerializer=m.default,t.DS.JSONSerializer=f.default,t.DS.JSONAPIAdapter=u.default,t.DS.JSONAPISerializer=p.default,t.DS.Transform=n.default,t.DS.DateTransform=o.default,t.DS.StringTransform=s.default,t.DS.NumberTransform=a.default,t.DS.BooleanTransform=l.default,t.DS.EmbeddedRecordsMixin=y.default,t.DS.belongsTo=t.belongsTo,t.DS.hasMany=t.hasMany,t.DS.Relationship=t.Relationship,t.DS._setupContainer=r.default,t.DS._initializeStoreService=i.default,Object.defineProperty(t.DS,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:t.normalizeModelName}),Object.defineProperty(t.global,"DS",{configurable:!0,get:function(){return t.DS}}),e.default=t.DS}),t("ember-data/initialize-store-service",["exports"],function(e){function t(e){(e.lookup?e:e.container).lookup("service:store")}e.__esModule=!0,e.default=t}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Model}})}),t("ember-data/relationships",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"belongsTo",{enumerable:!0,get:function(){return t.belongsTo}}),Object.defineProperty(e,"hasMany",{enumerable:!0,get:function(){return t.hasMany}})}),t("ember-data/serializer",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports"],function(e){function t(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)}e.__esModule=!0;var r=(Ember.typeOf,Ember.A),i=Ember.Mixin,n=Ember.String.camelize,a=Ember.set,o=Ember.get;e.default=i.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},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 i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var n=this.hasSerializeIdsOption(i),a=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(n){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else a&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[n]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[n]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[n]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var n=this._getMappedKey(r.key,e.type);n===r.key&&this.keyForRelationship&&(n=this.keyForRelationship(r.key,r.kind,"serialize")),t[n]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,t,i){var n=this.keyForAttribute(i.key,"serialize"),a=e.hasMany(i.key);t[n]=r(a).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,t){for(var i=e.hasMany(t.key),n=r(i),a=new Array(n.length),o=0;o<n.length;o++){var s=n[o],l=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,t,l),a[o]=l}return a},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var n=e.type.inverseFor(r.key,this.store);if(n){var a=n.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(a,n.kind,"deserialize");s&&delete i[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[n(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var n=this;return r.eachRelationship(function(r,a){e.hasDeserializeRecordsOption(r)&&("hasMany"===a.kind&&n._extractEmbeddedHasMany(t,r,i,a),"belongsTo"===a.kind&&n._extractEmbeddedBelongsTo(t,r,i,a))}),i},_extractEmbeddedHasMany:function(e,r,i,n){var s=o(i,"data.relationships."+r+".data");if(s){for(var l=new Array(s.length),d=0;d<s.length;d++){var u=s[d],c=this._normalizeEmbeddedRelationship(e,n,u),h=c.data,p=c.included;if(i.included=i.included||[],i.included.push(h),p){var f;(f=i.included).push.apply(f,t(p))}l[d]={id:h.id,type:h.type}}a(i,"data.relationships."+r,{data:l})}},_extractEmbeddedBelongsTo:function(e,r,i,n){var s=o(i,"data.relationships."+r+".data");if(s){var l=this._normalizeEmbeddedRelationship(e,n,s),d=l.data,u=l.included;if(i.included=i.included||[],i.included.push(d),u){var c;(c=i.included).push.apply(c,t(u))}var h={id:d.id,type:d.type};a(i,"data.relationships."+r,{data:h})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var n=e.modelFor(i);return e.serializerFor(i).normalize(n,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i){e.__esModule=!0;var n=Ember.typeOf,a=(Ember.isNone,Ember.String.dasherize),o=r.default.extend({_normalizeDocumentHelper:function(e){if("object"===n(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var t=new Array(e.data.length),r=0;r<e.data.length;r++){var i=e.data[r];t[r]=this._normalizeResourceHelper(i)}e.data=t}if(Array.isArray(e.included)){for(var a=new Array,o=0;o<e.included.length;o++){var s=e.included[o],l=this._normalizeResourceHelper(s);null!==l&&a.push(l)}e.included=a}return e},_normalizeRelationshipDataHelper:function(e){if((0,i.isEnabled)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var n=this.store._modelFor(t);return this.store.serializerFor(t).normalize(n,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,i.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,n,a){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){var e=this._super.apply(this,arguments);return e},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var n=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[n]&&(i[e]=t.attributes[n])}),i},extractRelationship:function(e){if("object"===n(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var t=new Array(e.data.length),r=0;r<e.data.length;r++){var i=e.data[r];t[r]=this._normalizeRelationshipDataHelper(i)}e.data=t}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,n){var a=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t.relationships[a]){var o=t.relationships[a];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,i.isEnabled)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),n=this.modelNameFromPayloadKey(t.type);return r!==n&&this._hasCustomModelNameFromPayloadKey()&&(r=n),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadKeyFromModelName:function(e){return(0,t.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 a(e)},keyForRelationship:function(e,t,r){return a(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),n=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){n=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);n!==a&&this._hasCustomPayloadKeyFromModelName()&&(n=a)}else n=this.payloadKeyFromModelName(e.modelName);return r.type=n,{data:r}},serializeAttribute:function(e,t,r,i){var n=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=a}},serializeBelongsTo:function(e,t,r){var n=r.key;if(this._canSerialize(n)){var a=e.belongsTo(n);if(void 0!==a){t.relationships=t.relationships||{};var o=this._getMappedKey(n,e.type);o===n&&(o=this.keyForRelationship(n,"belongsTo","serialize"));var s=null;if(a){var l=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){l=this.payloadTypeFromModelName(a.modelName);var d=this.payloadKeyFromModelName(a.modelName);l!==d&&this._hasCustomPayloadKeyFromModelName()&&(l=d)}else l=this.payloadKeyFromModelName(a.modelName);s={type:l,id:a.id}}t.relationships[o]={data:s}}}},serializeHasMany:function(e,t,r){var n=r.key;if(this.shouldSerializeHasMany(e,n,r)){var a=e.hasMany(n);if(void 0!==a){t.relationships=t.relationships||{};var o=this._getMappedKey(n,e.type);o===n&&this.keyForRelationship&&(o=this.keyForRelationship(n,"hasMany","serialize"));for(var s=new Array(a.length),l=0;l<a.length;l++){var d=a[l],u=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){u=this.payloadTypeFromModelName(d.modelName);var c=this.payloadKeyFromModelName(d.modelName);u!==c&&this._hasCustomPayloadKeyFromModelName()&&(u=c)}else u=this.payloadKeyFromModelName(d.modelName);s[l]={type:u,id:d.id}}t.relationships[o]={data:s}}}}});(0,i.isEnabled)("ds-payload-type-hooks")&&o.reopen({modelNameFromPayloadType:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return(0,t.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==o.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==o.prototype.payloadKeyFromModelName}}),e.default=o}),t("ember-data/serializers/json",["exports","ember-data/serializer","ember-data/-private"],function(e,t,r){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)}e.__esModule=!0;var n=Ember.assign,a=Ember.merge,o=Ember.isNone,s=Ember.typeOf,l=Ember.get,d=n||a,u=t.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=l(e,"attributes");return e.eachTransformedAttribute(function(e,n){if(void 0!==t[e]){var a=r.transformFor(n),o=i.get(e);t[e]=a.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,n){switch(n){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,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,n){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,n){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,n){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!0)},normalizeArrayResponse:function(e,t,r,i,n){return this._normalizeResponse(e,t,r,i,n,!1)},_normalizeResponse:function(e,t,r,n,a,o){var s={data:null,included:[]},l=this.extractMeta(e,t,r);if(l&&(s.meta=l),o){var d=this.normalize(t,r),u=d.data,c=d.included;s.data=u,c&&(s.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),v=y.data,b=y.included;if(b){var _;(_=s.included).push.apply(_,i(b))}h[p]=v}s.data=h}return s},normalize:function(e,t){var r=null;return t&&(this.normalizeUsingDeclaredMapping(e,t),"object"===s(t.links)&&this.normalizeUsingDeclaredMapping(e,t.links),r={id:this.extractId(e,t),type:e.modelName,attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)},this.applyTransforms(e,r.attributes)),{data:r}},extractId:function(e,t){var i=l(this,"primaryKey"),n=t[i];return(0,r.coerceId)(n)},extractAttributes:function(e,t){var r=this,i=void 0,n={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(n[e]=t[i])}),n},extractRelationship:function(e,t){if(o(t))return null;if("object"===s(t)){t.id&&(t.id=(0,r.coerceId)(t.id));var i=this.store.modelFor(e);if(t.type&&!(0,r.modelHasAttributeOrRelationshipNamedType)(i))if((0,r.isEnabled)("ds-payload-type-hooks")){var n=this.modelNameFromPayloadType(t.type),a=this.modelNameFromPayloadKey(t.type);n!==a&&this._hasCustomModelNameFromPayloadKey()&&(n=a),t.type=n}else t.type=this.modelNameFromPayloadKey(t.type);return t}return{id:(0,r.coerceId)(t),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,t){var r=this,i={};return e.eachRelationship(function(e,n){var a=null,s=r.keyForRelationship(e,n.kind,"deserialize");if(void 0!==t[s]){var l=null,d=t[s];if("belongsTo"===n.kind)l=n.options.polymorphic?r.extractPolymorphicRelationship(n.type,d,{key:e,resourceHash:t,relationshipMeta:n}):r.extractRelationship(n.type,d);else if("hasMany"===n.kind&&!o(d)){l=new Array(d.length);for(var u=0,c=d.length;u<c;u++){var h=d[u];l[u]=r.extractRelationship(n.type,h)}}a={data:l}}var p=r.keyForLink(e,n.kind);if(t.links&&void 0!==t.links[p]){var f=t.links[p];a=a||{},a.links={related:f}}a&&(i[e]=a)}),i},modelNameFromPayloadKey:function(e){return(0,r.normalizeModelName)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,n){i=r.keyForRelationship(e,n.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=l(this,"attrs"),i=void 0,n=void 0;if(r)for(var a in r)i=n=this._getMappedKey(a,e),void 0!==t[n]&&(l(e,"attributes").has(a)&&(i=this.keyForAttribute(a)),l(e,"relationshipsByName").has(a)&&(i=this.keyForRelationship(a)),n!==i&&(t[i]=t[n],delete t[n]))},_getMappedKey:function(e,t){var r=l(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=l(this,"attrs");return!t||!t[e]||!1!==t[e].serialize},_mustSerialize:function(e){var t=l(this,"attrs");return t&&t[e]&&!0===t[e].serialize},shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var i=this,n={};if(t&&t.includeId)if((0,r.isEnabled)("ds-serialize-id"))this.serializeId(e,n,l(this,"primaryKey"));else{var a=e.id;a&&(n[l(this,"primaryKey")]=a)}return e.eachAttribute(function(t,r){i.serializeAttribute(e,n,t,r)}),e.eachRelationship(function(t,r){"belongsTo"===r.kind?i.serializeBelongsTo(e,n,r):"hasMany"===r.kind&&i.serializeHasMany(e,n,r)}),n},serializeIntoHash:function(e,t,r,i){d(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var n=i.type,a=e.attr(r);if(n){a=this.transformFor(n).serialize(a,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=a}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var n=e.belongsTo(i,{id:!0}),a=this._getMappedKey(i,e.type);a===i&&this.keyForRelationship&&(a=this.keyForRelationship(i,"belongsTo","serialize")),o(n)?t[a]=null:t[a]=n,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key;if(this.shouldSerializeHasMany(e,i,r)){var n=e.hasMany(i,{ids:!0});if(void 0!==n){var a=this._getMappedKey(i,e.type);a===i&&this.keyForRelationship&&(a=this.keyForRelationship(i,"hasMany","serialize")),t[a]=n}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,i,n){var a=this;return i&&"object"==typeof i&&i.errors&&(i=(0,r.errorsArrayToHash)(i.errors),this.normalizeUsingDeclaredMapping(t,i),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==i[t]&&(i[e]=i[t],delete i[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==i[t]&&(i[e]=i[t],delete i[t])})),i},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){var i=(0,r.getOwner)(this).lookup("transform:"+e);return i}});(0,r.isEnabled)("ds-payload-type-hooks")&&u.reopen({modelNameFromPayloadType:function(e){return(0,r.normalizeModelName)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==u.prototype.modelNameFromPayloadKey}}),(0,r.isEnabled)("ds-serialize-id")&&u.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=u}),t("ember-data/serializers/rest",["exports","ember-inflector","ember-data/serializers/json","ember-data/-private"],function(e,t,r,i){function n(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)}e.__esModule=!0;var a=(Ember.typeOf,Ember.isNone),o=Ember.makeArray,s=Ember.String.camelize,l=r.default.extend({keyForPolymorphicType:function(e,t,r){return this.keyForRelationship(e)+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,t,r,i){var a=this,s={data:[],included:[]},l=e.modelFor(t),d=e.serializerFor(t);return o(r).forEach(function(t){var r=a._normalizePolymorphicRecord(e,t,i,l,d),o=r.data,u=r.included;if(s.data.push(o),u){var c;(c=s.included).push.apply(c,n(u))}}),s},_normalizePolymorphicRecord:function(e,t,r,n,a){var o=a,s=n;if(!(0,i.modelHasAttributeOrRelationshipNamedType)(n)&&t.type){var l=void 0;if((0,i.isEnabled)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var d=this.modelNameFromPayloadKey(t.type);l!==d&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=d)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(o=e.serializerFor(l),s=e.modelFor(l))}return o.normalize(s,t,r)},_normalizeResponse:function(e,t,r,a,o,s){var l={data:null,included:[]},d=this.extractMeta(e,t,r);d&&(l.meta=d);for(var u=Object.keys(r),c=0,h=u.length;c<h;c++){var p=u[c],f=p,m=!1;"_"===p.charAt(0)&&(m=!0,f=p.substr(1));var y=this.modelNameFromPayloadKey(f);if(e.modelFactoryFor(y)){var v=!m&&this.isPrimaryType(e,y,t),b=r[p];if(null!==b){if(!v||Array.isArray(b)){var _=this._normalizeArray(e,y,b,p),g=_.data,R=_.included;if(R){var M;(M=l.included).push.apply(M,n(R))}if(s)g.forEach(function(e){var t=v&&(0,i.coerceId)(e.id)===a;v&&!a&&!l.data||t?l.data=e:l.included.push(e)});else if(v)l.data=g;else if(g){var A;(A=l.included).push.apply(A,n(g))}}else{var F=this._normalizePolymorphicRecord(e,b,p,t,this),E=F.data,z=F.included;if(l.data=E,z){var k;(k=l.included).push.apply(k,n(z))}}}}}return l},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,t){var r={data:[],included:[]};for(var a in t){var s=this.modelNameFromPayloadKey(a);if(e.modelFactoryFor(s)){var l=e.modelFor(s),d=e.serializerFor(l.modelName);o(t[a]).forEach(function(e){var t=d.normalize(l,e,a),i=t.data,o=t.included;if(r.data.push(i),o){var s;(s=r.included).push.apply(s,n(o))}})}}if((0,i.isEnabled)("ds-pushpayload-return"))return e.push(r);e.push(r)},modelNameFromPayloadKey:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){e[this.payloadKeyFromModelName(t.modelName)]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return s(e)},serializePolymorphicType:function(e,t,r){var n=r.key,o=this.keyForPolymorphicType(n,r.type,"serialize"),l=e.belongsTo(n);a(l)?t[o]=null:(0,i.isEnabled)("ds-payload-type-hooks")?t[o]=this.payloadTypeFromModelName(l.modelName):t[o]=s(l.modelName)},extractPolymorphicRelationship:function(e,t,r){var n=r.key,a=r.resourceHash,o=r.relationshipMeta,s=o.options.polymorphic,l=this.keyForPolymorphicType(n,e,"deserialize");if(s&&void 0!==a[l]&&"object"!=typeof t){if((0,i.isEnabled)("ds-payload-type-hooks")){var d=a[l],u=this.modelNameFromPayloadType(d),c=this.modelNameFromPayloadKey(d);return d!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[l])}}return this._super.apply(this,arguments)}});(0,i.isEnabled)("ds-payload-type-hooks")&&l.reopen({modelNameFromPayloadType:function(e){return(0,t.singularize)((0,i.normalizeModelName)(e))},payloadTypeFromModelName:function(e){return s(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==l.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){return this.modelNameFromPayloadType!==l.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==l.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==l.prototype.payloadKeyFromModelName}}),e.default=l}),t("ember-data/setup-container",["exports","ember-data/-private","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest","ember-data/adapters/json-api","ember-data/adapters/rest","ember-data/transforms/number","ember-data/transforms/date","ember-data/transforms/string","ember-data/transforms/boolean"],function(e,t,r,i,n,a,o,s,l,d,u){function c(e,t){return e.has?e.has(t):e.hasRegistration(t)}function h(e){var s=e.registerOptionsForType||e.optionsForType;s.call(e,"serializer",{singleton:!1}),s.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",i.default),e.register("serializer:-rest",n.default),
6
+ e.register("adapter:-rest",o.default),e.register("adapter:-json-api",a.default),e.register("serializer:-json-api",r.default),c(e,"service:store")||e.register("service:store",t.Store)}function p(e){e.register("data-adapter:main",t.DebugAdapter)}function f(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")}function m(e){e.register("transform:boolean",u.default),e.register("transform:date",l.default),e.register("transform:number",s.default),e.register("transform:string",d.default)}function y(e){p(e),m(e),f(e),h(e)}e.__esModule=!0,e.default=y}),t("ember-data/store",["exports","ember-data/-private"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.Store}})}),t("ember-data/transform",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),t("ember-data/transforms/boolean",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0;var r=Ember.isNone;e.default=t.default.extend({deserialize:function(e,t){if(r(e)&&!0===t.allowNull)return null;var i=typeof e;return"boolean"===i?e:"string"===i?/^(true|t|1)$/i.test(e):"number"===i&&1===e},serialize:function(e,t){return r(e)&&!0===t.allowNull?null:Boolean(e)}})}),t("ember-data/transforms/date",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0,e.default=t.default.extend({deserialize:function(e){var t=typeof e;if("string"===t){var r=e.indexOf("+");return-1!==r&&e.length-5===r?(r+=3,new Date(e.slice(0,r)+":"+e.slice(r))):new Date(e)}return"number"===t?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/transforms/number",["exports","ember-data/transforms/transform"],function(e,t){function r(e){return e===e&&e!==1/0&&e!==-1/0}e.__esModule=!0;var i=Ember.isEmpty;e.default=t.default.extend({deserialize:function(e){var t=void 0;return i(e)?null:(t=Number(e),r(t)?t:null)},serialize:function(e){var t=void 0;return i(e)?null:(t=Number(e),r(t)?t:null)}})}),t("ember-data/transforms/string",["exports","ember-data/transforms/transform"],function(e,t){e.__esModule=!0;var r=Ember.isNone;e.default=t.default.extend({deserialize:function(e){return r(e)?null:String(e)},serialize:function(e){return r(e)?null:String(e)}})}),t("ember-data/transforms/transform",["exports"],function(e){e.__esModule=!0;var t=Ember.Object;e.default=t.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="3.0.0-beta.1"}),t("ember-inflector",["module","exports","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,i.Inflector.defaultRules=i.defaultRules,Ember.Inflector=i.Inflector,Ember.String.pluralize=i.pluralize,Ember.String.singularize=i.singularize,r.default=i.Inflector,r.pluralize=i.pluralize,r.singularize=i.singularize,r.defaultRules=i.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=i.Inflector,e.pluralize=i.pluralize,e.singularize=i.singularize,e}):void 0!==e&&e.exports&&(e.exports=i.Inflector,i.Inflector.singularize=i.singularize,i.Inflector.pluralize=i.pluralize)}),t("ember-inflector/lib/ext/string",["ember-inflector/lib/system/string"],function(e){(!0===Ember.EXTEND_PROTOTYPES||Ember.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,e.pluralize)(this)},String.prototype.singularize=function(){return(0,e.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e,r){var i=void 0,n=void 0,a=!1;return 1===e.length?(n=e[0],(0,t.pluralize)(n)):(i=e[0],n=e[1],r["without-count"]&&(a=r["without-count"]),1!==parseFloat(i)&&(n=(0,t.pluralize)(n)),a?n:i+" "+n)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,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,i){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.__esModule=!0,e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/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|bonus)(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"],function(e){function t(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function r(e,t){for(var r,i=0,n=t.length;i<n;i++)r=t[i],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 i=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};t(i,e.uncountable),r(i,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;var a=Ember.String.capitalize,o=/^\s*$/,s=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,d=/[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(),t(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),r(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 i,n,u,c,h,p,f,m;if(p=!e||o.test(e),f=d.test(e),"",p)return e;if(u=e.toLowerCase(),c=s.exec(e)||l.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[u]||this.rules.uncountable[h])return e;for(m in r)if(u.match(m+"$"))return n=r[m],f&&r[h]&&(n=a(n),m=a(m)),e.replace(new RegExp(m,"i"),n);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);return i=i||[],m=i[0],n=i[1],e.replace(m,n)}},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 i(e){return t.default.inflector.singularize(e)}e.__esModule=!0,e.singularize=e.pluralize=void 0,e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports"],function(e){function t(e){return Ember.Helper?Ember.Helper.helper(e):Ember.HTMLBars?Ember.HTMLBars.makeBoundHelper(e):Ember.Handlebars.makeBoundHelper(e)}e.__esModule=!0,e.default=t}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function a(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],l=[],d=Object.keys(n._eak_seen),u=0;u<d.length;u++){var c=d[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&l.push(c)}r(e,s),a(e,l)}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}).call(this),function(){function e(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"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 t)e(r,t[r])}()}();
@@ -6,7 +6,7 @@
6
6
  * @copyright Copyright 2011-2017 Tilde Inc. and contributors.
7
7
  * Portions Copyright 2011 LivingSocial Inc.
8
8
  * @license Licensed under MIT license (see license.js)
9
- * @version 2.18.3
9
+ * @version 3.0.0-beta.1
10
10
  */
11
11
 
12
12
  var loader, define, requireModule, require, requirejs;
@@ -1328,7 +1328,7 @@ define('ember-data/-private/global', ['exports'], function (exports) {
1328
1328
  // export real global
1329
1329
  exports.default = checkGlobal(checkElementIdShadowing(typeof global === 'object' && global)) || checkGlobal(typeof self === 'object' && self) || checkGlobal(typeof window === 'object' && window) || new Function('return this')();
1330
1330
  });
1331
- define('ember-data/-private', ['exports', 'ember-data/-private/system/model/model', 'ember-data/-private/system/model/errors', 'ember-data/-private/system/store', 'ember-data/-private/core', 'ember-data/-private/system/relationships/belongs-to', 'ember-data/-private/system/relationships/has-many', 'ember-data/-private/adapters/build-url-mixin', 'ember-data/-private/system/snapshot', 'ember-data/-private/adapters/errors', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/utils', 'ember-data/-private/system/coerce-id', 'ember-data/-private/utils/parse-response-headers', 'ember-data/-private/global', 'ember-data/-private/features', 'ember-data/-private/system/model/states', 'ember-data/-private/system/model/internal-model', 'ember-data/-private/system/store/container-instance-cache', 'ember-data/-private/system/promise-proxies', 'ember-data/-private/system/record-arrays', 'ember-data/-private/system/many-array', 'ember-data/-private/system/record-array-manager', 'ember-data/-private/system/relationships/state/relationship', 'ember-data/-private/system/debug/debug-adapter', 'ember-data/-private/system/diff-array', 'ember-data/-private/system/relationships/relationship-payloads-manager', 'ember-data/-private/system/relationships/relationship-payloads', 'ember-data/-private/system/snapshot-record-array'], function (exports, _model, _errors, _store, _core, _belongsTo, _hasMany, _buildUrlMixin, _snapshot, _errors2, _normalizeModelName, _utils, _coerceId, _parseResponseHeaders, _global, _features, _states, _internalModel, _containerInstanceCache, _promiseProxies, _recordArrays, _manyArray, _recordArrayManager, _relationship, _debugAdapter, _diffArray, _relationshipPayloadsManager, _relationshipPayloads, _snapshotRecordArray) {
1331
+ define('ember-data/-private', ['exports', 'ember-data/-private/system/model/model', 'ember-data/-private/system/model/errors', 'ember-data/-private/system/store', 'ember-data/-private/core', 'ember-data/-private/system/relationships/belongs-to', 'ember-data/-private/system/relationships/has-many', 'ember-data/-private/adapters/build-url-mixin', 'ember-data/-private/system/snapshot', 'ember-data/-private/adapters/errors', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/utils', 'ember-data/-private/system/coerce-id', 'ember-data/-private/utils/parse-response-headers', 'ember-data/-private/global', 'ember-data/-private/features', 'ember-data/-private/system/model/states', 'ember-data/-private/system/model/internal-model', 'ember-data/-private/system/promise-proxies', 'ember-data/-private/system/record-arrays', 'ember-data/-private/system/many-array', 'ember-data/-private/system/record-array-manager', 'ember-data/-private/system/relationships/state/relationship', 'ember-data/-private/system/debug/debug-adapter', 'ember-data/-private/system/diff-array', 'ember-data/-private/system/relationships/relationship-payloads-manager', 'ember-data/-private/system/relationships/relationship-payloads', 'ember-data/-private/system/snapshot-record-array'], function (exports, _model, _errors, _store, _core, _belongsTo, _hasMany, _buildUrlMixin, _snapshot, _errors2, _normalizeModelName, _utils, _coerceId, _parseResponseHeaders, _global, _features, _states, _internalModel, _promiseProxies, _recordArrays, _manyArray, _recordArrayManager, _relationship, _debugAdapter, _diffArray, _relationshipPayloadsManager, _relationshipPayloads, _snapshotRecordArray) {
1332
1332
  'use strict';
1333
1333
 
1334
1334
  exports.__esModule = true;
@@ -1500,12 +1500,6 @@ define('ember-data/-private', ['exports', 'ember-data/-private/system/model/mode
1500
1500
  return _internalModel.default;
1501
1501
  }
1502
1502
  });
1503
- Object.defineProperty(exports, 'ContainerInstanceCache', {
1504
- enumerable: true,
1505
- get: function () {
1506
- return _containerInstanceCache.default;
1507
- }
1508
- });
1509
1503
  Object.defineProperty(exports, 'PromiseArray', {
1510
1504
  enumerable: true,
1511
1505
  get: function () {
@@ -2689,24 +2683,12 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
2689
2683
  return true;
2690
2684
  }
2691
2685
 
2692
- // Handle dematerialization for relationship `rel`. In all cases, notify the
2693
- // relatinoship of the dematerialization: this is done so the relationship can
2694
- // notify its inverse which needs to update state
2695
- //
2696
- // If the inverse is sync, unloading this record is treated as a client-side
2697
- // delete, so we remove the inverse records from this relationship to
2698
- // disconnect the graph. Because it's not async, we don't need to keep around
2699
- // the internalModel as an id-wrapper for references and because the graph is
2700
- // disconnected we can actually destroy the internalModel when checking for
2701
- // orphaned models.
2702
2686
  function destroyRelationship(rel) {
2703
- rel.internalModelDidDematerialize();
2704
-
2705
- if (rel._inverseIsSync()) {
2706
- // disconnect the graph so that the sync inverse relationship does not
2707
- // prevent us from cleaning up during `_cleanupOrphanedInternalModels`
2708
- rel.removeAllInternalModelsFromOwn();
2709
- rel.removeAllCanonicalInternalModelsFromOwn();
2687
+ if (rel._inverseIsAsync()) {
2688
+ rel.removeInternalModelFromInverse(rel.inverseInternalModel);
2689
+ rel.removeInverseRelationships();
2690
+ } else {
2691
+ rel.removeCompletelyFromInverse();
2710
2692
  }
2711
2693
  }
2712
2694
  // this (and all heimdall instrumentation) will be stripped by a babel transform
@@ -2923,7 +2905,6 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
2923
2905
 
2924
2906
  InternalModel.prototype._directlyRelatedInternalModels = function _directlyRelatedInternalModels() {
2925
2907
  var array = [];
2926
-
2927
2908
  this._relationships.forEach(function (name, rel) {
2928
2909
  array = array.concat(rel.members.list, rel.canonicalMembers.list);
2929
2910
  });
@@ -3172,7 +3153,7 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
3172
3153
  }
3173
3154
 
3174
3155
  if (this.isNew()) {
3175
- this.removeFromInverseRelationships(true);
3156
+ this.removeFromInverseRelationships();
3176
3157
  }
3177
3158
 
3178
3159
  if (this.isValid()) {
@@ -3289,13 +3270,9 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
3289
3270
  };
3290
3271
 
3291
3272
  InternalModel.prototype.removeFromInverseRelationships = function removeFromInverseRelationships() {
3292
- var isNew = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
3293
-
3294
3273
  this._relationships.forEach(function (name, rel) {
3295
3274
  rel.removeCompletelyFromInverse();
3296
- if (isNew === true) {
3297
- rel.clear();
3298
- }
3275
+ rel.clear();
3299
3276
  });
3300
3277
 
3301
3278
  var implicitRelationships = this._implicitRelationships;
@@ -3305,9 +3282,7 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
3305
3282
  var rel = implicitRelationships[key];
3306
3283
 
3307
3284
  rel.removeCompletelyFromInverse();
3308
- if (isNew === true) {
3309
- rel.clear();
3310
- }
3285
+ rel.clear();
3311
3286
  });
3312
3287
  };
3313
3288
 
@@ -3321,7 +3296,10 @@ define('ember-data/-private/system/model/internal-model', ['exports', 'ember-dat
3321
3296
  this.__implicitRelationships = null;
3322
3297
  Object.keys(implicitRelationships).forEach(function (key) {
3323
3298
  var rel = implicitRelationships[key];
3299
+
3324
3300
  destroyRelationship(rel);
3301
+
3302
+ rel.destroy();
3325
3303
  });
3326
3304
  };
3327
3305
 
@@ -3726,7 +3704,7 @@ define('ember-data/-private/system/model/model', ['exports', 'ember-data/-privat
3726
3704
  var relationships = relationshipMap.get(type.modelName).filter(function (relationship) {
3727
3705
  var optionsForRelationship = inverseType.metaForProperty(relationship.name).options;
3728
3706
 
3729
- if (!optionsForRelationship.inverse) {
3707
+ if (!optionsForRelationship.inverse && optionsForRelationship.inverse !== null) {
3730
3708
  return true;
3731
3709
  }
3732
3710
 
@@ -4806,10 +4784,6 @@ define('ember-data/-private/system/model/model', ['exports', 'ember-data/-privat
4806
4784
  // the computed property.
4807
4785
  var meta = value.meta();
4808
4786
 
4809
- /*
4810
- This is buggy because if the parent has never been looked up
4811
- via `modelFor` it will not have `modelName` set.
4812
- */
4813
4787
  meta.parentType = proto.constructor;
4814
4788
  }
4815
4789
  }
@@ -6205,7 +6179,7 @@ define('ember-data/-private/system/record-arrays/adapter-populated-record-array'
6205
6179
 
6206
6180
  this._super.apply(this, arguments);
6207
6181
  this.query = this.query || null;
6208
- this.links = null;
6182
+ this.links = this.links || null;
6209
6183
  },
6210
6184
  replace: function () {
6211
6185
  throw new Error('The result of a server query (on ' + this.modelName + ') is immutable.');
@@ -6803,7 +6777,7 @@ define('ember-data/-private/system/references/belongs-to', ['exports', 'ember-da
6803
6777
  if ((0, _features.default)('ds-overhaul-references')) {
6804
6778
  (false && !(false) && Ember.deprecate("BelongsToReference#push(DS.Model) is deprecated. Update relationship via `model.set('relationshipName', value)` instead.", false, {
6805
6779
  id: 'ds.references.belongs-to.push-record',
6806
- until: '3.0'
6780
+ until: '4.0.0'
6807
6781
  }));
6808
6782
  }
6809
6783
  record = data;
@@ -7218,7 +7192,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember-data
7218
7192
  if ((0, _features.default)("ds-overhaul-references")) {
7219
7193
  (false && !(!Array.isArray(payload)) && Ember.deprecate("HasManyReference#push(array) is deprecated. Push a JSON-API document instead.", !Array.isArray(payload), {
7220
7194
  id: 'ds.references.has-many.push-array',
7221
- until: '3.0'
7195
+ until: '4.0.0'
7222
7196
  }));
7223
7197
  }
7224
7198
 
@@ -7230,7 +7204,7 @@ define('ember-data/-private/system/references/has-many', ['exports', 'ember-data
7230
7204
  if ((0, _features.default)('ds-overhaul-references')) {
7231
7205
  (false && !(!useLegacyArrayPush) && Ember.deprecate("HasManyReference#push() expects a valid JSON-API document.", !useLegacyArrayPush, {
7232
7206
  id: 'ds.references.has-many.push-invalid-json-api',
7233
- until: '3.0'
7207
+ until: '4.0.0'
7234
7208
  }));
7235
7209
  }
7236
7210
  }
@@ -7616,7 +7590,7 @@ define('ember-data/-private/system/relationship-meta', ['exports', 'ember-inflec
7616
7590
  }
7617
7591
 
7618
7592
  function relationshipFromMeta(meta) {
7619
- return {
7593
+ var result = {
7620
7594
  key: meta.key,
7621
7595
  kind: meta.kind,
7622
7596
  type: typeForRelationshipMeta(meta),
@@ -7625,6 +7599,12 @@ define('ember-data/-private/system/relationship-meta', ['exports', 'ember-inflec
7625
7599
  parentType: meta.parentType,
7626
7600
  isRelationship: true
7627
7601
  };
7602
+
7603
+ if (false) {
7604
+ result.parentType = meta.parentType;
7605
+ }
7606
+
7607
+ return result;
7628
7608
  }
7629
7609
  });
7630
7610
  define('ember-data/-private/system/relationships/belongs-to', ['exports', 'ember-data/-private/system/normalize-model-name'], function (exports, _normalizeModelName) {
@@ -8034,14 +8014,13 @@ define('ember-data/-private/system/relationships/relationship-payloads-manager',
8034
8014
  }
8035
8015
  }
8036
8016
 
8037
- var get = Ember.get;
8017
+ var _get = Ember.get;
8038
8018
 
8039
8019
  var RelationshipPayloadsManager = function () {
8040
8020
  function RelationshipPayloadsManager(store) {
8041
8021
  this._store = store;
8042
8022
  // cache of `RelationshipPayload`s
8043
8023
  this._cache = Object.create(null);
8044
- this._inverseLookupCache = new _relationshipPayloads.TypeCache();
8045
8024
  }
8046
8025
 
8047
8026
  /**
@@ -8062,7 +8041,9 @@ define('ember-data/-private/system/relationships/relationship-payloads-manager',
8062
8041
 
8063
8042
 
8064
8043
  RelationshipPayloadsManager.prototype.get = function get(modelName, id, relationshipName) {
8065
- var relationshipPayloads = this._getRelationshipPayloads(modelName, relationshipName, false);
8044
+ var modelClass = this._store._modelFor(modelName);
8045
+ var relationshipsByName = _get(modelClass, 'relationshipsByName');
8046
+ var relationshipPayloads = this._getRelationshipPayloads(modelName, relationshipName, modelClass, relationshipsByName, false);
8066
8047
  return relationshipPayloads && relationshipPayloads.get(modelName, id, relationshipName);
8067
8048
  };
8068
8049
 
@@ -8073,8 +8054,10 @@ define('ember-data/-private/system/relationships/relationship-payloads-manager',
8073
8054
  return;
8074
8055
  }
8075
8056
 
8057
+ var modelClass = this._store._modelFor(modelName);
8058
+ var relationshipsByName = _get(modelClass, 'relationshipsByName');
8076
8059
  Object.keys(relationshipsData).forEach(function (key) {
8077
- var relationshipPayloads = _this._getRelationshipPayloads(modelName, key, true);
8060
+ var relationshipPayloads = _this._getRelationshipPayloads(modelName, key, modelClass, relationshipsByName, true);
8078
8061
  if (relationshipPayloads) {
8079
8062
  relationshipPayloads.push(modelName, id, key, relationshipsData[key]);
8080
8063
  }
@@ -8085,153 +8068,51 @@ define('ember-data/-private/system/relationships/relationship-payloads-manager',
8085
8068
  var _this2 = this;
8086
8069
 
8087
8070
  var modelClass = this._store._modelFor(modelName);
8088
- var relationshipsByName = get(modelClass, 'relationshipsByName');
8071
+ var relationshipsByName = _get(modelClass, 'relationshipsByName');
8089
8072
  relationshipsByName.forEach(function (_, relationshipName) {
8090
- var relationshipPayloads = _this2._getRelationshipPayloads(modelName, relationshipName, false);
8073
+ var relationshipPayloads = _this2._getRelationshipPayloads(modelName, relationshipName, modelClass, relationshipsByName, false);
8091
8074
  if (relationshipPayloads) {
8092
8075
  relationshipPayloads.unload(modelName, id, relationshipName);
8093
8076
  }
8094
8077
  });
8095
8078
  };
8096
8079
 
8097
- RelationshipPayloadsManager.prototype._getRelationshipPayloads = function _getRelationshipPayloads(modelName, relationshipName, init) {
8098
- var relInfo = this.getRelationshipInfo(modelName, relationshipName);
8099
-
8100
- if (relInfo === null) {
8080
+ RelationshipPayloadsManager.prototype._getRelationshipPayloads = function _getRelationshipPayloads(modelName, relationshipName, modelClass, relationshipsByName, init) {
8081
+ if (!relationshipsByName.has(relationshipName)) {
8101
8082
  return;
8102
8083
  }
8103
8084
 
8104
- var cache = this._cache[relInfo.lhs_key];
8105
-
8106
- if (!cache && init) {
8107
- return this._initializeRelationshipPayloads(relInfo);
8085
+ var key = modelName + ':' + relationshipName;
8086
+ if (!this._cache[key] && init) {
8087
+ return this._initializeRelationshipPayloads(modelName, relationshipName, modelClass, relationshipsByName);
8108
8088
  }
8109
8089
 
8110
- return cache;
8090
+ return this._cache[key];
8111
8091
  };
8112
8092
 
8113
- RelationshipPayloadsManager.prototype.getRelationshipInfo = function getRelationshipInfo(modelName, relationshipName) {
8114
- var inverseCache = this._inverseLookupCache;
8115
- var store = this._store;
8116
- var cached = inverseCache.get(modelName, relationshipName);
8117
-
8118
- // CASE: We have a cached resolution (null if no relationship exists)
8119
- if (cached !== undefined) {
8120
- return cached;
8121
- }
8122
-
8123
- var modelClass = store._modelFor(modelName);
8124
- var relationshipsByName = get(modelClass, 'relationshipsByName');
8125
-
8126
- // CASE: We don't have a relationship at all
8127
- if (!relationshipsByName.has(relationshipName)) {
8128
- inverseCache.set(modelName, relationshipName, null);
8129
- return null;
8130
- }
8131
-
8132
- var inverseMeta = modelClass.inverseFor(relationshipName, store);
8093
+ RelationshipPayloadsManager.prototype._initializeRelationshipPayloads = function _initializeRelationshipPayloads(modelName, relationshipName, modelClass, relationshipsByName) {
8133
8094
  var relationshipMeta = relationshipsByName.get(relationshipName);
8134
- var selfIsPolymorphic = relationshipMeta.options !== undefined && relationshipMeta.options.polymorphic === true;
8135
- var inverseBaseModelName = relationshipMeta.type;
8136
-
8137
- // CASE: We have no inverse
8138
- if (!inverseMeta) {
8139
- var _info = {
8140
- lhs_key: modelName + ':' + relationshipName,
8141
- lhs_modelNames: [modelName],
8142
- lhs_baseModelName: modelName,
8143
- lhs_relationshipName: relationshipName,
8144
- lhs_relationshipMeta: relationshipMeta,
8145
- lhs_isPolymorphic: selfIsPolymorphic,
8146
- rhs_key: '',
8147
- rhs_modelNames: [],
8148
- rhs_baseModelName: inverseBaseModelName,
8149
- rhs_relationshipName: '',
8150
- rhs_relationshipMeta: null,
8151
- rhs_isPolymorphic: false,
8152
- hasInverse: false,
8153
- isSelfReferential: false, // modelName === inverseBaseModelName,
8154
- isReflexive: false
8155
- };
8156
-
8157
- inverseCache.set(modelName, relationshipName, _info);
8158
-
8159
- return _info;
8160
- }
8161
-
8162
- // CASE: We do have an inverse
8163
-
8164
- var inverseRelationshipName = inverseMeta.name;
8165
- var inverseRelationshipMeta = get(inverseMeta.type, 'relationshipsByName').get(inverseRelationshipName);
8166
- var baseModelName = inverseRelationshipMeta.type;
8167
- var isSelfReferential = baseModelName === inverseBaseModelName;
8168
-
8169
- // TODO we want to assert this but this breaks all of our shoddily written tests
8170
- /*
8171
- if (DEBUG) {
8172
- let inverseDoubleCheck = inverseMeta.type.inverseFor(inverseRelationshipName, store);
8173
- assert(`The ${inverseBaseModelName}:${inverseRelationshipName} relationship declares 'inverse: null', but it was resolved as the inverse for ${baseModelName}:${relationshipName}.`, inverseDoubleCheck);
8095
+ var inverseMeta = modelClass.inverseFor(relationshipName, this._store);
8096
+
8097
+ var inverseModelName = void 0;
8098
+ var inverseRelationshipName = void 0;
8099
+ var inverseRelationshipMeta = void 0;
8100
+
8101
+ // figure out the inverse relationship; we need two things
8102
+ // a) the inverse model name
8103
+ //- b) the name of the inverse relationship
8104
+ if (inverseMeta) {
8105
+ inverseRelationshipName = inverseMeta.name;
8106
+ inverseModelName = relationshipMeta.type;
8107
+ inverseRelationshipMeta = _get(inverseMeta.type, 'relationshipsByName').get(inverseRelationshipName);
8108
+ } else {
8109
+ // relationship has no inverse
8110
+ inverseModelName = inverseRelationshipName = '';
8111
+ inverseRelationshipMeta = null;
8174
8112
  }
8175
- */
8176
-
8177
- // CASE: We may have already discovered the inverse for the baseModelName
8178
- // CASE: We have already discovered the inverse
8179
- cached = inverseCache.get(baseModelName, relationshipName) || inverseCache.get(inverseBaseModelName, inverseRelationshipName);
8180
- if (cached) {
8181
- (false && Ember.assert('The ' + inverseBaseModelName + ':' + inverseRelationshipName + ' relationship declares \'inverse: null\', but it was resolved as the inverse for ' + baseModelName + ':' + relationshipName + '.', cached.hasInverse !== false));
8182
-
8183
-
8184
- var isLHS = cached.lhs_baseModelName === baseModelName;
8185
- var modelNames = isLHS ? cached.lhs_modelNames : cached.rhs_modelNames;
8186
- // make this lookup easier in the future by caching the key
8187
- modelNames.push(modelName);
8188
- inverseCache.set(modelName, relationshipName, cached);
8189
-
8190
- return cached;
8191
- }
8192
-
8193
- var info = {
8194
- lhs_key: baseModelName + ':' + relationshipName,
8195
- lhs_modelNames: [modelName],
8196
- lhs_baseModelName: baseModelName,
8197
- lhs_relationshipName: relationshipName,
8198
- lhs_relationshipMeta: relationshipMeta,
8199
- lhs_isPolymorphic: selfIsPolymorphic,
8200
- rhs_key: inverseBaseModelName + ':' + inverseRelationshipName,
8201
- rhs_modelNames: [],
8202
- rhs_baseModelName: inverseBaseModelName,
8203
- rhs_relationshipName: inverseRelationshipName,
8204
- rhs_relationshipMeta: inverseRelationshipMeta,
8205
- rhs_isPolymorphic: inverseRelationshipMeta.options !== undefined && inverseRelationshipMeta.options.polymorphic === true,
8206
- hasInverse: true,
8207
- isSelfReferential: isSelfReferential,
8208
- isReflexive: isSelfReferential && relationshipName === inverseRelationshipName
8209
- };
8210
-
8211
- // Create entries for the baseModelName as well as modelName to speed up
8212
- // inverse lookups
8213
- inverseCache.set(baseModelName, relationshipName, info);
8214
- inverseCache.set(modelName, relationshipName, info);
8215
-
8216
- // Greedily populate the inverse
8217
- inverseCache.set(inverseBaseModelName, inverseRelationshipName, info);
8218
-
8219
- return info;
8220
- };
8221
-
8222
- RelationshipPayloadsManager.prototype._initializeRelationshipPayloads = function _initializeRelationshipPayloads(relInfo) {
8223
- var lhsKey = relInfo.lhs_key;
8224
- var rhsKey = relInfo.rhs_key;
8225
- var existingPayloads = this._cache[lhsKey];
8226
-
8227
- if (relInfo.hasInverse === true && relInfo.rhs_isPolymorphic === true) {
8228
- existingPayloads = this._cache[rhsKey];
8229
8113
 
8230
- if (existingPayloads !== undefined) {
8231
- this._cache[lhsKey] = existingPayloads;
8232
- return existingPayloads;
8233
- }
8234
- }
8114
+ var lhsKey = modelName + ':' + relationshipName;
8115
+ var rhsKey = inverseModelName + ':' + inverseRelationshipName;
8235
8116
 
8236
8117
  // populate the cache for both sides of the relationship, as they both use
8237
8118
  // the same `RelationshipPayloads`.
@@ -8239,13 +8120,7 @@ define('ember-data/-private/system/relationships/relationship-payloads-manager',
8239
8120
  // This works out better than creating a single common key, because to
8240
8121
  // compute that key we would need to do work to look up the inverse
8241
8122
  //
8242
- var cache = this._cache[lhsKey] = new _relationshipPayloads.default(relInfo);
8243
-
8244
- if (relInfo.hasInverse === true) {
8245
- this._cache[rhsKey] = cache;
8246
- }
8247
-
8248
- return cache;
8123
+ return this._cache[lhsKey] = this._cache[rhsKey] = new _relationshipPayloads.default(this._store, modelName, relationshipName, relationshipMeta, inverseModelName, inverseRelationshipName, inverseRelationshipMeta);
8249
8124
  };
8250
8125
 
8251
8126
  return RelationshipPayloadsManager;
@@ -8258,6 +8133,12 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8258
8133
 
8259
8134
  exports.__esModule = true;
8260
8135
 
8136
+ function _classCallCheck(instance, Constructor) {
8137
+ if (!(instance instanceof Constructor)) {
8138
+ throw new TypeError("Cannot call a class as a function");
8139
+ }
8140
+ }
8141
+
8261
8142
  var _createClass = function () {
8262
8143
  function defineProperties(target, props) {
8263
8144
  for (var i = 0; i < props.length; i++) {
@@ -8276,57 +8157,35 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8276
8157
  };
8277
8158
  }();
8278
8159
 
8279
- function _classCallCheck(instance, Constructor) {
8280
- if (!(instance instanceof Constructor)) {
8281
- throw new TypeError("Cannot call a class as a function");
8282
- }
8283
- }
8284
-
8285
- var TypeCache = exports.TypeCache = function () {
8286
- function TypeCache() {
8287
- this.types = Object.create(null);
8288
- }
8289
-
8290
- TypeCache.prototype.get = function get(modelName, id) {
8291
- var types = this.types;
8292
-
8293
-
8294
- if (types[modelName] !== undefined) {
8295
- return types[modelName][id];
8296
- }
8297
- };
8298
-
8299
- TypeCache.prototype.set = function set(modelName, id, payload) {
8300
- var types = this.types;
8301
-
8302
- var typeMap = types[modelName];
8303
-
8304
- if (typeMap === undefined) {
8305
- typeMap = types[modelName] = Object.create(null);
8306
- }
8307
-
8308
- typeMap[id] = payload;
8309
- };
8310
-
8311
- TypeCache.prototype.delete = function _delete(modelName, id) {
8312
- var types = this.types;
8313
-
8314
-
8315
- if (types[modelName] !== undefined) {
8316
- delete types[modelName][id];
8317
- }
8318
- };
8160
+ var RelationshipPayloads = function () {
8161
+ function RelationshipPayloads(store, modelName, relationshipName, relationshipMeta, inverseModelName, inverseRelationshipName, inverseRelationshipMeta) {
8162
+ this._store = store;
8319
8163
 
8320
- return TypeCache;
8321
- }();
8164
+ this._lhsModelName = modelName;
8165
+ this._lhsRelationshipName = relationshipName;
8166
+ this._lhsRelationshipMeta = relationshipMeta;
8322
8167
 
8323
- var RelationshipPayloads = function () {
8324
- function RelationshipPayloads(relInfo) {
8325
- this._relInfo = relInfo;
8168
+ this._rhsModelName = inverseModelName;
8169
+ this._rhsRelationshipName = inverseRelationshipName;
8170
+ this._rhsRelationshipMeta = inverseRelationshipMeta;
8326
8171
 
8327
8172
  // a map of id -> payloads for the left hand side of the relationship.
8328
- this.lhs_payloads = new TypeCache();
8329
- this.rhs_payloads = relInfo.isReflexive ? this.lhs_payloads : new TypeCache();
8173
+ this._lhsPayloads = Object.create(null);
8174
+ if (modelName !== inverseModelName || relationshipName !== inverseRelationshipName) {
8175
+ // The common case of a non-reflexive relationship, or a reflexive
8176
+ // relationship whose inverse is not itself
8177
+ this._rhsPayloads = Object.create(null);
8178
+ this._isReflexive = false;
8179
+ } else {
8180
+ // Edge case when we have a reflexive relationship to itself
8181
+ // eg user hasMany friends inverse friends
8182
+ //
8183
+ // In this case there aren't really two sides to the relationship, but
8184
+ // we set `_rhsPayloads = _lhsPayloads` to make things easier to reason
8185
+ // about
8186
+ this._rhsPayloads = this._lhsPayloads;
8187
+ this._isReflexive = true;
8188
+ }
8330
8189
 
8331
8190
  // When we push relationship payloads, just stash them in a queue until
8332
8191
  // somebody actually asks for one of them.
@@ -8337,22 +8196,22 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8337
8196
  }
8338
8197
 
8339
8198
  /**
8340
- Get the payload for the relationship of an individual record.
8341
- This might return the raw payload as pushed into the store, or one computed
8342
- from the payload of the inverse relationship.
8343
- @method
8344
- */
8199
+ Get the payload for the relationship of an individual record.
8200
+ This might return the raw payload as pushed into the store, or one computed
8201
+ from the payload of the inverse relationship.
8202
+ @method
8203
+ */
8345
8204
 
8346
8205
 
8347
8206
  RelationshipPayloads.prototype.get = function get(modelName, id, relationshipName) {
8348
8207
  this._flushPending();
8349
8208
 
8350
8209
  if (this._isLHS(modelName, relationshipName)) {
8351
- return this.lhs_payloads.get(modelName, id);
8210
+ return this._lhsPayloads[id];
8352
8211
  } else {
8353
- (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._relInfo.lhs_key + '<->' + this._relInfo.rhs_key, this._isRHS(modelName, relationshipName)));
8212
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8354
8213
 
8355
- return this.rhs_payloads.get(modelName, id);
8214
+ return this._rhsPayloads[id];
8356
8215
  }
8357
8216
  };
8358
8217
 
@@ -8364,40 +8223,20 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8364
8223
  this._flushPending();
8365
8224
 
8366
8225
  if (this._isLHS(modelName, relationshipName)) {
8367
- delete this.lhs_payloads.delete(modelName, id);
8226
+ delete this._lhsPayloads[id];
8368
8227
  } else {
8369
- (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._relInfo.lhs_baseModelName + ':' + this._relInfo.lhs_relationshipName + '<->' + this._relInfo.rhs_baseModelName + ':' + this._relInfo.rhs_relationshipName, this._isRHS(modelName, relationshipName)));
8228
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8370
8229
 
8371
- delete this.rhs_payloads.delete(modelName, id);
8230
+ delete this._rhsPayloads[id];
8372
8231
  }
8373
8232
  };
8374
8233
 
8375
8234
  RelationshipPayloads.prototype._isLHS = function _isLHS(modelName, relationshipName) {
8376
- var relInfo = this._relInfo;
8377
- var isSelfReferential = relInfo.isSelfReferential;
8378
- var isRelationship = relationshipName === relInfo.lhs_relationshipName;
8379
-
8380
- if (isRelationship === true) {
8381
- return isSelfReferential === true || // itself
8382
- modelName === relInfo.lhs_baseModelName || // base or non-polymorphic
8383
- relInfo.lhs_modelNames.indexOf(modelName) !== -1; // polymorphic
8384
- }
8385
-
8386
- return false;
8235
+ return modelName === this._lhsModelName && relationshipName === this._lhsRelationshipName;
8387
8236
  };
8388
8237
 
8389
8238
  RelationshipPayloads.prototype._isRHS = function _isRHS(modelName, relationshipName) {
8390
- var relInfo = this._relInfo;
8391
- var isSelfReferential = relInfo.isSelfReferential;
8392
- var isRelationship = relationshipName === relInfo.rhs_relationshipName;
8393
-
8394
- if (isRelationship === true) {
8395
- return isSelfReferential === true || // itself
8396
- modelName === relInfo.rhs_baseModelName || // base or non-polymorphic
8397
- relInfo.rhs_modelNames.indexOf(modelName) !== -1; // polymorphic
8398
- }
8399
-
8400
- return false;
8239
+ return modelName === this._rhsModelName && relationshipName === this._rhsRelationshipName;
8401
8240
  };
8402
8241
 
8403
8242
  RelationshipPayloads.prototype._flushPending = function _flushPending() {
@@ -8418,28 +8257,26 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8418
8257
  id: id,
8419
8258
  type: modelName
8420
8259
  }
8421
- };
8422
8260
 
8423
- // start flushing this individual payload. The logic is the same whether
8424
- // it's for the left hand side of the relationship or the right hand side,
8425
- // except the role of primary and inverse idToPayloads is reversed
8426
- //
8427
- var previousPayload = void 0;
8428
- var payloadMap = void 0;
8429
- var inversePayloadMap = void 0;
8261
+ // start flushing this individual payload. The logic is the same whether
8262
+ // it's for the left hand side of the relationship or the right hand side,
8263
+ // except the role of primary and inverse idToPayloads is reversed
8264
+ //
8265
+ };var previousPayload = void 0;
8266
+ var idToPayloads = void 0;
8267
+ var inverseIdToPayloads = void 0;
8430
8268
  var inverseIsMany = void 0;
8431
-
8432
8269
  if (this._isLHS(modelName, relationshipName)) {
8433
- previousPayload = this.lhs_payloads.get(modelName, id);
8434
- payloadMap = this.lhs_payloads;
8435
- inversePayloadMap = this.rhs_payloads;
8270
+ previousPayload = this._lhsPayloads[id];
8271
+ idToPayloads = this._lhsPayloads;
8272
+ inverseIdToPayloads = this._rhsPayloads;
8436
8273
  inverseIsMany = this._rhsRelationshipIsMany;
8437
8274
  } else {
8438
- (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._relInfo.lhs_key + '<->' + this._relInfo.rhs_key, this._isRHS(modelName, relationshipName)));
8275
+ (false && Ember.assert(modelName + ':' + relationshipName + ' is not either side of this relationship, ' + this._lhsModelName + ':' + this._lhsRelationshipName + '<->' + this._rhsModelName + ':' + this._rhsRelationshipName, this._isRHS(modelName, relationshipName)));
8439
8276
 
8440
- previousPayload = this.rhs_payloads.get(modelName, id);
8441
- payloadMap = this.rhs_payloads;
8442
- inversePayloadMap = this.lhs_payloads;
8277
+ previousPayload = this._rhsPayloads[id];
8278
+ idToPayloads = this._rhsPayloads;
8279
+ inverseIdToPayloads = this._lhsPayloads;
8443
8280
  inverseIsMany = this._lhsRelationshipIsMany;
8444
8281
  }
8445
8282
 
@@ -8483,14 +8320,14 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8483
8320
  // * undefined is NOT considered new information, we should keep original state
8484
8321
  // * anything else is considered new information, and it should win
8485
8322
  if (relationshipData.data !== undefined) {
8486
- this._removeInverse(id, previousPayload, inversePayloadMap);
8323
+ this._removeInverse(id, previousPayload, inverseIdToPayloads);
8487
8324
  }
8488
- payloadMap.set(modelName, id, relationshipData);
8489
- this._populateInverse(relationshipData, inverseRelationshipData, inversePayloadMap, inverseIsMany);
8325
+ idToPayloads[id] = relationshipData;
8326
+ this._populateInverse(relationshipData, inverseRelationshipData, inverseIdToPayloads, inverseIsMany);
8490
8327
  }
8491
8328
  };
8492
8329
 
8493
- RelationshipPayloads.prototype._populateInverse = function _populateInverse(relationshipData, inversePayload, inversePayloadMap, inverseIsMany) {
8330
+ RelationshipPayloads.prototype._populateInverse = function _populateInverse(relationshipData, inversePayload, inverseIdToPayloads, inverseIsMany) {
8494
8331
  if (!relationshipData.data) {
8495
8332
  // This id doesn't have an inverse, eg a belongsTo with a payload
8496
8333
  // { data: null }, so there's nothing to populate
@@ -8499,24 +8336,22 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8499
8336
 
8500
8337
  if (Array.isArray(relationshipData.data)) {
8501
8338
  for (var i = 0; i < relationshipData.data.length; ++i) {
8502
- var resourceIdentifier = relationshipData.data[i];
8503
- this._addToInverse(inversePayload, resourceIdentifier, inversePayloadMap, inverseIsMany);
8339
+ var inverseId = relationshipData.data[i].id;
8340
+ this._addToInverse(inversePayload, inverseId, inverseIdToPayloads, inverseIsMany);
8504
8341
  }
8505
8342
  } else {
8506
- var _resourceIdentifier = relationshipData.data;
8507
- this._addToInverse(inversePayload, _resourceIdentifier, inversePayloadMap, inverseIsMany);
8343
+ var _inverseId = relationshipData.data.id;
8344
+ this._addToInverse(inversePayload, _inverseId, inverseIdToPayloads, inverseIsMany);
8508
8345
  }
8509
8346
  };
8510
8347
 
8511
- RelationshipPayloads.prototype._addToInverse = function _addToInverse(inversePayload, resourceIdentifier, inversePayloadMap, inverseIsMany) {
8512
- var relInfo = this._relInfo;
8513
-
8514
- if (relInfo.isReflexive && inversePayload.data.id === resourceIdentifier.id) {
8348
+ RelationshipPayloads.prototype._addToInverse = function _addToInverse(inversePayload, inverseId, inverseIdToPayloads, inverseIsMany) {
8349
+ if (this._isReflexive && inversePayload.data.id === inverseId) {
8515
8350
  // eg <user:1>.friends = [{ id: 1, type: 'user' }]
8516
8351
  return;
8517
8352
  }
8518
8353
 
8519
- var existingPayload = inversePayloadMap.get(resourceIdentifier.type, resourceIdentifier.id);
8354
+ var existingPayload = inverseIdToPayloads[inverseId];
8520
8355
  var existingData = existingPayload && existingPayload.data;
8521
8356
 
8522
8357
  if (existingData) {
@@ -8526,22 +8361,22 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8526
8361
  if (Array.isArray(existingData)) {
8527
8362
  existingData.push(inversePayload.data);
8528
8363
  } else {
8529
- inversePayloadMap.set(resourceIdentifier.type, resourceIdentifier.id, inversePayload);
8364
+ inverseIdToPayloads[inverseId] = inversePayload;
8530
8365
  }
8531
8366
  } else {
8532
8367
  // first time we're populating the inverse side
8533
8368
  //
8534
8369
  if (inverseIsMany) {
8535
- inversePayloadMap.set(resourceIdentifier.type, resourceIdentifier.id, {
8370
+ inverseIdToPayloads[inverseId] = {
8536
8371
  data: [inversePayload.data]
8537
- });
8372
+ };
8538
8373
  } else {
8539
- inversePayloadMap.set(resourceIdentifier.type, resourceIdentifier.id, inversePayload);
8374
+ inverseIdToPayloads[inverseId] = inversePayload;
8540
8375
  }
8541
8376
  }
8542
8377
  };
8543
8378
 
8544
- RelationshipPayloads.prototype._removeInverse = function _removeInverse(id, previousPayload, inversePayloadMap) {
8379
+ RelationshipPayloads.prototype._removeInverse = function _removeInverse(id, previousPayload, inverseIdToPayloads) {
8545
8380
  var data = previousPayload && previousPayload.data;
8546
8381
  if (!data) {
8547
8382
  // either this is the first time we've seen a payload for this id, or its
@@ -8556,16 +8391,15 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8556
8391
  if (Array.isArray(data)) {
8557
8392
  // TODO: diff rather than removeall addall?
8558
8393
  for (var i = 0; i < data.length; ++i) {
8559
- var resourceIdentifier = data[i];
8560
- this._removeFromInverse(id, resourceIdentifier, inversePayloadMap);
8394
+ this._removeFromInverse(id, data[i].id, inverseIdToPayloads);
8561
8395
  }
8562
8396
  } else {
8563
- this._removeFromInverse(id, data, inversePayloadMap);
8397
+ this._removeFromInverse(id, data.id, inverseIdToPayloads);
8564
8398
  }
8565
8399
  };
8566
8400
 
8567
- RelationshipPayloads.prototype._removeFromInverse = function _removeFromInverse(id, resourceIdentifier, inversePayloads) {
8568
- var inversePayload = inversePayloads.get(resourceIdentifier.type, resourceIdentifier.id);
8401
+ RelationshipPayloads.prototype._removeFromInverse = function _removeFromInverse(id, inverseId, inversePayloads) {
8402
+ var inversePayload = inversePayloads[inverseId];
8569
8403
  var data = inversePayload && inversePayload.data;
8570
8404
 
8571
8405
  if (!data) {
@@ -8577,23 +8411,21 @@ define('ember-data/-private/system/relationships/relationship-payloads', ['expor
8577
8411
  return x.id !== id;
8578
8412
  });
8579
8413
  } else {
8580
- inversePayloads.set(resourceIdentifier.type, resourceIdentifier.id, {
8414
+ inversePayloads[inverseId] = {
8581
8415
  data: null
8582
- });
8416
+ };
8583
8417
  }
8584
8418
  };
8585
8419
 
8586
8420
  _createClass(RelationshipPayloads, [{
8587
8421
  key: '_lhsRelationshipIsMany',
8588
8422
  get: function () {
8589
- var meta = this._relInfo.lhs_relationshipMeta;
8590
- return meta !== null && meta.kind === 'hasMany';
8423
+ return this._lhsRelationshipMeta && this._lhsRelationshipMeta.kind === 'hasMany';
8591
8424
  }
8592
8425
  }, {
8593
8426
  key: '_rhsRelationshipIsMany',
8594
8427
  get: function () {
8595
- var meta = this._relInfo.rhs_relationshipMeta;
8596
- return meta !== null && meta.kind === 'hasMany';
8428
+ return this._rhsRelationshipMeta && this._rhsRelationshipMeta.kind === 'hasMany';
8597
8429
  }
8598
8430
  }]);
8599
8431
 
@@ -8700,7 +8532,6 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8700
8532
  };
8701
8533
 
8702
8534
  BelongsToRelationship.prototype.inverseDidDematerialize = function inverseDidDematerialize() {
8703
- _Relationship.prototype.inverseDidDematerialize.call(this, this.inverseInternalModel);
8704
8535
  this.notifyBelongsToChanged();
8705
8536
  };
8706
8537
 
@@ -8717,12 +8548,6 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8717
8548
  }
8718
8549
  };
8719
8550
 
8720
- BelongsToRelationship.prototype.removeCompletelyFromInverse = function removeCompletelyFromInverse() {
8721
- _Relationship.prototype.removeCompletelyFromInverse.call(this);
8722
-
8723
- this.inverseInternalModel = null;
8724
- };
8725
-
8726
8551
  BelongsToRelationship.prototype.flushCanonical = function flushCanonical() {
8727
8552
  //temporary fix to not remove newly created records if server returned null.
8728
8553
  //TODO remove once we have proper diffing
@@ -8767,12 +8592,6 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8767
8592
  this.notifyBelongsToChanged();
8768
8593
  };
8769
8594
 
8770
- BelongsToRelationship.prototype.removeAllInternalModelsFromOwn = function removeAllInternalModelsFromOwn() {
8771
- _Relationship.prototype.removeAllInternalModelsFromOwn.call(this);
8772
- this.inverseInternalModel = null;
8773
- this.notifyBelongsToChanged();
8774
- };
8775
-
8776
8595
  BelongsToRelationship.prototype.notifyBelongsToChanged = function notifyBelongsToChanged() {
8777
8596
  this.internalModel.notifyBelongsToChanged(this.key);
8778
8597
  };
@@ -8785,11 +8604,6 @@ define('ember-data/-private/system/relationships/state/belongs-to', ['exports',
8785
8604
  _Relationship.prototype.removeCanonicalInternalModelFromOwn.call(this, internalModel);
8786
8605
  };
8787
8606
 
8788
- BelongsToRelationship.prototype.removeAllCanonicalInternalModelsFromOwn = function removeAllCanonicalInternalModelsFromOwn() {
8789
- _Relationship.prototype.removeAllCanonicalInternalModelsFromOwn.call(this);
8790
- this.canonicalState = null;
8791
- };
8792
-
8793
8607
  BelongsToRelationship.prototype.findRecord = function findRecord() {
8794
8608
  if (this.inverseInternalModel) {
8795
8609
  return this.store._findByInternalModel(this.inverseInternalModel);
@@ -9050,12 +8864,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9050
8864
  _this.belongsToType = relationshipMeta.type;
9051
8865
  _this.canonicalState = [];
9052
8866
  _this.isPolymorphic = relationshipMeta.options.polymorphic;
9053
- // The ManyArray for this relationship
9054
8867
  _this._manyArray = null;
9055
- // The previous ManyArray for this relationship. It will be destroyed when
9056
- // we create a new many array, but in the interim it will be updated if
9057
- // inverse internal models are unloaded.
9058
- _this._retainedManyArray = null;
9059
8868
  _this.__loadingPromise = null;
9060
8869
  return _this;
9061
8870
  }
@@ -9107,14 +8916,10 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9107
8916
  _Relationship.prototype.addCanonicalInternalModel.call(this, internalModel, idx);
9108
8917
  };
9109
8918
 
9110
- ManyRelationship.prototype.inverseDidDematerialize = function inverseDidDematerialize(inverseInternalModel) {
9111
- _Relationship.prototype.inverseDidDematerialize.call(this, inverseInternalModel);
9112
- if (this.isAsync) {
9113
- if (this._manyArray) {
9114
- this._retainedManyArray = this._manyArray;
9115
- this._manyArray = null;
9116
- }
9117
- this._removeInternalModelFromManyArray(this._retainedManyArray, inverseInternalModel);
8919
+ ManyRelationship.prototype.inverseDidDematerialize = function inverseDidDematerialize() {
8920
+ if (this._manyArray) {
8921
+ this._manyArray.destroy();
8922
+ this._manyArray = null;
9118
8923
  }
9119
8924
  this.notifyHasManyChanged();
9120
8925
  };
@@ -9143,12 +8948,6 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9143
8948
  _Relationship.prototype.removeCanonicalInternalModelFromOwn.call(this, internalModel, idx);
9144
8949
  };
9145
8950
 
9146
- ManyRelationship.prototype.removeAllCanonicalInternalModelsFromOwn = function removeAllCanonicalInternalModelsFromOwn() {
9147
- _Relationship.prototype.removeAllCanonicalInternalModelsFromOwn.call(this);
9148
- this.canonicalMembers.clear();
9149
- this.canonicalState.splice(0, this.canonicalState.length);
9150
- };
9151
-
9152
8951
  ManyRelationship.prototype.removeCompletelyFromOwn = function removeCompletelyFromOwn(internalModel) {
9153
8952
  _Relationship.prototype.removeCompletelyFromOwn.call(this, internalModel);
9154
8953
 
@@ -9181,33 +8980,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9181
8980
  return;
9182
8981
  }
9183
8982
  _Relationship.prototype.removeInternalModelFromOwn.call(this, internalModel, idx);
9184
- // note that ensuring the many array is created, via `this.manyArray`
9185
- // (instead of `this._manyArray`) is intentional.
9186
- //
9187
- // Because we're removing from local, and not canonical, state, it is
9188
- // important that the many array is initialized now with those changes,
9189
- // otherwise it will be initialized with canonical state and we'll have
9190
- // lost the fact that this internalModel was removed.
9191
- this._removeInternalModelFromManyArray(this.manyArray, internalModel, idx);
9192
- this._removeInternalModelFromManyArray(this._retainedManyArray, internalModel, idx);
9193
- };
9194
-
9195
- ManyRelationship.prototype.removeAllInternalModelsFromOwn = function removeAllInternalModelsFromOwn() {
9196
- _Relationship.prototype.removeAllInternalModelsFromOwn.call(this);
9197
- // as with removeInternalModelFromOwn, we make sure the many array is
9198
- // instantiated, or we'll lose local removals, as we're not updating
9199
- // canonical state here.
9200
- this.manyArray.clear();
9201
- if (this._retainedManyArray) {
9202
- this._retainedManyArray.clear();
9203
- }
9204
- };
9205
-
9206
- ManyRelationship.prototype._removeInternalModelFromManyArray = function _removeInternalModelFromManyArray(manyArray, internalModel, idx) {
9207
- if (manyArray === null) {
9208
- return;
9209
- }
9210
-
8983
+ var manyArray = this.manyArray;
9211
8984
  if (idx !== undefined) {
9212
8985
  //TODO(Igor) not used currently, fix
9213
8986
  manyArray.currentState.removeAt(idx);
@@ -9369,14 +9142,12 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9369
9142
  var manyArray = this._manyArray;
9370
9143
  if (manyArray) {
9371
9144
  manyArray.destroy();
9372
- this._manyArray = null;
9373
9145
  }
9374
9146
 
9375
9147
  var proxy = this.__loadingPromise;
9376
9148
 
9377
9149
  if (proxy) {
9378
9150
  proxy.destroy();
9379
- this.__loadingPromise = null;
9380
9151
  }
9381
9152
  };
9382
9153
 
@@ -9388,9 +9159,6 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9388
9159
  }, {
9389
9160
  key: 'manyArray',
9390
9161
  get: function () {
9391
- (false && Ember.assert('Error: relationship ' + this.parentType + ':' + this.key + ' has both many array and retained many array', this._manyArray === null || this._retainedManyArray === null));
9392
-
9393
-
9394
9162
  if (!this._manyArray) {
9395
9163
  this._manyArray = _manyArray.default.create({
9396
9164
  canonicalState: this.canonicalState,
@@ -9401,13 +9169,7 @@ define('ember-data/-private/system/relationships/state/has-many', ['exports', 'e
9401
9169
  meta: this.meta,
9402
9170
  isPolymorphic: this.isPolymorphic
9403
9171
  });
9404
-
9405
- if (this._retainedManyArray !== null) {
9406
- this._retainedManyArray.destroy();
9407
- this._retainedManyArray = null;
9408
- }
9409
9172
  }
9410
-
9411
9173
  return this._manyArray;
9412
9174
  }
9413
9175
  }]);
@@ -9460,7 +9222,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9460
9222
  }();
9461
9223
 
9462
9224
  var guidFor = Ember.guidFor;
9463
- var get = Ember.get;
9464
9225
 
9465
9226
  var Relationship = function () {
9466
9227
  function Relationship(store, internalModel, inverseKey, relationshipMeta) {
@@ -9482,52 +9243,34 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9482
9243
  this.meta = null;
9483
9244
  this.hasData = false;
9484
9245
  this.hasLoaded = false;
9485
- this.__inverseMeta = undefined;
9486
9246
  }
9487
9247
 
9488
9248
  Relationship.prototype._inverseIsAsync = function _inverseIsAsync() {
9489
- var inverseMeta = this._inverseMeta;
9490
- if (!inverseMeta) {
9249
+ if (!this.inverseKey || !this.inverseInternalModel) {
9491
9250
  return false;
9492
9251
  }
9493
-
9494
- var inverseAsync = inverseMeta.options.async;
9495
- return typeof inverseAsync === 'undefined' ? true : inverseAsync;
9496
- };
9497
-
9498
- Relationship.prototype._inverseIsSync = function _inverseIsSync() {
9499
- var inverseMeta = this._inverseMeta;
9500
- if (!inverseMeta) {
9501
- return false;
9502
- }
9503
-
9504
- var inverseAsync = inverseMeta.options.async;
9505
- return typeof inverseAsync === 'undefined' ? false : !inverseAsync;
9252
+ return this.inverseInternalModel._relationships.get(this.inverseKey).isAsync;
9506
9253
  };
9507
9254
 
9508
- Relationship.prototype.internalModelDidDematerialize = function internalModelDidDematerialize() {
9509
- var _this = this;
9510
-
9255
+ Relationship.prototype.removeInverseRelationships = function removeInverseRelationships() {
9511
9256
  if (!this.inverseKey) {
9512
9257
  return;
9513
9258
  }
9514
9259
 
9515
- this.forAllMembers(function (inverseInternalModel) {
9516
- var relationship = inverseInternalModel._relationships.get(_this.inverseKey);
9517
- relationship.inverseDidDematerialize(_this.internalModel);
9518
- });
9519
- };
9260
+ var allMembers =
9261
+ // we actually want a union of members and canonicalMembers
9262
+ // they should be disjoint but currently are not due to a bug
9263
+ this.members.list.concat(this.canonicalMembers.list);
9520
9264
 
9521
- Relationship.prototype.inverseDidDematerialize = function inverseDidDematerialize(inverseInternalModel) {
9522
- if (!this.isAsync) {
9523
- // unloading inverse of a sync relationship is treated as a client-side
9524
- // delete, so actually remove the models don't merely invalidate the cp
9525
- // cache.
9526
- this.removeInternalModelFromOwn(inverseInternalModel);
9527
- this.removeCanonicalInternalModelFromOwn(inverseInternalModel);
9265
+ for (var i = 0; i < allMembers.length; i++) {
9266
+ var inverseInternalModel = allMembers[i];
9267
+ var relationship = inverseInternalModel._relationships.get(this.inverseKey);
9268
+ relationship.inverseDidDematerialize();
9528
9269
  }
9529
9270
  };
9530
9271
 
9272
+ Relationship.prototype.inverseDidDematerialize = function inverseDidDematerialize() {};
9273
+
9531
9274
  Relationship.prototype.updateMeta = function updateMeta(meta) {
9532
9275
  this.meta = meta;
9533
9276
  };
@@ -9547,29 +9290,19 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9547
9290
  }
9548
9291
  };
9549
9292
 
9550
- Relationship.prototype.removeAllInternalModelsFromOwn = function removeAllInternalModelsFromOwn() {
9551
- this.members.clear();
9552
- this.internalModel.updateRecordArrays();
9553
- };
9554
-
9555
- Relationship.prototype.removeAllCanonicalInternalModelsFromOwn = function removeAllCanonicalInternalModelsFromOwn() {
9556
- this.canonicalMembers.clear();
9557
- this.flushCanonicalLater();
9558
- };
9559
-
9560
9293
  Relationship.prototype.removeInternalModels = function removeInternalModels(internalModels) {
9561
- var _this2 = this;
9294
+ var _this = this;
9562
9295
 
9563
9296
  internalModels.forEach(function (internalModel) {
9564
- return _this2.removeInternalModel(internalModel);
9297
+ return _this.removeInternalModel(internalModel);
9565
9298
  });
9566
9299
  };
9567
9300
 
9568
9301
  Relationship.prototype.addInternalModels = function addInternalModels(internalModels, idx) {
9569
- var _this3 = this;
9302
+ var _this2 = this;
9570
9303
 
9571
9304
  internalModels.forEach(function (internalModel) {
9572
- _this3.addInternalModel(internalModel, idx);
9305
+ _this2.addInternalModel(internalModel, idx);
9573
9306
  if (idx !== undefined) {
9574
9307
  idx++;
9575
9308
  }
@@ -9612,7 +9345,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9612
9345
  var _relationships = internalModel._implicitRelationships;
9613
9346
  var _relationship = _relationships[this.inverseKeyForImplicit];
9614
9347
  if (!_relationship) {
9615
- _relationship = _relationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync }, type: this.parentType });
9348
+ _relationship = _relationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync } });
9616
9349
  }
9617
9350
  _relationship.addCanonicalInternalModel(this.internalModel);
9618
9351
  }
@@ -9650,7 +9383,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9650
9383
  internalModel._relationships.get(this.inverseKey).addInternalModel(this.internalModel);
9651
9384
  } else {
9652
9385
  if (!internalModel._implicitRelationships[this.inverseKeyForImplicit]) {
9653
- internalModel._implicitRelationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync }, type: this.parentType });
9386
+ internalModel._implicitRelationships[this.inverseKeyForImplicit] = new Relationship(this.store, internalModel, this.key, { options: { async: this.isAsync } });
9654
9387
  }
9655
9388
  internalModel._implicitRelationships[this.inverseKeyForImplicit].addInternalModel(this.internalModel);
9656
9389
  }
@@ -9699,7 +9432,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9699
9432
  };
9700
9433
 
9701
9434
  Relationship.prototype.removeCompletelyFromInverse = function removeCompletelyFromInverse() {
9702
- var _this4 = this;
9435
+ var _this3 = this;
9703
9436
 
9704
9437
  if (!this.inverseKey) {
9705
9438
  return;
@@ -9714,7 +9447,7 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9714
9447
  var id = guidFor(inverseInternalModel);
9715
9448
 
9716
9449
  if (seen[id] === undefined) {
9717
- var relationship = inverseInternalModel._relationships.get(_this4.inverseKey);
9450
+ var relationship = inverseInternalModel._relationships.get(_this3.inverseKey);
9718
9451
  relationship.removeCompletelyFromOwn(internalModel);
9719
9452
  seen[id] = true;
9720
9453
  }
@@ -9722,32 +9455,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9722
9455
 
9723
9456
  this.members.forEach(unload);
9724
9457
  this.canonicalMembers.forEach(unload);
9725
-
9726
- if (!this.isAsync) {
9727
- this.clear();
9728
- }
9729
- };
9730
-
9731
- Relationship.prototype.forAllMembers = function forAllMembers(callback) {
9732
- var seen = Object.create(null);
9733
-
9734
- for (var i = 0; i < this.members.list.length; i++) {
9735
- var inverseInternalModel = this.members.list[i];
9736
- var id = guidFor(inverseInternalModel);
9737
- if (!seen[id]) {
9738
- seen[id] = true;
9739
- callback(inverseInternalModel);
9740
- }
9741
- }
9742
-
9743
- for (var _i = 0; _i < this.canonicalMembers.list.length; _i++) {
9744
- var _inverseInternalModel = this.canonicalMembers.list[_i];
9745
- var _id = guidFor(_inverseInternalModel);
9746
- if (!seen[_id]) {
9747
- seen[_id] = true;
9748
- callback(_inverseInternalModel);
9749
- }
9750
- }
9751
9458
  };
9752
9459
 
9753
9460
  Relationship.prototype.removeCompletelyFromOwn = function removeCompletelyFromOwn(internalModel) {
@@ -9770,8 +9477,8 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9770
9477
 
9771
9478
  //TODO(Igor) make this less abysmally slow
9772
9479
  this.members = this.canonicalMembers.copy();
9773
- for (var _i2 = 0; _i2 < newInternalModels.length; _i2++) {
9774
- this.members.add(newInternalModels[_i2]);
9480
+ for (var _i = 0; _i < newInternalModels.length; _i++) {
9481
+ this.members.add(newInternalModels[_i]);
9775
9482
  }
9776
9483
  };
9777
9484
 
@@ -9872,23 +9579,6 @@ define('ember-data/-private/system/relationships/state/relationship', ['exports'
9872
9579
  Relationship.prototype.destroy = function destroy() {};
9873
9580
 
9874
9581
  _createClass(Relationship, [{
9875
- key: '_inverseMeta',
9876
- get: function () {
9877
- if (this.__inverseMeta === undefined) {
9878
- var inverseMeta = null;
9879
-
9880
- if (this.inverseKey) {
9881
- var inverseModelClass = this.store.modelFor(this.relationshipMeta.type);
9882
- var inverseRelationships = get(inverseModelClass, 'relationshipsByName');
9883
- inverseMeta = inverseRelationships.get(this.inverseKey);
9884
- }
9885
-
9886
- this.__inverseMeta = inverseMeta;
9887
- }
9888
-
9889
- return this.__inverseMeta;
9890
- }
9891
- }, {
9892
9582
  key: 'parentType',
9893
9583
  get: function () {
9894
9584
  return this.internalModel.modelName;
@@ -10290,7 +9980,7 @@ define('ember-data/-private/system/snapshot', ['exports'], function (exports) {
10290
9980
 
10291
9981
  exports.default = Snapshot;
10292
9982
  });
10293
- define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adapters/errors', 'ember-data/-private/system/model/model', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/system/identity-map', '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/relationships/relationship-payloads-manager', '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/features'], function (exports, _errors, _model, _normalizeModelName, _identityMap, _promiseProxies, _common, _serializerResponse, _serializers, _relationshipPayloadsManager, _finders, _utils, _coerceId, _recordArrayManager, _containerInstanceCache, _internalModel5, _features) {
9983
+ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adapters/errors', 'ember-data/-private/system/model/model', 'ember-data/-private/system/normalize-model-name', 'ember-data/-private/system/identity-map', '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/relationships/relationship-payloads-manager', '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/model/internal-model', 'ember-data/-private/features'], function (exports, _errors, _model, _normalizeModelName, _identityMap, _promiseProxies, _common, _serializerResponse, _serializers, _relationshipPayloadsManager, _finders, _utils, _coerceId, _recordArrayManager, _internalModel5, _features) {
10294
9984
  'use strict';
10295
9985
 
10296
9986
  exports.__esModule = true;
@@ -10432,7 +10122,6 @@ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adap
10432
10122
  this.recordArrayManager = new _recordArrayManager.default({ store: this });
10433
10123
  this._identityMap = new _identityMap.default();
10434
10124
  this._pendingSave = [];
10435
- this._instanceCache = new _containerInstanceCache.default((0, _utils.getOwner)(this), this);
10436
10125
  this._modelFactoryCache = Object.create(null);
10437
10126
  this._relationshipsPayloads = new _relationshipPayloadsManager.default(this);
10438
10127
 
@@ -10458,7 +10147,8 @@ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adap
10458
10147
  }
10459
10148
  });
10460
10149
 
10461
- this._instanceCache = new _containerInstanceCache.default((0, _utils.getOwner)(this), this);
10150
+ this._adapterCache = Object.create(null);
10151
+ this._serializerCache = Object.create(null);
10462
10152
  },
10463
10153
 
10464
10154
 
@@ -12670,7 +12360,49 @@ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adap
12670
12360
 
12671
12361
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12672
12362
 
12673
- return this._instanceCache.get('adapter', normalizedModelName);
12363
+ var _adapterCache = this._adapterCache;
12364
+
12365
+ var adapter = _adapterCache[normalizedModelName];
12366
+ if (adapter) {
12367
+ return adapter;
12368
+ }
12369
+
12370
+ var owner = (0, _utils.getOwner)(this);
12371
+
12372
+ adapter = owner.lookup('adapter:' + normalizedModelName);
12373
+ if (adapter !== undefined) {
12374
+ set(adapter, 'store', this);
12375
+ _adapterCache[normalizedModelName] = adapter;
12376
+ return adapter;
12377
+ }
12378
+
12379
+ // no adapter found for the specific model, fallback and check for application adapter
12380
+ adapter = _adapterCache.application || owner.lookup('adapter:application');
12381
+ if (adapter !== undefined) {
12382
+ set(adapter, 'store', this);
12383
+ _adapterCache[normalizedModelName] = adapter;
12384
+ _adapterCache.application = adapter;
12385
+ return adapter;
12386
+ }
12387
+
12388
+ // no model specific adapter or application adapter, check for an `adapter`
12389
+ // property defined on the store
12390
+ var adapterName = this.get('adapter');
12391
+ adapter = _adapterCache[adapterName] || owner.lookup('adapter:' + adapterName);
12392
+ if (adapter !== undefined) {
12393
+ set(adapter, 'store', this);
12394
+ _adapterCache[normalizedModelName] = adapter;
12395
+ _adapterCache[adapterName] = adapter;
12396
+ return adapter;
12397
+ }
12398
+
12399
+ // final fallback, no model specific adapter, no application adapter, no
12400
+ // `adapter` property on store: use json-api adapter
12401
+ adapter = _adapterCache['-json-api'] || owner.lookup('adapter:-json-api');
12402
+ set(adapter, 'store', this);
12403
+ _adapterCache[normalizedModelName] = adapter;
12404
+ _adapterCache['-json-api'] = adapter;
12405
+ return adapter;
12674
12406
  },
12675
12407
 
12676
12408
 
@@ -12701,7 +12433,51 @@ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adap
12701
12433
 
12702
12434
  var normalizedModelName = (0, _normalizeModelName.default)(modelName);
12703
12435
 
12704
- return this._instanceCache.get('serializer', normalizedModelName);
12436
+ var _serializerCache = this._serializerCache;
12437
+
12438
+ var serializer = _serializerCache[normalizedModelName];
12439
+ if (serializer) {
12440
+ return serializer;
12441
+ }
12442
+
12443
+ var owner = (0, _utils.getOwner)(this);
12444
+
12445
+ serializer = owner.lookup('serializer:' + normalizedModelName);
12446
+ if (serializer !== undefined) {
12447
+ set(serializer, 'store', this);
12448
+ _serializerCache[normalizedModelName] = serializer;
12449
+ return serializer;
12450
+ }
12451
+
12452
+ // no serializer found for the specific model, fallback and check for application serializer
12453
+ serializer = _serializerCache.application || owner.lookup('serializer:application');
12454
+ if (serializer !== undefined) {
12455
+ set(serializer, 'store', this);
12456
+ _serializerCache[normalizedModelName] = serializer;
12457
+ _serializerCache.application = serializer;
12458
+ return serializer;
12459
+ }
12460
+
12461
+ // no model specific serializer or application serializer, check for the `defaultSerializer`
12462
+ // property defined on the adapter
12463
+ var adapter = this.adapterFor(modelName);
12464
+ var serializerName = get(adapter, 'defaultSerializer');
12465
+ serializer = _serializerCache[serializerName] || owner.lookup('serializer:' + serializerName);
12466
+ if (serializer !== undefined) {
12467
+ set(serializer, 'store', this);
12468
+ _serializerCache[normalizedModelName] = serializer;
12469
+ _serializerCache[serializerName] = serializer;
12470
+ return serializer;
12471
+ }
12472
+
12473
+ // final fallback, no model specific serializer, no application serializer, no
12474
+ // `serializer` property on store: use json-api serializer
12475
+ serializer = _serializerCache['-default'] || owner.lookup('serializer:-default');
12476
+ set(serializer, 'store', this);
12477
+ _serializerCache[normalizedModelName] = serializer;
12478
+ _serializerCache['-default'] = serializer;
12479
+
12480
+ return serializer;
12705
12481
  },
12706
12482
  lookupAdapter: function (name) {
12707
12483
  (false && !(false) && Ember.deprecate('Use of lookupAdapter is deprecated, use adapterFor instead.', false, {
@@ -12723,7 +12499,9 @@ define('ember-data/-private/system/store', ['exports', 'ember-data/-private/adap
12723
12499
  this._super.apply(this, arguments);
12724
12500
  this._pushedInternalModels = null;
12725
12501
  this.recordArrayManager.destroy();
12726
- this._instanceCache.destroy();
12502
+
12503
+ this._adapterCache = null;
12504
+ this._serializerCache = null;
12727
12505
 
12728
12506
  this.unloadAll();
12729
12507
  },
@@ -12960,110 +12738,6 @@ define('ember-data/-private/system/store/common', ['exports'], function (exports
12960
12738
  return !(get(object, "isDestroyed") || get(object, "isDestroying"));
12961
12739
  }
12962
12740
  });
12963
- define('ember-data/-private/system/store/container-instance-cache', ['exports'], function (exports) {
12964
- 'use strict';
12965
-
12966
- exports.__esModule = true;
12967
-
12968
- function _classCallCheck(instance, Constructor) {
12969
- if (!(instance instanceof Constructor)) {
12970
- throw new TypeError("Cannot call a class as a function");
12971
- }
12972
- }
12973
-
12974
- var set = Ember.set;
12975
-
12976
- var ContainerInstanceCache = function () {
12977
- function ContainerInstanceCache(owner, store) {
12978
- this.isDestroying = false;
12979
- this.isDestroyed = false;
12980
- this._owner = owner;
12981
- this._store = store;
12982
- this._namespaces = {
12983
- adapter: Object.create(null),
12984
- serializer: Object.create(null)
12985
- };
12986
- }
12987
-
12988
- ContainerInstanceCache.prototype.get = function get(namespace, preferredKey) {
12989
- var cache = this._namespaces[namespace];
12990
-
12991
- if (cache[preferredKey]) {
12992
- return cache[preferredKey];
12993
- }
12994
-
12995
- var preferredLookupKey = namespace + ':' + preferredKey;
12996
-
12997
- var instance = this._instanceFor(preferredLookupKey) || this._findInstance(namespace, this._fallbacksFor(namespace, preferredKey));
12998
- if (instance) {
12999
- cache[preferredKey] = instance;
13000
- set(instance, 'store', this._store);
13001
- }
13002
-
13003
- return cache[preferredKey];
13004
- };
13005
-
13006
- ContainerInstanceCache.prototype._fallbacksFor = function _fallbacksFor(namespace, preferredKey) {
13007
- if (namespace === 'adapter') {
13008
- return ['application', this._store.get('adapter'), '-json-api'];
13009
- }
13010
-
13011
- // serializer
13012
- return ['application', this.get('adapter', preferredKey).get('defaultSerializer'), '-default'];
13013
- };
13014
-
13015
- ContainerInstanceCache.prototype._findInstance = function _findInstance(namespace, fallbacks) {
13016
- var cache = this._namespaces[namespace];
13017
-
13018
- for (var i = 0, length = fallbacks.length; i < length; i++) {
13019
- var fallback = fallbacks[i];
13020
-
13021
- if (cache[fallback]) {
13022
- return cache[fallback];
13023
- }
13024
-
13025
- var lookupKey = namespace + ':' + fallback;
13026
- var instance = this._instanceFor(lookupKey);
13027
-
13028
- if (instance) {
13029
- cache[fallback] = instance;
13030
- return instance;
13031
- }
13032
- }
13033
- };
13034
-
13035
- ContainerInstanceCache.prototype._instanceFor = function _instanceFor(key) {
13036
- return this._owner.lookup(key);
13037
- };
13038
-
13039
- ContainerInstanceCache.prototype.destroyCache = function destroyCache(cache) {
13040
- var cacheEntries = Object.keys(cache);
13041
-
13042
- for (var i = 0, length = cacheEntries.length; i < length; i++) {
13043
- var cacheKey = cacheEntries[i];
13044
- var cacheEntry = cache[cacheKey];
13045
- if (cacheEntry) {
13046
- cacheEntry.destroy();
13047
- }
13048
- }
13049
- };
13050
-
13051
- ContainerInstanceCache.prototype.destroy = function destroy() {
13052
- this.isDestroying = true;
13053
- this.destroyCache(this._namespaces.adapter);
13054
- this.destroyCache(this._namespaces.serializer);
13055
- this.isDestroyed = true;
13056
- };
13057
-
13058
- ContainerInstanceCache.prototype.toString = function toString() {
13059
- return 'ContainerInstanceCache';
13060
- };
13061
-
13062
- return ContainerInstanceCache;
13063
- }();
13064
-
13065
- exports.default = ContainerInstanceCache;
13066
- });
13067
12741
  define('ember-data/-private/system/store/finders', ['exports', 'ember-data/-private/system/store/common', 'ember-data/-private/system/store/serializer-response', 'ember-data/-private/system/store/serializers'], function (exports, _common, _serializerResponse, _serializers) {
13068
12742
  'use strict';
13069
12743
 
@@ -15394,10 +15068,7 @@ define('ember-data/attr', ['exports'], function (exports) {
15394
15068
  return options.defaultValue.apply(null, arguments);
15395
15069
  } else {
15396
15070
  var defaultValue = options.defaultValue;
15397
- (false && !(typeof defaultValue !== 'object' || defaultValue === null) && Ember.deprecate('Non primitive defaultValues are deprecated because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.', typeof defaultValue !== 'object' || defaultValue === null, {
15398
- id: 'ds.defaultValue.complex-object',
15399
- until: '3.0.0'
15400
- }));
15071
+ (false && Ember.assert('Non primitive defaultValues are not supported because they are shared between all instances. If you would like to use a complex object as a default value please provide a function that returns the complex object.', typeof defaultValue !== 'object' || defaultValue === null));
15401
15072
 
15402
15073
  return defaultValue;
15403
15074
  }
@@ -15661,10 +15332,6 @@ define('ember-data/initialize-store-service', ['exports'], function (exports) {
15661
15332
 
15662
15333
  exports.__esModule = true;
15663
15334
  exports.default = initializeStoreService;
15664
-
15665
-
15666
- var deprecateOldEmberDataInitializers = void 0;
15667
-
15668
15335
  /*
15669
15336
  Configures a registry for use with an Ember-Data
15670
15337
  store.
@@ -15679,61 +15346,8 @@ define('ember-data/initialize-store-service', ['exports'], function (exports) {
15679
15346
 
15680
15347
  // Eagerly generate the store so defaultStore is populated.
15681
15348
  container.lookup('service:store');
15682
-
15683
- if (false) {
15684
- // In Ember 2.4+ instance.base is the `Ember.Application` or `Ember.Engine` instance
15685
- // In Ember 1.11 - 2.3 we fallback to `instance.application`
15686
- var base = instance.base || instance.application;
15687
- deprecateOldEmberDataInitializers(base.constructor.initializers);
15688
- }
15689
- }
15690
-
15691
- if (false) {
15692
- var DEPRECATED_INITIALIZER_NAMES = ['data-adapter', 'injectStore', 'transforms', 'store'];
15693
-
15694
- var matchesDeprecatedInititalizer = function matchesDeprecatedInititalizer(name) {
15695
- return DEPRECATED_INITIALIZER_NAMES.indexOf(name) !== -1;
15696
- };
15697
-
15698
- var warnForDeprecatedInitializers = function warnForDeprecatedInitializers(initializer) {
15699
- var deprecatedBeforeInitializer = matchesDeprecatedInititalizer(initializer.before);
15700
- var deprecatedAfterInitializer = matchesDeprecatedInititalizer(initializer.after);
15701
- var deprecatedProp = deprecatedBeforeInitializer ? 'before' : 'after';
15702
-
15703
- (false && !(!(deprecatedBeforeInitializer || deprecatedAfterInitializer)) && Ember.deprecate('The initializer `' + initializer[deprecatedProp] + '` has been deprecated. Please update your `' + initializer.name + '` initializer to use use `' + deprecatedProp + ': \'ember-data\'` instead.', !(deprecatedBeforeInitializer || deprecatedAfterInitializer), {
15704
- id: 'ds.deprecated-initializers',
15705
- until: '3.0.0'
15706
- }));
15707
- };
15708
-
15709
- deprecateOldEmberDataInitializers = function deprecateOldEmberDataInitializers(initializers) {
15710
- // collect all of the initializers
15711
- var keys = Object.keys(initializers);
15712
-
15713
- for (var i = 0; i < keys.length; i++) {
15714
- var name = keys[i];
15715
-
15716
- // filter out all of the Ember Data initializer. We have some
15717
- // deprecated initializers that depend on other deprecated
15718
- // initializers which may trigger the deprecation warning
15719
- // unintentionally.
15720
- if (!matchesDeprecatedInititalizer(name)) {
15721
- warnForDeprecatedInitializers(initializers[name]);
15722
- }
15723
- }
15724
- };
15725
15349
  }
15726
15350
  });
15727
- define('ember-data/initializers/data-adapter', ['exports'], function (exports) {
15728
- 'use strict';
15729
-
15730
- exports.__esModule = true;
15731
- exports.default = {
15732
- name: 'data-adapter',
15733
- before: 'store',
15734
- initialize: function () {}
15735
- };
15736
- });
15737
15351
  define('ember-data/initializers/ember-data', ['exports', 'ember-data/setup-container', 'ember-data'], function (exports, _setupContainer) {
15738
15352
  'use strict';
15739
15353
 
@@ -15743,36 +15357,6 @@ define('ember-data/initializers/ember-data', ['exports', 'ember-data/setup-conta
15743
15357
  initialize: _setupContainer.default
15744
15358
  };
15745
15359
  });
15746
- define('ember-data/initializers/injectStore', ['exports'], function (exports) {
15747
- 'use strict';
15748
-
15749
- exports.__esModule = true;
15750
- exports.default = {
15751
- name: 'injectStore',
15752
- before: 'store',
15753
- initialize: function () {}
15754
- };
15755
- });
15756
- define('ember-data/initializers/store', ['exports'], function (exports) {
15757
- 'use strict';
15758
-
15759
- exports.__esModule = true;
15760
- exports.default = {
15761
- name: 'store',
15762
- after: 'ember-data',
15763
- initialize: function () {}
15764
- };
15765
- });
15766
- define('ember-data/initializers/transforms', ['exports'], function (exports) {
15767
- 'use strict';
15768
-
15769
- exports.__esModule = true;
15770
- exports.default = {
15771
- name: 'transforms',
15772
- before: 'store',
15773
- initialize: function () {}
15774
- };
15775
- });
15776
15360
  define("ember-data/instance-initializers/ember-data", ["exports", "ember-data/initialize-store-service"], function (exports, _initializeStoreService) {
15777
15361
  "use strict";
15778
15362
 
@@ -16617,7 +16201,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16617
16201
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
16618
16202
  (false && !(false) && Ember.deprecate("You are using modelNameFromPayloadKey to normalize the type for a relationship. This has been deprecated in favor of modelNameFromPayloadType", false, {
16619
16203
  id: 'ds.json-api-serializer.deprecated-model-name-for-relationship',
16620
- until: '3.0.0'
16204
+ until: '4.0.0'
16621
16205
  }));
16622
16206
 
16623
16207
 
@@ -16649,7 +16233,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16649
16233
  if (modelName !== deprecatedModelNameLookup && this._hasCustomModelNameFromPayloadKey()) {
16650
16234
  (false && !(false) && Ember.deprecate("You are using modelNameFromPayloadKey to normalize the type for a resource. This has been deprecated in favor of modelNameFromPayloadType", false, {
16651
16235
  id: 'ds.json-api-serializer.deprecated-model-name-for-resource',
16652
- until: '3.0.0'
16236
+ until: '4.0.0'
16653
16237
  }));
16654
16238
 
16655
16239
 
@@ -16825,7 +16409,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16825
16409
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16826
16410
  (false && !(false) && Ember.deprecate("You used payloadKeyFromModelName to customize how a type is serialized. Use payloadTypeFromModelName instead.", false, {
16827
16411
  id: 'ds.json-api-serializer.deprecated-payload-type-for-model',
16828
- until: '3.0.0'
16412
+ until: '4.0.0'
16829
16413
  }));
16830
16414
 
16831
16415
 
@@ -16884,7 +16468,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16884
16468
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16885
16469
  (false && !(false) && Ember.deprecate("You used payloadKeyFromModelName to serialize type for belongs-to relationship. Use payloadTypeFromModelName instead.", false, {
16886
16470
  id: 'ds.json-api-serializer.deprecated-payload-type-for-belongs-to',
16887
- until: '3.0.0'
16471
+ until: '4.0.0'
16888
16472
  }));
16889
16473
 
16890
16474
 
@@ -16906,12 +16490,8 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16906
16490
  },
16907
16491
  serializeHasMany: function (snapshot, json, relationship) {
16908
16492
  var key = relationship.key;
16909
- var shouldSerializeHasMany = '_shouldSerializeHasMany';
16910
- if ((0, _private.isEnabled)("ds-check-should-serialize-relationships")) {
16911
- shouldSerializeHasMany = 'shouldSerializeHasMany';
16912
- }
16913
16493
 
16914
- if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
16494
+ if (this.shouldSerializeHasMany(snapshot, key, relationship)) {
16915
16495
  var hasMany = snapshot.hasMany(key);
16916
16496
  if (hasMany !== undefined) {
16917
16497
 
@@ -16936,7 +16516,7 @@ define('ember-data/serializers/json-api', ['exports', 'ember-inflector', 'ember-
16936
16516
  if (payloadType !== deprecatedPayloadTypeLookup && this._hasCustomPayloadKeyFromModelName()) {
16937
16517
  (false && !(false) && Ember.deprecate("You used payloadKeyFromModelName to serialize type for belongs-to relationship. Use payloadTypeFromModelName instead.", false, {
16938
16518
  id: 'ds.json-api-serializer.deprecated-payload-type-for-has-many',
16939
- until: '3.0.0'
16519
+ until: '4.0.0'
16940
16520
  }));
16941
16521
 
16942
16522
 
@@ -17502,16 +17082,6 @@ define('ember-data/serializers/json', ['exports', 'ember-data/serializer', 'embe
17502
17082
  return attrs && attrs[key] && attrs[key].serialize === true;
17503
17083
  },
17504
17084
  shouldSerializeHasMany: function (snapshot, key, relationship) {
17505
- if (this._shouldSerializeHasMany !== JSONSerializer.prototype._shouldSerializeHasMany) {
17506
- (false && !(false) && Ember.deprecate('The private method _shouldSerializeHasMany has been promoted to the public API. Please remove the underscore to use the public shouldSerializeHasMany method.', false, {
17507
- id: 'ds.serializer.private-should-serialize-has-many',
17508
- until: '3.0.0'
17509
- }));
17510
- }
17511
-
17512
- return this._shouldSerializeHasMany(snapshot, key, relationship);
17513
- },
17514
- _shouldSerializeHasMany: function (snapshot, key, relationship) {
17515
17085
  var relationshipType = snapshot.type.determineRelationshipType(relationship, this.store);
17516
17086
  if (this._mustSerialize(key)) {
17517
17087
  return true;
@@ -17599,12 +17169,8 @@ define('ember-data/serializers/json', ['exports', 'ember-data/serializer', 'embe
17599
17169
  },
17600
17170
  serializeHasMany: function (snapshot, json, relationship) {
17601
17171
  var key = relationship.key;
17602
- var shouldSerializeHasMany = '_shouldSerializeHasMany';
17603
- if ((0, _private.isEnabled)("ds-check-should-serialize-relationships")) {
17604
- shouldSerializeHasMany = 'shouldSerializeHasMany';
17605
- }
17606
17172
 
17607
- if (this[shouldSerializeHasMany](snapshot, key, relationship)) {
17173
+ if (this.shouldSerializeHasMany(snapshot, key, relationship)) {
17608
17174
  var hasMany = snapshot.hasMany(key, { ids: true });
17609
17175
  if (hasMany !== undefined) {
17610
17176
  // if provided, use the mapping provided by `attrs` in
@@ -18037,25 +17603,6 @@ define('ember-data/serializers/rest', ['exports', 'ember-inflector', 'ember-data
18037
17603
  var typeKey = this.keyForPolymorphicType(key, relationship.type, 'serialize');
18038
17604
  var belongsTo = snapshot.belongsTo(key);
18039
17605
 
18040
- // old way of getting the key for the polymorphic type
18041
- key = this.keyForAttribute ? this.keyForAttribute(key, "serialize") : key;
18042
- key = key + 'Type';
18043
-
18044
- // The old way of serializing the type of a polymorphic record used
18045
- // `keyForAttribute`, which is not correct. The next code checks if the old
18046
- // way is used and if it differs from the new way of using
18047
- // `keyForPolymorphicType`. If this is the case, a deprecation warning is
18048
- // logged and the old way is restored (so nothing breaks).
18049
- if (key !== typeKey && this.keyForPolymorphicType === RESTSerializer.prototype.keyForPolymorphicType) {
18050
- (false && !(false) && Ember.deprecate("The key to serialize the type of a polymorphic record is created via keyForAttribute which has been deprecated. Use the keyForPolymorphicType hook instead.", false, {
18051
- id: 'ds.rest-serializer.deprecated-key-for-polymorphic-type',
18052
- until: '3.0.0'
18053
- }));
18054
-
18055
-
18056
- typeKey = key;
18057
- }
18058
-
18059
17606
  if (isNone(belongsTo)) {
18060
17607
  json[typeKey] = null;
18061
17608
  } else {
@@ -18187,12 +17734,9 @@ define('ember-data/setup-container', ['exports', 'ember-data/-private', 'ember-d
18187
17734
  @param {Ember.Registry} registry
18188
17735
  */
18189
17736
  function initializeStore(registry) {
18190
- // registry.optionsForType for Ember < 2.1.0
18191
- // application.registerOptionsForType for Ember 2.1.0+
18192
17737
  var registerOptionsForType = registry.registerOptionsForType || registry.optionsForType;
18193
17738
  registerOptionsForType.call(registry, 'serializer', { singleton: false });
18194
17739
  registerOptionsForType.call(registry, 'adapter', { singleton: false });
18195
-
18196
17740
  registry.register('serializer:-default', _json.default);
18197
17741
  registry.register('serializer:-rest', _rest.default);
18198
17742
  registry.register('adapter:-rest', _rest2.default);
@@ -18311,54 +17855,6 @@ define('ember-data/transforms/date', ['exports', 'ember-data/transforms/transfor
18311
17855
  'use strict';
18312
17856
 
18313
17857
  exports.__esModule = true;
18314
-
18315
-
18316
- Ember.Date = Ember.Date || {};
18317
-
18318
- /**
18319
- Date.parse with progressive enhancement for ISO 8601 <https://github.com/csnover/js-iso8601>
18320
-
18321
- © 2011 Colin Snover <http://zetafleet.com>
18322
-
18323
- Released under MIT license.
18324
-
18325
- @class Date
18326
- @namespace Ember
18327
- @static
18328
- @deprecated
18329
- */
18330
- Ember.Date.parse = function (date) {
18331
- (false && !(false) && Ember.deprecate('Ember.Date.parse is deprecated because Safari 5-, IE8-, and\n Firefox 3.6- are no longer supported (see\n https://github.com/csnover/js-iso8601 for the history of this issue).\n Please use Date.parse instead', false, {
18332
- id: 'ds.ember.date.parse-deprecate',
18333
- until: '3.0.0'
18334
- }));
18335
-
18336
-
18337
- return Date.parse(date);
18338
- };
18339
-
18340
- /**
18341
- The `DS.DateTransform` class is used to serialize and deserialize
18342
- date attributes on Ember Data record objects. This transform is used
18343
- when `date` is passed as the type parameter to the
18344
- [DS.attr](../../data#method_attr) function. It uses the [`ISO 8601`](https://en.wikipedia.org/wiki/ISO_8601)
18345
- standard.
18346
-
18347
- ```app/models/score.js
18348
- import DS from 'ember-data';
18349
-
18350
- export default DS.Model.extend({
18351
- value: DS.attr('number'),
18352
- player: DS.belongsTo('player'),
18353
- date: DS.attr('date')
18354
- });
18355
- ```
18356
-
18357
- @class DateTransform
18358
- @extends DS.Transform
18359
- @namespace DS
18360
- */
18361
-
18362
17858
  exports.default = _transform.default.extend({
18363
17859
  deserialize: function (serialized) {
18364
17860
  var type = typeof serialized;
@@ -18366,16 +17862,7 @@ define('ember-data/transforms/date', ['exports', 'ember-data/transforms/transfor
18366
17862
  if (type === "string") {
18367
17863
  var offset = serialized.indexOf('+');
18368
17864
 
18369
- if (offset !== -1 && serialized.length - 3 === offset) {
18370
- (false && !(false) && Ember.deprecate('The ECMA2015 Spec for ISO 8601 dates does not allow for shorthand timezone offsets such as +00.\n Ember Data\'s normalization of date\'s allowing for this shorthand has been deprecated, please update your API to return\n UTC dates formatted with \xB1hh:mm timezone offsets or implement a custom UTC transform.', false, {
18371
- id: 'ds.attr.date.normalize-utc',
18372
- until: '3.0.0'
18373
- }));
18374
-
18375
- return new Date(serialized + ':00');
18376
-
18377
- // this is a phantom specific bug fix in which +0000 is not supported
18378
- } else if (offset !== -1 && serialized.length - 5 === offset) {
17865
+ if (offset !== -1 && serialized.length - 5 === offset) {
18379
17866
  offset += 3;
18380
17867
  return new Date(serialized.slice(0, offset) + ':' + serialized.slice(offset));
18381
17868
  }
@@ -18515,7 +18002,7 @@ define("ember-data/version", ["exports"], function (exports) {
18515
18002
  "use strict";
18516
18003
 
18517
18004
  exports.__esModule = true;
18518
- exports.default = "2.18.3";
18005
+ exports.default = "3.0.0-beta.1";
18519
18006
  });
18520
18007
  define("ember-inflector", ["module", "exports", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _system) {
18521
18008
  "use strict";