import _defineProperty from '@babel/runtime/helpers/defineProperty';
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
import { u as useViewHandler, e as evalVisible, _ as _onClickCheckout, I as Icon } from './index-bbdfb97a.js';
import classnames from 'classnames';
import { observer } from 'mobx-react-lite';
import 'react';
import { useTranslation } from '@crystaldesign/diva-core';
import { w as wcConfiguratorSettingsActions, i as isOnFirstStep, a as isOnFirstStepDisabled, b as isOnLastStep, v as vertical, p as portrait, l as landscape, d as container, e as button, f as back, c as checkoutButton, g as forth } from './index.module-f05b48c3.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import 'react-dynamic-multi-render';
import '@babel/runtime/helpers/asyncToGenerator';
import '@babel/runtime/helpers/slicedToArray';
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 _excluded = ["className", "showBackButtonText", "backOverwrite", "forthOverwrite", "showNextButtonIcon", "showCheckoutButtons"];
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var ActionNavigation = function ActionNavigation(_ref) {
  var _viewHandler$uiState$;
  var className = _ref.className,
    showBackButtonText = _ref.showBackButtonText,
    backOverwrite = _ref.backOverwrite,
    forthOverwrite = _ref.forthOverwrite,
    showNextButtonIcon = _ref.showNextButtonIcon,
    showCheckoutButtons = _ref.showCheckoutButtons,
    props = _objectWithoutProperties(_ref, _excluded);
  var viewHandler = useViewHandler();
  var _useTranslation = useTranslation(),
    t = _useTranslation.t;
  return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, props), {}, {
    className: classnames(className, wcConfiguratorSettingsActions, viewHandler.actionButtonState.isOnFirstStep ? isOnFirstStep : undefined, viewHandler.actionButtonState.isOnFirstStepDisabled ? isOnFirstStepDisabled : undefined, viewHandler.actionButtonState.isOnLastStep ? isOnLastStep : undefined, viewHandler.tabGroupState.curTabGroupType == 'vertical' ? vertical : undefined, viewHandler.uiState.isMobilePortrait ? portrait : undefined, viewHandler.uiState.isMobileLandscape ? landscape : undefined),
    children: /*#__PURE__*/jsxs("div", {
      className: container,
      children: [/*#__PURE__*/jsxs("div", {
        className: classnames(button, back, backOverwrite),
        onClick: function onClick() {
          window.lastNavigationType = 'NAVIGATION_STANDARD_BACK_BUTTON';
          viewHandler.actionButtonState.onClickConfiguratorSettingsBack();
        },
        children: [!showBackButtonText && /*#__PURE__*/jsx("svg", {
          width: "12",
          height: "22",
          viewBox: "0 0 12 22",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
          children: /*#__PURE__*/jsx("path", {
            d: "M11 1L1 11L11 21",
            stroke: "var(--navigateBack, var(--secondaryColor))",
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          })
        }), showBackButtonText && t('configurator.Back')]
      }), showCheckoutButtons && ((_viewHandler$uiState$ = viewHandler.uiState.checkoutConfig) === null || _viewHandler$uiState$ === void 0 ? void 0 : _viewHandler$uiState$.buttons.filter(function (b) {
        return evalVisible(b, viewHandler, 'navigator');
      }).map(function (b) {
        return /*#__PURE__*/jsx("div", {
          className: checkoutButton,
          onClick: function onClick() {
            return _onClickCheckout(b, viewHandler, b.index, t);
          },
          children: /*#__PURE__*/jsx(Icon, {
            checkoutButton: _objectSpread(_objectSpread({}, b), {}, {
              isPrimary: false
            }),
            size: 40
          })
        }, b.index);
      })), /*#__PURE__*/jsxs("div", {
        className: classnames(button, forth, forthOverwrite),
        onClick: function onClick() {
          window.lastNavigationType = 'NAVIGATION_STANDARD_FORWARD_BUTTON';
          viewHandler.actionButtonState.onClickConfiguratorSettingsForth();
        },
        id: "wcConfigurator-action-next",
        children: [t('configurator.Next'), showNextButtonIcon && /*#__PURE__*/jsx("svg", {
          width: "12",
          height: "22",
          viewBox: "0 0 12 22",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg",
          children: /*#__PURE__*/jsx("path", {
            d: "M11 1L1 11L11 21",
            stroke: "var(--navigateForthFontColor, #ffffff)",
            strokeWidth: "2",
            strokeLinecap: "round",
            strokeLinejoin: "round"
          })
        })]
      })]
    })
  }));
};
var ActionNavigation$1 = observer(ActionNavigation);

export { ActionNavigation$1 as default };
