import{round as n,identity as r}from"lodash";import{getUnitDisplay as t,convertValue as i}from"../convert.js";var o=function(n){return n.sumVal},u=function(n){return n.sumVal/n.number},e=function(n){return n.maxVal};function a(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.formatUnitDisplay,o=void 0===i?r:i,u=n.to,e=n.unitType;return u||e?o(u||t(e)):""}function f(r,t,o,u){if(!Number.isFinite(r)||!t)return null;var e=t.unitType,a=t.from,f=t.to,l=t.customConvert,m=t.convertForMultiRigs,v=t.precision,c=void 0===v?2:v,s=t.allowNegativeValue,p=void 0!==s&&s,d=m&&o?m({sumVal:r,maxVal:u,number:o}):r;if(l)return l(d,t);var g=e?i(d,e,a,f,c):d;return g=n(g,c),g=p?g:Math.max(g,0)}function l(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.precision,o=void 0===i?2:i,u=100*r;return n(u>100&&u<101.5?100:u,o)}function m(n){return Number(n)/100}function v(n){return n/i(1,"length","ft")}function c(n){return n*i(1,"length","ft")}export{c as convertCostToSave,v as convertCostToShow,l as convertPercentageMetrics,m as convertPercentageToSave,u as getAverage,f as getConvertedMetricValue,e as getMax,a as getMetricUnitDisplay,o as getSum};
