Liferay.Loader.define("data-engine-js-components-web@1.0.89/js/custom/form-report/utils/data",["module","exports","require"],(function(e,t,o){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.toArray=t.sumTotalEntries=t.roundPercentage=t.removeEmptyValues=t.getPercentage=t.getColumnLabel=t.default=void 0;const getColumnLabel=(e,t)=>t.columns[e]?t.columns[e].value:void 0;t.getColumnLabel=getColumnLabel;const getPercentage=(e,t)=>e/t;t.getPercentage=getPercentage;const removeEmptyValues=e=>Array.isArray(e)&&e.filter((e=>e));t.removeEmptyValues=removeEmptyValues;const roundPercentage=e=>"".concat(parseFloat((100*e).toFixed(1)),"%");t.roundPercentage=roundPercentage;const sumTotalEntries=e=>Object.values(e).reduce(((e,t)=>e+t),0);t.sumTotalEntries=sumTotalEntries;const toArray=e=>e.map((({value:e})=>e));t.toArray=toArray;var _default=(e,t)=>Object.entries(t).map((([t,o])=>({count:o,label:e[t]?e[t].value:t}))).sort(((e,t)=>e.count>t.count?-1:t.count>e.count?1:0));t.default=_default}}));
//# sourceMappingURL=data.js.map