"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/toConsumableArray"),r=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/helpers/slicedToArray"),s=require("@babel/runtime/regenerator"),n=require("react"),a=require("../utils/apiCalls.js"),u=require("../constants.js");require("../../../utils/index.js");var i=require("../../../constants/goals.js");require("../../../constants/segment.js"),require("../../../constants/alerts.js"),require("../../../constants/apps.js"),require("../../../constants/drillstring.js"),require("../../../constants/completion.js"),require("../../../constants/appPackages.js"),require("../../../constants/notifications.js"),require("../../../constants/feed.js"),require("../../../constants/bha.js"),require("../../../utils/env.js"),require("lodash"),require("../../GradientManager/configuration/constants.js");var o=require("../../../utils/goals.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=c(e),f=c(r),p=c(t),q=c(s);exports.useCompanyMetricKey=function(e,r){var t=n.useState([]),s=p.default(t,2),c=s[0],j=s[1];return n.useEffect((function(){function t(){return(t=f.default(q.default.mark((function r(){var t,s;return q.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,a.fetchCompanyGoals(e);case 2:t=r.sent,s=o.getCompanyGoalSetting(t,i.BENCHMARK_METRIC_GOAL),j(s?[s]:[]);case 5:case"end":return r.stop()}}),r)})))).apply(this,arguments)}r?j(r):e&&function(){t.apply(this,arguments)}()}),[e,r]),c.includes(u.DEFAULT_METRICS_KEY)||j((function(e){return[u.DEFAULT_METRICS_KEY].concat(l.default(e)).slice(0,3)})),[c,j]};
