"use strict";

exports.__esModule = true;
exports.default = void 0;
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _button = _interopRequireDefault(require("../../atom/button"));
var _picture = _interopRequireDefault(require("../../atom/picture"));
var _style = _interopRequireDefault(require("./style.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const Header = ({
  step,
  header,
  subHeader
}) => /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.headerContainer
}, step ? /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.headerWrapper
}, /*#__PURE__*/_react.default.createElement("h1", {
  className: _style.default.step
}, step), /*#__PURE__*/_react.default.createElement("h1", {
  className: _style.default.header
}, header)) : /*#__PURE__*/_react.default.createElement("h1", {
  className: _style.default.header
}, header, " "), subHeader ? /*#__PURE__*/_react.default.createElement("h4", {
  className: _style.default.subHeader
}, subHeader, " ") : null);
Header.propTypes = process.env.NODE_ENV !== "production" ? {
  step: _propTypes.default.string,
  header: _propTypes.default.string,
  subHeader: _propTypes.default.string
} : {};
const QrCodeImage = ({
  showMobileAppAccess,
  qrCodeImageUrl,
  preMessage,
  linkMessage,
  endMessage,
  qrCodeImageAlt
}) => {
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.qrcodeWrapper
  }, /*#__PURE__*/_react.default.createElement(_picture.default, {
    src: qrCodeImageUrl,
    alt: qrCodeImageAlt
  }), showMobileAppAccess ? /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.qrcodeOverlay
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.qrcodeModal
  }, /*#__PURE__*/_react.default.createElement("span", null, preMessage, " "), /*#__PURE__*/_react.default.createElement("a", {
    href: "mailto:assistance@coorpacademy.com",
    className: _style.default.qrcodeModalLink
  }, /*#__PURE__*/_react.default.createElement("span", null, linkMessage, " ")), /*#__PURE__*/_react.default.createElement("span", null, endMessage, " "))) : null);
};
QrCodeImage.propTypes = process.env.NODE_ENV !== "production" ? {
  showMobileAppAccess: _propTypes.default.bool,
  qrCodeImageUrl: _propTypes.default.string,
  preMessage: _propTypes.default.string,
  linkMessage: _propTypes.default.string,
  endMessage: _propTypes.default.string,
  qrCodeImageAlt: _propTypes.default.string
} : {};
const MagicLink = ({
  disabled,
  submitValue,
  magicLinkUrl,
  color
}) => {
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.buttonWrapper
  }, /*#__PURE__*/_react.default.createElement(_button.default, {
    color: color,
    disabled: disabled,
    isLinkDisabled: disabled,
    href: magicLinkUrl,
    type: "link",
    submitValue: null
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.iconWrapper
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyMagicWand, {
    className: _style.default.magicLinkIcon
  }), /*#__PURE__*/_react.default.createElement("p", null, submitValue))));
};
MagicLink.propTypes = process.env.NODE_ENV !== "production" ? {
  magicLinkUrl: _propTypes.default.string,
  disabled: _propTypes.default.bool,
  submitValue: _propTypes.default.string
} : {};
const StoresLinks = ({
  onAppStoreButtonClick,
  appStoreButtonImageUrl,
  playStoreButtonImageUrl,
  onPlayStoreButtonClick,
  'android-alt': androidAlt,
  'ios-alt': iosAlt
}) => /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.storeLinksContainer
}, /*#__PURE__*/_react.default.createElement(_picture.default, {
  className: _style.default.img,
  src: appStoreButtonImageUrl,
  onClick: onAppStoreButtonClick,
  alt: iosAlt
}), /*#__PURE__*/_react.default.createElement(_picture.default, {
  className: _style.default.img,
  src: playStoreButtonImageUrl,
  onClick: onPlayStoreButtonClick,
  alt: androidAlt
}));
StoresLinks.propTypes = process.env.NODE_ENV !== "production" ? {
  onAppStoreButtonClick: _propTypes.default.func,
  appStoreButtonImageUrl: _propTypes.default.string,
  playStoreButtonImageUrl: _propTypes.default.string,
  onPlayStoreButtonClick: _propTypes.default.func,
  'android-alt': _propTypes.default.string,
  'ios-alt': _propTypes.default.string
} : {};
const Divider = ({
  word
}) => /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.dividerWrapper
}, /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.divider
}), /*#__PURE__*/_react.default.createElement("p", null, word), /*#__PURE__*/_react.default.createElement("div", {
  className: _style.default.divider
}));
Divider.propTypes = process.env.NODE_ENV !== "production" ? {
  word: _propTypes.default.string
} : {};
const GetTheApp = (props, context) => {
  const {
    onAppStoreButtonClick,
    appStoreButtonImageUrl,
    playStoreButtonImageUrl,
    onPlayStoreButtonClick,
    storeStep,
    connectionStep,
    qrCodeStep,
    magicLinkStep,
    diviserWord,
    qrCodeImageUrl,
    magicLinkUrl,
    disabled,
    showMobileAppAccess,
    submitValue,
    preMessage,
    linkMessage,
    endMessage,
    'android-alt': androidAlt,
    'ios-alt': iosAlt,
    qrCodeImageAlt,
    'logo-aria-label': coorpAppLogoAriaLabel
  } = props;
  const {
    skin
  } = context;
  const primaryColor = (0, _get2.default)('common.primary', skin);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.container
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.coorpAppLogoWrapper
  }, /*#__PURE__*/_react.default.createElement(_novaIcons.NovaCompositionCoorpacademyCoorpApp, {
    height: 51,
    width: 250,
    className: _style.default.coorpAppLogo,
    "aria-label": coorpAppLogoAriaLabel
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.store
  }, /*#__PURE__*/_react.default.createElement(Header, storeStep), /*#__PURE__*/_react.default.createElement(StoresLinks, {
    onAppStoreButtonClick: onAppStoreButtonClick,
    appStoreButtonImageUrl: appStoreButtonImageUrl,
    playStoreButtonImageUrl: playStoreButtonImageUrl,
    onPlayStoreButtonClick: onPlayStoreButtonClick,
    "android-alt": androidAlt,
    "ios-alt": iosAlt
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.secondStepWrapper
  }, /*#__PURE__*/_react.default.createElement(Header, connectionStep), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.connectionWrapper
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.wrapper
  }, /*#__PURE__*/_react.default.createElement(Header, qrCodeStep), /*#__PURE__*/_react.default.createElement(QrCodeImage, {
    showMobileAppAccess: showMobileAppAccess,
    qrCodeImageUrl: qrCodeImageUrl,
    preMessage: preMessage,
    linkMessage: linkMessage,
    endMessage: endMessage,
    qrCodeImageAlt: qrCodeImageAlt
  })), /*#__PURE__*/_react.default.createElement(Divider, {
    word: diviserWord
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _style.default.wrapper
  }, /*#__PURE__*/_react.default.createElement(Header, magicLinkStep), /*#__PURE__*/_react.default.createElement(MagicLink, {
    style: {
      color: primaryColor
    },
    submitValue: submitValue,
    disabled: disabled,
    magicLinkUrl: magicLinkUrl
  })))));
};
GetTheApp.propTypes = process.env.NODE_ENV !== "production" ? {
  ...StoresLinks.propTypes,
  storeStep: _propTypes.default.shape(Header.propTypes),
  connectionStep: _propTypes.default.shape(Header.propTypes),
  qrCodeStep: _propTypes.default.shape(Header.propTypes),
  magicLinkStep: _propTypes.default.shape(Header.propTypes),
  ...QrCodeImage.propTypes,
  diviserWord: Divider.propTypes.word,
  ...MagicLink.propTypes
} : {};
var _default = exports.default = GetTheApp;
//# sourceMappingURL=index.js.map