import { s as styleInject, u as useViewHandler } from './index-bbdfb97a.js';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import { useRef, useEffect } from 'react';
import { useTranslation } from '@crystaldesign/diva-core';
import { jsx } from 'react/jsx-runtime';
import '@babel/runtime/helpers/defineProperty';
import 'react-dynamic-multi-render';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/helpers/slicedToArray';
import '@babel/runtime/helpers/objectWithoutProperties';
import '@babel/runtime/regenerator';
import '@babel/runtime/helpers/classCallCheck';
import '@babel/runtime/helpers/createClass';
import '@babel/runtime/helpers/toConsumableArray';
import '@crystaldesign/diva-utils';
import 'mobx';
import '@crystaldesign/web-planner-logic';
import 'qrcode.react';
import '@babel/runtime/helpers/typeof';
import 'flat';
import 'react-switch';
import 'react-countup';

var wcTabGroupItem = "wcTabGroupItem-RxTRT";
var wcActiveStep = "wcActiveStep-W687q";
var wcVisitedStep = "wcVisitedStep-IGlR4";
var wcTabGroupItemMobile = "wcTabGroupItemMobile-tMZbr";
var tablet = "tablet--DGT2";
var css_248z = ".wcTabGroupItem-RxTRT {\n  height: 100%;\n  width: -moz-fit-content;\n  width: fit-content;\n  float: left;\n  transition:\n    background-color 0.3s ease-out,\n    color 0.3s ease-out;\n  line-height: 56px;\n  padding: 0 13px;\n  cursor: pointer;\n}\n\n.wcTabGroupItem-RxTRT.wcActiveStep-W687q,\n.wcTabGroupItem-RxTRT.wcActiveStep-W687q.wcTabGroupItem-RxTRT:hover {\n  background-color: var(--primaryColor);\n}\n\n.wcTabGroupItem-RxTRT.wcVisitedStep-IGlR4 {\n  background-color: #b1b1b1;\n}\n\n.wcVisitedStep-IGlR4.wcTabGroupItem-RxTRT:hover {\n  background-color: #bbbbbb;\n}\n.wcTabGroupItem-RxTRT.wcTabGroupItem-RxTRT:hover {\n  background-color: #c8c8c8;\n}\n\n.wcTabGroupItem-RxTRT.wcActiveStep-W687q {\n  color: white;\n}\n\n.wcTabGroupItemMobile-tMZbr {\n  height: 100%;\n  width: -moz-fit-content;\n  width: fit-content;\n  float: left;\n  line-height: calc(var(--configuratorTabGroupHeight) - 3px);\n  padding-left: 10px;\n  padding-right: 10px;\n  color: var(--secondaryColor);\n  font-size: 14px;\n  font-weight: 600;\n  position: relative;\n}\n\n:not(.tablet--DGT2).wcTabGroupItemMobile-tMZbr {\n  font-size: 12px;\n}\n\n.wcTabGroupItemMobile-tMZbr::after {\n  content: '';\n  position: absolute;\n  width: 0px;\n  height: 3px;\n  left: 50%;\n  bottom: 0;\n  background-color: var(--primaryColor);\n  transition: all ease-in-out 0.2s;\n}\n\n.wcActiveStep-W687q::after {\n  width: 100%;\n  left: 0;\n}\n\n.wcTabGroupItemMobile-tMZbr:hover {\n  color: var(--primaryColor);\n}\n\n.wcActiveStep-W687q {\n  border: none;\n  color: var(--primaryColor);\n  background: rgba(230, 230, 230, 0.95);\n}\n";
styleInject(css_248z);

var TabGroupItemHorizontal = function TabGroupItemHorizontal(_ref) {
  var tabGroup = _ref.tabGroup;
  var viewHandler = useViewHandler();
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  var tabGroupItemRef = useRef(null);
  var curTabGroup = viewHandler.tabGroupState.curTabGroup;
  useEffect(function () {
    viewHandler.tabGroupState.setTabGroupItems(tabGroup.key, tabGroupItemRef.current);
  }, [tabGroupItemRef]);
  var onTabGroupClick = function onTabGroupClick(tabGroup) {
    window.lastNavigationType = 'TABGROUP_BY_POS_NR';
    viewHandler.tabGroupState.navigateToTabgroupByPosNr(+tabGroup.posNr);
  };
  var active = tabGroup.title == (curTabGroup === null || curTabGroup === void 0 ? void 0 : curTabGroup.title) && tabGroup.posNr == (curTabGroup === null || curTabGroup === void 0 ? void 0 : curTabGroup.posNr);
  return /*#__PURE__*/jsx("div", {
    ref: tabGroupItemRef,
    onClick: function onClick(e) {
      e.stopPropagation();
      onTabGroupClick(tabGroup);
    },
    className: classnames(!viewHandler.uiState.isInMobileView ? wcTabGroupItem : wcTabGroupItemMobile, viewHandler.uiState.isTablet ? tablet : undefined, active ? wcActiveStep : undefined, viewHandler.tabGroupAlreadyVisited(tabGroup) && !active ? wcVisitedStep : undefined),
    children: t('configurator.' + tabGroup.title, tabGroup.title)
  });
};
var index = observer(TabGroupItemHorizontal);

export { index as default };
