"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

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

var _Collapse = _interopRequireDefault(require("../../../../common/Collapse"));

var _ImageConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/ImageConfig"));

var _ButtonConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/ButtonConfig"));

var _TextConfig = _interopRequireDefault(require("../../../../meta-comp/config-panels/TextConfig"));

var _BackgroundConfig = _interopRequireDefault(require("../../../common/config-panels/BackgroundConfig"));

var _common = require("../../../../common");

var _businessUtil = require("../../../../utils/businessUtil");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var __extends = void 0 && (void 0).__extends || function () {
  var _extendStatics = function extendStatics(d, b) {
    _extendStatics = Object.setPrototypeOf || {
      __proto__: []
    } instanceof Array && function (d, b) {
      d.__proto__ = b;
    } || function (d, b) {
      for (var p in b) {
        if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
      }
    };

    return _extendStatics(d, b);
  };

  return function (d, b) {
    if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");

    _extendStatics(d, b);

    function __() {
      this.constructor = d;
    }

    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
}();

var ImageTextSecondConfig =
/** @class */
function (_super) {
  __extends(ImageTextSecondConfig, _super);

  function ImageTextSecondConfig() {
    var _this = _super !== null && _super.apply(this, arguments) || this;

    _this.state = {};

    _this.getContentPanel = function (data) {
      var source = [{
        key: 'imageTextSecondContent1',
        name: 'Image',
        value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
          data: data.image
        }),
        metaOption: data.image
      }, {
        key: 'imageTextSecondContent2',
        name: 'Title',
        value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
          data: data.title
        }),
        metaOption: data.title
      }, {
        key: 'imageTextSecondContent3',
        name: 'Text',
        value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
          data: data.text
        }),
        metaOption: data.text
      }, {
        key: 'imageTextSecondContent4',
        name: 'Button',
        value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
          data: data.button
        }),
        metaOption: data.button
      }, {
        key: 'imageTextSecondContent5',
        name: 'Secondary Button',
        value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
          data: data.secondButton
        }),
        metaOption: data.secondButton
      }];
      return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
        headerSize: "middle",
        onRefresh: function onRefresh() {
          return (0, _businessUtil.renderPreview)();
        },
        showActiveColor: true,
        source: source,
        type: "switch"
      }), /*#__PURE__*/_react["default"].createElement(_common.Field, null, /*#__PURE__*/_react["default"].createElement(_BackgroundConfig["default"], {
        data: data.background
      })));
    };

    return _this;
  }

  ImageTextSecondConfig.prototype.render = function () {
    var panelProps = this.props.panelProps;
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: "banner_second_conf_wrap"
    }, /*#__PURE__*/_react["default"].createElement(_Collapse["default"], {
      divider: "bold",
      headerSize: "large",
      source: [{
        key: 'imageTextSecondConfig1',
        name: 'Content',
        value: this.getContentPanel(panelProps)
      }, {
        key: 'imageTextSecondConfig2',
        name: 'Hover',
        value: this.getContentPanel(panelProps.hover)
      }]
    }));
  };

  ImageTextSecondConfig.defaultProps = {
    panelProps: {}
  };
  return ImageTextSecondConfig;
}(_react["default"].Component);

var _default = ImageTextSecondConfig;
exports["default"] = _default;