/**
 * 动态表情
 */
export const emojis = {
  '[微笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/001_微笑.png'>",
  '[撇嘴]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/002_撇嘴.png'>",
  '[色]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/003_色.png'>",
  '[发呆]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/004_发呆.png'>",
  '[得意]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/005_得意.png'>",
  '[流泪]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/006_流泪.png'>",
  '[害羞]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/007_害羞.png'>",
  '[闭嘴]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/008_闭嘴.png'>",
  '[睡]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/009_睡.png'>",
  '[大哭]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/010_大哭.png'>",
  '[尴尬]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/011_尴尬.png'>",
  '[发怒]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/012_发怒.png'>",
  '[调皮]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/013_调皮.png'>",
  '[呲牙]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/014_呲牙.png'>",
  '[惊讶]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/015_惊讶.png'>",
  '[难过]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/016_难过.png'>",
  '[囧]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/017_囧.png'>",
  '[抓狂]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/018_抓狂.png'>",
  '[吐]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/019_吐.png'>",
  '[偷笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/020_偷笑.png'>",
  '[可爱]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/021_愉快.png'>",
  '[白眼]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/022_白眼.png'>",
  '[傲慢]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/023_傲慢.png'>",
  '[困]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/024_困.png'>",
  '[惊恐]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/025_惊恐.png'>",
  '[憨笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/026_憨笑.png'>",
  '[大兵]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/027_悠闲.png'>",
  '[咒骂]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/028_咒骂.png'>",
  '[疑问]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/029_疑问.png'>",
  '[嘘]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/030_嘘.png'>",
  '[晕]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/031_晕.png'>",
  '[衰]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/032_衰.png'>",
  '[骷髅]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/033_骷髅.png'>",
  '[敲打]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/034_敲打.png'>",
  '[再见]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/035_再见.png'>",
  '[擦汗]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/036_擦汗.png'>",
  '[抠鼻]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/037_抠鼻.png'>",
  '[鼓掌]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/038_鼓掌.png'>",
  '[坏笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/039_坏笑.png'>",
  '[右哼哼]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/040_右哼哼.png'>",
  '[鄙视]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/041_鄙视.png'>",
  '[委屈]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/042_委屈.png'>",
  '[快哭了]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/043_快哭了.png'>",
  '[阴险]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/044_阴险.png'>",
  '[亲亲]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/045_亲亲.png'>",
  '[可怜]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/046_可怜.png'>",
  '[笑脸]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/047_笑脸.png'>",
  '[生病]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/048_生病.png'>",
  '[脸红]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/049_脸红.png'>",
  '[破涕为笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/050_破涕为笑.png'>",
  '[恐惧]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/051_恐惧.png'>",
  '[失望]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/052_失望.png'>",
  '[无语]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/053_无语.png'>",
  '[嘿哈]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/054_嘿哈.png'>",
  '[捂脸]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/055_捂脸.png'>",
  '[奸笑]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/056_奸笑.png'>",
  '[机智]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/057_机智.png'>",
  '[皱眉]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/058_皱眉.png'>",
  '[耶]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/059_耶.png'>",
  '[吃瓜]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/060_吃瓜.png'>",
  '[加油]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/061_加油.png'>",
  '[汗]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/062_汗.png'>",
  '[天啊]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/063_天啊.png'>",
  '[Emm]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/064_Emm.png'>",
  '[社会社会]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/065_社会社会.png'>",
  '[旺柴]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/066_旺柴.png'>",
  '[好的]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/067_好的.png'>",
  '[打脸]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/068_打脸.png'>",
  '[哇]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/069_哇.png'>",
  '[翻白眼]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/070_翻白眼.png'>",
  '[666]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/071_666.png'>",
  '[让我看看]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/072_让我看看.png'>",
  '[叹气]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/073_叹气.png'>",
  '[苦涩]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/074_苦涩.png'>",
  '[裂开]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/075_裂开.png'>",
  '[嘴唇]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/076_嘴唇.png'>",
  '[爱心]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/077_爱心.png'>",
  '[心碎]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/078_心碎.png'>",
  '[拥抱]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/079_拥抱.png'>",
  '[强]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/080_强.png'>",
  '[弱]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/081_弱.png'>",
  '[握手]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/082_握手.png'>",
  '[胜利]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/083_胜利.png'>",
  '[抱拳]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/084_抱拳.png'>",
  '[勾引]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/085_勾引.png'>",
  '[拳头]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/086_拳头.png'>",
  '[OK]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/087_OK.png'>",
  '[合十]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/088_合十.png'>",
  '[啤酒]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/089_啤酒.png'>",
  '[咖啡]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/090_咖啡.png'>",
  '[蛋糕]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/091_蛋糕.png'>",
  '[玫瑰]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/092_玫瑰.png'>",
  '[凋谢]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/093_凋谢.png'>",
  '[菜刀]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/094_菜刀.png'>",
  '[炸弹]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/095_炸弹.png'>",
  '[便便]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/096_便便.png'>",
  '[月亮]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/097_月亮.png'>",
  '[太阳]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/098_太阳.png'>",
  '[庆祝]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/099_庆祝.png'>",
  '[礼物]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/100_礼物.png'>",
  '[红包]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/101_红包.png'>",
  '[發]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/102_發.png'>",
  '[福]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/103_福.png'>",
  '[烟花]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/104_烟花.png'>",
  '[爆竹]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/105_爆竹.png'>",
  '[猪头]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/106_猪头.png'>",
  '[跳跳]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/107_跳跳.png'>",
  '[发抖]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/108_发抖.png'>",
  '[转圈]':
    "<img class='emoji' src='https://e-cdn.fontree.cn/fonchain-chat/emoji/109_转圈.png'>",
}

const emojisKeys = Object.keys(emojis)

const regEmoji = emojisKeys
  .map((value) => '|\\' + value)
  .join('')
  .replace('|', '')

/**
 * 替换表情文字
 *
 * @param {String} content 需要替换的字符串
 */
export function textReplaceEmoji(content) {
  return content.replace(new RegExp(`(${regEmoji})`, 'gi'), ($0, $1) => {
    return emojis[$1]
  })
}
