"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.systemPublisher = exports.safeParse = exports.getChartProps = void 0;
var systemPublisher = {
  avatar: {
    big: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_b.png",
    color: "#f0c75a",
    hasAvatar: true,
    large: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_l.png",
    medium: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_m.png",
    normal: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_n.png",
    original: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_o.png",
    small: "https://file.tita.com/TitaImage/352728/d820ed195e204b5aa7d6d1b9bd94f215_s.png"
  },
  blessingType: 0,
  decorationType: 0,
  departmentId: 0,
  departmentName: null,
  jobState: 0,
  medalPosition: null,
  medalUrl: null,
  name: "Tita小助手",
  postition: null,
  praiseType: 0,
  tag: null,
  userId: 100000,
  userMark: null,
  userType: 0
};
exports.systemPublisher = systemPublisher;

var safeParse = function safeParse(json) {
  var parsed = {};

  try {
    parsed = JSON.parse(json);
  } catch (e) {
    throw new Error(e);
  }

  return parsed;
};

exports.safeParse = safeParse;

var getChartProps = function getChartProps(json) {
  var parsed = safeParse(json);

  if (typeof parsed === "number") {
    return {
      id: parsed
    };
  }

  return parsed;
};

exports.getChartProps = getChartProps;