"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _stylesModule = _interopRequireDefault(require("./styles.module.css"));
var _Phase = require("./Phase1");
var _Phase2 = require("./Phase2");
var _Phase3 = require("./Phase3");
var _Phase4 = require("./Phase4");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const OverlayingTutorial = _ref => {
  let {
    onTutorialFinished,
    tutorialPhase,
    setTutorialPhase
  } = _ref;
  const onFinished = () => {
    if (onTutorialFinished) {
      onTutorialFinished();
    }
  };
  if (!tutorialPhase) {
    return null;
  }
  const onOverlayClick = e => {
    e.stopPropagation();
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
    className: _stylesModule.default.overlay,
    onClick: onOverlayClick,
    children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
      className: _stylesModule.default.tutorialBody,
      children: [tutorialPhase === 1 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase.Phase1, {
        nextPhase: () => setTutorialPhase(2)
      }) : null, tutorialPhase === 2 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase2.Phase2, {
        nextPhase: () => setTutorialPhase(3)
      }) : null, tutorialPhase === 3 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase3.Phase3, {
        nextPhase: () => setTutorialPhase(4)
      }) : null, tutorialPhase === 4 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Phase4.Phase4, {
        nextPhase: onFinished
      }) : null]
    })
  });
};
var _default = exports.default = OverlayingTutorial;