"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../../ext-esm/tslib/tslib.es6.js'),r=require("react/jsx-runtime"),n=require("react"),s=require("lodash"),t=require("rollbar"),a=require("@rollbar/react");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");var o=require("../../../../../constants/corvaCompanyId.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../../../../GradientManager/configuration/constants.js");var c=i(t),l=function(t){var o=t.children,i=t.rollbarManifestConfig,l=t.appKey,u=t.version,d=n.useMemo((function(){var e,r=window.parent.Rollbar,n={accessToken:!i.useGlobalInstance&&i.accessToken?i.accessToken:null===(e=null==r?void 0:r.options)||void 0===e?void 0:e.accessToken,payload:{context:i.contextPrefix?"".concat(i.contextPrefix,"#").concat(l):l,client:{javascript:{code_version:u}}}},t=s.merge({},null==r?void 0:r.options,n);return new c.default(t)}),[]);return r.jsx(a.Provider,e.__assign({instance:d},{children:o}))};exports.RollbarWrapper=function(n){var s=n.children,t=n.rollbarManifestConfig,a=n.isCLIApp,i=n.companyId===o.CORVA_COMPANY_ID;return t&&t.enabled&&i&&!a?r.jsx(l,e.__assign({},n,{children:s})):s};
