"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

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

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

var _classnames = _interopRequireDefault(require("classnames"));

var _mblog = _interopRequireDefault(require("../mblog"));

var _praiseRecord = _interopRequireDefault(require("../praise-record"));

var _CommunicationRecord = _interopRequireDefault(require("./CommunicationRecord"));

var _requestV = require("../../utils/request-v1");

var _bsGlobal = require("../../utils/bs-global");

var _style = require("./style");

var _openData = require("../../utils/open-data");

var _getLocale = require("../../utils/getLocale");

var _avatar = _interopRequireDefault(require("../avatar"));

require("./index.css");

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

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }

function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }

function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }

function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

var prefix = 'titaui-communication';

var Communication = /*#__PURE__*/function (_PureComponent) {
  _inherits(Communication, _PureComponent);

  var _super = _createSuper(Communication);

  function Communication(props) {
    var _this;

    _classCallCheck(this, Communication);

    _this = _super.call(this, props);

    _this.getFeedInfo = function (feedId, commentCount) {
      var _this$props = _this.props,
          commentType = _this$props.commentType,
          okrFeedParams = _this$props.okrFeedParams;
      var url = commentType == 1 ? (0, _requestV.getApiUrl2)("comment/Get?feed_id=".concat(feedId, "&comment_type=0")) : (0, _requestV.getApiUrl)("okr/cycle/getFeed?objId=".concat(okrFeedParams && okrFeedParams.objId, "&objType=").concat(okrFeedParams && okrFeedParams.objType, "&cycleType=").concat(okrFeedParams && okrFeedParams.cycleType, "&yqmNum=").concat(okrFeedParams && okrFeedParams.yqmNum, "&annualNum=").concat(okrFeedParams && okrFeedParams.annualNum, "&commentCount=").concat(commentCount));
      (0, _requestV.taker)(url, 'GET').then(function (res) {
        if (res.Code === 1) {
          var data = res.Data && (res.Data.feedComments || res.Data);

          _this.setState({
            communicationTrackList: data.comments ? data.comments : [],
            communicationTrackTotal: data.total,
            okrCommentFeedId: commentType === 2 ? res.Data.feedId : ''
          });
        } else {
          _this.setState({
            communicationTrackList: [],
            communicationTrackTotal: 0
          });
        }
      });
    };

    _this.handlerSwitchShowRecord = function () {
      var feedId = _this.props.feedId; // 默认展示条数

      var communicationTrackTotal = _this.state.communicationTrackTotal; // 记录总数

      var isShowAllCommunicationRecord = _this.state.isShowAllCommunicationRecord;
      isShowAllCommunicationRecord = !isShowAllCommunicationRecord;

      _this.setState({
        isShowAllCommunicationRecord: isShowAllCommunicationRecord
      }, function () {
        if (isShowAllCommunicationRecord) {
          _this.getFeedInfo(feedId, communicationTrackTotal);
        }
      });
    };

    _this.handlerCommunicationRecordChange = function (event, actionType, index) {
      event.stopPropagation();
      event.nativeEvent.stopImmediatePropagation();
      var _this$props2 = _this.props,
          feedId = _this$props2.feedId,
          commentCount = _this$props2.commentCount;
      var _this$state = _this.state,
          isShowAllCommunicationRecord = _this$state.isShowAllCommunicationRecord,
          communicationTrackTotal = _this$state.communicationTrackTotal;

      var communicationTrackList = _toConsumableArray(_this.state.communicationTrackList);

      if (actionType === 'delete') {
        // 删除
        var url = (0, _requestV.getApiUrl2)("comment/Delete?comment_id=".concat(communicationTrackList[index].commentId, "&feed_id=").concat(feedId || _this.state.okrCommentFeedId));
        (0, _requestV.taker)(url, 'DELETE').then(function (res) {
          if (res.Code === 1) {
            isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal - 1) : _this.getFeedInfo(feedId, commentCount);

            if (_this.props.onReplyChange) {
              _this.props.onReplyChange({
                submitType: 'delete'
              });
            }
          }
        });
      } else if (actionType === 'reply') {
        // 沟通里的回复
        if (_this.props.useCustomMblog && _this.props.onComment) {
          _this.props.onComment({
            userName: communicationTrackList[index].publishUser.name,
            userId: communicationTrackList[index].publishUser.userId,
            commentId: communicationTrackList[index].commentId
          });

          return;
        }

        if (_this.props.textareaRef) {
          setTimeout(function () {
            // @ts-ignore
            _this.props.textareaRef.focus();
          }, 300);
        }

        _this.setState({
          isShowReplyToUser: true,
          replyUser: communicationTrackList[index].publishUser.name,
          replyUserId: communicationTrackList[index].publishUser.userId,
          replyUserCommentId: communicationTrackList[index].commentId,
          isShowDefaultInput: false,
          needAutoFocus: true
        });
      } else if (actionType === 'praise') {
        // 沟通里的点赞
        var isPraise = communicationTrackList[index].isPraise;
        isPraise = !isPraise;

        _this.setState({
          praiseStatus: 2
        });

        var _url = isPraise ? (0, _requestV.getApiUrl)("praise/add?objId=".concat(communicationTrackList[index].commentId, "&objType=19&praiseType=1")) : (0, _requestV.getApiUrl)("praise/cancel?objId=".concat(communicationTrackList[index].commentId, "&objType=19"));

        (0, _requestV.taker)(_url, 'POST').then(function (res) {
          if (res.Code === 1) {
            var praiseTotal = communicationTrackList[index].praiseTotal;
            communicationTrackList[index].isPraise = isPraise;
            communicationTrackList[index].praiseTotal = isPraise ? praiseTotal + 1 : praiseTotal - 1;

            _this.setState({
              praiseStatus: 1,
              communicationTrackList: communicationTrackList
            });
          } else {
            _this.setState({
              praiseStatus: 0
            });
          }
        });
      } else if (actionType === 'showPraiseRecord') {
        // 显示点赞记录
        _this.setState({
          isShowPraiseRecordPop: true,
          praiseObjId: communicationTrackList[index].commentId
        });
      }

      _this.setState({
        submitStatus: 0
      });
    };

    _this.refresh = function () {
      var _this$props3 = _this.props,
          feedId = _this$props3.feedId,
          commentCount = _this$props3.commentCount;
      var _this$state2 = _this.state,
          communicationTrackTotal = _this$state2.communicationTrackTotal,
          isShowAllCommunicationRecord = _this$state2.isShowAllCommunicationRecord;
      isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal) : _this.getFeedInfo(feedId, commentCount);
    };

    _this.customSubmitCallback = function (res) {
      var _this$state3 = _this.state,
          communicationTrackList = _this$state3.communicationTrackList,
          isShowAllCommunicationRecord = _this$state3.isShowAllCommunicationRecord,
          communicationTrackTotal = _this$state3.communicationTrackTotal;
      var _this$props4 = _this.props,
          feedId = _this$props4.feedId,
          commentCount = _this$props4.commentCount;

      if (res.Code === 1) {
        _this.setState({
          submitStatus: 1,
          isShowReplyToUser: false,
          isShowDefaultInput: true
        });

        if (!feedId) {
          _this.setState({
            communicationTrackList: [].concat(_toConsumableArray(communicationTrackList), [res.Data])
          });

          return;
        }

        if (isShowAllCommunicationRecord) _this.getFeedInfo(feedId, communicationTrackTotal + 1);else _this.getFeedInfo(feedId, commentCount);
      } else {
        _this.setState({
          submitStatus: 0
        });
      }
    };

    _this.handlerReply = function (submitType, sentData) {
      var _this$state4 = _this.state,
          isShowReplyToUser = _this$state4.isShowReplyToUser,
          replyUserCommentId = _this$state4.replyUserCommentId,
          communicationTrackTotal = _this$state4.communicationTrackTotal,
          isShowAllCommunicationRecord = _this$state4.isShowAllCommunicationRecord;
      var _this$props5 = _this.props,
          feedId = _this$props5.feedId,
          commentCount = _this$props5.commentCount,
          commentType = _this$props5.commentType,
          okrFeedParams = _this$props5.okrFeedParams,
          onReplyChange = _this$props5.onReplyChange,
          customSubmitHandlerSync = _this$props5.customSubmitHandlerSync,
          customSubmitHandler = _this$props5.customSubmitHandler;

      if (submitType === 'submit' && customSubmitHandlerSync) {
        customSubmitHandlerSync(sentData).then(_this.customSubmitCallback);
        return;
      }

      if (submitType === 'submit' && customSubmitHandler) {
        customSubmitHandler(sentData, _this.customSubmitCallback);
        return;
      }

      if (submitType === 'submit') {
        // 发送
        sentData.FeedId = feedId;
        sentData.CommentId = 0;
        sentData.ObjId = 0;
        sentData.ObjType = 0;
        sentData.Content = sentData.Content || ' ';

        if (isShowReplyToUser) {
          sentData.CommentId = replyUserCommentId;
        }

        _this.setState({
          submitStatus: 2
        });

        var url = commentType === 1 ? (0, _requestV.getApiUrl2)('comment/Add') : (0, _requestV.getApiUrl)("okr/cycle/addComment?objId=".concat(okrFeedParams && okrFeedParams.objId, "&objType=").concat(okrFeedParams && okrFeedParams.objType, "&cycleType=").concat(okrFeedParams && okrFeedParams.cycleType, "&yqmNum=").concat(okrFeedParams && okrFeedParams.yqmNum, "&annualNum=").concat(okrFeedParams && okrFeedParams.annualNum));
        (0, _requestV.taker)(url, 'POST', sentData).then(function (res) {
          if (res.Code === 1) {
            isShowAllCommunicationRecord ? _this.getFeedInfo(feedId, communicationTrackTotal + 1) : _this.getFeedInfo(feedId, commentCount);

            _this.setState({
              submitStatus: 1,
              isShowReplyToUser: false,
              isShowDefaultInput: true
            });
          } else {
            _this.setState({
              submitStatus: 0
            });
          }
        });
      } else {
        // 取消
        _this.setState({
          submitStatus: 0
        });
      }

      if (onReplyChange) {
        onReplyChange({
          submitType: submitType
        });
      }
    };

    _this.handlerCancelReplyUser = function () {
      return _this.setState({
        isShowReplyToUser: false
      });
    };

    _this.handleShowMblog = function () {
      _this.setState({
        isShowDefaultInput: false,
        needAutoFocus: true
      });
    };

    var showDefaultInput = props.showDefaultInput,
        usePropsComment = props.usePropsComment,
        communication = props.communication;
    var comments = usePropsComment ? communication || [] : [];
    var communicationLength = props.totalCommunicationNum || comments.length;
    _this.state = {
      communicationTrackList: comments,
      // 沟通记录
      communicationTrackTotal: communicationLength,
      // 沟通记录条数
      isShowAllCommunicationRecord: false,
      // 是否显示所有记录
      // 回复
      replyUser: '',
      replyUserId: '',
      replyUserCommentId: '0',
      isShowReplyToUser: false,
      // 是否显示回复谁
      submitStatus: 0,
      praiseStatus: 0,
      // 点赞记录
      praiseObjId: '',
      isShowPraiseRecordPop: false,
      okrCommentFeedId: '',
      isShowDefaultInput: showDefaultInput && communicationLength !== 0 ? true : false,
      needAutoFocus: false
    };
    return _this;
  }

  _createClass(Communication, [{
    key: "componentDidMount",
    value: function componentDidMount() {
      var _this$props6 = this.props,
          feedId = _this$props6.feedId,
          commentCount = _this$props6.commentCount,
          commentType = _this$props6.commentType,
          usePropsComment = _this$props6.usePropsComment;

      if ((feedId || commentType === 2) && !usePropsComment) {
        this.getFeedInfo(feedId, commentCount);
      }
    }
  }, {
    key: "componentDidUpdate",
    value: function componentDidUpdate(prevProps, prevState) {
      if (prevProps.feedId !== this.props.feedId || prevProps.okrFeedParams !== this.props.okrFeedParams || prevProps.usePropsComment !== this.props.usePropsComment) {
        var _this$props7 = this.props,
            feedId = _this$props7.feedId,
            commentCount = _this$props7.commentCount;
        this.getFeedInfo(feedId, commentCount);
      }
    }
    /**
     *获取feed信息
     * @feed_id
     * @commentCount 返回的回复条数
     * @memberof Cooperation
     */

  }, {
    key: "render",
    value: function render() {
      var _this2 = this;

      var _this$state5 = this.state,
          communicationTrackList = _this$state5.communicationTrackList,
          communicationTrackTotal = _this$state5.communicationTrackTotal,
          isShowAllCommunicationRecord = _this$state5.isShowAllCommunicationRecord,
          replyUser = _this$state5.replyUser,
          replyUserId = _this$state5.replyUserId,
          isShowReplyToUser = _this$state5.isShowReplyToUser,
          submitStatus = _this$state5.submitStatus,
          isShowPraiseRecordPop = _this$state5.isShowPraiseRecordPop,
          praiseObjId = _this$state5.praiseObjId,
          isShowDefaultInput = _this$state5.isShowDefaultInput,
          needAutoFocus = _this$state5.needAutoFocus;
      var _this$props8 = this.props,
          feedId = _this$props8.feedId,
          className = _this$props8.className,
          isShowSendSms = _this$props8.isShowSendSms,
          confirmPopAlign = _this$props8.confirmPopAlign,
          setTextareaRef = _this$props8.setTextareaRef,
          userSelectorPopAlign = _this$props8.userSelectorPopAlign,
          emotionsSelectorPopAlign = _this$props8.emotionsSelectorPopAlign,
          showAtAll = _this$props8.showAtAll,
          atAllTipText = _this$props8.atAllTipText,
          atAllValue = _this$props8.atAllValue,
          atAllText = _this$props8.atAllText,
          commentCount = _this$props8.commentCount,
          useCustomMblog = _this$props8.useCustomMblog,
          _this$props8$submitTe = _this$props8.submitText,
          submitText = _this$props8$submitTe === void 0 ? (0, _getLocale.getLocale)('Mod_Reply') : _this$props8$submitTe,
          _this$props8$highLigh = _this$props8.highLightKeyWord,
          highLightKeyWord = _this$props8$highLigh === void 0 ? '' : _this$props8$highLigh,
          _this$props8$autoFocu = _this$props8.autoFocus,
          autoFocus = _this$props8$autoFocu === void 0 ? false : _this$props8$autoFocu,
          _this$props8$showUser = _this$props8.showUser,
          showUser = _this$props8$showUser === void 0 ? false : _this$props8$showUser,
          _this$props8$attachem = _this$props8.attachemntCanSubmit,
          attachemntCanSubmit = _this$props8$attachem === void 0 ? true : _this$props8$attachem,
          useMouseDown = _this$props8.useMouseDown;
      var user = (0, _bsGlobal.getUserInfo)();
      return /*#__PURE__*/_react["default"].createElement(_style.CommunicationWrapper, {
        className: "communcation-wrapper ".concat(className)
      }, /*#__PURE__*/_react["default"].createElement("div", null, communicationTrackTotal > 3 && /*#__PURE__*/_react["default"].createElement(_style.CommunicationRecordTotal, null, /*#__PURE__*/_react["default"].createElement("div", {
        className: "".concat(prefix, "__communication-total"),
        onMouseDown: function onMouseDown() {
          return _this2.handlerSwitchShowRecord();
        }
      }, (0, _getLocale.getLocale)('Mod_Allcommu'), "\xA0", /*#__PURE__*/_react["default"].createElement("span", null, communicationTrackTotal), communicationTrackTotal > commentCount && /*#__PURE__*/_react["default"].createElement("i", {
        className: (0, _classnames["default"])("".concat(prefix, "__communication-total-icon"), {
          'tu-icon-APP-xi': !isShowAllCommunicationRecord,
          'tu-icon-arrow-down1': isShowAllCommunicationRecord
        })
      }))), /*#__PURE__*/_react["default"].createElement("div", {
        className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefix, "__communication-list"), communicationTrackList.length > 0))
      }, communicationTrackList.length > 0 && communicationTrackList.map(function (item, index) {
        var length = communicationTrackList.length;

        if (!isShowAllCommunicationRecord && index < length - commentCount) {
          return;
        }

        return /*#__PURE__*/_react["default"].createElement(_CommunicationRecord["default"], {
          communicationTrack: item,
          highLightKeyWord: highLightKeyWord,
          index: index,
          key: item.commentId,
          praiseStatus: _this2.state.praiseStatus,
          confirmPopAlign: confirmPopAlign,
          onCommunicationRecordChange: function onCommunicationRecordChange(event, actionType, index) {
            return _this2.handlerCommunicationRecordChange(event, actionType, index);
          }
        });
      }))), !useCustomMblog && /*#__PURE__*/_react["default"].createElement("div", {
        className: "".concat(prefix, "__reply-container")
      }, isShowReplyToUser && /*#__PURE__*/_react["default"].createElement(_style.ReplyToUser, {
        height: isShowReplyToUser ? 'auto' : '0',
        padding: isShowReplyToUser ? '4px 0' : '0',
        className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefix, "__reply-container--show-user"), showUser))
      }, /*#__PURE__*/_react["default"].createElement(_style.ReplyUser, null, /*#__PURE__*/_react["default"].createElement("span", {
        className: "".concat(prefix, "__reply-container-text")
      }, (0, _getLocale.getLocale)('Mod_Reply')), /*#__PURE__*/_react["default"].createElement("span", {
        className: "name"
      }, /*#__PURE__*/_react["default"].createElement(_openData.OpenUserName, {
        name: replyUser,
        id: replyUserId
      })), /*#__PURE__*/_react["default"].createElement("span", {
        className: "tu-icon-cross",
        onMouseDown: this.handlerCancelReplyUser
      }))), isShowDefaultInput && !isShowReplyToUser && /*#__PURE__*/_react["default"].createElement("div", {
        className: "".concat(prefix, "__reply-default-input")
      }, /*#__PURE__*/_react["default"].createElement("span", {
        className: "".concat(prefix, "__reply-default-input-avatar")
      }, /*#__PURE__*/_react["default"].createElement(_avatar["default"], {
        size: {
          width: 28,
          textNum: 1,
          fontSize: 14
        },
        name: user.Name,
        color: user.UserAvatar.Color,
        src: user.UserAvatar.Medium,
        userId: user.Id
      })), /*#__PURE__*/_react["default"].createElement("span", {
        onClick: this.handleShowMblog,
        className: "".concat(prefix, "__reply-default-input-text")
      }, "\u8F93\u5165\u6C9F\u901A\u5185\u5BB9")), !isShowDefaultInput && /*#__PURE__*/_react["default"].createElement(_mblog["default"], {
        setTextareaRef: setTextareaRef || function () {},
        isHasPlaceholder: true,
        placeholderText: (0, _getLocale.getLocale)('Mod_contentofyour'),
        isShowRange: false,
        isShowBtnCancel: false,
        isShowSendSms: isShowSendSms,
        submitText: submitText,
        showAtAll: showAtAll,
        attachemntCanSubmit: attachemntCanSubmit,
        atAllText: atAllText,
        atAllTipText: atAllTipText,
        atAllValue: atAllValue,
        commentsTypeKey: feedId,
        submitStatus: submitStatus,
        userSelectorPopAlign: userSelectorPopAlign,
        emotionsSelectorPopAlign: emotionsSelectorPopAlign,
        autoFocus: autoFocus || needAutoFocus,
        autoResizing: false,
        onMblogSubmit: function onMblogSubmit(submitType, sentData) {
          return _this2.handlerReply(submitType, sentData);
        },
        showUser: showUser,
        useMouseDown: useMouseDown
      })), isShowPraiseRecordPop && /*#__PURE__*/_react["default"].createElement(_praiseRecord["default"], {
        objId: praiseObjId,
        objType: 19,
        onSubmit: function onSubmit() {
          return _this2.setState({
            isShowPraiseRecordPop: false,
            praiseObjId: ''
          });
        }
      }));
    }
  }]);

  return Communication;
}(_react.PureComponent);

Communication.defaultProps = {
  commentType: 1
};
var _default = Communication;
exports["default"] = _default;