"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _utils = require("../../utils");

var _react = _interopRequireWildcard(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

var _constants = require("../../constants");

var _Icon = _interopRequireDefault(require("../Icon"));

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `Breadcrumbs` component indicates a position of current page in general hierarchy of all pages,
 * and it is used for navigation up to the main page of the product.
 * @since 2.3.0
 */
const Breadcrumbs = ({
  baseClassName = `${_constants.CLS_PREFIX}breadcrumbs`,
  className,
  children,
  ...props
}) => /*#__PURE__*/_react.default.createElement("nav", (0, _extends2.default)({
  role: "navigation",
  "aria-label": "Breadcrumbs",
  className: (0, _classnames.default)(baseClassName, className)
}, props), /*#__PURE__*/_react.default.createElement("ul", {
  className: `${baseClassName}__list`
}, _react.Children.map(children, child => /*#__PURE__*/_react.default.createElement("li", {
  className: `${baseClassName}__item`
}, child, /*#__PURE__*/_react.default.createElement("span", {
  className: `${baseClassName}__separator`
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
  name: (0, _utils.isRtl)() ? 'chevron-left' : 'chevron-right'
}))))));

var _default = Breadcrumbs;
exports.default = _default;