"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.excludeZeroTypes = exports.InfoDialog = exports.IncludeZeroDialog = exports.ExcludeZeroDialog = exports.DeleteTrait = exports.DeleteScale = exports.DecreaseMaxPoints = void 0;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _styles = require("@material-ui/core/styles");

var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));

var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));

var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));

var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));

var _DialogContentText = _interopRequireDefault(require("@material-ui/core/DialogContentText"));

var _Button = _interopRequireDefault(require("@material-ui/core/Button"));

var _renderUi = require("@pie-lib/render-ui");

var _defaults = _interopRequireDefault(require("./defaults"));

var _defaults$configurati = _defaults["default"].configuration,
    excludeZeroDialogBoxContent = _defaults$configurati.excludeZeroDialogBoxContent,
    includeZeroDialogBoxContent = _defaults$configurati.includeZeroDialogBoxContent,
    deleteScaleDialogBoxContent = _defaults$configurati.deleteScaleDialogBoxContent,
    maxPointsDialogBoxContent = _defaults$configurati.maxPointsDialogBoxContent;
var excludeZeroTypes = {
  remove0: 'remove0',
  add0: 'add0',
  shiftLeft: 'shiftLeft',
  shiftRight: 'shiftRight'
};
exports.excludeZeroTypes = excludeZeroTypes;

var styles = function styles(theme) {
  return {
    root: {
      padding: theme.spacing.unit * 2.5
    },
    title: {
      padding: "0 0 ".concat(theme.spacing.unit * 2, "px 0"),
      '& h2': {
        fontSize: '20px',
        lineHeight: '23px',
        fontFamily: 'Cerebri Sans',
        color: _renderUi.color.text()
      }
    },
    text: {
      paddingLeft: '0',
      '& p': {
        fontSize: theme.typography.fontSize + 2,
        fontFamily: 'Cerebri Sans',
        color: _renderUi.color.text()
      }
    },
    button: {
      padding: "".concat(theme.spacing.unit * 1.5, "px ").concat(theme.spacing.unit * 2, "px"),
      borderRadius: '4px',
      fontSize: theme.typography.fontSize,
      fontFamily: 'Cerebri Sans',
      lineHeight: '14px',
      textTransform: 'none',
      background: _renderUi.color.primary(),
      color: theme.palette.common.white
    },
    cancelButton: {
      background: _renderUi.color.secondaryBackground(),
      color: _renderUi.color.text()
    }
  };
};

var RawExcludeZeroDialog = function RawExcludeZeroDialog(_ref) {
  var open = _ref.open,
      changeExcludeZero = _ref.changeExcludeZero,
      cancel = _ref.cancel,
      classes = _ref.classes;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, excludeZeroDialogBoxContent.title), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    classes: {
      root: classes.text
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
    dangerouslySetInnerHTML: {
      __html: excludeZeroDialogBoxContent.text
    }
  }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: "".concat(classes.button, " ").concat(classes.cancelButton)
    },
    onClick: function onClick() {
      return cancel();
    }
  }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: function onClick() {
      return changeExcludeZero(excludeZeroTypes.shiftLeft);
    }
  }, "Shift to Left"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: function onClick() {
      return changeExcludeZero(excludeZeroTypes.remove0);
    }
  }, "Remove 0 column")));
};

RawExcludeZeroDialog.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  changeExcludeZero: _propTypes["default"].func,
  cancel: _propTypes["default"].func
};
var ExcludeZeroDialog = (0, _styles.withStyles)(styles)(RawExcludeZeroDialog);
exports.ExcludeZeroDialog = ExcludeZeroDialog;

var RawIncludeZeroDialog = function RawIncludeZeroDialog(_ref2) {
  var open = _ref2.open,
      changeExcludeZero = _ref2.changeExcludeZero,
      cancel = _ref2.cancel,
      classes = _ref2.classes;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, includeZeroDialogBoxContent.title), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    classes: {
      root: classes.text
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
    dangerouslySetInnerHTML: {
      __html: includeZeroDialogBoxContent.text
    }
  }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: "".concat(classes.button, " ").concat(classes.cancelButton)
    },
    onClick: function onClick() {
      return cancel();
    }
  }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: function onClick() {
      return changeExcludeZero(excludeZeroTypes.shiftRight);
    }
  }, "Shift to Right"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: function onClick() {
      return changeExcludeZero(excludeZeroTypes.add0);
    }
  }, "Add 0 column")));
};

