"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.JavaScriptFrameHeadingRenderer = JavaScriptFrameHeadingRenderer;
var _react = _interopRequireDefault(require("react"));
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

function JavaScriptFrameHeadingRenderer({
  stackframe,
  fileDetailComponent: FileDetail
}) {
  var _stackframe$line$numb, _stackframe$line, _stackframe$line$colu, _stackframe$line2;
  const {
    classname,
    filename,
    function: fn
  } = stackframe;
  const lineNumber = (_stackframe$line$numb = (_stackframe$line = stackframe.line) === null || _stackframe$line === void 0 ? void 0 : _stackframe$line.number) !== null && _stackframe$line$numb !== void 0 ? _stackframe$line$numb : 0;
  const columnNumber = (_stackframe$line$colu = (_stackframe$line2 = stackframe.line) === null || _stackframe$line2 === void 0 ? void 0 : _stackframe$line2.column) !== null && _stackframe$line$colu !== void 0 ? _stackframe$line$colu : 0;
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "at", ' ', /*#__PURE__*/_react.default.createElement(FileDetail, null, classname && `${classname}.`, fn), ' ', "(", /*#__PURE__*/_react.default.createElement(FileDetail, null, filename, lineNumber > 0 && `:${lineNumber}`, lineNumber > 0 && columnNumber > 0 && `:${columnNumber}`), ")");
}