"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireWildcard(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _clsx = _interopRequireDefault(require("clsx"));
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
var _styles = require("@material-ui/core/styles");
var _withWidth = _interopRequireDefault(require("@material-ui/core/withWidth"));
var _Card = _interopRequireDefault(require("@material-ui/core/Card"));
var _CardContent = _interopRequireDefault(require("@material-ui/core/CardContent"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _Button = _interopRequireDefault(require("@material-ui/core/Button"));
var _CardActions = _interopRequireDefault(require("@material-ui/core/CardActions"));
var _Grid = _interopRequireDefault(require("@material-ui/core/Grid"));
var _colors = require("@material-ui/core/colors");
var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
var _Icon = _interopRequireDefault(require("@material-ui/core/Icon"));
var _RootRef = _interopRequireDefault(require("@material-ui/core/RootRef"));
var _reactIntersectionObserver = require("react-intersection-observer");
var _i18n = require("../../../../Framework/i18n");
var _AnalyticsWrapper = _interopRequireDefault(require("../Analytics/AnalyticsWrapper"));
var _customClassName = _interopRequireDefault(require("../../../Utils/customClassName"));
var _MainButton = _interopRequireDefault(require("../../../../Shared/Components/MainButton"));
var _PriceOverview = _interopRequireDefault(require("../PriceOverview"));
var _Notification = _interopRequireDefault(require("../Notification"));
var _PriceList = _interopRequireDefault(require("../PriceList"));
var _AddToBasket = _interopRequireDefault(require("../AddToBasket"));
var _ReceiveOfferForm = _interopRequireDefault(require("../ReceiveOfferForm"));
var _AcceptDesign = _interopRequireDefault(require("../AcceptDesign"));
var _LoadingOverlay = _interopRequireDefault(require("../../../../Framework/Components/LoadingOverlay"));
var _utils = require("@material-ui/core/utils");
var _AcceptPrivacy = _interopRequireDefault(require("../AcceptPrivacy"));
var _ConfigurationOverview = _interopRequireDefault(require("../ConfigurationOverview"));
var _isMobileDevice = require("../../../../Framework/Helpers/isMobileDevice");
var _IconButton = _interopRequireDefault(require("@material-ui/core/IconButton"));
var _AutoFocusDialogContentContainer = _interopRequireDefault(require("../AutoFocusDialogContentContainer/AutoFocusDialogContentContainer"));
var _excluded = ["onTouchMove"],
  _excluded2 = ["wrapperClass", "renderPriceBox"];
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
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; }
function _regeneratorRuntime() { "use strict"; var r = _regenerator(), e = r.m(_regeneratorRuntime), t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; function n(r) { var e = "function" == typeof r && r.constructor; return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); } var o = { "throw": 1, "return": 2, "break": 3, "continue": 3 }; function a(r) { var e, t; return function (n) { e || (e = { stop: function stop() { return t(n.a, 2); }, "catch": function _catch() { return n.v; }, abrupt: function abrupt(r, e) { return t(n.a, o[r], e); }, delegateYield: function delegateYield(r, o, a) { return e.resultName = o, t(n.d, _regeneratorValues(r), a); }, finish: function finish(r) { return t(n.f, r); } }, t = function t(r, _t, o) { n.p = e.prev, n.n = e.next; try { return r(_t, o); } finally { e.next = n.n; } }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; try { return r.call(this, e); } finally { n.p = e.prev, n.n = e.next; } }; } return (_regeneratorRuntime = function _regeneratorRuntime() { return { wrap: function wrap(e, t, n, o) { return r.w(a(e), t, n, o && o.reverse()); }, isGeneratorFunction: n, mark: r.m, awrap: function awrap(r, e) { return new _OverloadYield(r, e); }, AsyncIterator: _regeneratorAsyncIterator, async: function async(r, e, t, o, u) { return (n(e) ? _regeneratorAsyncGen : _regeneratorAsync)(a(r), e, t, o, u); }, keys: _regeneratorKeys, values: _regeneratorValues }; })(); }
function _regeneratorValues(e) { if (null != e) { var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], r = 0; if (t) return t.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) return { next: function next() { return e && r >= e.length && (e = void 0), { value: e && e[r++], done: !e }; } }; } throw new TypeError(_typeof(e) + " is not iterable"); }
function _regeneratorKeys(e) { var n = Object(e), r = []; for (var t in n) r.unshift(t); return function e() { for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; return e.done = !0, e; }; }
function _regeneratorAsync(n, e, r, t, o) { var a = _regeneratorAsyncGen(n, e, r, t, o); return a.next().then(function (n) { return n.done ? n.value : a.next(); }); }
function _regeneratorAsyncGen(r, e, t, o, n) { return new _regeneratorAsyncIterator(_regenerator().w(r, e, t, o), n || Promise); }
function _regeneratorAsyncIterator(t, e) { function n(r, o, i, f) { try { var c = t[r](o), u = c.value; return u instanceof _OverloadYield ? e.resolve(u.v).then(function (t) { n("next", t, i, f); }, function (t) { n("throw", t, i, f); }) : e.resolve(u).then(function (t) { c.value = t, i(c); }, function (t) { return n("throw", t, i, f); }); } catch (t) { f(t); } } var r; this.next || (_regeneratorDefine2(_regeneratorAsyncIterator.prototype), _regeneratorDefine2(_regeneratorAsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { return this; })), _regeneratorDefine2(this, "_invoke", function (t, o, i) { function f() { return new e(function (e, r) { n(t, i, e, r); }); } return r = r ? r.then(f, f) : f(); }, !0); }
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
function _OverloadYield(e, d) { this.v = e, this.k = d; }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var styles = function styles(theme) {
  var _contentPositioning, _card, _MuiDialogActions, _MuiDialogTitleRo, _AmountPriceButton, _mainButtonLabel, _closeIcon;
  return {
    contentPositioning: (_contentPositioning = {
      paddingLeft: 32,
      paddingRight: 20
    }, _defineProperty(_contentPositioning, theme.breakpoints.down('xs'), {
      paddingLeft: 0,
      paddingRight: 8,
      marginRight: '-8px'
    }), _defineProperty(_contentPositioning, '& p', {
      fontSize: 15,
      letterSpacing: 'normal'
    }), _defineProperty(_contentPositioning, "marginRight", 4), _defineProperty(_contentPositioning, "padding", 0), _contentPositioning),
    dialogWrapper: _defineProperty({
      borderTop: '7px solid ' + theme.palette.primary.main,
      padding: '0 32px',
      overflow: 'hidden'
    }, theme.breakpoints.down('xs'), {
      padding: '0 16px'
    }),
    card: (_card = {
      marginBottom: 1,
      borderTop: '7px solid ' + theme.palette.primary.main,
      padding: 15,
      overflow: 'visible'
    }, _defineProperty(_card, theme.breakpoints.between('xs', 'lg'), {
      marginTop: 16
    }), _defineProperty(_card, theme.breakpoints.down('xs'), {
      overflow: 'hidden',
      display: 'flex',
      boxShadow: 'none',
      '&:last-child': {
        padding: '12px 0 0'
      },
      paddingTop: 0,
      borderTop: '1px solid ' + _colors.grey[500],
      borderRadius: 0
    }), _card),
    cardUnboxed: _defineProperty({
      borderTop: 'none',
      boxShadow: 'none'
    }, theme.breakpoints.down('xs'), {
      display: 'flex'
    }),
    cardContentWrapper: _defineProperty({}, theme.breakpoints.down('xs'), {
      '&:last-child': {
        paddingBottom: 4
      }
    }),
    AmountPriceContent: {
      padding: 0,
      '&:last-child': {
        paddingBottom: 5
      }
    },
    dialogPositioning: {
      overflow: 'hidden',
      '& .MuiDialog-container': {
        '& .MuiDialogTitle-root': {
          paddingTop: 25,
          paddingBottom: 15,
          '& p, h2': {
            fontSize: 24,
            fontWeight: 'bold',
            letterSpacing: 'normal'
          }
        },
        '& .MuiDialogActions-root': (_MuiDialogActions = {
          paddingBottom: 24
        }, _defineProperty(_MuiDialogActions, theme.breakpoints.down('xs'), {
          marginRight: 0
        }), _defineProperty(_MuiDialogActions, "marginRight", 8), _MuiDialogActions),
        '& .MuiDialogTitle-root, .MuiDialogActions-root': (_MuiDialogTitleRo = {
          paddingLeft: 32,
          paddingRight: 20,
          marginRight: 4
        }, _defineProperty(_MuiDialogTitleRo, theme.breakpoints.down('xs'), {
          paddingLeft: 0,
          paddingRight: 0
        }), _defineProperty(_MuiDialogTitleRo, '& p', {
          fontSize: 15,
          letterSpacing: 'normal'
        }), _MuiDialogTitleRo)
      },
      '& .MuiButton-root': _defineProperty({
        height: 40,
        textTransform: 'none',
        minWidth: 140,
        marginTop: 8,
        color: theme.palette.primary.darkText
      }, theme.breakpoints.down('xs'), {
        height: 56
      })
    },
    AmountPriceButton: (_AmountPriceButton = {
      textTransform: 'none',
      whiteSpace: 'nowrap',
      margin: 0,
      padding: '6px 15px'
    }, _defineProperty(_AmountPriceButton, theme.breakpoints.down('xs'), {
      minWidth: 35,
      padding: 0
    }), _defineProperty(_AmountPriceButton, "color", theme.palette.primary.darkText), _AmountPriceButton),
    smallButtonSize: _defineProperty({}, theme.breakpoints.down('xs'), {
      fontSize: 12,
      lineHeight: 1
    }),
    mainButton: _defineProperty({
      margin: 0,
      padding: '6px 15px',
      height: 40,
      lineHeight: 1.5
    }, theme.breakpoints.down('xs'), {
      height: 56
    }),
    mainButtonLabel: (_mainButtonLabel = {}, _defineProperty(_mainButtonLabel, theme.breakpoints.down('xs'), {
      whiteSpace: 'normal',
      fontSize: 12
    }), _defineProperty(_mainButtonLabel, "whiteSpace", 'nowrap'), _mainButtonLabel),
    AmountPriceTypography: _defineProperty({
      textAlign: 'end',
      lineHeight: 1.2,
      fontSize: '1.5rem'
    }, theme.breakpoints.down('xs'), {
      padding: '3px 0',
      textAlign: 'start',
      fontSize: 12,
      lineHeight: 1
    }),
    AmountPriceTypographyVat: _defineProperty({
      fontSize: 9,
      lineHeight: 1.2,
      textAlign: 'end',
      display: 'block'
    }, theme.breakpoints.down('xs'), {
      fontSize: 9,
      textAlign: 'start'
    }),
    cardActions: _defineProperty({
      padding: '8px 0'
    }, theme.breakpoints.down('xs'), {
      padding: 0
    }),
    closeIcon: (_closeIcon = {
      position: 'absolute',
      right: 16,
      top: 16
    }, _defineProperty(_closeIcon, theme.breakpoints.down('xs'), {
      right: 0
    }), _defineProperty(_closeIcon, '&:hover', {
      cursor: 'pointer'
    }), _closeIcon),
    configurationButton: {
      '&:hover': {
        cursor: 'pointer'
      },
      fontWeight: 'bold',
      textTransform: 'none',
      padding: '6px 15px',
      marginRight: '5px'
    },
    summary: {
      display: 'flex',
      alignItems: 'center',
      '& svg': {
        marginRight: 5
      }
    },
    dialogTitleRoot: {
      padding: '20px 0'
    }
  };
};
var DialogActionsWrapper = function DialogActionsWrapper(_ref) {
  var onTouchMove = _ref.onTouchMove,
    props = _objectWithoutProperties(_ref, _excluded);
  var ref = (0, _react.useRef)();
  (0, _react.useEffect)(function () {
    var current = ref.current;
    if (current) {
      current.addEventListener('touchmove', onTouchMove, {
        passive: false
      });
    }
    return function () {
      if (current) {
        current.removeEventListener('touchmove', onTouchMove, {
          passive: false
        });
      }
    };
  }, [onTouchMove]);
  return (
    /*#__PURE__*/
    // as of material-ui v3.x the refs are not forwarded, so the only way to get it is using RootRef
    // FIXME check after updating material-ui
    _react["default"].createElement(_RootRef["default"], {
      rootRef: ref
    }, /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], props))
  );
};
var AmountPrice = /*#__PURE__*/function (_React$Component) {
  _inherits(AmountPrice, _React$Component);
  var _super = _createSuper(AmountPrice);
  function AmountPrice() {
    var _this;
    _classCallCheck(this, AmountPrice);
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _super.call.apply(_super, [this].concat(args));
    _defineProperty(_assertThisInitialized(_this), "state", {
      showPriceOverview: false,
      showConfigurationOverview: false,
      notice: '',
      hasErrorReceiveOfferForm: false,
      bulkNameErrors: [],
      approval: {
        value: false,
        error: null
      },
      inView: true,
      showErrors: false,
      dataPrivacyAccepted: false
    });
    _defineProperty(_assertThisInitialized(_this), "receiveOfferFormComponentRef", /*#__PURE__*/_react["default"].createRef());
    _defineProperty(_assertThisInitialized(_this), "dialogContentRef", /*#__PURE__*/_react["default"].createRef());
    _defineProperty(_assertThisInitialized(_this), "priceListRef", /*#__PURE__*/_react["default"].createRef());
    _defineProperty(_assertThisInitialized(_this), "acceptDesignRef", /*#__PURE__*/_react["default"].createRef());
    _defineProperty(_assertThisInitialized(_this), "acceptDataPrivacyRef", /*#__PURE__*/_react["default"].createRef());
    _defineProperty(_assertThisInitialized(_this), "handleChange", function (event) {
      _this.setState(_defineProperty({}, event.target.name, {
        value: event.target.checked,
        error: null
      }));
    });
    _defineProperty(_assertThisInitialized(_this), "verifyRequestErrors", function (hasFormValidationErrors) {
      var _this$props = _this.props,
        bulkNameErrors = _this$props.bulkNameErrors,
        displayAcceptDesign = _this$props.displayAcceptDesign;
      var designApproved = _this.state.approval.value;
      if (bulkNameErrors && bulkNameErrors.length > 0) {
        _this.setState({
          showErrors: true
        });
        _this.setState({
          bulkNameErrors: bulkNameErrors
        });
        _this.dialogContentRef.current.scrollTo(0, 0);
      }
      if (displayAcceptDesign && !designApproved) {
        _this.setState({
          approval: {
            value: false,
            error: true
          }
        });
        !hasFormValidationErrors && _this.acceptDesignRef.current && _this.acceptDesignRef.current.scrollIntoView();
      }
      if (!_this.dataPrivacyApproved()) {
        _this.setState({
          dataPrivacyAccepted: {
            value: false,
            error: true
          }
        });
        !hasFormValidationErrors && _this.acceptDataPrivacyRef.current && _this.acceptDataPrivacyRef.current.scrollIntoView();
      }
    });
    _defineProperty(_assertThisInitialized(_this), "requestHasErrors", function () {
      var _this$props2 = _this.props,
        bulkNameErrors = _this$props2.bulkNameErrors,
        displayAcceptDesign = _this$props2.displayAcceptDesign;
      var designApproved = _this.state.approval.value;
      if (bulkNameErrors && bulkNameErrors.length > 0 || displayAcceptDesign && !designApproved || !_this.dataPrivacyApproved()) {
        return true;
      }
      return false;
    });
    _defineProperty(_assertThisInitialized(_this), "onAddToBasket", function () {
      var onAddToBasket = _this.props.onAddToBasket;
      if (!_this.requestHasErrors()) {
        onAddToBasket();
      } else {
        _this.verifyRequestErrors();
      }
    });
    _defineProperty(_assertThisInitialized(_this), "dataPrivacyApproved", function () {
      var _this$props3 = _this.props,
        showReceiveOfferForm = _this$props3.showReceiveOfferForm,
        clientTexts = _this$props3.clientTexts;
      var dataPrivacyLink = clientTexts.dataPrivacyLink;
      var dataPrivacyApproved = _this.state.dataPrivacyAccepted.value;
      return !dataPrivacyLink || !showReceiveOfferForm || dataPrivacyApproved;
    });
    _defineProperty(_assertThisInitialized(_this), "handleTouchMove", function (evt) {
      var dialogContent = _this.dialogContentRef.current;
      evt.preventDefault();
      dialogContent.scrollTo(0, dialogContent.scrollTop);
    }.bind(_assertThisInitialized(_this)));
    _defineProperty(_assertThisInitialized(_this), "openPriceOverview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
      return _regeneratorRuntime().wrap(function _callee$(_context) {
        while (1) switch (_context.prev = _context.next) {
          case 0:
            _context.prev = 0;
            _context.next = 3;
            return _this.props.validateConfiguration();
          case 3:
            _this.setState({
              showPriceOverview: !_this.state.showPriceOverview,
              hasErrorReceiveOfferForm: false
            });
            _context.next = 9;
            break;
          case 6:
            _context.prev = 6;
            _context.t0 = _context["catch"](0);
            // eslint-disable-next-line no-console
            console.warn("Error while validating configuration: ".concat(_context.t0));
          case 9:
          case "end":
            return _context.stop();
        }
      }, _callee, null, [[0, 6]]);
    })));
    _defineProperty(_assertThisInitialized(_this), "openConfigurationOverview", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
      return _regeneratorRuntime().wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            _context2.prev = 0;
            _context2.next = 3;
            return _this.props.validateConfiguration();
          case 3:
            _this.setState({
              showConfigurationOverview: true,
              hasErrorReceiveOfferForm: false
            });
            _context2.next = 9;
            break;
          case 6:
            _context2.prev = 6;
            _context2.t0 = _context2["catch"](0);
            // eslint-disable-next-line no-console
            console.warn("Error while validating configuration: ".concat(_context2.t0));
          case 9:
          case "end":
            return _context2.stop();
        }
      }, _callee2, null, [[0, 6]]);
    })));
    _defineProperty(_assertThisInitialized(_this), "onAddToCartClick", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
      return _regeneratorRuntime().wrap(function _callee3$(_context3) {
        while (1) switch (_context3.prev = _context3.next) {
          case 0:
            if (!_this.props.skipPriceOverview) {
              _context3.next = 17;
              break;
            }
            _context3.prev = 1;
            _this.props.toggleGlobalLoader(true);
            _context3.next = 5;
            return _this.props.validateConfiguration();
          case 5:
            _context3.next = 7;
            return _this.props.onAddToBasket();
          case 7:
            return _context3.abrupt("return", _context3.sent);
          case 10:
            _context3.prev = 10;
            _context3.t0 = _context3["catch"](1);
            // eslint-disable-next-line no-console
            console.warn("Error while validating configuration: ".concat(_context3.t0));
          case 13:
            _context3.prev = 13;
            _this.props.toggleGlobalLoader(false);
            return _context3.finish(13);
          case 16:
            return _context3.abrupt("return");
          case 17:
            return _context3.abrupt("return", _this.openPriceOverview());
          case 18:
          case "end":
            return _context3.stop();
        }
      }, _callee3, null, [[1, 10, 13, 16]]);
    })));
    _defineProperty(_assertThisInitialized(_this), "handleClose", function () {
      _this.setState({
        showConfigurationOverview: false,
        showPriceOverview: false,
        bulkNameErrors: [],
        approval: {
          value: false,
          error: null
        },
        showErrors: false
      });
      _this.props.onClose();
    });
    _defineProperty(_assertThisInitialized(_this), "onReceiveOfferFormPress", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
      var formValidation, result;
      return _regeneratorRuntime().wrap(function _callee4$(_context4) {
        while (1) switch (_context4.prev = _context4.next) {
          case 0:
            formValidation = _this.receiveOfferFormComponentRef.current.validate();
            if (!(!_this.requestHasErrors() && formValidation)) {
              _context4.next = 9;
              break;
            }
            _context4.next = 4;
            return _this.props.sendReceiveOfferRequest(formValidation);
          case 4:
            result = _context4.sent;
            if (!result) {
              _this.setState({
                hasErrorReceiveOfferForm: true
              });
              _this.dialogContentRef.current.scrollTo(0, 0);
            }
            if (result) {
              _this.setState({
                hasErrorReceiveOfferForm: false
              });
            }
            _context4.next = 10;
            break;
          case 9:
            _this.verifyRequestErrors(formValidation.hasError);
          case 10:
          case "end":
            return _context4.stop();
        }
      }, _callee4);
    })));
    _defineProperty(_assertThisInitialized(_this), "setConfigurationCommentDebounced", (0, _utils.debounce)(function (value) {
      return _this.props.setConfigurationComment(value);
    }, 700));
    _defineProperty(_assertThisInitialized(_this), "handleBasketNoticeChange", function (event) {
      _this.setState({
        notice: event.target.value
      });
      _this.setConfigurationCommentDebounced(event.target.value);
    });
    _defineProperty(_assertThisInitialized(_this), "onSelectableChanged", function (priceData) {
      return function (key, newSelected) {
        var nextData = priceData.map(function (currentElement) {
          if (currentElement.key === key) {
            return _objectSpread(_objectSpread({}, currentElement), {}, {
              selected: newSelected,
              price: newSelected ? '10,00 €' : '0,00 €'
            });
          }
          return currentElement;
        });
        _this.setState({
          priceData: nextData
        });
      };
    });
    _defineProperty(_assertThisInitialized(_this), "priceListClick", function () {
      _this.priceListRef.current.scrollIntoView();
    });
    _defineProperty(_assertThisInitialized(_this), "showPriceListButton", function (inView) {
      _this.setState({
        inView: inView
      });
    });
    _defineProperty(_assertThisInitialized(_this), "renderDefaultPriceBox", function () {
      var _this$props4 = _this.props,
        classes = _this$props4.classes,
        amount = _this$props4.amount,
        boxed = _this$props4.boxed,
        priceFormatted = _this$props4.priceFormatted,
        hidePrices = _this$props4.hidePrices,
        hidePieces = _this$props4.hidePieces,
        vatNotice = _this$props4.vatNotice,
        showReceiveOfferForm = _this$props4.showReceiveOfferForm,
        showCallToAction = _this$props4.showCallToAction,
        showConfigurationModeSwitch = _this$props4.showConfigurationModeSwitch,
        ConfigurationModeSwitchComponent = _this$props4.ConfigurationModeSwitchComponent,
        isCreator = _this$props4.isCreator,
        width = _this$props4.width;
      var isMobile = (0, _isMobileDevice.isMobileDevice)() || width === 'xs';
      var boxStyle = boxed ? classes.card : classes.cardUnboxed;
      return /*#__PURE__*/_react["default"].createElement(_Card["default"], {
        className: (0, _clsx["default"])(boxStyle, (0, _customClassName["default"])('cta-box'))
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 3,
        sm: 12
      }, /*#__PURE__*/_react["default"].createElement(_CardContent["default"], {
        className: classes.cardContentWrapper,
        classes: {
          root: classes.AmountPriceContent
        }
      }, isCreator && !isMobile && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        container: true
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        sm: 12,
        md: 12,
        lg: 12,
        className: classes.summary
      }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "list_alt"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
        className: classes.configurationButton,
        variant: "text",
        size: "small",
        onClick: _this.openConfigurationOverview
      }, (0, _i18n.t)('amountPrice.configurationOverview')))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        container: true
      }, !hidePieces && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        sm: 6,
        md: 5,
        lg: 5
      }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
        variant: "text",
        size: "small",
        onClick: _this.openPriceOverview,
        classes: {
          root: classes.AmountPriceButton,
          sizeSmall: classes.smallButtonSize
        }
      }, amount, " ", (0, _i18n.t)('amountPrice.pieces'))), !hidePrices && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 12,
        sm: 6,
        md: 7,
        lg: 7
      }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
        variant: "body2",
        classes: {
          root: classes.AmountPriceTypography
        }
      }, /*#__PURE__*/_react["default"].createElement("b", null, priceFormatted)), priceFormatted && /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
        className: classes.pos,
        variant: "caption",
        classes: {
          root: classes.AmountPriceTypographyVat
        }
      }, /*#__PURE__*/_react["default"].createElement("i", null, vatNotice)))))), /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: 9,
        sm: 12
      }, /*#__PURE__*/_react["default"].createElement(_CardActions["default"], {
        className: classes.cardActions
      }, /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        container: true,
        spacing: 1
      }, showConfigurationModeSwitch && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: showCallToAction ? 6 : 12
      }, /*#__PURE__*/_react["default"].createElement(ConfigurationModeSwitchComponent, {
        className: (0, _customClassName["default"])('configuration-type-button'),
        classes: {
          root: classes.mainButton,
          label: classes.mainButtonLabel
        }
      })), showCallToAction && /*#__PURE__*/_react["default"].createElement(_Grid["default"], {
        item: true,
        xs: showConfigurationModeSwitch ? 6 : 12
      }, /*#__PURE__*/_react["default"].createElement(_AnalyticsWrapper["default"], {
        targetId: "add_to_cart"
      }, /*#__PURE__*/_react["default"].createElement(_MainButton["default"], {
        className: (0, _customClassName["default"])('cta-button'),
        variant: "contained",
        fullWidth: true,
        size: "medium",
        onClick: _this.onAddToCartClick,
        classes: {
          root: classes.mainButton,
          label: classes.mainButtonLabel
        }
      }, (0, _i18n.t)(showReceiveOfferForm ? 'receiveOfferForm.sendButton' : 'amountPrice.intoCart'))))))));
    });
    return _this;
  }
  _createClass(AmountPrice, [{
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps, prevState) {
      var _this$props5 = this.props,
        error = _this$props5.error,
        bulkNameErrors = _this$props5.bulkNameErrors;
      if (error && !(0, _isEqual["default"])(error, prevProps.error) && this.dialogContentRef.current) {
        this.dialogContentRef.current.scrollTo(0, 0);
      }
      if (bulkNameErrors !== prevProps.bulkNameErrors) {
        this.setState({
          bulkNameErrors: bulkNameErrors
        });
      }
      if (prevProps.addToCartPopUpLoader && !this.props.addToCartPopUpLoader) {
        this.handleClose();
      }
      var showPriceOverview = this.state.showPriceOverview;
      if (showPriceOverview !== prevState.showPriceOverview) {
        var onShowChange = this.props.onShowChange;
        onShowChange && onShowChange(showPriceOverview);
      }
      var showConfigurationOverview = this.state.showConfigurationOverview;
      if (showConfigurationOverview !== prevState.showConfigurationOverview) {
        var _onShowChange = this.props.onShowChange;
        _onShowChange && _onShowChange(showConfigurationOverview);
      }
      if (this.state.notice === prevState.notice && this.props.userComment !== this.state.notice) {
        this.setState({
          notice: this.props.userComment
        });
      }
    }
  }, {
    key: "renderConfigurationOverview",
    value: function renderConfigurationOverview() {
      var showConfigurationOverview = this.state.showConfigurationOverview;
      var _this$props6 = this.props,
        ConfigurationOverviewComponent = _this$props6.ConfigurationOverviewComponent,
        userConfiguration = _this$props6.userConfiguration,
        width = _this$props6.width,
        classes = _this$props6.classes;
      var dialogTitleId = 'configuration-overview-dialog-title';
      return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
        "aria-labelledby": dialogTitleId,
        classes: {
          paper: classes.dialogWrapper,
          container: width === 'md' || width === 'xs' ? classes.dialogPositioning : '',
          root: classes.dialogPositioning
        },
        BackdropProps: {
          className: classes.dialogPositioning
        },
        onClose: this.handleClose.bind(this),
        open: showConfigurationOverview,
        fullWidth: true,
        fullScreen: width === 'sm' || width === 'xs',
        scroll: "paper"
      }, /*#__PURE__*/_react["default"].createElement(_LoadingOverlay["default"], {
        show: this.props.addToCartPopUpLoader
      }), /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
        classes: {
          root: classes.dialogTitleRoot
        }
      }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
        variant: "body1",
        id: dialogTitleId
      }, /*#__PURE__*/_react["default"].createElement("b", null, (0, _i18n.t)('amountPrice.configurationOverview'))), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
        className: classes.closeIcon,
        onClick: this.handleClose.bind(this)
      }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "close"))), /*#__PURE__*/_react["default"].createElement(_RootRef["default"], {
        rootRef: this.dialogContentRef
      }, /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
        classes: {
          root: classes.contentPositioning
        }
      }, /*#__PURE__*/_react["default"].createElement(ConfigurationOverviewComponent, {
        optionclassifications: userConfiguration.optionclassifications
      }))));
    }
  }, {
    key: "renderDialogTitle",
    value: function renderDialogTitle(options) {
      var dialogTitleId = options.dialogTitleId;
      return this.props.renderDialogTitle ? this.props.renderDialogTitle(this.props, options) : /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
        variant: "body1",
        id: dialogTitleId
      }, /*#__PURE__*/_react["default"].createElement("b", null, (0, _i18n.t)(this.props.showReceiveOfferForm ? 'receiveOfferForm.sendButton' : 'amountPrice.intoCart')));
    }
  }, {
    key: "renderPriceOverview",
    value: function renderPriceOverview() {
      var _this2 = this;
      var _this$state = this.state,
        notice = _this$state.notice,
        showPriceOverview = _this$state.showPriceOverview,
        approval = _this$state.approval,
        inView = _this$state.inView,
        showErrors = _this$state.showErrors,
        bulkNameErrors = _this$state.bulkNameErrors,
        dataPrivacyAccepted = _this$state.dataPrivacyAccepted;
      var _this$props7 = this.props,
        amount = _this$props7.amount,
        priceList = _this$props7.priceList,
        priceFormatted = _this$props7.priceFormatted,
        onSelectableChanged = _this$props7.onSelectableChanged,
        showProductVariants = _this$props7.showProductVariants,
        ProductVariantComponent = _this$props7.ProductVariantComponent,
        error = _this$props7.error,
        width = _this$props7.width,
        hidePrices = _this$props7.hidePrices,
        title = _this$props7.title,
        classes = _this$props7.classes,
        showReceiveOfferForm = _this$props7.showReceiveOfferForm,
        vatNotice = _this$props7.vatNotice,
        clientTexts = _this$props7.clientTexts,
        displayAcceptDesign = _this$props7.displayAcceptDesign,
        notifications = _this$props7.notifications,
        showCallToAction = _this$props7.showCallToAction,
        ReceiveOfferFormComponent = _this$props7.ReceiveOfferFormComponent,
        AcceptDesignComponent = _this$props7.AcceptDesignComponent,
        PriceOverviewComponent = _this$props7.PriceOverviewComponent,
        NotificationComponent = _this$props7.NotificationComponent,
        PriceListComponent = _this$props7.PriceListComponent,
        AddToCartComponent = _this$props7.AddToCartComponent,
        AcceptPrivacyComponent = _this$props7.AcceptPrivacyComponent;
      var termsAndConditionsLink = clientTexts.termsAndConditionsLink,
        dataPrivacyLink = clientTexts.dataPrivacyLink;
      var mergedNotifications = _toConsumableArray(notifications) || [];
      if (showErrors && bulkNameErrors && bulkNameErrors.length > 0) {
        bulkNameErrors.map(function (error) {
          mergedNotifications.push({
            message: error,
            level: 'error',
            color: 'error'
          });
        });
      }
      var dialogTitleId = 'price-overview-dialog-title';
      return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
        "aria-labelledby": dialogTitleId,
        classes: {
          paper: classes.dialogWrapper,
          container: width === 'md' || width === 'xs' ? classes.dialogPositioning : '',
          root: classes.dialogPositioning
        },
        BackdropProps: {
          className: classes.dialogPositioning
        },
        onClose: this.handleClose.bind(this),
        open: showPriceOverview,
        maxWidth: 'md',
        fullWidth: true,
        fullScreen: width === 'sm' || width === 'xs',
        scroll: "paper"
      }, /*#__PURE__*/_react["default"].createElement(_LoadingOverlay["default"], {
        show: this.props.addToCartPopUpLoader
      }), /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
        classes: {
          root: classes.dialogTitleRoot
        }
      }, this.renderDialogTitle({
        dialogTitleId: dialogTitleId
      }), /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
        onClick: this.handleClose.bind(this),
        className: classes.closeIcon
      }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], null, "close"))), /*#__PURE__*/_react["default"].createElement(_RootRef["default"], {
        rootRef: this.dialogContentRef
      }, /*#__PURE__*/_react["default"].createElement(_AutoFocusDialogContentContainer["default"], {
        Component: _DialogContent["default"],
        classes: {
          root: classes.contentPositioning
        }
      }, this.state.hasErrorReceiveOfferForm && /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
        color: "error",
        variant: "body2"
      }, (0, _i18n.t)('receiveOfferForm.checkInputsInForm')), /*#__PURE__*/_react["default"].createElement(PriceOverviewComponent, {
        title: (0, _i18n.t)('amountPrice.productVariants'),
        contactData: (0, _i18n.t)('amountPrice.contactData'),
        handleClose: this.handleClose,
        amount: amount,
        acceptDesignComponent: showCallToAction ? /*#__PURE__*/_react["default"].createElement("div", {
          ref: this.acceptDesignRef
        }, /*#__PURE__*/_react["default"].createElement(AcceptDesignComponent, {
          termsAndConditionsLink: termsAndConditionsLink,
          displayAcceptDesign: displayAcceptDesign,
          handleChangeCheckboxApproval: this.handleChange,
          approval: approval,
          closeProductOverviewDialog: this.handleClose,
          notice: notice,
          noteLabel: (0, _i18n.t)('amountPrice.notice'),
          handleChange: this.handleBasketNoticeChange
        })) : null,
        acceptDataPrivacyComponent: showReceiveOfferForm && dataPrivacyLink ? /*#__PURE__*/_react["default"].createElement("div", {
          ref: this.acceptDataPrivacyRef
        }, /*#__PURE__*/_react["default"].createElement(AcceptPrivacyComponent, {
          dataPrivacyLink: dataPrivacyLink,
          displayAcceptDesign: true,
          handleChangeCheckboxApproval: this.handleChange,
          approval: dataPrivacyAccepted,
          closeProductOverviewDialog: this.handleClose,
          displayNote: false
        })) : null,
        notificationComponent: mergedNotifications.map(function (_ref6, key) {
          var message = _ref6.message,
            level = _ref6.level,
            color = _ref6.color;
          return /*#__PURE__*/_react["default"].createElement(NotificationComponent, {
            key: key,
            icon: level,
            color: color,
            notification: message
          });
        }),
        priceListComponent: /*#__PURE__*/_react["default"].createElement("div", {
          ref: this.priceListRef
        }, /*#__PURE__*/_react["default"].createElement(_reactIntersectionObserver.InView, {
          as: "div",
          onChange: function onChange(inView) {
            return _this2.showPriceListButton(inView);
          }
        }, /*#__PURE__*/_react["default"].createElement(PriceListComponent, {
          amount: amount,
          list: priceList,
          totalPrice: priceFormatted,
          taxNote: (0, _i18n.t)('amountPrice.vatNotice'),
          onSelectableChanged: onSelectableChanged,
          hidePrices: hidePrices,
          showReceiveOfferForm: showReceiveOfferForm,
          productTitle: title
        }))),
        productVariantComponent: showProductVariants && /*#__PURE__*/_react["default"].createElement(ProductVariantComponent, null),
        receiveOfferFormComponent: /*#__PURE__*/_react["default"].createElement(ReceiveOfferFormComponent, {
          innerRef: this.receiveOfferFormComponentRef
        }),
        showReceiveOfferForm: showReceiveOfferForm
      }))), /*#__PURE__*/_react["default"].createElement(DialogActionsWrapper, {
        onTouchMove: this.handleTouchMove
      }, /*#__PURE__*/_react["default"].createElement(AddToCartComponent, {
        buttonLabel: (0, _i18n.t)(showReceiveOfferForm ? 'receiveOfferForm.sendButton' : 'amountPrice.intoCart'),
        showCallToAction: showCallToAction,
        onPress: showReceiveOfferForm ? this.onReceiveOfferFormPress : this.onAddToBasket,
        handleChange: this.handleBasketNoticeChange,
        disabled: !!error,
        totalPrice: priceFormatted,
        taxNote: vatNotice,
        showPriceList: !inView,
        priceListLabel: (0, _i18n.t)('amountPrice.showPriceList'),
        priceListClick: this.priceListClick,
        hidePrices: hidePrices,
        amount: amount,
        showReceiveOfferForm: showReceiveOfferForm
      })));
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props8 = this.props,
        wrapperClass = _this$props8.wrapperClass,
        renderPriceBox = _this$props8.renderPriceBox,
        props = _objectWithoutProperties(_this$props8, _excluded2);
      var _this$state2 = this.state,
        showPriceOverview = _this$state2.showPriceOverview,
        showConfigurationOverview = _this$state2.showConfigurationOverview;
      var openPriceOverview = this.openPriceOverview,
        openConfigurationOverview = this.openConfigurationOverview,
        renderDefaultPriceBox = this.renderDefaultPriceBox;
      return /*#__PURE__*/_react["default"].createElement("div", {
        className: wrapperClass
      }, renderPriceBox ? renderPriceBox(_objectSpread(_objectSpread({}, props), {}, {
        openPriceOverview: openPriceOverview,
        openConfigurationOverview: openConfigurationOverview,
        renderDefaultPriceBox: renderDefaultPriceBox
      })) : this.renderDefaultPriceBox(), showPriceOverview && this.renderPriceOverview(), showConfigurationOverview && this.renderConfigurationOverview());
    }
  }]);
  return AmountPrice;
}(_react["default"].Component);
_defineProperty(AmountPrice, "defaultProps", {
  showCallToAction: true,
  showConfigurationModeSwitch: false,
  notifications: [],
  clientTexts: {
    termsAndConditionsLink: ''
  },
  hidePieces: false,
  ReceiveOfferFormComponent: _ReceiveOfferForm["default"],
  AcceptDesignComponent: _AcceptDesign["default"],
  PriceOverviewComponent: _PriceOverview["default"],
  ConfigurationOverviewComponent: _ConfigurationOverview["default"],
  NotificationComponent: _Notification["default"],
  PriceListComponent: _PriceList["default"],
  AddToCartComponent: _AddToBasket["default"],
  AcceptPrivacyComponent: _AcceptPrivacy["default"],
  skipPriceOverview: false
});
var _default = exports["default"] = (0, _withWidth["default"])()((0, _styles.withStyles)(styles, {
  name: 'AmountPrice'
})(AmountPrice));