RawIncludeZeroDialog.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  changeExcludeZero: _propTypes["default"].func,
  cancel: _propTypes["default"].func
};
var IncludeZeroDialog = (0, _styles.withStyles)(styles)(RawIncludeZeroDialog);
exports.IncludeZeroDialog = IncludeZeroDialog;

var RawDecreaseMaxPoints = function RawDecreaseMaxPoints(_ref3) {
  var open = _ref3.open,
      deleteScorePoints = _ref3.deleteScorePoints,
      cancel = _ref3.cancel,
      classes = _ref3.classes;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, maxPointsDialogBoxContent.title), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    classes: {
      root: classes.text
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
    dangerouslySetInnerHTML: {
      __html: maxPointsDialogBoxContent.text
    }
  }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: "".concat(classes.button, " ").concat(classes.cancelButton)
    },
    onClick: cancel
  }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: deleteScorePoints
  }, "Confirm")));
};

RawDecreaseMaxPoints.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  deleteScorePoints: _propTypes["default"].func,
  cancel: _propTypes["default"].func
};
var DecreaseMaxPoints = (0, _styles.withStyles)(styles)(RawDecreaseMaxPoints);
exports.DecreaseMaxPoints = DecreaseMaxPoints;

var RawDeleteScale = function RawDeleteScale(_ref4) {
  var open = _ref4.open,
      scaleIndex = _ref4.scaleIndex,
      deleteScale = _ref4.deleteScale,
      cancel = _ref4.cancel,
      classes = _ref4.classes;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, "".concat(deleteScaleDialogBoxContent.title, " #").concat(scaleIndex + 1)), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    classes: {
      root: classes.text
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
    dangerouslySetInnerHTML: {
      __html: deleteScaleDialogBoxContent.text
    }
  }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: "".concat(classes.button, " ").concat(classes.cancelButton)
    },
    onClick: cancel
  }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: deleteScale
  }, "Delete")));
};

RawDeleteScale.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  scaleIndex: _propTypes["default"].number,
  deleteScale: _propTypes["default"].func,
  cancel: _propTypes["default"].func
};
var DeleteScale = (0, _styles.withStyles)(styles)(RawDeleteScale);
exports.DeleteScale = DeleteScale;

var RawDeleteTrait = function RawDeleteTrait(_ref5) {
  var open = _ref5.open,
      deleteTrait = _ref5.deleteTrait,
      cancel = _ref5.cancel,
      classes = _ref5.classes,
      traitLabel = _ref5.traitLabel;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, "Delete ", traitLabel), /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    classes: {
      root: classes.text
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogContentText["default"], null, /*#__PURE__*/_react["default"].createElement("div", {
    dangerouslySetInnerHTML: {
      __html: "Are you sure you want to delete this ".concat(traitLabel, "?")
    }
  }))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: "".concat(classes.button, " ").concat(classes.cancelButton)
    },
    onClick: cancel
  }, "Cancel"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: deleteTrait
  }, "Delete")));
};

RawDeleteTrait.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  deleteTrait: _propTypes["default"].func,
  cancel: _propTypes["default"].func,
  traitLabel: _propTypes["default"].string
};
var DeleteTrait = (0, _styles.withStyles)(styles)(RawDeleteTrait);
exports.DeleteTrait = DeleteTrait;

var RawInfoDialog = function RawInfoDialog(_ref6) {
  var classes = _ref6.classes,
      open = _ref6.open,
      text = _ref6.text,
      onClose = _ref6.onClose;
  return /*#__PURE__*/_react["default"].createElement(_Dialog["default"], {
    open: open,
    classes: {
      paper: classes.root
    }
  }, /*#__PURE__*/_react["default"].createElement(_DialogTitle["default"], {
    classes: {
      root: classes.title
    }
  }, text), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    classes: {
      root: classes.button
    },
    onClick: onClose
  }, "OK")));
};

RawInfoDialog.propTypes = {
  classes: _propTypes["default"].object,
  open: _propTypes["default"].bool,
  text: _propTypes["default"].string,
  cancel: _propTypes["default"].func,
  onClose: _propTypes["default"].func
};
var InfoDialog = (0, _styles.withStyles)(styles)(RawInfoDialog);
exports.InfoDialog = InfoDialog;
//# sourceMappingURL=modals.js.map