"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../constants/completion.js");exports.getElementInfo=function(a){var n,t,m=a.designElements,r=a.actualElements,u=a.rowKey,o=a.predictionSummary;switch(u){case"volumeChemicals":n=e.CHEMICALS_VOL_TYPES.map((function(e){return e.name})),t="volume";break;case"massChemicals":n=e.CHEMICALS_MASS_TYPES.map((function(e){return e.name})),t="mass";break;case"proppants":n=e.PROPPANTS_TYPES.map((function(e){return e.name})),t="mass";break;default:n=e.FLUIDS_TYPES.map((function(e){return e.name})),t="oil"}return n.reduce((function(a,n){var s=m[n]&&m[n].amount,i=r[n]&&r[n].amount,c=0;if("volumeChemicals"===u||"massChemicals"===u){var l=e.CHEMICALS_TYPES.find((function(e){return e.name===n}))||{};c=o[l.key]}if(!s&&!i&&!c)return a;var p=Math.max(s||0,i||0);return{elemMax:Math.max(p,a.elemMax),elemAmount:a.elemAmount.concat({key:n,design:s||0,actual:i||0,predictionVal:c,unitType:t})}}),{elemMax:0,elemAmount:[]})};
