text: // A map to give the "opposite bracket",
  // for example: ( maps to ), [ maps to ], { maps to }, and so on...
  // Compiled from: http://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt
  const oppositeBracket = new Map([
    [ 0x0028, 0x0029 ], // LEFT PARENTHESIS
    [ 0x0029, 0x0028 ], // RIGHT PARENTHESIS
    [ 0x005B, 0x005D ], // LEFT SQUARE BRACKET
    [ 0x005D, 0x005B ], // RIGHT SQUARE BRACKET
    [ 0x007B, 0x007D ], // LEFT CURLY BRACKET
    [ 0x007D, 0x007B ], // RIGHT CURLY BRACKET
    [ 0x0F3A, 0x0F3B ], // TIBETAN MARK GUG RTAGS GYON
    [ 0x0F3B, 0x0F3A ], // TIBETAN MARK GUG RTAGS GYAS
    [ 0x0F3C, 0x0F3D ], // TIBETAN MARK ANG KHANG GYON
    [ 0x0F3D, 0x0F3C ], // TIBETAN MARK ANG KHANG GYAS
    [ 0x169B, 0x169C ], // OGHAM FEATHER MARK
    [ 0x169C, 0x169B ], // OGHAM REVERSED FEATHER MARK
    [ 0x2045, 0x2046 ], // LEFT SQUARE BRACKET WITH QUILL
    [ 0x2046, 0x2045 ], // RIGHT SQUARE BRACKET WITH QUILL
    [ 0x207D, 0x207E ], // SUPERSCRIPT LEFT PARENTHESIS
    [ 0x207E, 0x207D ], // SUPERSCRIPT RIGHT PARENTHESIS
    [ 0x208D, 0x208E ], // SUBSCRIPT LEFT PARENTHESIS
    [ 0x208E, 0x208D ], // SUBSCRIPT RIGHT PARENTHESIS
    [ 0x2308, 0x2309 ], // LEFT CEILING
    [ 0x2309, 0x2308 ], // RIGHT CEILING
    [ 0x230A, 0x230B ], // LEFT FLOOR
    [ 0x230B, 0x230A ], // RIGHT FLOOR
    [ 0x2329, 0x232A ], // LEFT-POINTING ANGLE BRACKET
    [ 0x232A, 0x2329 ], // RIGHT-POINTING ANGLE BRACKET
    [ 0x2768, 0x2769 ], // MEDIUM LEFT PARENTHESIS ORNAMENT
    [ 0x2769, 0x2768 ], // MEDIUM RIGHT PARENTHESIS ORNAMENT
    [ 0x276A, 0x276B ], // MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT
    [ 0x276B, 0x276A ], // MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT
    [ 0x276C, 0x276D ], // MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
    [ 0x276D, 0x276C ], // MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
    [ 0x276E, 0x276F ], // HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
    [ 0x276F, 0x276E ], // HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
    [ 0x2770, 0x2771 ], // HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT
    [ 0x2771, 0x2770 ], // HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT
    [ 0x2772, 0x2773 ], // LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT
    [ 0x2773, 0x2772 ], // LIGHT RIGHT TORTOISE SHELL BRACKET ORNAMENT
    [ 0x2774, 0x2775 ], // MEDIUM LEFT CURLY BRACKET ORNAMENT
    [ 0x2775, 0x2774 ], // MEDIUM RIGHT CURLY BRACKET ORNAMENT
    [ 0x27C5, 0x27C6 ], // LEFT S-SHAPED BAG DELIMITER
    [ 0x27C6, 0x27C5 ], // RIGHT S-SHAPED BAG DELIMITER
    [ 0x27E6, 0x27E7 ], // MATHEMATICAL LEFT WHITE SQUARE BRACKET
    [ 0x27E7, 0x27E6 ], // MATHEMATICAL RIGHT WHITE SQUARE BRACKET
    [ 0x27E8, 0x27E9 ], // MATHEMATICAL LEFT ANGLE BRACKET
    [ 0x27E9, 0x27E8 ], // MATHEMATICAL RIGHT ANGLE BRACKET
    [ 0x27EA, 0x27EB ], // MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
    [ 0x27EB, 0x27EA ], // MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
    [ 0x27EC, 0x27ED ], // MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
    [ 0x27ED, 0x27EC ], // MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
    [ 0x27EE, 0x27EF ], // MATHEMATICAL LEFT FLATTENED PARENTHESIS
    [ 0x27EF, 0x27EE ], // MATHEMATICAL RIGHT FLATTENED PARENTHESIS
    [ 0x2983, 0x2984 ], // LEFT WHITE CURLY BRACKET
    [ 0x2984, 0x2983 ], // RIGHT WHITE CURLY BRACKET
    [ 0x2985, 0x2986 ], // LEFT WHITE PARENTHESIS
    [ 0x2986, 0x2985 ], // RIGHT WHITE PARENTHESIS
    [ 0x2987, 0x2988 ], // Z NOTATION LEFT IMAGE BRACKET
    [ 0x2988, 0x2987 ], // Z NOTATION RIGHT IMAGE BRACKET
    [ 0x2989, 0x298A ], // Z NOTATION LEFT BINDING BRACKET
    [ 0x298A, 0x2989 ], // Z NOTATION RIGHT BINDING BRACKET
    [ 0x298B, 0x298C ], // LEFT SQUARE BRACKET WITH UNDERBAR
    [ 0x298C, 0x298B ], // RIGHT SQUARE BRACKET WITH UNDERBAR
    [ 0x298D, 0x2990 ], // LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
    [ 0x298E, 0x298F ], // RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
    [ 0x298F, 0x298E ], // LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
    [ 0x2990, 0x298D ], // RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
    [ 0x2991, 0x2992 ], // LEFT ANGLE BRACKET WITH DOT
    [ 0x2992, 0x2991 ], // RIGHT ANGLE BRACKET WITH DOT
    [ 0x2993, 0x2994 ], // LEFT ARC LESS-THAN BRACKET
    [ 0x2994, 0x2993 ], // RIGHT ARC GREATER-THAN BRACKET
    [ 0x2995, 0x2996 ], // DOUBLE LEFT ARC GREATER-THAN BRACKET
    [ 0x2996, 0x2995 ], // DOUBLE RIGHT ARC LESS-THAN BRACKET
    [ 0x2997, 0x2998 ], // LEFT BLACK TORTOISE SHELL BRACKET
    [ 0x2998, 0x2997 ], // RIGHT BLACK TORTOISE SHELL BRACKET
    [ 0x29D8, 0x29D9 ], // LEFT WIGGLY FENCE
    [ 0x29D9, 0x29D8 ], // RIGHT WIGGLY FENCE
    [ 0x29DA, 0x29DB ], // LEFT DOUBLE WIGGLY FENCE
    [ 0x29DB, 0x29DA ], // RIGHT DOUBLE WIGGLY FENCE
    [ 0x29FC, 0x29FD ], // LEFT-POINTING CURVED ANGLE BRACKET
    [ 0x29FD, 0x29FC ], // RIGHT-POINTING CURVED ANGLE BRACKET
    [ 0x2E22, 0x2E23 ], // TOP LEFT HALF BRACKET
    [ 0x2E23, 0x2E22 ], // TOP RIGHT HALF BRACKET
    [ 0x2E24, 0x2E25 ], // BOTTOM LEFT HALF BRACKET
    [ 0x2E25, 0x2E24 ], // BOTTOM RIGHT HALF BRACKET
    [ 0x2E26, 0x2E27 ], // LEFT SIDEWAYS U BRACKET
    [ 0x2E27, 0x2E26 ], // RIGHT SIDEWAYS U BRACKET
    [ 0x2E28, 0x2E29 ], // LEFT DOUBLE PARENTHESIS
    [ 0x2E29, 0x2E28 ], // RIGHT DOUBLE PARENTHESIS
    [ 0x3008, 0x3009 ], // LEFT ANGLE BRACKET
    [ 0x3009, 0x3008 ], // RIGHT ANGLE BRACKET
    [ 0x300A, 0x300B ], // LEFT DOUBLE ANGLE BRACKET
    [ 0x300B, 0x300A ], // RIGHT DOUBLE ANGLE BRACKET
    [ 0x300C, 0x300D ], // LEFT CORNER BRACKET
    [ 0x300D, 0x300C ], // RIGHT CORNER BRACKET
    [ 0x300E, 0x300F ], // LEFT WHITE CORNER BRACKET
    [ 0x300F, 0x300E ], // RIGHT WHITE CORNER BRACKET
    [ 0x3010, 0x3011 ], // LEFT BLACK LENTICULAR BRACKET
    [ 0x3011, 0x3010 ], // RIGHT BLACK LENTICULAR BRACKET
    [ 0x3014, 0x3015 ], // LEFT TORTOISE SHELL BRACKET
    [ 0x3015, 0x3014 ], // RIGHT TORTOISE SHELL BRACKET
    [ 0x3016, 0x3017 ], // LEFT WHITE LENTICULAR BRACKET
    [ 0x3017, 0x3016 ], // RIGHT WHITE LENTICULAR BRACKET
    [ 0x3018, 0x3019 ], // LEFT WHITE TORTOISE SHELL BRACKET
    [ 0x3019, 0x3018 ], // RIGHT WHITE TORTOISE SHELL BRACKET
    [ 0x301A, 0x301B ], // LEFT WHITE SQUARE BRACKET
    [ 0x301B, 0x301A ], // RIGHT WHITE SQUARE BRACKET
    [ 0xFE59, 0xFE5A ], // SMALL LEFT PARENTHESIS
    [ 0xFE5A, 0xFE59 ], // SMALL RIGHT PARENTHESIS
    [ 0xFE5B, 0xFE5C ], // SMALL LEFT CURLY BRACKET
    [ 0xFE5C, 0xFE5B ], // SMALL RIGHT CURLY BRACKET
    [ 0xFE5D, 0xFE5E ], // SMALL LEFT TORTOISE SHELL BRACKET
    [ 0xFE5E, 0xFE5D ], // SMALL RIGHT TORTOISE SHELL BRACKET
    [ 0xFF08, 0xFF09 ], // FULLWIDTH LEFT PARENTHESIS
    [ 0xFF09, 0xFF08 ], // FULLWIDTH RIGHT PARENTHESIS
    [ 0xFF3B, 0xFF3D ], // FULLWIDTH LEFT SQUARE BRACKET
    [ 0xFF3D, 0xFF3B ], // FULLWIDTH RIGHT SQUARE BRACKET
    [ 0xFF5B, 0xFF5D ], // FULLWIDTH LEFT CURLY BRACKET
    [ 0xFF5D, 0xFF5B ], // FULLWIDTH RIGHT CURLY BRACKET
    [ 0xFF5F, 0xFF60 ], // FULLWIDTH LEFT WHITE PARENTHESIS
    [ 0xFF60, 0xFF5F ], // FULLWIDTH RIGHT WHITE PARENTHESIS
    [ 0xFF62, 0xFF63 ], // HALFWIDTH LEFT CORNER BRACKET
    [ 0xFF63, 0xFF62 ]  // HALFWIDTH RIGHT CORNER BRACKET
  ]);
  
  export default oppositeBracket;
  