import r from"@babel/runtime/helpers/defineProperty";import{round as t}from"lodash";import{getUnitPreference as e,getUnitDisplay as n,convertValue as o,getUnitDescription as i}from"../convert.js";import{GoalsConfig as c}from"./goalsConfig.js";function f(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(Object(n),!0).forEach((function(e){r(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}var u=function(r){if(!c[r])return"";var t=c[r],o=t.unit,i=t.unitType,f=t.formatUnitDisplay;return i||f?f?f(e(null!=i?i:"")):"percent"===i?o:n(i):""},a=function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"TO_SHOW";if(!c[n])return r;var f=c[n],p=f.unitType,u=f.unit,a=f.convertToShow,l=f.convertToSave;if(!(u||p||a||l))return r;if("TO_SHOW"===i){if(""===r)return r;var s=a?a(+r):o(+r,p,u,void 0,16),O=t(s,2),b=String(O);return b}return"TO_SAVE"===i?r?String(l?l(+r):o(+r,p,e(p),u,16)):"":void 0},l=function(){return p(p({},c),{},{cost_per_ft:p(p({},c.cost_per_ft),{},{label:"Cost/".concat(i(e("length")).singular)}),cost_per_lat_ft:p(p({},c.cost_per_lat_ft),{},{label:"Lateral Cost/".concat(i(e("length")).singular)})})};export{a as convertGoalValue,l as getGoalsConfig,u as getGoalsUnitDisplay};
//# sourceMappingURL=utils.js.map
