{"version":3,"sources":["webpack:///./node_modules/aurelia-chart/dist/commonjs/observers/model-observer.js","webpack:///./node_modules/aurelia-chart/dist/commonjs/index.js","webpack:///./node_modules/aurelia-chart/dist/commonjs/attributes/chart-attribute.js","webpack:///./node_modules/aurelia-chart/dist/commonjs/elements/chart-element.js","webpack:///./node_modules/aurelia-chart/dist/commonjs/elements/chart-element.html"],"names":["Object","defineProperty","exports","value","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","Constructor","protoProps","staticProps","prototype","_aureliaFramework","ModelObserver","bindingEngine","observerLocator","_this","this","instance","TypeError","_classCallCheck","_ModelObserver","throttle","_throttleTimeout","_activeSubscriptions","observe","model","onChange","subscriptions","_getAllSubscriptions","throttledHandler","args","setTimeout","outstandingSubscription","push","unsubscribe","dispose","obj","constructor","Date","_this2","Array","isArray","subscription","collectionObserver","subscribe","property","_getObjectType","underlyingArray","forEach","entry","index","arraySubscription","propertyObserver","inject","BindingEngine","configure","aurelia","globalResources","container","registerTransient","_observersModelObserver","_createDecoratedClass","descriptors","initializers","decorators","initializer","f","decorator","undefined","protoInitializers","staticInitializers","_defineDecoratedPropertyDescriptor","_descriptor","_key","call","_chartJs","_chartJs2","__esModule","ChartAttribute","_instanceInitializers","element","modelObserver","_ChartAttribute","_isSetup","propertyChanged","propertyName","newValue","oldValue","_isObserving","refreshChart","_modelObserver","subscribeToChanges","_chartData","data","_clonedData","_activeChart","update","resize","bindable","defaultBindingMode","bindingMode","twoWay","createChart","shouldUpdate","destroy","type","options","nativeOptions","get","JSON","parse","stringify","Element","customAttribute","ChartElement","_ChartElement","canvasElement","datasets","useView","customElement","module"],"mappings":"yFAEAA,OAAOC,eAAeC,EAAS,aAAc,CACzCC,OAAO,IAGX,IAAIC,EAAe,WAAe,SAASC,EAAiBC,EAAQC,GAAS,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,IAAIE,EAAaH,EAAMC,GAAIE,EAAWC,WAAaD,EAAW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AAW,IAEjB,CACD7E,IAAK,cACLX,MAAO,WACLqB,KAAK4E,WAAa,CAChBa,KAAMzF,KAAKyF,KACXZ,KAAM7E,KAAK8E,YACXY,QAAS1F,KAAK2F,eAGhB3F,KAAK+E,aAAe,IAAInB,EAAmB,QAAE5D,KAAKoG,cAAepG,KAAK4E,YACtE5E,KAAK2F,cAAgB3F,KAAK+E,aAAaW,QACvC1F,KAAKyE,iBAEN,CACDnF,IAAK,qBACLX,MAAO,WACLqB,KAAK0E,eAAerE,SAAWL,KAAKK,UAAY,IAChDL,KAAK0E,eAAelE,QAAQR,KAAK6E,KAAKwB,SAAUrG,KAAKyE,gBAEtD,CACDnF,IAAK,eACLsG,IAAK,WACH,OAA4B,GAArB5F,KAAKuF,cAA6C,QAArBvF,KAAKuF,eAE1C,CACDjG,IAAK,cACLsG,IAAK,WACH,OAAOC,KAAKC,MAAMD,KAAKE,UAAU/F,KAAK6E,UAEtC,KAAMd,GAEV,IAAIoC,EAAgBD,EAIpB,OAHAA,GAAe,EAAIvG,EAAkB2G,SAAS,uBAA/B,CAAuDJ,IAAiBA,EACvFA,GAAe,EAAIvG,EAAkB0C,QAAQO,EAAwBhD,cAAtD,CAAqEsG,IAAiBA,EACrGA,GAAe,EAAIvG,EAAkB4G,eAAe,QAArC,CAA8CL,IAAiBA,EAhI7D,GAoInBxH,EAAQwH,aAAeA,G,0DC1JvBM,EAAO9H,QAAU","file":"npm.aurelia-chart.a086f9f4a6c81a50d30b.js","sourcesContent":["\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\n\r\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\r\n\r\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n\r\nvar _aureliaFramework = require('aurelia-framework');\r\n\r\nvar ModelObserver = (function () {\r\n function ModelObserver(bindingEngine, observerLocator) {\r\n var _this = this;\r\n\r\n _classCallCheck(this, _ModelObserver);\r\n\r\n this.throttle = 100;\r\n this._throttleTimeout = 0;\r\n this._activeSubscriptions = [];\r\n\r\n this.observe = function (model, onChange) {\r\n var subscriptions = [];\r\n _this._getAllSubscriptions(model, subscriptions);\r\n\r\n var throttledHandler = function throttledHandler(args) {\r\n if (_this.throttle <= 0) {\r\n return onChange();\r\n }\r\n\r\n if (!_this._throttleTimeout) {\r\n _this._throttleTimeout = setTimeout(function () {\r\n _this._throttleTimeout = null;\r\n onChange();\r\n }, _this.throttle);\r\n }\r\n };\r\n\r\n for (var i = 0; i < subscriptions.length; i++) {\r\n var outstandingSubscription = subscriptions[i](throttledHandler);\r\n _this._activeSubscriptions.push(outstandingSubscription);\r\n }\r\n };\r\n\r\n this.unsubscribe = function () {\r\n for (var i = 0; i < _this._activeSubscriptions.length; i++) {\r\n _this._activeSubscriptions[i].dispose();\r\n }\r\n\r\n _this._activeSubscriptions = [];\r\n };\r\n\r\n this.bindingEngine = bindingEngine;\r\n this.observerLocator = observerLocator;\r\n }\r\n\r\n _createClass(ModelObserver, [{\r\n key: \"_getObjectType\",\r\n value: function _getObjectType(obj) {\r\n if (obj && typeof obj === \"object\" && obj.constructor == new Date().constructor) return \"date\";\r\n return typeof obj;\r\n }\r\n }, {\r\n key: \"_getAllSubscriptions\",\r\n value: function _getAllSubscriptions(model, subscriptions) {\r\n var _this2 = this;\r\n\r\n if (Array.isArray(model)) {\r\n var subscription = this.bindingEngine.collectionObserver(model).subscribe;\r\n subscriptions.push(subscription);\r\n }\r\n\r\n for (var property in model) {\r\n var typeOfData = this._getObjectType(model[property]);\r\n switch (typeOfData) {\r\n case \"object\":\r\n {\r\n this._getAllSubscriptions(model[property], subscriptions);\r\n }\r\n break;\r\n case \"array\":\r\n {\r\n var underlyingArray = model[property]();\r\n underlyingArray.forEach(function (entry, index) {\r\n _this2._getAllSubscriptions(underlyingArray[index], subscriptions);\r\n });\r\n\r\n var arraySubscription = this.bindingEngine.propertyObserver(model, property).subscribe;\r\n if (arraySubscription) {\r\n subscriptions.push(arraySubscription);\r\n }\r\n }\r\n break;\r\n\r\n default:\r\n {\r\n var subscription = this.bindingEngine.propertyObserver(model, property).subscribe;\r\n if (subscription) {\r\n subscriptions.push(subscription);\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }]);\r\n\r\n var _ModelObserver = ModelObserver;\r\n ModelObserver = (0, _aureliaFramework.inject)(_aureliaFramework.BindingEngine)(ModelObserver) || ModelObserver;\r\n return ModelObserver;\r\n})();\r\n\r\nexports.ModelObserver = ModelObserver;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\nexports.configure = configure;\r\n\r\nvar _observersModelObserver = require(\"./observers/model-observer\");\r\n\r\nfunction configure(aurelia) {\r\n aurelia.globalResources(\"./elements/chart-element\", \"./attributes/chart-attribute\");\r\n\r\n aurelia.container.registerTransient(_observersModelObserver.ModelObserver);\r\n}","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\n\r\nvar _createDecoratedClass = (function () { function defineProperties(target, descriptors, initializers) { for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === \"function\") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError(\"The decorator for method \" + descriptor.key + \" is of the invalid type \" + typeof decorator); } } if (descriptor.initializer !== undefined) { initializers[key] = descriptor; continue; } } Object.defineProperty(target, key, descriptor); } } return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) { if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers); if (staticProps) defineProperties(Constructor, staticProps, staticInitializers); return Constructor; }; })();\r\n\r\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\r\n\r\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n\r\nfunction _defineDecoratedPropertyDescriptor(target, key, descriptors) { var _descriptor = descriptors[key]; if (!_descriptor) return; var descriptor = {}; for (var _key in _descriptor) descriptor[_key] = _descriptor[_key]; descriptor.value = descriptor.initializer ? descriptor.initializer.call(target) : undefined; Object.defineProperty(target, key, descriptor); }\r\n\r\nvar _aureliaFramework = require('aurelia-framework');\r\n\r\nvar _observersModelObserver = require(\"../observers/model-observer\");\r\n\r\nvar _chartJs = require(\"chart.js\");\r\n\r\nvar _chartJs2 = _interopRequireDefault(_chartJs);\r\n\r\nvar ChartAttribute = (function () {\r\n var _instanceInitializers = {};\r\n var _instanceInitializers = {};\r\n\r\n _createDecoratedClass(ChartAttribute, [{\r\n key: \"type\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"data\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"shouldUpdate\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"throttle\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"nativeOptions\",\r\n decorators: [(0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay })],\r\n initializer: function initializer() {\r\n return {};\r\n },\r\n enumerable: true\r\n }], null, _instanceInitializers);\r\n\r\n function ChartAttribute(element, modelObserver) {\r\n var _this = this;\r\n\r\n _classCallCheck(this, _ChartAttribute);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"type\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"data\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"shouldUpdate\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"throttle\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"nativeOptions\", _instanceInitializers);\r\n\r\n this._isSetup = false;\r\n\r\n this.propertyChanged = function (propertyName, newValue, oldValue) {\r\n if (_this._isSetup && _this._isObserving) {\r\n _this.refreshChart();\r\n _this._modelObserver.unsubscribe();\r\n _this.subscribeToChanges();\r\n }\r\n };\r\n\r\n this.refreshChart = function () {\r\n _this._chartData.data = _this._clonedData;\r\n _this._activeChart.update();\r\n _this._activeChart.resize();\r\n };\r\n\r\n this.element = element;\r\n this._modelObserver = modelObserver;\r\n }\r\n\r\n _createDecoratedClass(ChartAttribute, [{\r\n key: \"attached\",\r\n value: function attached() {\r\n this.createChart();\r\n this._isSetup = true;\r\n\r\n if (this._isObserving) {\r\n this.subscribeToChanges();\r\n }\r\n }\r\n }, {\r\n key: \"detached\",\r\n value: function detached() {\r\n if (this.shouldUpdate == true) {\r\n this._modelObserver.unsubscribe();\r\n }\r\n\r\n this._activeChart.destroy();\r\n\r\n this._isSetup = false;\r\n }\r\n }, {\r\n key: \"createChart\",\r\n value: function createChart() {\r\n this._chartData = {\r\n type: this.type,\r\n data: this._clonedData,\r\n options: this.nativeOptions\r\n };\r\n\r\n this._activeChart = new _chartJs2[\"default\"](this.element, this._chartData);\r\n this.nativeOptions = this._activeChart.options;\r\n this.refreshChart();\r\n }\r\n }, {\r\n key: \"subscribeToChanges\",\r\n value: function subscribeToChanges() {\r\n this._modelObserver.throttle = this.throttle || 100;\r\n this._modelObserver.observe(this.data, this.refreshChart);\r\n }\r\n }, {\r\n key: \"_isObserving\",\r\n get: function get() {\r\n return this.shouldUpdate == true || this.shouldUpdate == \"true\";\r\n }\r\n }, {\r\n key: \"_clonedData\",\r\n get: function get() {\r\n return JSON.parse(JSON.stringify(this.data));\r\n }\r\n }], null, _instanceInitializers);\r\n\r\n var _ChartAttribute = ChartAttribute;\r\n ChartAttribute = (0, _aureliaFramework.inject)(Element, _observersModelObserver.ModelObserver)(ChartAttribute) || ChartAttribute;\r\n ChartAttribute = (0, _aureliaFramework.customAttribute)('chart')(ChartAttribute) || ChartAttribute;\r\n return ChartAttribute;\r\n})();\r\n\r\nexports.ChartAttribute = ChartAttribute;","\"use strict\";\r\n\r\nObject.defineProperty(exports, \"__esModule\", {\r\n value: true\r\n});\r\n\r\nvar _createDecoratedClass = (function () { function defineProperties(target, descriptors, initializers) { for (var i = 0; i < descriptors.length; i++) { var descriptor = descriptors[i]; var decorators = descriptor.decorators; var key = descriptor.key; delete descriptor.key; delete descriptor.decorators; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor || descriptor.initializer) descriptor.writable = true; if (decorators) { for (var f = 0; f < decorators.length; f++) { var decorator = decorators[f]; if (typeof decorator === \"function\") { descriptor = decorator(target, key, descriptor) || descriptor; } else { throw new TypeError(\"The decorator for method \" + descriptor.key + \" is of the invalid type \" + typeof decorator); } } if (descriptor.initializer !== undefined) { initializers[key] = descriptor; continue; } } Object.defineProperty(target, key, descriptor); } } return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) { if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers); if (staticProps) defineProperties(Constructor, staticProps, staticInitializers); return Constructor; }; })();\r\n\r\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\r\n\r\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\r\n\r\nfunction _defineDecoratedPropertyDescriptor(target, key, descriptors) { var _descriptor = descriptors[key]; if (!_descriptor) return; var descriptor = {}; for (var _key in _descriptor) descriptor[_key] = _descriptor[_key]; descriptor.value = descriptor.initializer ? descriptor.initializer.call(target) : undefined; Object.defineProperty(target, key, descriptor); }\r\n\r\nvar _aureliaFramework = require('aurelia-framework');\r\n\r\nvar _observersModelObserver = require(\"../observers/model-observer\");\r\n\r\nvar _chartJs = require(\"chart.js\");\r\n\r\nvar _chartJs2 = _interopRequireDefault(_chartJs);\r\n\r\nvar ChartElement = (function () {\r\n var _instanceInitializers = {};\r\n var _instanceInitializers = {};\r\n\r\n _createDecoratedClass(ChartElement, [{\r\n key: \"type\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"data\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"shouldUpdate\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"throttle\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }, {\r\n key: \"nativeOptions\",\r\n decorators: [(0, _aureliaFramework.bindable)({ defaultBindingMode: _aureliaFramework.bindingMode.twoWay })],\r\n initializer: function initializer() {\r\n return {};\r\n },\r\n enumerable: true\r\n }, {\r\n key: \"canvasElement\",\r\n decorators: [_aureliaFramework.bindable],\r\n initializer: null,\r\n enumerable: true\r\n }], null, _instanceInitializers);\r\n\r\n function ChartElement(modelObserver) {\r\n var _this = this;\r\n\r\n _classCallCheck(this, _ChartElement);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"type\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"data\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"shouldUpdate\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"throttle\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"nativeOptions\", _instanceInitializers);\r\n\r\n _defineDecoratedPropertyDescriptor(this, \"canvasElement\", _instanceInitializers);\r\n\r\n this._isSetup = false;\r\n\r\n this.propertyChanged = function (propertyName, newValue, oldValue) {\r\n if (_this._isSetup && _this._isObserving) {\r\n _this.refreshChart();\r\n _this._modelObserver.unsubscribe();\r\n _this.subscribeToChanges();\r\n }\r\n };\r\n\r\n this.refreshChart = function () {\r\n _this._chartData.data = _this._clonedData;\r\n _this._activeChart.update();\r\n _this._activeChart.resize();\r\n };\r\n\r\n this._modelObserver = modelObserver;\r\n }\r\n\r\n _createDecoratedClass(ChartElement, [{\r\n key: \"attached\",\r\n value: function attached() {\r\n this.createChart();\r\n this._isSetup = true;\r\n\r\n if (this._isObserving) {\r\n this.subscribeToChanges();\r\n }\r\n }\r\n }, {\r\n key: \"detached\",\r\n value: function detached() {\r\n if (this._isObserving) {\r\n this._modelObserver.unsubscribe();\r\n }\r\n\r\n this._activeChart.destroy();\r\n this._isSetup = false;\r\n }\r\n }, {\r\n key: \"createChart\",\r\n value: function createChart() {\r\n this._chartData = {\r\n type: this.type,\r\n data: this._clonedData,\r\n options: this.nativeOptions\r\n };\r\n\r\n this._activeChart = new _chartJs2[\"default\"](this.canvasElement, this._chartData);\r\n this.nativeOptions = this._activeChart.options;\r\n this.refreshChart();\r\n }\r\n }, {\r\n key: \"subscribeToChanges\",\r\n value: function subscribeToChanges() {\r\n this._modelObserver.throttle = this.throttle || 100;\r\n this._modelObserver.observe(this.data.datasets, this.refreshChart);\r\n }\r\n }, {\r\n key: \"_isObserving\",\r\n get: function get() {\r\n return this.shouldUpdate == true || this.shouldUpdate == \"true\";\r\n }\r\n }, {\r\n key: \"_clonedData\",\r\n get: function get() {\r\n return JSON.parse(JSON.stringify(this.data));\r\n }\r\n }], null, _instanceInitializers);\r\n\r\n var _ChartElement = ChartElement;\r\n ChartElement = (0, _aureliaFramework.useView)(\"./chart-element.html\")(ChartElement) || ChartElement;\r\n ChartElement = (0, _aureliaFramework.inject)(_observersModelObserver.ModelObserver)(ChartElement) || ChartElement;\r\n ChartElement = (0, _aureliaFramework.customElement)('chart')(ChartElement) || ChartElement;\r\n return ChartElement;\r\n})();\r\n\r\nexports.ChartElement = ChartElement;","module.exports = \"\";"],"sourceRoot":""}