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