import{__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{round as r}from"lodash";import{getUnitPreference as n,getUnitDisplay as o,convertValue as e,getUnitDescription as i}from"../convert.js";import{GoalsConfig as a}from"./goalsConfig.js";var l=function(t){if(!a[t])return"";var r=a[t],e=r.unit,i=r.unitType,l=r.formatUnitDisplay;return i||l?l?l(n(i)):"percent"===i?e:o(i):""},u=function(t,o,i){if(void 0===i&&(i="TO_SHOW"),!a[o])return t;var l=a[o],u=l.unitType,f=l.unit,s=l.convertToShow,c=l.convertToSave;if(!f&&!s&&!c)return t;if("TO_SHOW"===i){if(""===t)return t;var _=s?s(t):e(+t,u,f,null,16),p=r(_,2);return String(p)}return"TO_SAVE"===i?t?String(c?c(t):e(+t,u,n(u),f,16)):"":void 0},f=function(){return t(t({},a),{cost_per_ft:t(t({},a.cost_per_ft),{label:"Cost/".concat(i(n("length")).singular)}),cost_per_lat_ft:t(t({},a.cost_per_lat_ft),{label:"Lateral Cost/".concat(i(n("length")).singular)})})};export{u as convertGoalValue,f as getGoalsConfig,l as getGoalsUnitDisplay};
