function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ownKeys(e,t){var r,n=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)),n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(t,e){if("object"!=_typeof(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(()=>{function t(r,t,o){var i=t.createWidget(r);r.child.alerts.setAlertGroupDismissStrategy("warning","temporary_or_permanent"),i.refresh=function(){var n,t=this.mostRecentKpi.dataPoints,e=this.mostRecentKpi.measurements;r.dps=_.filter(t,function(t){return e[t.id]}),r.measurements=_.map(r.dps,function(t){return e[t.id].value<0?_objectSpread(_objectSpread({},e[t.id]),{},{value:0}):e[t.id]}),n=i.mostRecentKpi.measurements,t=_.filter(r.dps,function(t){return n[t.id].value<0}),r.child.alerts.clear("warning"),t.length&&(t=_.map(t,function(t){var e=t.label,t=n[t.id],r=t.value,t=t.unit;return"".concat(e,": ").concat(r).concat(t)}).join("; "),t={text:o.getString("Negative measurements received from data point(s): {{ list }}",{list:t}),type:"warning"},r.child.alerts.addAlerts(t))},i.onNotification=i.refresh,r.$watch("child.config.pieChartOptions",function(){r.options=r.child.config.pieChartOptions||{}}),r.options=r.child.config.pieChartOptions||{},i.init()}t.$inject=["$scope","baseWidgetSvc","gettextCatalog"],angular.module("c8y.parts.kpi").controller("pieChartCtrl",t)})();