var DEFAULT_SEPARATOR = '，';
var DEFAULT_LABEL_SEPARATOR = '：';
function parseRobotMessage(info) {
  var labelSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_LABEL_SEPARATOR;
  if (typeof info === 'string') return info;
  var _ref = info || {},
    content = _ref.content,
    link = _ref.link,
    label = _ref.label,
    isTitle = _ref.isTitle;
  if (link) {
    return "[".concat(content, "](").concat(link, ")");
  }
  if (label) {
    return "".concat(label).concat(labelSeparator).concat(content);
  }
  if (isTitle) {
    return "\u3010".concat(content, "\u3011");
  }
  return content;
}
function genRobotMessage(list) {
  var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_SEPARATOR;
  var labelSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_LABEL_SEPARATOR;
  return list.map(function (message) {
    if (typeof message === 'string') {
      return message;
    }
    return message.map(function (messageItem) {
      return parseRobotMessage(messageItem, labelSeparator);
    }).join(separator);
  }).join('\n');
}

export { genRobotMessage, parseRobotMessage };
