"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"] = _default;

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

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

var _richEditor = require("@titaui/rich-editor");

var _tooltip = _interopRequireDefault(require("../../../../../tooltip"));

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

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

var _iconText = _interopRequireDefault(require("../../../icon-text"));

var _confidence = _interopRequireDefault(require("../../../../../confidence"));

var _progress = _interopRequireDefault(require("../../../../../progress"));

var _context2 = require("../../../../context");

var _toast = _interopRequireDefault(require("../../../../../toast"));

var _dialogConfirm = _interopRequireWildcard(require("../../../../../dialog-confirm"));

var _errorTip = _interopRequireDefault(require("../../../../../tooltip/error-tip"));

var _requestApis = require("../../../../request-apis");

var _auth = require("../../../../../../utils/auth");

var _rangePickerPop = _interopRequireDefault(require("./range-picker-pop"));

var _krScoreEditor = _interopRequireDefault(require("./kr-score-editor"));

var _precls = _interopRequireDefault(require("../../precls"));

var _drawerManager = _interopRequireDefault(require("../../../../../drawer-manager"));

var _utils = require("../../../../../progress/utils");

var _EditKrWightModal = _interopRequireDefault(require("../../../../../edit-kr-wight/EditKrWightModal"));

var _okrProgressModal = _interopRequireDefault(require("../../../../../okr-progress-modal"));

var _helper = require("../../../../helper");

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

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

var _i18nFrontTranslate = require("../../../../../../utils/i18n-front-translate");

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 asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }

function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }

function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure 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 _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 _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }

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

function OkrRowColumn(_ref) {
  var children = _ref.children,
      width = _ref.width,
      _ref$marginLeft = _ref.marginLeft,
      marginLeft = _ref$marginLeft === void 0 ? 0 : _ref$marginLeft;
  return /*#__PURE__*/_react["default"].createElement("span", {
    style: {
      display: 'inline-block',
      width: width,
      textAlign: 'left',
      marginLeft: marginLeft
    }
  }, children);
}

