"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireWildcard(require("react"));
var _AnnouncementModalLayoutSt = require("./AnnouncementModalLayout.st.css.js");
var _TextButton = _interopRequireDefault(require("../TextButton"));
var _constants = require("./constants");
var _BaseModalLayout = _interopRequireDefault(require("../BaseModalLayout"));
var _deprecationLog = _interopRequireDefault(require("../utils/deprecationLog"));
var _excluded = ["theme", "actionsSize"],
  _excluded2 = ["className", "children", "footnoteSkin"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/AnnouncementModalLayout/AnnouncementModalLayout.tsx";
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 _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
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) { (0, _defineProperty2.default)(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; }
/** A layout for announcement modals, to be used inside a &lt;Modal /&gt; */
var AnnouncementModalLayout = _ref => {
  var {
      theme = 'standard',
      // TODO: add default value for skin once theme is removed
      actionsSize = 'medium'
    } = _ref,
    propsWithoutDefaults = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var _theme$actionsSize$pr = _objectSpread({
      theme,
      actionsSize
    }, propsWithoutDefaults),
    {
      className,
      children,
      footnoteSkin
    } = _theme$actionsSize$pr,
    restProps = (0, _objectWithoutProperties2.default)(_theme$actionsSize$pr, _excluded2);
  var skin = propsWithoutDefaults.skin || theme;
  (0, _react.useEffect)(() => {
    if (theme) {
      (0, _deprecationLog.default)('<AnnouncementModalLayout/> - prop "theme" is deprecated and will be removed in next major release, please use "skin" property instead.');
    }
  }, [theme]);
  return /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default, (0, _extends2.default)({
    className: (0, _AnnouncementModalLayoutSt.st)(_AnnouncementModalLayoutSt.classes.announcementModalLayout, className)
  }, restProps, {
    skin: skin,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 5
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Illustration, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 37,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Header, {
    titleSize: "extraLarge",
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 38,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Content, {
    hideTopScrollDivider: true,
    hideBottomScrollDivider: true,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 40,
      columnNumber: 7
    }
  }, children), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Footer, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 44,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(Link, (0, _extends2.default)({}, restProps, {
    skin: skin,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 45,
      columnNumber: 7
    }
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: _AnnouncementModalLayoutSt.classes.bottomSpacing,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 46,
      columnNumber: 7
    }
  }), /*#__PURE__*/_react.default.createElement(_BaseModalLayout.default.Footnote, {
    skin: footnoteSkin,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 47,
      columnNumber: 7
    }
  }));
};
var Link = _ref2 => {
  var {
    linkText,
    linkOnClick,
    skin
  } = _ref2;
  return (linkText || linkOnClick) && /*#__PURE__*/_react.default.createElement("div", {
    className: _AnnouncementModalLayoutSt.classes.link,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 58,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_TextButton.default, {
    size: "small",
    weight: "normal",
    dataHook: _constants.dataHooks.link,
    onClick: linkOnClick,
    skin: skin,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 59,
      columnNumber: 7
    }
  }, linkText)) || null;
};
AnnouncementModalLayout.displayName = 'AnnouncementModalLayout';
var _default = exports.default = AnnouncementModalLayout;
//# sourceMappingURL=AnnouncementModalLayout.js.map