{"version":3,"sources":["ember-pardon.js","ember-pardon/index.js","ember-pardon/mixins/ember-pardon.js"],"sourcesContent":["define(\"ember-pardon\", [\"ember-pardon/index\",\"exports\"], function(__index__, __exports__) {\n  \"use strict\";\n  Object.keys(__index__).forEach(function(key){\n    __exports__[key] = __index__[key];\n  });\n});\n","define('ember-pardon/index', ['exports', 'ember-pardon/mixins/ember-pardon'], function (exports, EmberPardon) {\n\n\t'use strict';\n\n\texports['default'] = EmberPardon['default'];\n\n});","define('ember-pardon/mixins/ember-pardon', ['exports', 'ember'], function (exports, Ember) {\n\n\t'use strict';\n\n\tvar EmberPardon = Ember['default'].Mixin.create({\n\t\tbeforeDestroy: Ember['default'].K,\n\t\tisPardoned:false,\n\t\t_isPardoned:false,\n\t\t_pardonedChildren:Ember['default'].A(),\n\t\t_pardonOnPardonChange:function(){\n\t\t\tthis._setPardon(this.get('isPardoned'));\n\t\t}.observes('isPardoned'),\n\t\t_setPardon:function(value){\n\t\t\tthis._isPardoned = value;\n\t\t\tthis.set('isPardoned', value);\n\t\t\tthis._pardonCheckVirtualParent();\n\t\t},\n\t\t_pardonCheckVirtualParent:function(){\n\t\t\tif (!this._parentView){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this._parentView.isVirtual || !EmberPardon.detect(this._parentView)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (this._isPardoned){\n\t\t\t\tthis._parentView.pardonChild(this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._parentView.unpardonChild(this);\n\t\t},\n\t\tinit:function(){\n\t\t\tthis._super.apply(this, arguments);\n\t\t\tthis._isPardoned = this.get('isPardoned');\n\t\t},\n\t\tpardon:function(){\n\t\t\tif (this._state === 'destroying'){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._setPardon(true);\n\t\t\tthis._pardonCheckVirtualParent();\n\t\t},\n\t\tunpardon:function(){\n\t\t\tif (this._state === 'destroying'){\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._setPardon(false);\n\t\t},\n\t\tpardonChild:function(child){\n\t\t\tthis._pardonedChildren.addObject(child);\n\t\t\tthis._setPardon(true);\n\t\t},\n\t\tunpardonChild:function(child){\n\t\t\tthis._pardonedChildren.removeObject(child);\n\t\t\tif (this._pardonedChildren.length <= 0){\n\t\t\t\tthis._setPardon(false);\n\t\t\t}\n\t\t},\n\t\tdestroy:function(){\n\t\t\tif (this._state === 'destroying'){\n\t\t\t\tthis._super.apply(this, arguments);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.beforeDestroy();\n\t\t\tif(this._isPardoned){\n\t\t\t\tthis.unpardon();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._super.apply(this, arguments);\n\t\t},\n\t});\n\n\texports['default'] = EmberPardon;\n\n});"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;","file":"addons.js"}