function _default(props) {
  var _getBSGlobal;

  var data = props.data,
      index = props.index,
      title = props.title,
      key = props.key,
      canEditOkr = props.canEditOkr;
  var mileStoneName = data.mileStoneName,
      mileStoneNameRichText = data.mileStoneNameRichText;

  var _useContext = (0, _react.useContext)(_context2.CommonContext),
      refreshAll = _useContext.refreshAll,
      okrInfo = _useContext.okrInfo,
      approvalSetting = _useContext.approvalSetting;

  var _useState = (0, _react.useState)(data.confidenceIndex),
      _useState2 = _slicedToArray(_useState, 2),
      confidence = _useState2[0],
      setConfidence = _useState2[1];

  var _useState3 = (0, _react.useState)(''),
      _useState4 = _slicedToArray(_useState3, 2),
      errorTip = _useState4[0],
      setErrorTip = _useState4[1];

  var _useState5 = (0, _react.useState)(data.user || {}),
      _useState6 = _slicedToArray(_useState5, 2),
      user = _useState6[0],
      setUser = _useState6[1];

  var _useState7 = (0, _react.useState)(false),
      _useState8 = _slicedToArray(_useState7, 2),
      editWightVisible = _useState8[0],
      setEditWightVisible = _useState8[1];

  var _useState9 = (0, _react.useState)(false),
      _useState10 = _slicedToArray(_useState9, 2),
      editing = _useState10[0],
      setEditing = _useState10[1];

  var _useState11 = (0, _react.useState)(data.evaluateValue),
      _useState12 = _slicedToArray(_useState11, 2),
      evaluateValue = _useState12[0],
      setEvaluateValue = _useState12[1];

  var _useState13 = (0, _react.useState)(false),
      _useState14 = _slicedToArray(_useState13, 2),
      krModalVsible = _useState14[0],
      setKrModalVsible = _useState14[1];

  var _useState15 = (0, _react.useState)(false),
      _useState16 = _slicedToArray(_useState15, 2),
      deleteModalVisible = _useState16[0],
      setDeleteModalVisible = _useState16[1];

  var _useState17 = (0, _react.useState)({
    pureText: mileStoneName,
    pureTextExcludeAt: mileStoneName,
    richText: mileStoneNameRichText ? JSON.parse(mileStoneNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(mileStoneName),
    mentionUsers: []
  }),
      _useState18 = _slicedToArray(_useState17, 2),
      krNameData = _useState18[0],
      setKrNameData = _useState18[1];

  var _useState19 = (0, _react.useState)((_getBSGlobal = (0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting')) === null || _getBSGlobal === void 0 ? void 0 : _getBSGlobal.KRSetting.ShowKrConfidence),
      _useState20 = _slicedToArray(_useState19, 1),
      showHeart = _useState20[0]; // 高级功能： 关键成果信心指数


  var _useState21 = (0, _react.useState)((0, _bsGlobal.getBSGlobal)('OkrAdvancedSetting').KRSetting.KrWeight),
      _useState22 = _slicedToArray(_useState21, 1),
      showKrWeight = _useState22[0]; // 高级功能： 关见成果权重


  var _useState23 = (0, _react.useState)(data.isEvaluate),
      _useState24 = _slicedToArray(_useState23, 2),
      isEvaluate = _useState24[0],
      setIsEvaluate = _useState24[1]; // 权限 & 非结束目标


  var _useState25 = (0, _react.useState)(function () {
    var hasAuth = new _auth.KRAuth({
      user: data.user,
      createUserId: data.createUserId
    }).hasAuth() || canEditOkr;
    var livetime = okrInfo.status != 2;
    return hasAuth && livetime;
  }),
      _useState26 = _slicedToArray(_useState25, 1),
      krCanEdit = _useState26[0];

  var progressEdit = okrInfo.isParticipant || data.isParticipant || krCanEdit;
  var mentionInputRef = (0, _react.useRef)();
  (0, _react.useEffect)(function () {
    setKrNameData({
      pureText: mileStoneName,
      pureTextExcludeAt: mileStoneName,
      richText: data.mileStoneNameRichText ? JSON.parse(data.mileStoneNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(mileStoneName),
      mentionUsers: []
    });
  }, [mileStoneName]);

  var _useContext2 = (0, _react.useContext)(_context2.OkrListContext),
      updateKrs = _useContext2.updateKrs;

  var onEditUserHandler = function onEditUserHandler(_ref2) {
    var _ref3 = _slicedToArray(_ref2, 1),
        user = _ref3[0];

    setUser(user.data);
    (0, _requestApis.updateKrPrincipal)({
      kr: data,
      user: user.data
    });
  };

  var onHartChangeHandler = function onHartChangeHandler(level) {
    setConfidence(level);
    (0, _requestApis.updateConfidenceIndex)({
      kr: data,
      confidenceIndex: level
    }).then(function () {
      _toast["default"].Success('修改成功');
    });
  };

  var onEditWightOkHandler = function onEditWightOkHandler() {
    updateKrs();
    setEditWightVisible(false);
  };

  var onEditWightCancelHandler = function onEditWightCancelHandler() {
    setEditWightVisible(false);
  };

  var onWightClickHandler = function onWightClickHandler() {
    setEditWightVisible(true);
  };

  var onProcessModalOk = function onProcessModalOk(val) {
    var progress = val.progress,
        progressDescription = val.progressDescription,
        riskLevel = val.riskLevel,
        updateProgressWay = val.updateProgressWay;
    progress = progress.replace(/%/, '');
    (0, _requestApis.updateKrProgressAndStatus)({
      krId: data.mileStoneId,
      progress: Number(progress),
      progressDescription: progressDescription,
      riskLevel: riskLevel,
      updateProgressWay: updateProgressWay
    }).then(function (res) {
      if (res.Code == 1) {
        _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));

        refreshAll();
        updateKrs();
        setKrModalVsible(false);
      } else {
        _toast["default"].Error(res.Message);
      }
    });
  };

  var onDeleteKrHandler = /*#__PURE__*/function () {
    var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
      var _yield$deleteKr, Message;

      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return (0, _requestApis.deleteKr)(data.mileStoneId);

            case 2:
              _yield$deleteKr = _context.sent;
              Message = _yield$deleteKr.Message;
              setDeleteModalVisible(false);

              if (!Message) {
                _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));

                setTimeout(function () {
                  refreshAll();
                  updateKrs();
                }, 500);
              } else {
                _toast["default"].Error(Message);
              }

            case 6:
            case "end":
              return _context.stop();
          }
        }
      }, _callee);
    }));

    return function onDeleteKrHandler() {
      return _ref4.apply(this, arguments);
    };
  }();

  var onInputKeyDownHandler = function onInputKeyDownHandler(e) {
    if (e.keyCode !== 13) return;
    onKrNameChangeHandler();
  };

  var validateKrName = function validateKrName(data) {
    var _pureTextExcludeAt$tr;

    var pureTextExcludeAt = data.pureTextExcludeAt;
    var krNameLen = pureTextExcludeAt === null || pureTextExcludeAt === void 0 ? void 0 : (_pureTextExcludeAt$tr = pureTextExcludeAt.trim()) === null || _pureTextExcludeAt$tr === void 0 ? void 0 : _pureTextExcludeAt$tr.length;

    if (krNameLen === 0) {
      setErrorTip('KR 名称不能为空');
      return false;
    }

    if (krNameLen > 5000) {
      setErrorTip((0, _i18nFrontTranslate.inputWordTrans)(krNameLen, 5000));
      return false;
    }

    setErrorTip('');
    return true;
  };

  var onEditorChange = function onEditorChange(data) {
    setKrNameData(function () {
      return data;
    });
    validateKrName(data);
  };

  var onKrNameChangeHandler = function onKrNameChangeHandler() {
    var mentionUsers = krNameData.mentionUsers,
        pureText = krNameData.pureText,
        richText = krNameData.richText;

    if (data.mileStoneName == pureText) {
      setEditing(false);
      return;
    }

    var hasError = !validateKrName(krNameData);
    if (hasError) return;
    (0, _requestApis.updateKrName)({
      mileStoneName: pureText,
      mileStoneNameRichText: richText,
      aiteUsers: mentionUsers === null || mentionUsers === void 0 ? void 0 : mentionUsers.map(function (user) {
        return user.mentionId;
      }),
      workId: data.workId,
      workMileStoneId: data.mileStoneId
    }).then(function (res) {
      setEditing(false);

      if (res) {
        _toast["default"].Success((0, _getLocale.getLocale)('Mod_Successfuloperat'));
      } else {
        setKrNameData(function () {
          var mileStoneName = data.mileStoneName,
              mileStoneNameRichText = data.mileStoneNameRichText;
          return {
            pureText: mileStoneName,
            pureTextExcludeAt: mileStoneName,
            richText: mileStoneNameRichText ? JSON.parse(mileStoneNameRichText) : (0, _richEditor.TitaRichEditorInitTextState)(mileStoneName),
            mentionUsers: []
          };
        });
      }
    });
  };

  var onPrograssEditHandler = function onPrograssEditHandler() {
    if (!progressEdit) return;
    setKrModalVsible(true);
  };

  var onEvaluateChangeHanler = function onEvaluateChangeHanler(val) {
    refreshAll();
    updateKrs();
    setEvaluateValue(val);
    setIsEvaluate(true);
  };

  var onTitleTextClickHandler = function onTitleTextClickHandler() {
    if (editing) return;

    _drawerManager["default"].open('krDetail', {
      krId: data.mileStoneId
    });
  };

  var triggerEdit = function triggerEdit(e) {
    e.stopPropagation();
    e.nativeEvent.stopImmediatePropagation();
    setEditing(true);
    setTimeout(function () {
      var _mentionInputRef$curr;

      // @ts-ignore
      (_mentionInputRef$curr = mentionInputRef.current) === null || _mentionInputRef$curr === void 0 ? void 0 : _mentionInputRef$curr.methods().focus();
    }, 0);
  };

  var krNameEditable = krCanEdit && (0, _helper.getApprovalKr)(approvalSetting, 'changeOkrName', okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes, data === null || data === void 0 ? void 0 : data.KrApprovalTypes);
  return /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node"))
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-drag"))
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "tu-icon-tuozhuai"
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-h1"))
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-prefix"))
  }, "KR", index + 1), /*#__PURE__*/_react["default"].createElement(_errorTip["default"], {
    overlay: /*#__PURE__*/_react["default"].createElement("span", {
      style: {
        color: '#f05e5e'
      }
    }, errorTip),
    visible: editing && errorTip.length > 0,
    placement: "top"
  }, editing ? /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-title"), _defineProperty({}, "".concat(_precls["default"], "__kr-node-title--editing"), editing)),
    onClick: onTitleTextClickHandler
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
    editable: editing,
    initialState: krNameData.richText,
    onDocChange: onEditorChange,
    onBlur: onKrNameChangeHandler,
    onKeyDown: onInputKeyDownHandler,
    placeholder: "KR\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
    ref: mentionInputRef
  }), krNameEditable && !editing && /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__text-icon"))
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "tu-icon-bianji2",
    onClick: triggerEdit
  }))) : /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
    overlay: (0, _openData.parseString)(krNameData.pureText)
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-title"), _defineProperty({}, "".concat(_precls["default"], "__kr-node-title--editing"), editing)),
    onClick: onTitleTextClickHandler
  }, /*#__PURE__*/_react["default"].createElement(_richEditor.TitaInlineRichEditor, {
    editable: editing,
    initialState: krNameData.richText,
    onDocChange: onEditorChange,
    onBlur: onKrNameChangeHandler,
    onKeyDown: onInputKeyDownHandler,
    placeholder: "KR\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",
    ref: mentionInputRef
  }), krNameEditable && !editing && /*#__PURE__*/_react["default"].createElement("span", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__text-icon"))
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "tu-icon-bianji2",
    onClick: triggerEdit
  })))))), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-h2"))
  }, /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
    width: 68
  }, /*#__PURE__*/_react["default"].createElement(_avatar["default"].Text, {
    name: user.name,
    id: user.userId,
    width: 68,
    editable: krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval,
    onEditUser: onEditUserHandler,
    nameTips: function nameTips(name) {
      return /*#__PURE__*/_react["default"].createElement("span", null, (0, _getLocale.getLocale)('OKR_MyO_Text_Owner'), name);
    }
  })), showKrWeight && /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
    width: 60,
    marginLeft: 16
  }, /*#__PURE__*/_react["default"].createElement(_iconText["default"], {
    width: 60,
    editable: krCanEdit,
    content: "".concat(data.krWeight, "%"),
    onTextClick: onWightClickHandler,
    icon: "tu-icon-app-quanzhong"
  })), /*#__PURE__*/_react["default"].createElement(OkrRowColumn, {
    width: 190,
    marginLeft: 16
  }, /*#__PURE__*/_react["default"].createElement(_rangePickerPop["default"], {
    data: data,
    editable: krCanEdit && (0, _helper.getApprovalKr)(approvalSetting, 'changeOkrTime', okrInfo.applyState, okrInfo === null || okrInfo === void 0 ? void 0 : okrInfo.OkrAndKrApprovalTypes, data === null || data === void 0 ? void 0 : data.KrApprovalTypes)
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-actions"))
  }, showHeart && /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-confidence"))
  }, /*#__PURE__*/_react["default"].createElement(_confidence["default"], _defineProperty({
    value: confidence,
    editable: krCanEdit,
    onValueChange: setConfidence
  }, "onValueChange", onHartChangeHandler))), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-circle")),
    onClick: onPrograssEditHandler
  }, /*#__PURE__*/_react["default"].createElement(_progress["default"].Circle, {
    size: 22,
    width: 3,
    percent: data.progress,
    linear: true,
    linearId: data.mileStoneId,
    linearStartColor: (0, _utils.getProcessColor)(data.riskLevel, 'linearStartColor', okrInfo.status),
    linearEndColor: (0, _utils.getProcessColor)(data.riskLevel, 'linearEndColor', okrInfo.status),
    backgroundColor: (0, _utils.getProcessColor)(data.riskLevel, 'backgroundColor', okrInfo.status)
  })), /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-score"))
  }, /*#__PURE__*/_react["default"].createElement(_krScoreEditor["default"], {
    data: data,
    editable: krCanEdit || data.evaluateEditable,
    evaluateValue: evaluateValue,
    setEvaluateValue: onEvaluateChangeHanler,
    isEvaluate: isEvaluate
  })), krCanEdit && okrInfo.applyState !== _helper.EApproveStatus.UnderApproval && /*#__PURE__*/_react["default"].createElement("div", {
    className: (0, _classnames["default"])("".concat(_precls["default"], "__kr-node-delete")),
    onClick: function onClick() {
      return setDeleteModalVisible(true);
    }
  }, /*#__PURE__*/_react["default"].createElement("span", {
    className: "tu-icon-del"
  })))), /*#__PURE__*/_react["default"].createElement(_EditKrWightModal["default"], {
    workId: data.workId,
    isShowModal: editWightVisible,
    onCancel: onEditWightCancelHandler,
    onClose: function onClose() {
      return setEditWightVisible(false);
    },
    onOk: onEditWightOkHandler
  }), /*#__PURE__*/_react["default"].createElement(_okrProgressModal["default"], {
    okrInfo: data,
    title: (0, _getLocale.getLocale)('OKR_MyO_Title_UpdateKR'),
    visible: krModalVsible,
    onClose: function onClose() {
      return setKrModalVsible(false);
    },
    onOk: onProcessModalOk,
    isKr: true,
    maxLength: 5000
  }), /*#__PURE__*/_react["default"].createElement(_dialogConfirm["default"], {
    visible: deleteModalVisible,
    type: "warning"
  }, /*#__PURE__*/_react["default"].createElement("span", {
    type: "title"
  }, (0, _getLocale.getLocale)('OKR_MyO_KRP_Deletekey')), /*#__PURE__*/_react["default"].createElement("span", {
    type: "content"
  }, (0, _getLocale.getLocale)('OKR_MyO_KRP_Thekeyachieve')), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
    type: "button",
    onClick: function onClick() {
      return setDeleteModalVisible(false);
    }
  }, (0, _getLocale.getLocale)('Mod_Cancel')), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.WarningButton, {
    type: "button",
    onClick: onDeleteKrHandler
  }, (0, _getLocale.getLocale)('Mod_Delete'))));
}