react-intl 3.9.1 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/createFormattedComponent.js +4 -2
  3. package/dist/components/html-message.js +1 -1
  4. package/dist/components/injectIntl.d.ts +1 -1
  5. package/dist/components/message.js +13 -4
  6. package/dist/components/plural.d.ts +1 -1
  7. package/dist/components/provider.js +2 -2
  8. package/dist/components/relative.js +3 -10
  9. package/dist/formatters/dateTime.js +2 -2
  10. package/dist/formatters/list.d.ts +1 -2
  11. package/dist/formatters/message.d.ts +1 -0
  12. package/dist/formatters/message.js +19 -18
  13. package/dist/index.d.ts +2 -2
  14. package/dist/react-intl.api.md +7 -5
  15. package/dist/react-intl.d.ts +30 -9
  16. package/dist/react-intl.js +563 -386
  17. package/dist/react-intl.js.map +1 -1
  18. package/dist/react-intl.min.js +1 -1
  19. package/dist/react-intl.min.js.map +1 -1
  20. package/dist/types.d.ts +2 -1
  21. package/dist/utils.d.ts +1 -1
  22. package/dist/utils.js +2 -7
  23. package/lib/components/createFormattedComponent.js +4 -2
  24. package/lib/components/html-message.js +1 -1
  25. package/lib/components/injectIntl.d.ts +1 -1
  26. package/lib/components/message.js +5 -3
  27. package/lib/components/plural.d.ts +1 -1
  28. package/lib/components/provider.js +2 -2
  29. package/lib/components/relative.js +3 -10
  30. package/lib/formatters/dateTime.js +2 -2
  31. package/lib/formatters/list.d.ts +1 -2
  32. package/lib/formatters/message.d.ts +1 -0
  33. package/lib/formatters/message.js +12 -18
  34. package/lib/index.d.ts +2 -2
  35. package/lib/react-intl.d.ts +6 -5
  36. package/lib/tsdoc-metadata.json +1 -1
  37. package/lib/types.d.ts +2 -1
  38. package/lib/utils.d.ts +1 -1
  39. package/lib/utils.js +1 -6
  40. package/package.json +31 -31
  41. package/src/components/provider.tsx +1 -1
  42. package/src/components/relative.tsx +6 -15
  43. package/src/formatters/list.ts +7 -1
  44. package/src/formatters/message.ts +13 -18
  45. package/src/types.ts +5 -1
  46. package/src/utils.ts +2 -7
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2019, Yahoo Inc.
2
+ * Copyright 2020, Yahoo Inc.
3
3
  * Copyrights licensed under the New BSD License.
4
4
  * See the accompanying LICENSE file for terms.
5
5
  */
@@ -195,6 +195,12 @@
195
195
  */
196
196
 
197
197
  TYPE[TYPE["plural"] = 6] = "plural";
198
+ /**
199
+ * Only possible within plural argument.
200
+ * This is the `#` symbol that will be substituted with the count.
201
+ */
202
+
203
+ TYPE[TYPE["pound"] = 7] = "pound";
198
204
  })(TYPE || (TYPE = {}));
199
205
  /**
200
206
  * Type Guards
@@ -222,6 +228,9 @@
222
228
  function isPluralElement(el) {
223
229
  return el.type === TYPE.plural;
224
230
  }
231
+ function isPoundElement(el) {
232
+ return el.type === TYPE.pound;
233
+ }
225
234
  function isNumberSkeleton(el) {
226
235
  return !!(el && _typeof(el) === 'object' && el.type === 0
227
236
  /* number */
@@ -405,41 +414,50 @@
405
414
  }, insertLocation());
406
415
  };
407
416
 
408
- var peg$c2 = peg$otherExpectation("argumentElement");
409
- var peg$c3 = "{";
410
- var peg$c4 = peg$literalExpectation("{", false);
411
- var peg$c5 = "}";
412
- var peg$c6 = peg$literalExpectation("}", false);
417
+ var peg$c2 = "#";
418
+ var peg$c3 = peg$literalExpectation("#", false);
419
+
420
+ var peg$c4 = function peg$c4() {
421
+ return __assign({
422
+ type: TYPE.pound
423
+ }, insertLocation());
424
+ };
425
+
426
+ var peg$c5 = peg$otherExpectation("argumentElement");
427
+ var peg$c6 = "{";
428
+ var peg$c7 = peg$literalExpectation("{", false);
429
+ var peg$c8 = "}";
430
+ var peg$c9 = peg$literalExpectation("}", false);
413
431
 
414
- var peg$c7 = function peg$c7(value) {
432
+ var peg$c10 = function peg$c10(value) {
415
433
  return __assign({
416
434
  type: TYPE.argument,
417
435
  value: value
418
436
  }, insertLocation());
419
437
  };
420
438
 
421
- var peg$c8 = peg$otherExpectation("numberSkeletonId");
422
- var peg$c9 = /^['\/{}]/;
423
- var peg$c10 = peg$classExpectation(["'", "/", "{", "}"], false, false);
424
- var peg$c11 = peg$anyExpectation();
425
- var peg$c12 = peg$otherExpectation("numberSkeletonTokenOption");
426
- var peg$c13 = "/";
427
- var peg$c14 = peg$literalExpectation("/", false);
439
+ var peg$c11 = peg$otherExpectation("numberSkeletonId");
440
+ var peg$c12 = /^['\/{}]/;
441
+ var peg$c13 = peg$classExpectation(["'", "/", "{", "}"], false, false);
442
+ var peg$c14 = peg$anyExpectation();
443
+ var peg$c15 = peg$otherExpectation("numberSkeletonTokenOption");
444
+ var peg$c16 = "/";
445
+ var peg$c17 = peg$literalExpectation("/", false);
428
446
 
429
- var peg$c15 = function peg$c15(option) {
447
+ var peg$c18 = function peg$c18(option) {
430
448
  return option;
431
449
  };
432
450
 
433
- var peg$c16 = peg$otherExpectation("numberSkeletonToken");
451
+ var peg$c19 = peg$otherExpectation("numberSkeletonToken");
434
452
 
435
- var peg$c17 = function peg$c17(stem, options) {
453
+ var peg$c20 = function peg$c20(stem, options) {
436
454
  return {
437
455
  stem: stem,
438
456
  options: options
439
457
  };
440
458
  };
441
459
 
442
- var peg$c18 = function peg$c18(tokens) {
460
+ var peg$c21 = function peg$c21(tokens) {
443
461
  return __assign({
444
462
  type: 0
445
463
  /* number */
@@ -448,23 +466,29 @@
448
466
  }, insertLocation());
449
467
  };
450
468
 
451
- var peg$c19 = "::";
452
- var peg$c20 = peg$literalExpectation("::", false);
469
+ var peg$c22 = "::";
470
+ var peg$c23 = peg$literalExpectation("::", false);
453
471
 
454
- var peg$c21 = function peg$c21(skeleton) {
472
+ var peg$c24 = function peg$c24(skeleton) {
455
473
  return skeleton;
456
474
  };
457
475
 
458
- var peg$c22 = function peg$c22(style) {
476
+ var peg$c25 = function peg$c25() {
477
+ messageCtx.push('numberArgStyle');
478
+ return true;
479
+ };
480
+
481
+ var peg$c26 = function peg$c26(style) {
482
+ messageCtx.pop();
459
483
  return style.replace(/\s*$/, '');
460
484
  };
461
485
 
462
- var peg$c23 = ",";
463
- var peg$c24 = peg$literalExpectation(",", false);
464
- var peg$c25 = "number";
465
- var peg$c26 = peg$literalExpectation("number", false);
486
+ var peg$c27 = ",";
487
+ var peg$c28 = peg$literalExpectation(",", false);
488
+ var peg$c29 = "number";
489
+ var peg$c30 = peg$literalExpectation("number", false);
466
490
 
467
- var peg$c27 = function peg$c27(value, type, style) {
491
+ var peg$c31 = function peg$c31(value, type, style) {
468
492
  return __assign({
469
493
  type: type === 'number' ? TYPE.number : type === 'date' ? TYPE.date : TYPE.time,
470
494
  style: style && style[2],
@@ -472,16 +496,16 @@
472
496
  }, insertLocation());
473
497
  };
474
498
 
475
- var peg$c28 = "'";
476
- var peg$c29 = peg$literalExpectation("'", false);
477
- var peg$c30 = /^[^']/;
478
- var peg$c31 = peg$classExpectation(["'"], true, false);
479
- var peg$c32 = /^[^a-zA-Z'{}]/;
480
- var peg$c33 = peg$classExpectation([["a", "z"], ["A", "Z"], "'", "{", "}"], true, false);
481
- var peg$c34 = /^[a-zA-Z]/;
482
- var peg$c35 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
499
+ var peg$c32 = "'";
500
+ var peg$c33 = peg$literalExpectation("'", false);
501
+ var peg$c34 = /^[^']/;
502
+ var peg$c35 = peg$classExpectation(["'"], true, false);
503
+ var peg$c36 = /^[^a-zA-Z'{}]/;
504
+ var peg$c37 = peg$classExpectation([["a", "z"], ["A", "Z"], "'", "{", "}"], true, false);
505
+ var peg$c38 = /^[a-zA-Z]/;
506
+ var peg$c39 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
483
507
 
484
- var peg$c36 = function peg$c36(pattern) {
508
+ var peg$c40 = function peg$c40(pattern) {
485
509
  return __assign({
486
510
  type: 1
487
511
  /* dateTime */
@@ -490,18 +514,23 @@
490
514
  }, insertLocation());
491
515
  };
492
516
 
493
- var peg$c37 = "date";
494
- var peg$c38 = peg$literalExpectation("date", false);
495
- var peg$c39 = "time";
496
- var peg$c40 = peg$literalExpectation("time", false);
497
- var peg$c41 = "plural";
498
- var peg$c42 = peg$literalExpectation("plural", false);
499
- var peg$c43 = "selectordinal";
500
- var peg$c44 = peg$literalExpectation("selectordinal", false);
501
- var peg$c45 = "offset:";
502
- var peg$c46 = peg$literalExpectation("offset:", false);
503
-
504
- var peg$c47 = function peg$c47(value, pluralType, offset, options) {
517
+ var peg$c41 = function peg$c41() {
518
+ messageCtx.push('dateOrTimeArgStyle');
519
+ return true;
520
+ };
521
+
522
+ var peg$c42 = "date";
523
+ var peg$c43 = peg$literalExpectation("date", false);
524
+ var peg$c44 = "time";
525
+ var peg$c45 = peg$literalExpectation("time", false);
526
+ var peg$c46 = "plural";
527
+ var peg$c47 = peg$literalExpectation("plural", false);
528
+ var peg$c48 = "selectordinal";
529
+ var peg$c49 = peg$literalExpectation("selectordinal", false);
530
+ var peg$c50 = "offset:";
531
+ var peg$c51 = peg$literalExpectation("offset:", false);
532
+
533
+ var peg$c52 = function peg$c52(value, pluralType, offset, options) {
505
534
  return __assign({
506
535
  type: TYPE.plural,
507
536
  pluralType: pluralType === 'plural' ? 'cardinal' : 'ordinal',
@@ -525,10 +554,10 @@
525
554
  }, insertLocation());
526
555
  };
527
556
 
528
- var peg$c48 = "select";
529
- var peg$c49 = peg$literalExpectation("select", false);
557
+ var peg$c53 = "select";
558
+ var peg$c54 = peg$literalExpectation("select", false);
530
559
 
531
- var peg$c50 = function peg$c50(value, options) {
560
+ var peg$c55 = function peg$c55(value, options) {
532
561
  return __assign({
533
562
  type: TYPE.select,
534
563
  value: value,
@@ -550,73 +579,91 @@
550
579
  }, insertLocation());
551
580
  };
552
581
 
553
- var peg$c51 = "=";
554
- var peg$c52 = peg$literalExpectation("=", false);
582
+ var peg$c56 = "=";
583
+ var peg$c57 = peg$literalExpectation("=", false);
584
+
585
+ var peg$c58 = function peg$c58(id) {
586
+ messageCtx.push('select');
587
+ return true;
588
+ };
555
589
 
556
- var peg$c53 = function peg$c53(id, value) {
590
+ var peg$c59 = function peg$c59(id, value) {
591
+ messageCtx.pop();
557
592
  return __assign({
558
593
  id: id,
559
594
  value: value
560
595
  }, insertLocation());
561
596
  };
562
597
 
563
- var peg$c54 = function peg$c54(id, value) {
598
+ var peg$c60 = function peg$c60(id) {
599
+ messageCtx.push('plural');
600
+ return true;
601
+ };
602
+
603
+ var peg$c61 = function peg$c61(id, value) {
604
+ messageCtx.pop();
564
605
  return __assign({
565
606
  id: id,
566
607
  value: value
567
608
  }, insertLocation());
568
609
  };
569
610
 
570
- var peg$c55 = peg$otherExpectation("whitespace pattern");
571
- var peg$c56 = /^[\t-\r \x85\u200E\u200F\u2028\u2029]/;
572
- var peg$c57 = peg$classExpectation([["\t", "\r"], " ", "\x85", "\u200E", "\u200F", "\u2028", "\u2029"], false, false);
573
- var peg$c58 = peg$otherExpectation("syntax pattern");
574
- var peg$c59 = /^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/;
575
- var peg$c60 = peg$classExpectation([["!", "/"], [":", "@"], ["[", "^"], "`", ["{", "~"], ["\xA1", "\xA7"], "\xA9", "\xAB", "\xAC", "\xAE", "\xB0", "\xB1", "\xB6", "\xBB", "\xBF", "\xD7", "\xF7", ["\u2010", "\u2027"], ["\u2030", "\u203E"], ["\u2041", "\u2053"], ["\u2055", "\u205E"], ["\u2190", "\u245F"], ["\u2500", "\u2775"], ["\u2794", "\u2BFF"], ["\u2E00", "\u2E7F"], ["\u3001", "\u3003"], ["\u3008", "\u3020"], "\u3030", "\uFD3E", "\uFD3F", "\uFE45", "\uFE46"], false, false);
576
- var peg$c61 = peg$otherExpectation("optional whitespace");
577
- var peg$c62 = peg$otherExpectation("number");
578
- var peg$c63 = "-";
579
- var peg$c64 = peg$literalExpectation("-", false);
580
-
581
- var peg$c65 = function peg$c65(negative, num) {
611
+ var peg$c62 = peg$otherExpectation("whitespace pattern");
612
+ var peg$c63 = /^[\t-\r \x85\u200E\u200F\u2028\u2029]/;
613
+ var peg$c64 = peg$classExpectation([["\t", "\r"], " ", "\x85", "\u200E", "\u200F", "\u2028", "\u2029"], false, false);
614
+ var peg$c65 = peg$otherExpectation("syntax pattern");
615
+ var peg$c66 = /^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/;
616
+ var peg$c67 = peg$classExpectation([["!", "/"], [":", "@"], ["[", "^"], "`", ["{", "~"], ["\xA1", "\xA7"], "\xA9", "\xAB", "\xAC", "\xAE", "\xB0", "\xB1", "\xB6", "\xBB", "\xBF", "\xD7", "\xF7", ["\u2010", "\u2027"], ["\u2030", "\u203E"], ["\u2041", "\u2053"], ["\u2055", "\u205E"], ["\u2190", "\u245F"], ["\u2500", "\u2775"], ["\u2794", "\u2BFF"], ["\u2E00", "\u2E7F"], ["\u3001", "\u3003"], ["\u3008", "\u3020"], "\u3030", "\uFD3E", "\uFD3F", "\uFE45", "\uFE46"], false, false);
617
+ var peg$c68 = peg$otherExpectation("optional whitespace");
618
+ var peg$c69 = peg$otherExpectation("number");
619
+ var peg$c70 = "-";
620
+ var peg$c71 = peg$literalExpectation("-", false);
621
+
622
+ var peg$c72 = function peg$c72(negative, num) {
582
623
  return num ? negative ? -num : num : 0;
583
624
  };
584
- var peg$c67 = peg$otherExpectation("double apostrophes");
585
- var peg$c68 = "''";
586
- var peg$c69 = peg$literalExpectation("''", false);
625
+ var peg$c74 = peg$otherExpectation("double apostrophes");
626
+ var peg$c75 = "''";
627
+ var peg$c76 = peg$literalExpectation("''", false);
587
628
 
588
- var peg$c70 = function peg$c70() {
629
+ var peg$c77 = function peg$c77() {
589
630
  return "'";
590
631
  };
591
632
 
592
- var peg$c71 = /^[{}]/;
593
- var peg$c72 = peg$classExpectation(["{", "}"], false, false);
594
-
595
- var peg$c73 = function peg$c73(escapedChar, quotedChars) {
633
+ var peg$c78 = function peg$c78(escapedChar, quotedChars) {
596
634
  return escapedChar + quotedChars.replace("''", "'");
597
635
  };
598
636
 
599
- var peg$c74 = /^[^{}]/;
600
- var peg$c75 = peg$classExpectation(["{", "}"], true, false);
601
- var peg$c76 = peg$otherExpectation("argNameOrNumber");
602
- var peg$c77 = peg$otherExpectation("argNumber");
603
- var peg$c78 = "0";
604
- var peg$c79 = peg$literalExpectation("0", false);
637
+ var peg$c79 = function peg$c79(x) {
638
+ return x !== '{' && !(isInPluralOption() && x === '#') && !(isNestedMessageText() && x === '}');
639
+ };
640
+
641
+ var peg$c80 = "\n";
642
+ var peg$c81 = peg$literalExpectation("\n", false);
643
+
644
+ var peg$c82 = function peg$c82(x) {
645
+ return x === '{' || x === '}' || isInPluralOption() && x === '#';
646
+ };
605
647
 
606
- var peg$c80 = function peg$c80() {
648
+ var peg$c83 = peg$otherExpectation("argNameOrNumber");
649
+ var peg$c84 = peg$otherExpectation("argNumber");
650
+ var peg$c85 = "0";
651
+ var peg$c86 = peg$literalExpectation("0", false);
652
+
653
+ var peg$c87 = function peg$c87() {
607
654
  return 0;
608
655
  };
609
656
 
610
- var peg$c81 = /^[1-9]/;
611
- var peg$c82 = peg$classExpectation([["1", "9"]], false, false);
612
- var peg$c83 = /^[0-9]/;
613
- var peg$c84 = peg$classExpectation([["0", "9"]], false, false);
657
+ var peg$c88 = /^[1-9]/;
658
+ var peg$c89 = peg$classExpectation([["1", "9"]], false, false);
659
+ var peg$c90 = /^[0-9]/;
660
+ var peg$c91 = peg$classExpectation([["0", "9"]], false, false);
614
661
 
615
- var peg$c85 = function peg$c85(digits) {
662
+ var peg$c92 = function peg$c92(digits) {
616
663
  return parseInt(digits.join(''), 10);
617
664
  };
618
665
 
619
- var peg$c86 = peg$otherExpectation("argName");
666
+ var peg$c93 = peg$otherExpectation("argName");
620
667
  var peg$currPos = 0;
621
668
  var peg$savedPos = 0;
622
669
  var peg$posDetailsCache = [{
@@ -792,6 +839,10 @@
792
839
 
793
840
  if (s0 === peg$FAILED) {
794
841
  s0 = peg$parseselectElement();
842
+
843
+ if (s0 === peg$FAILED) {
844
+ s0 = peg$parsepoundElement();
845
+ }
795
846
  }
796
847
  }
797
848
  }
@@ -854,19 +905,43 @@
854
905
  return s0;
855
906
  }
856
907
 
908
+ function peg$parsepoundElement() {
909
+ var s0, s1;
910
+ s0 = peg$currPos;
911
+
912
+ if (input.charCodeAt(peg$currPos) === 35) {
913
+ s1 = peg$c2;
914
+ peg$currPos++;
915
+ } else {
916
+ s1 = peg$FAILED;
917
+
918
+ if (peg$silentFails === 0) {
919
+ peg$fail(peg$c3);
920
+ }
921
+ }
922
+
923
+ if (s1 !== peg$FAILED) {
924
+ peg$savedPos = s0;
925
+ s1 = peg$c4();
926
+ }
927
+
928
+ s0 = s1;
929
+ return s0;
930
+ }
931
+
857
932
  function peg$parseargumentElement() {
858
933
  var s0, s1, s2, s3, s4, s5;
859
934
  peg$silentFails++;
860
935
  s0 = peg$currPos;
861
936
 
862
937
  if (input.charCodeAt(peg$currPos) === 123) {
863
- s1 = peg$c3;
938
+ s1 = peg$c6;
864
939
  peg$currPos++;
865
940
  } else {
866
941
  s1 = peg$FAILED;
867
942
 
868
943
  if (peg$silentFails === 0) {
869
- peg$fail(peg$c4);
944
+ peg$fail(peg$c7);
870
945
  }
871
946
  }
872
947
 
@@ -881,19 +956,19 @@
881
956
 
882
957
  if (s4 !== peg$FAILED) {
883
958
  if (input.charCodeAt(peg$currPos) === 125) {
884
- s5 = peg$c5;
959
+ s5 = peg$c8;
885
960
  peg$currPos++;
886
961
  } else {
887
962
  s5 = peg$FAILED;
888
963
 
889
964
  if (peg$silentFails === 0) {
890
- peg$fail(peg$c6);
965
+ peg$fail(peg$c9);
891
966
  }
892
967
  }
893
968
 
894
969
  if (s5 !== peg$FAILED) {
895
970
  peg$savedPos = s0;
896
- s1 = peg$c7(s3);
971
+ s1 = peg$c10(s3);
897
972
  s0 = s1;
898
973
  } else {
899
974
  peg$currPos = s0;
@@ -922,7 +997,7 @@
922
997
  s1 = peg$FAILED;
923
998
 
924
999
  if (peg$silentFails === 0) {
925
- peg$fail(peg$c2);
1000
+ peg$fail(peg$c5);
926
1001
  }
927
1002
  }
928
1003
 
@@ -940,14 +1015,14 @@
940
1015
  s4 = peg$parsepatternWhiteSpace();
941
1016
 
942
1017
  if (s4 === peg$FAILED) {
943
- if (peg$c9.test(input.charAt(peg$currPos))) {
1018
+ if (peg$c12.test(input.charAt(peg$currPos))) {
944
1019
  s4 = input.charAt(peg$currPos);
945
1020
  peg$currPos++;
946
1021
  } else {
947
1022
  s4 = peg$FAILED;
948
1023
 
949
1024
  if (peg$silentFails === 0) {
950
- peg$fail(peg$c10);
1025
+ peg$fail(peg$c13);
951
1026
  }
952
1027
  }
953
1028
  }
@@ -969,7 +1044,7 @@
969
1044
  s4 = peg$FAILED;
970
1045
 
971
1046
  if (peg$silentFails === 0) {
972
- peg$fail(peg$c11);
1047
+ peg$fail(peg$c14);
973
1048
  }
974
1049
  }
975
1050
 
@@ -994,14 +1069,14 @@
994
1069
  s4 = peg$parsepatternWhiteSpace();
995
1070
 
996
1071
  if (s4 === peg$FAILED) {
997
- if (peg$c9.test(input.charAt(peg$currPos))) {
1072
+ if (peg$c12.test(input.charAt(peg$currPos))) {
998
1073
  s4 = input.charAt(peg$currPos);
999
1074
  peg$currPos++;
1000
1075
  } else {
1001
1076
  s4 = peg$FAILED;
1002
1077
 
1003
1078
  if (peg$silentFails === 0) {
1004
- peg$fail(peg$c10);
1079
+ peg$fail(peg$c13);
1005
1080
  }
1006
1081
  }
1007
1082
  }
@@ -1023,7 +1098,7 @@
1023
1098
  s4 = peg$FAILED;
1024
1099
 
1025
1100
  if (peg$silentFails === 0) {
1026
- peg$fail(peg$c11);
1101
+ peg$fail(peg$c14);
1027
1102
  }
1028
1103
  }
1029
1104
 
@@ -1055,7 +1130,7 @@
1055
1130
  s1 = peg$FAILED;
1056
1131
 
1057
1132
  if (peg$silentFails === 0) {
1058
- peg$fail(peg$c8);
1133
+ peg$fail(peg$c11);
1059
1134
  }
1060
1135
  }
1061
1136
 
@@ -1068,13 +1143,13 @@
1068
1143
  s0 = peg$currPos;
1069
1144
 
1070
1145
  if (input.charCodeAt(peg$currPos) === 47) {
1071
- s1 = peg$c13;
1146
+ s1 = peg$c16;
1072
1147
  peg$currPos++;
1073
1148
  } else {
1074
1149
  s1 = peg$FAILED;
1075
1150
 
1076
1151
  if (peg$silentFails === 0) {
1077
- peg$fail(peg$c14);
1152
+ peg$fail(peg$c17);
1078
1153
  }
1079
1154
  }
1080
1155
 
@@ -1083,7 +1158,7 @@
1083
1158
 
1084
1159
  if (s2 !== peg$FAILED) {
1085
1160
  peg$savedPos = s0;
1086
- s1 = peg$c15(s2);
1161
+ s1 = peg$c18(s2);
1087
1162
  s0 = s1;
1088
1163
  } else {
1089
1164
  peg$currPos = s0;
@@ -1100,7 +1175,7 @@
1100
1175
  s1 = peg$FAILED;
1101
1176
 
1102
1177
  if (peg$silentFails === 0) {
1103
- peg$fail(peg$c12);
1178
+ peg$fail(peg$c15);
1104
1179
  }
1105
1180
  }
1106
1181
 
@@ -1127,7 +1202,7 @@
1127
1202
 
1128
1203
  if (s3 !== peg$FAILED) {
1129
1204
  peg$savedPos = s0;
1130
- s1 = peg$c17(s2, s3);
1205
+ s1 = peg$c20(s2, s3);
1131
1206
  s0 = s1;
1132
1207
  } else {
1133
1208
  peg$currPos = s0;
@@ -1148,7 +1223,7 @@
1148
1223
  s1 = peg$FAILED;
1149
1224
 
1150
1225
  if (peg$silentFails === 0) {
1151
- peg$fail(peg$c16);
1226
+ peg$fail(peg$c19);
1152
1227
  }
1153
1228
  }
1154
1229
 
@@ -1172,7 +1247,7 @@
1172
1247
 
1173
1248
  if (s1 !== peg$FAILED) {
1174
1249
  peg$savedPos = s0;
1175
- s1 = peg$c18(s1);
1250
+ s1 = peg$c21(s1);
1176
1251
  }
1177
1252
 
1178
1253
  s0 = s1;
@@ -1183,14 +1258,14 @@
1183
1258
  var s0, s1, s2;
1184
1259
  s0 = peg$currPos;
1185
1260
 
1186
- if (input.substr(peg$currPos, 2) === peg$c19) {
1187
- s1 = peg$c19;
1261
+ if (input.substr(peg$currPos, 2) === peg$c22) {
1262
+ s1 = peg$c22;
1188
1263
  peg$currPos += 2;
1189
1264
  } else {
1190
1265
  s1 = peg$FAILED;
1191
1266
 
1192
1267
  if (peg$silentFails === 0) {
1193
- peg$fail(peg$c20);
1268
+ peg$fail(peg$c23);
1194
1269
  }
1195
1270
  }
1196
1271
 
@@ -1199,7 +1274,7 @@
1199
1274
 
1200
1275
  if (s2 !== peg$FAILED) {
1201
1276
  peg$savedPos = s0;
1202
- s1 = peg$c21(s2);
1277
+ s1 = peg$c24(s2);
1203
1278
  s0 = s1;
1204
1279
  } else {
1205
1280
  peg$currPos = s0;
@@ -1212,14 +1287,30 @@
1212
1287
 
1213
1288
  if (s0 === peg$FAILED) {
1214
1289
  s0 = peg$currPos;
1215
- s1 = peg$parsemessageText();
1290
+ peg$savedPos = peg$currPos;
1291
+ s1 = peg$c25();
1216
1292
 
1217
- if (s1 !== peg$FAILED) {
1218
- peg$savedPos = s0;
1219
- s1 = peg$c22(s1);
1293
+ if (s1) {
1294
+ s1 = undefined;
1295
+ } else {
1296
+ s1 = peg$FAILED;
1220
1297
  }
1221
1298
 
1222
- s0 = s1;
1299
+ if (s1 !== peg$FAILED) {
1300
+ s2 = peg$parsemessageText();
1301
+
1302
+ if (s2 !== peg$FAILED) {
1303
+ peg$savedPos = s0;
1304
+ s1 = peg$c26(s2);
1305
+ s0 = s1;
1306
+ } else {
1307
+ peg$currPos = s0;
1308
+ s0 = peg$FAILED;
1309
+ }
1310
+ } else {
1311
+ peg$currPos = s0;
1312
+ s0 = peg$FAILED;
1313
+ }
1223
1314
  }
1224
1315
 
1225
1316
  return s0;
@@ -1230,13 +1321,13 @@
1230
1321
  s0 = peg$currPos;
1231
1322
 
1232
1323
  if (input.charCodeAt(peg$currPos) === 123) {
1233
- s1 = peg$c3;
1324
+ s1 = peg$c6;
1234
1325
  peg$currPos++;
1235
1326
  } else {
1236
1327
  s1 = peg$FAILED;
1237
1328
 
1238
1329
  if (peg$silentFails === 0) {
1239
- peg$fail(peg$c4);
1330
+ peg$fail(peg$c7);
1240
1331
  }
1241
1332
  }
1242
1333
 
@@ -1251,13 +1342,13 @@
1251
1342
 
1252
1343
  if (s4 !== peg$FAILED) {
1253
1344
  if (input.charCodeAt(peg$currPos) === 44) {
1254
- s5 = peg$c23;
1345
+ s5 = peg$c27;
1255
1346
  peg$currPos++;
1256
1347
  } else {
1257
1348
  s5 = peg$FAILED;
1258
1349
 
1259
1350
  if (peg$silentFails === 0) {
1260
- peg$fail(peg$c24);
1351
+ peg$fail(peg$c28);
1261
1352
  }
1262
1353
  }
1263
1354
 
@@ -1265,14 +1356,14 @@
1265
1356
  s6 = peg$parse_();
1266
1357
 
1267
1358
  if (s6 !== peg$FAILED) {
1268
- if (input.substr(peg$currPos, 6) === peg$c25) {
1269
- s7 = peg$c25;
1359
+ if (input.substr(peg$currPos, 6) === peg$c29) {
1360
+ s7 = peg$c29;
1270
1361
  peg$currPos += 6;
1271
1362
  } else {
1272
1363
  s7 = peg$FAILED;
1273
1364
 
1274
1365
  if (peg$silentFails === 0) {
1275
- peg$fail(peg$c26);
1366
+ peg$fail(peg$c30);
1276
1367
  }
1277
1368
  }
1278
1369
 
@@ -1283,13 +1374,13 @@
1283
1374
  s9 = peg$currPos;
1284
1375
 
1285
1376
  if (input.charCodeAt(peg$currPos) === 44) {
1286
- s10 = peg$c23;
1377
+ s10 = peg$c27;
1287
1378
  peg$currPos++;
1288
1379
  } else {
1289
1380
  s10 = peg$FAILED;
1290
1381
 
1291
1382
  if (peg$silentFails === 0) {
1292
- peg$fail(peg$c24);
1383
+ peg$fail(peg$c28);
1293
1384
  }
1294
1385
  }
1295
1386
 
@@ -1324,19 +1415,19 @@
1324
1415
 
1325
1416
  if (s10 !== peg$FAILED) {
1326
1417
  if (input.charCodeAt(peg$currPos) === 125) {
1327
- s11 = peg$c5;
1418
+ s11 = peg$c8;
1328
1419
  peg$currPos++;
1329
1420
  } else {
1330
1421
  s11 = peg$FAILED;
1331
1422
 
1332
1423
  if (peg$silentFails === 0) {
1333
- peg$fail(peg$c6);
1424
+ peg$fail(peg$c9);
1334
1425
  }
1335
1426
  }
1336
1427
 
1337
1428
  if (s11 !== peg$FAILED) {
1338
1429
  peg$savedPos = s0;
1339
- s1 = peg$c27(s3, s7, s9);
1430
+ s1 = peg$c31(s3, s7, s9);
1340
1431
  s0 = s1;
1341
1432
  } else {
1342
1433
  peg$currPos = s0;
@@ -1391,13 +1482,13 @@
1391
1482
  s0 = peg$currPos;
1392
1483
 
1393
1484
  if (input.charCodeAt(peg$currPos) === 39) {
1394
- s1 = peg$c28;
1485
+ s1 = peg$c32;
1395
1486
  peg$currPos++;
1396
1487
  } else {
1397
1488
  s1 = peg$FAILED;
1398
1489
 
1399
1490
  if (peg$silentFails === 0) {
1400
- peg$fail(peg$c29);
1491
+ peg$fail(peg$c33);
1401
1492
  }
1402
1493
  }
1403
1494
 
@@ -1406,14 +1497,14 @@
1406
1497
  s3 = peg$parsedoubleApostrophes();
1407
1498
 
1408
1499
  if (s3 === peg$FAILED) {
1409
- if (peg$c30.test(input.charAt(peg$currPos))) {
1500
+ if (peg$c34.test(input.charAt(peg$currPos))) {
1410
1501
  s3 = input.charAt(peg$currPos);
1411
1502
  peg$currPos++;
1412
1503
  } else {
1413
1504
  s3 = peg$FAILED;
1414
1505
 
1415
1506
  if (peg$silentFails === 0) {
1416
- peg$fail(peg$c31);
1507
+ peg$fail(peg$c35);
1417
1508
  }
1418
1509
  }
1419
1510
  }
@@ -1424,14 +1515,14 @@
1424
1515
  s3 = peg$parsedoubleApostrophes();
1425
1516
 
1426
1517
  if (s3 === peg$FAILED) {
1427
- if (peg$c30.test(input.charAt(peg$currPos))) {
1518
+ if (peg$c34.test(input.charAt(peg$currPos))) {
1428
1519
  s3 = input.charAt(peg$currPos);
1429
1520
  peg$currPos++;
1430
1521
  } else {
1431
1522
  s3 = peg$FAILED;
1432
1523
 
1433
1524
  if (peg$silentFails === 0) {
1434
- peg$fail(peg$c31);
1525
+ peg$fail(peg$c35);
1435
1526
  }
1436
1527
  }
1437
1528
  }
@@ -1442,13 +1533,13 @@
1442
1533
 
1443
1534
  if (s2 !== peg$FAILED) {
1444
1535
  if (input.charCodeAt(peg$currPos) === 39) {
1445
- s3 = peg$c28;
1536
+ s3 = peg$c32;
1446
1537
  peg$currPos++;
1447
1538
  } else {
1448
1539
  s3 = peg$FAILED;
1449
1540
 
1450
1541
  if (peg$silentFails === 0) {
1451
- peg$fail(peg$c29);
1542
+ peg$fail(peg$c33);
1452
1543
  }
1453
1544
  }
1454
1545
 
@@ -1473,14 +1564,14 @@
1473
1564
  s1 = peg$parsedoubleApostrophes();
1474
1565
 
1475
1566
  if (s1 === peg$FAILED) {
1476
- if (peg$c32.test(input.charAt(peg$currPos))) {
1567
+ if (peg$c36.test(input.charAt(peg$currPos))) {
1477
1568
  s1 = input.charAt(peg$currPos);
1478
1569
  peg$currPos++;
1479
1570
  } else {
1480
1571
  s1 = peg$FAILED;
1481
1572
 
1482
1573
  if (peg$silentFails === 0) {
1483
- peg$fail(peg$c33);
1574
+ peg$fail(peg$c37);
1484
1575
  }
1485
1576
  }
1486
1577
  }
@@ -1491,14 +1582,14 @@
1491
1582
  s1 = peg$parsedoubleApostrophes();
1492
1583
 
1493
1584
  if (s1 === peg$FAILED) {
1494
- if (peg$c32.test(input.charAt(peg$currPos))) {
1585
+ if (peg$c36.test(input.charAt(peg$currPos))) {
1495
1586
  s1 = input.charAt(peg$currPos);
1496
1587
  peg$currPos++;
1497
1588
  } else {
1498
1589
  s1 = peg$FAILED;
1499
1590
 
1500
1591
  if (peg$silentFails === 0) {
1501
- peg$fail(peg$c33);
1592
+ peg$fail(peg$c37);
1502
1593
  }
1503
1594
  }
1504
1595
  }
@@ -1515,14 +1606,14 @@
1515
1606
  var s0, s1;
1516
1607
  s0 = [];
1517
1608
 
1518
- if (peg$c34.test(input.charAt(peg$currPos))) {
1609
+ if (peg$c38.test(input.charAt(peg$currPos))) {
1519
1610
  s1 = input.charAt(peg$currPos);
1520
1611
  peg$currPos++;
1521
1612
  } else {
1522
1613
  s1 = peg$FAILED;
1523
1614
 
1524
1615
  if (peg$silentFails === 0) {
1525
- peg$fail(peg$c35);
1616
+ peg$fail(peg$c39);
1526
1617
  }
1527
1618
  }
1528
1619
 
@@ -1530,14 +1621,14 @@
1530
1621
  while (s1 !== peg$FAILED) {
1531
1622
  s0.push(s1);
1532
1623
 
1533
- if (peg$c34.test(input.charAt(peg$currPos))) {
1624
+ if (peg$c38.test(input.charAt(peg$currPos))) {
1534
1625
  s1 = input.charAt(peg$currPos);
1535
1626
  peg$currPos++;
1536
1627
  } else {
1537
1628
  s1 = peg$FAILED;
1538
1629
 
1539
1630
  if (peg$silentFails === 0) {
1540
- peg$fail(peg$c35);
1631
+ peg$fail(peg$c39);
1541
1632
  }
1542
1633
  }
1543
1634
  }
@@ -1580,7 +1671,7 @@
1580
1671
 
1581
1672
  if (s1 !== peg$FAILED) {
1582
1673
  peg$savedPos = s0;
1583
- s1 = peg$c36(s1);
1674
+ s1 = peg$c40(s1);
1584
1675
  }
1585
1676
 
1586
1677
  s0 = s1;
@@ -1591,14 +1682,14 @@
1591
1682
  var s0, s1, s2;
1592
1683
  s0 = peg$currPos;
1593
1684
 
1594
- if (input.substr(peg$currPos, 2) === peg$c19) {
1595
- s1 = peg$c19;
1685
+ if (input.substr(peg$currPos, 2) === peg$c22) {
1686
+ s1 = peg$c22;
1596
1687
  peg$currPos += 2;
1597
1688
  } else {
1598
1689
  s1 = peg$FAILED;
1599
1690
 
1600
1691
  if (peg$silentFails === 0) {
1601
- peg$fail(peg$c20);
1692
+ peg$fail(peg$c23);
1602
1693
  }
1603
1694
  }
1604
1695
 
@@ -1607,7 +1698,7 @@
1607
1698
 
1608
1699
  if (s2 !== peg$FAILED) {
1609
1700
  peg$savedPos = s0;
1610
- s1 = peg$c21(s2);
1701
+ s1 = peg$c24(s2);
1611
1702
  s0 = s1;
1612
1703
  } else {
1613
1704
  peg$currPos = s0;
@@ -1620,14 +1711,30 @@
1620
1711
 
1621
1712
  if (s0 === peg$FAILED) {
1622
1713
  s0 = peg$currPos;
1623
- s1 = peg$parsemessageText();
1714
+ peg$savedPos = peg$currPos;
1715
+ s1 = peg$c41();
1624
1716
 
1625
- if (s1 !== peg$FAILED) {
1626
- peg$savedPos = s0;
1627
- s1 = peg$c22(s1);
1717
+ if (s1) {
1718
+ s1 = undefined;
1719
+ } else {
1720
+ s1 = peg$FAILED;
1628
1721
  }
1629
1722
 
1630
- s0 = s1;
1723
+ if (s1 !== peg$FAILED) {
1724
+ s2 = peg$parsemessageText();
1725
+
1726
+ if (s2 !== peg$FAILED) {
1727
+ peg$savedPos = s0;
1728
+ s1 = peg$c26(s2);
1729
+ s0 = s1;
1730
+ } else {
1731
+ peg$currPos = s0;
1732
+ s0 = peg$FAILED;
1733
+ }
1734
+ } else {
1735
+ peg$currPos = s0;
1736
+ s0 = peg$FAILED;
1737
+ }
1631
1738
  }
1632
1739
 
1633
1740
  return s0;
@@ -1638,13 +1745,13 @@
1638
1745
  s0 = peg$currPos;
1639
1746
 
1640
1747
  if (input.charCodeAt(peg$currPos) === 123) {
1641
- s1 = peg$c3;
1748
+ s1 = peg$c6;
1642
1749
  peg$currPos++;
1643
1750
  } else {
1644
1751
  s1 = peg$FAILED;
1645
1752
 
1646
1753
  if (peg$silentFails === 0) {
1647
- peg$fail(peg$c4);
1754
+ peg$fail(peg$c7);
1648
1755
  }
1649
1756
  }
1650
1757
 
@@ -1659,13 +1766,13 @@
1659
1766
 
1660
1767
  if (s4 !== peg$FAILED) {
1661
1768
  if (input.charCodeAt(peg$currPos) === 44) {
1662
- s5 = peg$c23;
1769
+ s5 = peg$c27;
1663
1770
  peg$currPos++;
1664
1771
  } else {
1665
1772
  s5 = peg$FAILED;
1666
1773
 
1667
1774
  if (peg$silentFails === 0) {
1668
- peg$fail(peg$c24);
1775
+ peg$fail(peg$c28);
1669
1776
  }
1670
1777
  }
1671
1778
 
@@ -1673,26 +1780,26 @@
1673
1780
  s6 = peg$parse_();
1674
1781
 
1675
1782
  if (s6 !== peg$FAILED) {
1676
- if (input.substr(peg$currPos, 4) === peg$c37) {
1677
- s7 = peg$c37;
1783
+ if (input.substr(peg$currPos, 4) === peg$c42) {
1784
+ s7 = peg$c42;
1678
1785
  peg$currPos += 4;
1679
1786
  } else {
1680
1787
  s7 = peg$FAILED;
1681
1788
 
1682
1789
  if (peg$silentFails === 0) {
1683
- peg$fail(peg$c38);
1790
+ peg$fail(peg$c43);
1684
1791
  }
1685
1792
  }
1686
1793
 
1687
1794
  if (s7 === peg$FAILED) {
1688
- if (input.substr(peg$currPos, 4) === peg$c39) {
1689
- s7 = peg$c39;
1795
+ if (input.substr(peg$currPos, 4) === peg$c44) {
1796
+ s7 = peg$c44;
1690
1797
  peg$currPos += 4;
1691
1798
  } else {
1692
1799
  s7 = peg$FAILED;
1693
1800
 
1694
1801
  if (peg$silentFails === 0) {
1695
- peg$fail(peg$c40);
1802
+ peg$fail(peg$c45);
1696
1803
  }
1697
1804
  }
1698
1805
  }
@@ -1704,13 +1811,13 @@
1704
1811
  s9 = peg$currPos;
1705
1812
 
1706
1813
  if (input.charCodeAt(peg$currPos) === 44) {
1707
- s10 = peg$c23;
1814
+ s10 = peg$c27;
1708
1815
  peg$currPos++;
1709
1816
  } else {
1710
1817
  s10 = peg$FAILED;
1711
1818
 
1712
1819
  if (peg$silentFails === 0) {
1713
- peg$fail(peg$c24);
1820
+ peg$fail(peg$c28);
1714
1821
  }
1715
1822
  }
1716
1823
 
@@ -1745,19 +1852,19 @@
1745
1852
 
1746
1853
  if (s10 !== peg$FAILED) {
1747
1854
  if (input.charCodeAt(peg$currPos) === 125) {
1748
- s11 = peg$c5;
1855
+ s11 = peg$c8;
1749
1856
  peg$currPos++;
1750
1857
  } else {
1751
1858
  s11 = peg$FAILED;
1752
1859
 
1753
1860
  if (peg$silentFails === 0) {
1754
- peg$fail(peg$c6);
1861
+ peg$fail(peg$c9);
1755
1862
  }
1756
1863
  }
1757
1864
 
1758
1865
  if (s11 !== peg$FAILED) {
1759
1866
  peg$savedPos = s0;
1760
- s1 = peg$c27(s3, s7, s9);
1867
+ s1 = peg$c31(s3, s7, s9);
1761
1868
  s0 = s1;
1762
1869
  } else {
1763
1870
  peg$currPos = s0;
@@ -1823,13 +1930,13 @@
1823
1930
  s0 = peg$currPos;
1824
1931
 
1825
1932
  if (input.charCodeAt(peg$currPos) === 123) {
1826
- s1 = peg$c3;
1933
+ s1 = peg$c6;
1827
1934
  peg$currPos++;
1828
1935
  } else {
1829
1936
  s1 = peg$FAILED;
1830
1937
 
1831
1938
  if (peg$silentFails === 0) {
1832
- peg$fail(peg$c4);
1939
+ peg$fail(peg$c7);
1833
1940
  }
1834
1941
  }
1835
1942
 
@@ -1844,13 +1951,13 @@
1844
1951
 
1845
1952
  if (s4 !== peg$FAILED) {
1846
1953
  if (input.charCodeAt(peg$currPos) === 44) {
1847
- s5 = peg$c23;
1954
+ s5 = peg$c27;
1848
1955
  peg$currPos++;
1849
1956
  } else {
1850
1957
  s5 = peg$FAILED;
1851
1958
 
1852
1959
  if (peg$silentFails === 0) {
1853
- peg$fail(peg$c24);
1960
+ peg$fail(peg$c28);
1854
1961
  }
1855
1962
  }
1856
1963
 
@@ -1858,26 +1965,26 @@
1858
1965
  s6 = peg$parse_();
1859
1966
 
1860
1967
  if (s6 !== peg$FAILED) {
1861
- if (input.substr(peg$currPos, 6) === peg$c41) {
1862
- s7 = peg$c41;
1968
+ if (input.substr(peg$currPos, 6) === peg$c46) {
1969
+ s7 = peg$c46;
1863
1970
  peg$currPos += 6;
1864
1971
  } else {
1865
1972
  s7 = peg$FAILED;
1866
1973
 
1867
1974
  if (peg$silentFails === 0) {
1868
- peg$fail(peg$c42);
1975
+ peg$fail(peg$c47);
1869
1976
  }
1870
1977
  }
1871
1978
 
1872
1979
  if (s7 === peg$FAILED) {
1873
- if (input.substr(peg$currPos, 13) === peg$c43) {
1874
- s7 = peg$c43;
1980
+ if (input.substr(peg$currPos, 13) === peg$c48) {
1981
+ s7 = peg$c48;
1875
1982
  peg$currPos += 13;
1876
1983
  } else {
1877
1984
  s7 = peg$FAILED;
1878
1985
 
1879
1986
  if (peg$silentFails === 0) {
1880
- peg$fail(peg$c44);
1987
+ peg$fail(peg$c49);
1881
1988
  }
1882
1989
  }
1883
1990
  }
@@ -1887,13 +1994,13 @@
1887
1994
 
1888
1995
  if (s8 !== peg$FAILED) {
1889
1996
  if (input.charCodeAt(peg$currPos) === 44) {
1890
- s9 = peg$c23;
1997
+ s9 = peg$c27;
1891
1998
  peg$currPos++;
1892
1999
  } else {
1893
2000
  s9 = peg$FAILED;
1894
2001
 
1895
2002
  if (peg$silentFails === 0) {
1896
- peg$fail(peg$c24);
2003
+ peg$fail(peg$c28);
1897
2004
  }
1898
2005
  }
1899
2006
 
@@ -1903,14 +2010,14 @@
1903
2010
  if (s10 !== peg$FAILED) {
1904
2011
  s11 = peg$currPos;
1905
2012
 
1906
- if (input.substr(peg$currPos, 7) === peg$c45) {
1907
- s12 = peg$c45;
2013
+ if (input.substr(peg$currPos, 7) === peg$c50) {
2014
+ s12 = peg$c50;
1908
2015
  peg$currPos += 7;
1909
2016
  } else {
1910
2017
  s12 = peg$FAILED;
1911
2018
 
1912
2019
  if (peg$silentFails === 0) {
1913
- peg$fail(peg$c46);
2020
+ peg$fail(peg$c51);
1914
2021
  }
1915
2022
  }
1916
2023
 
@@ -1961,19 +2068,19 @@
1961
2068
 
1962
2069
  if (s14 !== peg$FAILED) {
1963
2070
  if (input.charCodeAt(peg$currPos) === 125) {
1964
- s15 = peg$c5;
2071
+ s15 = peg$c8;
1965
2072
  peg$currPos++;
1966
2073
  } else {
1967
2074
  s15 = peg$FAILED;
1968
2075
 
1969
2076
  if (peg$silentFails === 0) {
1970
- peg$fail(peg$c6);
2077
+ peg$fail(peg$c9);
1971
2078
  }
1972
2079
  }
1973
2080
 
1974
2081
  if (s15 !== peg$FAILED) {
1975
2082
  peg$savedPos = s0;
1976
- s1 = peg$c47(s3, s7, s11, s13);
2083
+ s1 = peg$c52(s3, s7, s11, s13);
1977
2084
  s0 = s1;
1978
2085
  } else {
1979
2086
  peg$currPos = s0;
@@ -2044,13 +2151,13 @@
2044
2151
  s0 = peg$currPos;
2045
2152
 
2046
2153
  if (input.charCodeAt(peg$currPos) === 123) {
2047
- s1 = peg$c3;
2154
+ s1 = peg$c6;
2048
2155
  peg$currPos++;
2049
2156
  } else {
2050
2157
  s1 = peg$FAILED;
2051
2158
 
2052
2159
  if (peg$silentFails === 0) {
2053
- peg$fail(peg$c4);
2160
+ peg$fail(peg$c7);
2054
2161
  }
2055
2162
  }
2056
2163
 
@@ -2065,13 +2172,13 @@
2065
2172
 
2066
2173
  if (s4 !== peg$FAILED) {
2067
2174
  if (input.charCodeAt(peg$currPos) === 44) {
2068
- s5 = peg$c23;
2175
+ s5 = peg$c27;
2069
2176
  peg$currPos++;
2070
2177
  } else {
2071
2178
  s5 = peg$FAILED;
2072
2179
 
2073
2180
  if (peg$silentFails === 0) {
2074
- peg$fail(peg$c24);
2181
+ peg$fail(peg$c28);
2075
2182
  }
2076
2183
  }
2077
2184
 
@@ -2079,14 +2186,14 @@
2079
2186
  s6 = peg$parse_();
2080
2187
 
2081
2188
  if (s6 !== peg$FAILED) {
2082
- if (input.substr(peg$currPos, 6) === peg$c48) {
2083
- s7 = peg$c48;
2189
+ if (input.substr(peg$currPos, 6) === peg$c53) {
2190
+ s7 = peg$c53;
2084
2191
  peg$currPos += 6;
2085
2192
  } else {
2086
2193
  s7 = peg$FAILED;
2087
2194
 
2088
2195
  if (peg$silentFails === 0) {
2089
- peg$fail(peg$c49);
2196
+ peg$fail(peg$c54);
2090
2197
  }
2091
2198
  }
2092
2199
 
@@ -2095,13 +2202,13 @@
2095
2202
 
2096
2203
  if (s8 !== peg$FAILED) {
2097
2204
  if (input.charCodeAt(peg$currPos) === 44) {
2098
- s9 = peg$c23;
2205
+ s9 = peg$c27;
2099
2206
  peg$currPos++;
2100
2207
  } else {
2101
2208
  s9 = peg$FAILED;
2102
2209
 
2103
2210
  if (peg$silentFails === 0) {
2104
- peg$fail(peg$c24);
2211
+ peg$fail(peg$c28);
2105
2212
  }
2106
2213
  }
2107
2214
 
@@ -2126,19 +2233,19 @@
2126
2233
 
2127
2234
  if (s12 !== peg$FAILED) {
2128
2235
  if (input.charCodeAt(peg$currPos) === 125) {
2129
- s13 = peg$c5;
2236
+ s13 = peg$c8;
2130
2237
  peg$currPos++;
2131
2238
  } else {
2132
2239
  s13 = peg$FAILED;
2133
2240
 
2134
2241
  if (peg$silentFails === 0) {
2135
- peg$fail(peg$c6);
2242
+ peg$fail(peg$c9);
2136
2243
  }
2137
2244
  }
2138
2245
 
2139
2246
  if (s13 !== peg$FAILED) {
2140
2247
  peg$savedPos = s0;
2141
- s1 = peg$c50(s3, s11);
2248
+ s1 = peg$c55(s3, s11);
2142
2249
  s0 = s1;
2143
2250
  } else {
2144
2251
  peg$currPos = s0;
@@ -2202,13 +2309,13 @@
2202
2309
  s1 = peg$currPos;
2203
2310
 
2204
2311
  if (input.charCodeAt(peg$currPos) === 61) {
2205
- s2 = peg$c51;
2312
+ s2 = peg$c56;
2206
2313
  peg$currPos++;
2207
2314
  } else {
2208
2315
  s2 = peg$FAILED;
2209
2316
 
2210
2317
  if (peg$silentFails === 0) {
2211
- peg$fail(peg$c52);
2318
+ peg$fail(peg$c57);
2212
2319
  }
2213
2320
  }
2214
2321
 
@@ -2241,7 +2348,7 @@
2241
2348
  }
2242
2349
 
2243
2350
  function peg$parseselectOption() {
2244
- var s0, s1, s2, s3, s4, s5, s6;
2351
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2245
2352
  s0 = peg$currPos;
2246
2353
  s1 = peg$parse_();
2247
2354
 
@@ -2253,35 +2360,49 @@
2253
2360
 
2254
2361
  if (s3 !== peg$FAILED) {
2255
2362
  if (input.charCodeAt(peg$currPos) === 123) {
2256
- s4 = peg$c3;
2363
+ s4 = peg$c6;
2257
2364
  peg$currPos++;
2258
2365
  } else {
2259
2366
  s4 = peg$FAILED;
2260
2367
 
2261
2368
  if (peg$silentFails === 0) {
2262
- peg$fail(peg$c4);
2369
+ peg$fail(peg$c7);
2263
2370
  }
2264
2371
  }
2265
2372
 
2266
2373
  if (s4 !== peg$FAILED) {
2267
- s5 = peg$parsemessage();
2374
+ peg$savedPos = peg$currPos;
2375
+ s5 = peg$c58();
2376
+
2377
+ if (s5) {
2378
+ s5 = undefined;
2379
+ } else {
2380
+ s5 = peg$FAILED;
2381
+ }
2268
2382
 
2269
2383
  if (s5 !== peg$FAILED) {
2270
- if (input.charCodeAt(peg$currPos) === 125) {
2271
- s6 = peg$c5;
2272
- peg$currPos++;
2273
- } else {
2274
- s6 = peg$FAILED;
2384
+ s6 = peg$parsemessage();
2385
+
2386
+ if (s6 !== peg$FAILED) {
2387
+ if (input.charCodeAt(peg$currPos) === 125) {
2388
+ s7 = peg$c8;
2389
+ peg$currPos++;
2390
+ } else {
2391
+ s7 = peg$FAILED;
2275
2392
 
2276
- if (peg$silentFails === 0) {
2277
- peg$fail(peg$c6);
2393
+ if (peg$silentFails === 0) {
2394
+ peg$fail(peg$c9);
2395
+ }
2278
2396
  }
2279
- }
2280
2397
 
2281
- if (s6 !== peg$FAILED) {
2282
- peg$savedPos = s0;
2283
- s1 = peg$c53(s2, s5);
2284
- s0 = s1;
2398
+ if (s7 !== peg$FAILED) {
2399
+ peg$savedPos = s0;
2400
+ s1 = peg$c59(s2, s6);
2401
+ s0 = s1;
2402
+ } else {
2403
+ peg$currPos = s0;
2404
+ s0 = peg$FAILED;
2405
+ }
2285
2406
  } else {
2286
2407
  peg$currPos = s0;
2287
2408
  s0 = peg$FAILED;
@@ -2311,7 +2432,7 @@
2311
2432
  }
2312
2433
 
2313
2434
  function peg$parsepluralOption() {
2314
- var s0, s1, s2, s3, s4, s5, s6;
2435
+ var s0, s1, s2, s3, s4, s5, s6, s7;
2315
2436
  s0 = peg$currPos;
2316
2437
  s1 = peg$parse_();
2317
2438
 
@@ -2323,35 +2444,49 @@
2323
2444
 
2324
2445
  if (s3 !== peg$FAILED) {
2325
2446
  if (input.charCodeAt(peg$currPos) === 123) {
2326
- s4 = peg$c3;
2447
+ s4 = peg$c6;
2327
2448
  peg$currPos++;
2328
2449
  } else {
2329
2450
  s4 = peg$FAILED;
2330
2451
 
2331
2452
  if (peg$silentFails === 0) {
2332
- peg$fail(peg$c4);
2453
+ peg$fail(peg$c7);
2333
2454
  }
2334
2455
  }
2335
2456
 
2336
2457
  if (s4 !== peg$FAILED) {
2337
- s5 = peg$parsemessage();
2458
+ peg$savedPos = peg$currPos;
2459
+ s5 = peg$c60();
2460
+
2461
+ if (s5) {
2462
+ s5 = undefined;
2463
+ } else {
2464
+ s5 = peg$FAILED;
2465
+ }
2338
2466
 
2339
2467
  if (s5 !== peg$FAILED) {
2340
- if (input.charCodeAt(peg$currPos) === 125) {
2341
- s6 = peg$c5;
2342
- peg$currPos++;
2343
- } else {
2344
- s6 = peg$FAILED;
2468
+ s6 = peg$parsemessage();
2469
+
2470
+ if (s6 !== peg$FAILED) {
2471
+ if (input.charCodeAt(peg$currPos) === 125) {
2472
+ s7 = peg$c8;
2473
+ peg$currPos++;
2474
+ } else {
2475
+ s7 = peg$FAILED;
2345
2476
 
2346
- if (peg$silentFails === 0) {
2347
- peg$fail(peg$c6);
2477
+ if (peg$silentFails === 0) {
2478
+ peg$fail(peg$c9);
2479
+ }
2348
2480
  }
2349
- }
2350
2481
 
2351
- if (s6 !== peg$FAILED) {
2352
- peg$savedPos = s0;
2353
- s1 = peg$c54(s2, s5);
2354
- s0 = s1;
2482
+ if (s7 !== peg$FAILED) {
2483
+ peg$savedPos = s0;
2484
+ s1 = peg$c61(s2, s6);
2485
+ s0 = s1;
2486
+ } else {
2487
+ peg$currPos = s0;
2488
+ s0 = peg$FAILED;
2489
+ }
2355
2490
  } else {
2356
2491
  peg$currPos = s0;
2357
2492
  s0 = peg$FAILED;
@@ -2384,14 +2519,14 @@
2384
2519
  var s0;
2385
2520
  peg$silentFails++;
2386
2521
 
2387
- if (peg$c56.test(input.charAt(peg$currPos))) {
2522
+ if (peg$c63.test(input.charAt(peg$currPos))) {
2388
2523
  s0 = input.charAt(peg$currPos);
2389
2524
  peg$currPos++;
2390
2525
  } else {
2391
2526
  s0 = peg$FAILED;
2392
2527
 
2393
2528
  if (peg$silentFails === 0) {
2394
- peg$fail(peg$c57);
2529
+ peg$fail(peg$c64);
2395
2530
  }
2396
2531
  }
2397
2532
 
@@ -2400,7 +2535,7 @@
2400
2535
  if (s0 === peg$FAILED) {
2401
2536
 
2402
2537
  if (peg$silentFails === 0) {
2403
- peg$fail(peg$c55);
2538
+ peg$fail(peg$c62);
2404
2539
  }
2405
2540
  }
2406
2541
 
@@ -2411,14 +2546,14 @@
2411
2546
  var s0;
2412
2547
  peg$silentFails++;
2413
2548
 
2414
- if (peg$c59.test(input.charAt(peg$currPos))) {
2549
+ if (peg$c66.test(input.charAt(peg$currPos))) {
2415
2550
  s0 = input.charAt(peg$currPos);
2416
2551
  peg$currPos++;
2417
2552
  } else {
2418
2553
  s0 = peg$FAILED;
2419
2554
 
2420
2555
  if (peg$silentFails === 0) {
2421
- peg$fail(peg$c60);
2556
+ peg$fail(peg$c67);
2422
2557
  }
2423
2558
  }
2424
2559
 
@@ -2427,7 +2562,7 @@
2427
2562
  if (s0 === peg$FAILED) {
2428
2563
 
2429
2564
  if (peg$silentFails === 0) {
2430
- peg$fail(peg$c58);
2565
+ peg$fail(peg$c65);
2431
2566
  }
2432
2567
  }
2433
2568
 
@@ -2458,7 +2593,7 @@
2458
2593
  s1 = peg$FAILED;
2459
2594
 
2460
2595
  if (peg$silentFails === 0) {
2461
- peg$fail(peg$c61);
2596
+ peg$fail(peg$c68);
2462
2597
  }
2463
2598
  }
2464
2599
 
@@ -2471,13 +2606,13 @@
2471
2606
  s0 = peg$currPos;
2472
2607
 
2473
2608
  if (input.charCodeAt(peg$currPos) === 45) {
2474
- s1 = peg$c63;
2609
+ s1 = peg$c70;
2475
2610
  peg$currPos++;
2476
2611
  } else {
2477
2612
  s1 = peg$FAILED;
2478
2613
 
2479
2614
  if (peg$silentFails === 0) {
2480
- peg$fail(peg$c64);
2615
+ peg$fail(peg$c71);
2481
2616
  }
2482
2617
  }
2483
2618
 
@@ -2490,7 +2625,7 @@
2490
2625
 
2491
2626
  if (s2 !== peg$FAILED) {
2492
2627
  peg$savedPos = s0;
2493
- s1 = peg$c65(s1, s2);
2628
+ s1 = peg$c72(s1, s2);
2494
2629
  s0 = s1;
2495
2630
  } else {
2496
2631
  peg$currPos = s0;
@@ -2507,7 +2642,7 @@
2507
2642
  s1 = peg$FAILED;
2508
2643
 
2509
2644
  if (peg$silentFails === 0) {
2510
- peg$fail(peg$c62);
2645
+ peg$fail(peg$c69);
2511
2646
  }
2512
2647
  }
2513
2648
 
@@ -2519,20 +2654,20 @@
2519
2654
  peg$silentFails++;
2520
2655
  s0 = peg$currPos;
2521
2656
 
2522
- if (input.substr(peg$currPos, 2) === peg$c68) {
2523
- s1 = peg$c68;
2657
+ if (input.substr(peg$currPos, 2) === peg$c75) {
2658
+ s1 = peg$c75;
2524
2659
  peg$currPos += 2;
2525
2660
  } else {
2526
2661
  s1 = peg$FAILED;
2527
2662
 
2528
2663
  if (peg$silentFails === 0) {
2529
- peg$fail(peg$c69);
2664
+ peg$fail(peg$c76);
2530
2665
  }
2531
2666
  }
2532
2667
 
2533
2668
  if (s1 !== peg$FAILED) {
2534
2669
  peg$savedPos = s0;
2535
- s1 = peg$c70();
2670
+ s1 = peg$c77();
2536
2671
  }
2537
2672
 
2538
2673
  s0 = s1;
@@ -2542,7 +2677,7 @@
2542
2677
  s1 = peg$FAILED;
2543
2678
 
2544
2679
  if (peg$silentFails === 0) {
2545
- peg$fail(peg$c67);
2680
+ peg$fail(peg$c74);
2546
2681
  }
2547
2682
  }
2548
2683
 
@@ -2554,52 +2689,43 @@
2554
2689
  s0 = peg$currPos;
2555
2690
 
2556
2691
  if (input.charCodeAt(peg$currPos) === 39) {
2557
- s1 = peg$c28;
2692
+ s1 = peg$c32;
2558
2693
  peg$currPos++;
2559
2694
  } else {
2560
2695
  s1 = peg$FAILED;
2561
2696
 
2562
2697
  if (peg$silentFails === 0) {
2563
- peg$fail(peg$c29);
2698
+ peg$fail(peg$c33);
2564
2699
  }
2565
2700
  }
2566
2701
 
2567
2702
  if (s1 !== peg$FAILED) {
2568
- if (peg$c71.test(input.charAt(peg$currPos))) {
2569
- s2 = input.charAt(peg$currPos);
2570
- peg$currPos++;
2571
- } else {
2572
- s2 = peg$FAILED;
2573
-
2574
- if (peg$silentFails === 0) {
2575
- peg$fail(peg$c72);
2576
- }
2577
- }
2703
+ s2 = peg$parseescapedChar();
2578
2704
 
2579
2705
  if (s2 !== peg$FAILED) {
2580
2706
  s3 = peg$currPos;
2581
2707
  s4 = [];
2582
2708
 
2583
- if (input.substr(peg$currPos, 2) === peg$c68) {
2584
- s5 = peg$c68;
2709
+ if (input.substr(peg$currPos, 2) === peg$c75) {
2710
+ s5 = peg$c75;
2585
2711
  peg$currPos += 2;
2586
2712
  } else {
2587
2713
  s5 = peg$FAILED;
2588
2714
 
2589
2715
  if (peg$silentFails === 0) {
2590
- peg$fail(peg$c69);
2716
+ peg$fail(peg$c76);
2591
2717
  }
2592
2718
  }
2593
2719
 
2594
2720
  if (s5 === peg$FAILED) {
2595
- if (peg$c30.test(input.charAt(peg$currPos))) {
2721
+ if (peg$c34.test(input.charAt(peg$currPos))) {
2596
2722
  s5 = input.charAt(peg$currPos);
2597
2723
  peg$currPos++;
2598
2724
  } else {
2599
2725
  s5 = peg$FAILED;
2600
2726
 
2601
2727
  if (peg$silentFails === 0) {
2602
- peg$fail(peg$c31);
2728
+ peg$fail(peg$c35);
2603
2729
  }
2604
2730
  }
2605
2731
  }
@@ -2607,26 +2733,26 @@
2607
2733
  while (s5 !== peg$FAILED) {
2608
2734
  s4.push(s5);
2609
2735
 
2610
- if (input.substr(peg$currPos, 2) === peg$c68) {
2611
- s5 = peg$c68;
2736
+ if (input.substr(peg$currPos, 2) === peg$c75) {
2737
+ s5 = peg$c75;
2612
2738
  peg$currPos += 2;
2613
2739
  } else {
2614
2740
  s5 = peg$FAILED;
2615
2741
 
2616
2742
  if (peg$silentFails === 0) {
2617
- peg$fail(peg$c69);
2743
+ peg$fail(peg$c76);
2618
2744
  }
2619
2745
  }
2620
2746
 
2621
2747
  if (s5 === peg$FAILED) {
2622
- if (peg$c30.test(input.charAt(peg$currPos))) {
2748
+ if (peg$c34.test(input.charAt(peg$currPos))) {
2623
2749
  s5 = input.charAt(peg$currPos);
2624
2750
  peg$currPos++;
2625
2751
  } else {
2626
2752
  s5 = peg$FAILED;
2627
2753
 
2628
2754
  if (peg$silentFails === 0) {
2629
- peg$fail(peg$c31);
2755
+ peg$fail(peg$c35);
2630
2756
  }
2631
2757
  }
2632
2758
  }
@@ -2640,19 +2766,23 @@
2640
2766
 
2641
2767
  if (s3 !== peg$FAILED) {
2642
2768
  if (input.charCodeAt(peg$currPos) === 39) {
2643
- s4 = peg$c28;
2769
+ s4 = peg$c32;
2644
2770
  peg$currPos++;
2645
2771
  } else {
2646
2772
  s4 = peg$FAILED;
2647
2773
 
2648
2774
  if (peg$silentFails === 0) {
2649
- peg$fail(peg$c29);
2775
+ peg$fail(peg$c33);
2650
2776
  }
2651
2777
  }
2652
2778
 
2779
+ if (s4 === peg$FAILED) {
2780
+ s4 = null;
2781
+ }
2782
+
2653
2783
  if (s4 !== peg$FAILED) {
2654
2784
  peg$savedPos = s0;
2655
- s1 = peg$c73(s2, s3);
2785
+ s1 = peg$c78(s2, s3);
2656
2786
  s0 = s1;
2657
2787
  } else {
2658
2788
  peg$currPos = s0;
@@ -2675,18 +2805,101 @@
2675
2805
  }
2676
2806
 
2677
2807
  function peg$parseunquotedString() {
2678
- var s0, s1;
2808
+ var s0, s1, s2, s3;
2679
2809
  s0 = peg$currPos;
2810
+ s1 = peg$currPos;
2680
2811
 
2681
- if (peg$c74.test(input.charAt(peg$currPos))) {
2682
- s1 = input.charAt(peg$currPos);
2812
+ if (input.length > peg$currPos) {
2813
+ s2 = input.charAt(peg$currPos);
2683
2814
  peg$currPos++;
2684
2815
  } else {
2816
+ s2 = peg$FAILED;
2817
+
2818
+ if (peg$silentFails === 0) {
2819
+ peg$fail(peg$c14);
2820
+ }
2821
+ }
2822
+
2823
+ if (s2 !== peg$FAILED) {
2824
+ peg$savedPos = peg$currPos;
2825
+ s3 = peg$c79(s2);
2826
+
2827
+ if (s3) {
2828
+ s3 = undefined;
2829
+ } else {
2830
+ s3 = peg$FAILED;
2831
+ }
2832
+
2833
+ if (s3 !== peg$FAILED) {
2834
+ s2 = [s2, s3];
2835
+ s1 = s2;
2836
+ } else {
2837
+ peg$currPos = s1;
2838
+ s1 = peg$FAILED;
2839
+ }
2840
+ } else {
2841
+ peg$currPos = s1;
2685
2842
  s1 = peg$FAILED;
2843
+ }
2844
+
2845
+ if (s1 === peg$FAILED) {
2846
+ if (input.charCodeAt(peg$currPos) === 10) {
2847
+ s1 = peg$c80;
2848
+ peg$currPos++;
2849
+ } else {
2850
+ s1 = peg$FAILED;
2851
+
2852
+ if (peg$silentFails === 0) {
2853
+ peg$fail(peg$c81);
2854
+ }
2855
+ }
2856
+ }
2857
+
2858
+ if (s1 !== peg$FAILED) {
2859
+ s0 = input.substring(s0, peg$currPos);
2860
+ } else {
2861
+ s0 = s1;
2862
+ }
2863
+
2864
+ return s0;
2865
+ }
2866
+
2867
+ function peg$parseescapedChar() {
2868
+ var s0, s1, s2, s3;
2869
+ s0 = peg$currPos;
2870
+ s1 = peg$currPos;
2871
+
2872
+ if (input.length > peg$currPos) {
2873
+ s2 = input.charAt(peg$currPos);
2874
+ peg$currPos++;
2875
+ } else {
2876
+ s2 = peg$FAILED;
2686
2877
 
2687
2878
  if (peg$silentFails === 0) {
2688
- peg$fail(peg$c75);
2879
+ peg$fail(peg$c14);
2880
+ }
2881
+ }
2882
+
2883
+ if (s2 !== peg$FAILED) {
2884
+ peg$savedPos = peg$currPos;
2885
+ s3 = peg$c82(s2);
2886
+
2887
+ if (s3) {
2888
+ s3 = undefined;
2889
+ } else {
2890
+ s3 = peg$FAILED;
2689
2891
  }
2892
+
2893
+ if (s3 !== peg$FAILED) {
2894
+ s2 = [s2, s3];
2895
+ s1 = s2;
2896
+ } else {
2897
+ peg$currPos = s1;
2898
+ s1 = peg$FAILED;
2899
+ }
2900
+ } else {
2901
+ peg$currPos = s1;
2902
+ s1 = peg$FAILED;
2690
2903
  }
2691
2904
 
2692
2905
  if (s1 !== peg$FAILED) {
@@ -2720,7 +2933,7 @@
2720
2933
  s1 = peg$FAILED;
2721
2934
 
2722
2935
  if (peg$silentFails === 0) {
2723
- peg$fail(peg$c76);
2936
+ peg$fail(peg$c83);
2724
2937
  }
2725
2938
  }
2726
2939
 
@@ -2733,19 +2946,19 @@
2733
2946
  s0 = peg$currPos;
2734
2947
 
2735
2948
  if (input.charCodeAt(peg$currPos) === 48) {
2736
- s1 = peg$c78;
2949
+ s1 = peg$c85;
2737
2950
  peg$currPos++;
2738
2951
  } else {
2739
2952
  s1 = peg$FAILED;
2740
2953
 
2741
2954
  if (peg$silentFails === 0) {
2742
- peg$fail(peg$c79);
2955
+ peg$fail(peg$c86);
2743
2956
  }
2744
2957
  }
2745
2958
 
2746
2959
  if (s1 !== peg$FAILED) {
2747
2960
  peg$savedPos = s0;
2748
- s1 = peg$c80();
2961
+ s1 = peg$c87();
2749
2962
  }
2750
2963
 
2751
2964
  s0 = s1;
@@ -2754,42 +2967,42 @@
2754
2967
  s0 = peg$currPos;
2755
2968
  s1 = peg$currPos;
2756
2969
 
2757
- if (peg$c81.test(input.charAt(peg$currPos))) {
2970
+ if (peg$c88.test(input.charAt(peg$currPos))) {
2758
2971
  s2 = input.charAt(peg$currPos);
2759
2972
  peg$currPos++;
2760
2973
  } else {
2761
2974
  s2 = peg$FAILED;
2762
2975
 
2763
2976
  if (peg$silentFails === 0) {
2764
- peg$fail(peg$c82);
2977
+ peg$fail(peg$c89);
2765
2978
  }
2766
2979
  }
2767
2980
 
2768
2981
  if (s2 !== peg$FAILED) {
2769
2982
  s3 = [];
2770
2983
 
2771
- if (peg$c83.test(input.charAt(peg$currPos))) {
2984
+ if (peg$c90.test(input.charAt(peg$currPos))) {
2772
2985
  s4 = input.charAt(peg$currPos);
2773
2986
  peg$currPos++;
2774
2987
  } else {
2775
2988
  s4 = peg$FAILED;
2776
2989
 
2777
2990
  if (peg$silentFails === 0) {
2778
- peg$fail(peg$c84);
2991
+ peg$fail(peg$c91);
2779
2992
  }
2780
2993
  }
2781
2994
 
2782
2995
  while (s4 !== peg$FAILED) {
2783
2996
  s3.push(s4);
2784
2997
 
2785
- if (peg$c83.test(input.charAt(peg$currPos))) {
2998
+ if (peg$c90.test(input.charAt(peg$currPos))) {
2786
2999
  s4 = input.charAt(peg$currPos);
2787
3000
  peg$currPos++;
2788
3001
  } else {
2789
3002
  s4 = peg$FAILED;
2790
3003
 
2791
3004
  if (peg$silentFails === 0) {
2792
- peg$fail(peg$c84);
3005
+ peg$fail(peg$c91);
2793
3006
  }
2794
3007
  }
2795
3008
  }
@@ -2808,7 +3021,7 @@
2808
3021
 
2809
3022
  if (s1 !== peg$FAILED) {
2810
3023
  peg$savedPos = s0;
2811
- s1 = peg$c85(s1);
3024
+ s1 = peg$c92(s1);
2812
3025
  }
2813
3026
 
2814
3027
  s0 = s1;
@@ -2820,7 +3033,7 @@
2820
3033
  s1 = peg$FAILED;
2821
3034
 
2822
3035
  if (peg$silentFails === 0) {
2823
- peg$fail(peg$c77);
3036
+ peg$fail(peg$c84);
2824
3037
  }
2825
3038
  }
2826
3039
 
@@ -2858,7 +3071,7 @@
2858
3071
  s4 = peg$FAILED;
2859
3072
 
2860
3073
  if (peg$silentFails === 0) {
2861
- peg$fail(peg$c11);
3074
+ peg$fail(peg$c14);
2862
3075
  }
2863
3076
  }
2864
3077
 
@@ -2903,7 +3116,7 @@
2903
3116
  s4 = peg$FAILED;
2904
3117
 
2905
3118
  if (peg$silentFails === 0) {
2906
- peg$fail(peg$c11);
3119
+ peg$fail(peg$c14);
2907
3120
  }
2908
3121
  }
2909
3122
 
@@ -2935,13 +3148,23 @@
2935
3148
  s1 = peg$FAILED;
2936
3149
 
2937
3150
  if (peg$silentFails === 0) {
2938
- peg$fail(peg$c86);
3151
+ peg$fail(peg$c93);
2939
3152
  }
2940
3153
  }
2941
3154
 
2942
3155
  return s0;
2943
3156
  }
2944
3157
 
3158
+ var messageCtx = ['root'];
3159
+
3160
+ function isNestedMessageText() {
3161
+ return messageCtx.length > 1;
3162
+ }
3163
+
3164
+ function isInPluralOption() {
3165
+ return messageCtx[messageCtx.length - 1] === 'plural';
3166
+ }
3167
+
2945
3168
  function insertLocation() {
2946
3169
  return options && options.captureLocation ? {
2947
3170
  location: location()
@@ -3526,8 +3749,6 @@
3526
3749
 
3527
3750
  return r;
3528
3751
  };
3529
- var ESCAPE_HASH_REGEX = /\\#/g;
3530
- var PLURAL_HASH = /(^|[^\\])#/g;
3531
3752
 
3532
3753
  var FormatError =
3533
3754
  /** @class */
@@ -3571,17 +3792,11 @@
3571
3792
  originalMessage) {
3572
3793
  // Hot path for straight simple msg translations
3573
3794
  if (els.length === 1 && isLiteralElement(els[0])) {
3574
- var value = els[0].value;
3575
-
3576
- if (typeof currentPluralValue === 'number') {
3577
- value = value.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
3578
- }
3579
-
3580
3795
  return [{
3581
3796
  type: 0
3582
3797
  /* literal */
3583
3798
  ,
3584
- value: value.replace(ESCAPE_HASH_REGEX, '#')
3799
+ value: els[0].value
3585
3800
  }];
3586
3801
  }
3587
3802
 
@@ -3591,18 +3806,27 @@
3591
3806
  var el = els_1[_i]; // Exit early for string parts.
3592
3807
 
3593
3808
  if (isLiteralElement(el)) {
3594
- var value_1 = el.value;
3595
-
3596
- if (typeof currentPluralValue === 'number') {
3597
- value_1 = value_1.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
3598
- }
3599
-
3600
3809
  result.push({
3601
3810
  type: 0
3602
3811
  /* literal */
3603
3812
  ,
3604
- value: value_1.replace(ESCAPE_HASH_REGEX, '#')
3813
+ value: el.value
3605
3814
  });
3815
+ continue;
3816
+ } // TODO: should this part be literal type?
3817
+ // Replace `#` in plural rules with the actual numeric value.
3818
+
3819
+
3820
+ if (isPoundElement(el)) {
3821
+ if (typeof currentPluralValue === 'number') {
3822
+ result.push({
3823
+ type: 0
3824
+ /* literal */
3825
+ ,
3826
+ value: formatters.getNumberFormat(locales).format(currentPluralValue)
3827
+ });
3828
+ }
3829
+
3606
3830
  continue;
3607
3831
  }
3608
3832
 
@@ -4038,47 +4262,15 @@
4038
4262
  See the accompanying LICENSE file for terms.
4039
4263
  */
4040
4264
 
4041
- /**
4042
- * Copyright (c) 2013-present, Facebook, Inc.
4043
- *
4044
- * This source code is licensed under the MIT license found in the
4045
- * LICENSE file in the root directory of this source tree.
4046
- */
4047
-
4048
- var invariant = function invariant(condition, format, a, b, c, d, e, f) {
4049
- {
4050
- if (format === undefined) {
4051
- throw new Error('invariant requires an error message argument');
4052
- }
4265
+ function invariant(condition, message, Err) {
4266
+ if (Err === void 0) {
4267
+ Err = Error;
4053
4268
  }
4054
4269
 
4055
4270
  if (!condition) {
4056
- var error;
4057
-
4058
- if (format === undefined) {
4059
- error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
4060
- } else {
4061
- var args = [a, b, c, d, e, f];
4062
- var argIndex = 0;
4063
- error = new Error(format.replace(/%s/g, function () {
4064
- return args[argIndex++];
4065
- }));
4066
- error.name = 'Invariant Violation';
4067
- }
4068
-
4069
- error.framesToPop = 1; // we don't care about invariant's own frame
4070
-
4071
- throw error;
4271
+ throw new Err(message);
4072
4272
  }
4073
- };
4074
-
4075
- var invariant_1 = invariant;
4076
-
4077
- var invariant_ = /*#__PURE__*/Object.freeze({
4078
- __proto__: null,
4079
- 'default': invariant_1,
4080
- __moduleExports: invariant_1
4081
- });
4273
+ }
4082
4274
 
4083
4275
  /*
4084
4276
  HTML escaping is the same as React's
@@ -4090,7 +4282,6 @@
4090
4282
  This source code is licensed under the BSD-style license found in the LICENSE
4091
4283
  file in the root directory of React's source tree.
4092
4284
  */
4093
- var invariant$1 = invariant_1 || invariant_;
4094
4285
  var ESCAPED_CHARS = {
4095
4286
  38: '&',
4096
4287
  62: '>',
@@ -4117,7 +4308,7 @@
4117
4308
  }, {});
4118
4309
  }
4119
4310
  function invariantIntlContext(intl) {
4120
- invariant$1(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
4311
+ invariant(intl, '[React Intl] Could not find required `intl` object. ' + '<IntlProvider> needs to exist in the component ancestry.');
4121
4312
  }
4122
4313
  function createError(message, exception) {
4123
4314
  var eMsg = exception ? "\n".concat(exception.stack) : '';
@@ -4614,7 +4805,7 @@
4614
4805
  }
4615
4806
 
4616
4807
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
4617
- if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
4808
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
4618
4809
  }
4619
4810
  return t;
4620
4811
  };
@@ -4810,14 +5001,14 @@
4810
5001
  timeZone = _ref.timeZone;
4811
5002
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4812
5003
  var format = options.format;
4813
- var defaults = Object.assign({}, timeZone && {
5004
+ var defaults = Object.assign(Object.assign({}, timeZone && {
4814
5005
  timeZone: timeZone
4815
- }, format && getNamedFormat(formats, type, format, onError));
5006
+ }), format && getNamedFormat(formats, type, format, onError));
4816
5007
  var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
4817
5008
 
4818
5009
  if (type === 'time' && !filteredOptions.hour && !filteredOptions.minute && !filteredOptions.second) {
4819
5010
  // Add default formatting options if hour, minute, or second isn't defined.
4820
- filteredOptions = Object.assign({}, filteredOptions, {
5011
+ filteredOptions = Object.assign(Object.assign({}, filteredOptions), {
4821
5012
  hour: 'numeric',
4822
5013
  minute: 'numeric'
4823
5014
  });
@@ -4895,13 +5086,6 @@
4895
5086
  return 'other';
4896
5087
  }
4897
5088
 
4898
- /*
4899
- * Copyright 2015, Yahoo Inc.
4900
- * Copyrights licensed under the New BSD License.
4901
- * See the accompanying LICENSE file for terms.
4902
- */
4903
- var invariant$2 = invariant_1 || invariant_;
4904
-
4905
5089
  function setTimeZoneInOptions(opts, timeZone) {
4906
5090
  return Object.keys(opts).reduce(function (all, k) {
4907
5091
  all[k] = Object.assign({
@@ -4912,9 +5096,9 @@
4912
5096
  }
4913
5097
 
4914
5098
  function deepMergeOptions(opts1, opts2) {
4915
- var keys = Object.keys(Object.assign({}, opts1, opts2));
5099
+ var keys = Object.keys(Object.assign(Object.assign({}, opts1), opts2));
4916
5100
  return keys.reduce(function (all, k) {
4917
- all[k] = Object.assign({}, opts1[k] || {}, opts2[k] || {});
5101
+ all[k] = Object.assign(Object.assign({}, opts1[k] || {}), opts2[k] || {});
4918
5102
  return all;
4919
5103
  }, {});
4920
5104
  }
@@ -4925,12 +5109,15 @@
4925
5109
  }
4926
5110
 
4927
5111
  var mfFormats = IntlMessageFormat.formats;
4928
- return Object.assign({}, mfFormats, f1, {
5112
+ return Object.assign(Object.assign(Object.assign({}, mfFormats), f1), {
4929
5113
  date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)),
4930
5114
  time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone))
4931
5115
  });
4932
5116
  }
4933
5117
 
5118
+ var prepareIntlMessageFormatHtmlOutput = function prepareIntlMessageFormatHtmlOutput(chunks) {
5119
+ return React.createElement.apply(React, [React.Fragment, null].concat(_toConsumableArray(chunks)));
5120
+ };
4934
5121
  function formatMessage(_ref, state) {
4935
5122
  var locale = _ref.locale,
4936
5123
  formats = _ref.formats,
@@ -4946,13 +5133,8 @@
4946
5133
  var id = messageDescriptor.id,
4947
5134
  defaultMessage = messageDescriptor.defaultMessage; // `id` is a required field of a Message Descriptor.
4948
5135
 
4949
- invariant$2(id, '[React Intl] An `id` must be provided to format a message.');
4950
-
4951
- if (!id) {
4952
- throw new Error('[React Intl] An `id` must be provided to format a message.');
4953
- }
4954
-
4955
- var message = messages && messages[id];
5136
+ invariant(!!id, '[React Intl] An `id` must be provided to format a message.');
5137
+ var message = messages && messages[String(id)];
4956
5138
  formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
4957
5139
  defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
4958
5140
  var formattedMessageParts = [];
@@ -4989,17 +5171,17 @@
4989
5171
  onError(createError("Cannot format message: \"".concat(id, "\", ") + "using message ".concat(message || defaultMessage ? 'source' : 'id', " as fallback.")));
4990
5172
 
4991
5173
  if (typeof message === 'string') {
4992
- return message || defaultMessage || id;
5174
+ return message || defaultMessage || String(id);
4993
5175
  }
4994
5176
 
4995
- return defaultMessage || id;
5177
+ return defaultMessage || String(id);
4996
5178
  }
4997
5179
 
4998
5180
  if (formattedMessageParts.length === 1 && typeof formattedMessageParts[0] === 'string') {
4999
- return formattedMessageParts[0] || defaultMessage || id;
5181
+ return formattedMessageParts[0] || defaultMessage || String(id);
5000
5182
  }
5001
5183
 
5002
- return formattedMessageParts;
5184
+ return prepareIntlMessageFormatHtmlOutput(formattedMessageParts);
5003
5185
  }
5004
5186
  function formatHTMLMessage$1(config, state) {
5005
5187
  var messageDescriptor = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
@@ -5037,7 +5219,7 @@
5037
5219
  for (var i = 0; i < len; i++) {
5038
5220
  var key = aKeys[i];
5039
5221
 
5040
- if (objA[key] !== objB[key]) {
5222
+ if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {
5041
5223
  return false;
5042
5224
  }
5043
5225
  }
@@ -5132,7 +5314,7 @@
5132
5314
 
5133
5315
  function createIntl(config, cache) {
5134
5316
  var formatters = createFormatters(cache);
5135
- var resolvedConfig = Object.assign({}, DEFAULT_INTL_CONFIG, config);
5317
+ var resolvedConfig = Object.assign(Object.assign({}, DEFAULT_INTL_CONFIG), config);
5136
5318
 
5137
5319
  if (!resolvedConfig.locale || !areIntlLocalesSupported(resolvedConfig.locale)) {
5138
5320
  var locale = resolvedConfig.locale,
@@ -5151,7 +5333,7 @@
5151
5333
  resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
5152
5334
  }
5153
5335
 
5154
- return Object.assign({}, resolvedConfig, {
5336
+ return Object.assign(Object.assign({}, resolvedConfig), {
5155
5337
  formatters: formatters,
5156
5338
  formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat),
5157
5339
  formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat),
@@ -5218,7 +5400,6 @@
5218
5400
  IntlProvider$1.displayName = 'IntlProvider';
5219
5401
  IntlProvider$1.defaultProps = DEFAULT_INTL_CONFIG;
5220
5402
 
5221
- var invariant$3 = invariant_1 || invariant_;
5222
5403
  var MINUTE = 60;
5223
5404
  var HOUR = 60 * 60;
5224
5405
  var DAY = 60 * 60 * 24;
@@ -5281,10 +5462,6 @@
5281
5462
  return INCREMENTABLE_UNITS.includes(unit);
5282
5463
  }
5283
5464
 
5284
- function verifyProps(updateIntervalInSeconds, unit) {
5285
- invariant$3(!updateIntervalInSeconds || updateIntervalInSeconds && canIncrement(unit), 'Cannot schedule update with unit longer than hour');
5286
- }
5287
-
5288
5465
  var FormattedRelativeTime =
5289
5466
  /*#__PURE__*/
5290
5467
  function (_React$PureComponent) {
@@ -5303,7 +5480,7 @@
5303
5480
  prevValue: _this.props.value,
5304
5481
  currentValueInSeconds: canIncrement(_this.props.unit) ? valueToSeconds(_this.props.value, _this.props.unit) : 0
5305
5482
  };
5306
- verifyProps(props.updateIntervalInSeconds, props.unit);
5483
+ invariant(!props.updateIntervalInSeconds || !!(props.updateIntervalInSeconds && canIncrement(props.unit)), 'Cannot schedule update with unit longer than hour');
5307
5484
  return _this;
5308
5485
  }
5309
5486
 
@@ -5464,7 +5641,7 @@
5464
5641
  }
5465
5642
 
5466
5643
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
5467
- if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]];
5644
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
5468
5645
  }
5469
5646
  return t;
5470
5647
  };
@@ -5475,7 +5652,7 @@
5475
5652
  console.error('[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry. Using default message as fallback.');
5476
5653
  }
5477
5654
 
5478
- return formatMessage(Object.assign({}, DEFAULT_INTL_CONFIG, {
5655
+ return formatMessage(Object.assign(Object.assign({}, DEFAULT_INTL_CONFIG), {
5479
5656
  locale: 'en'
5480
5657
  }), createFormatters(), descriptor, values);
5481
5658
  };
@@ -5629,7 +5806,7 @@
5629
5806
  }(FormattedMessage);
5630
5807
 
5631
5808
  FormattedHTMLMessage.displayName = 'FormattedHTMLMessage';
5632
- FormattedHTMLMessage.defaultProps = Object.assign({}, FormattedMessage.defaultProps, {
5809
+ FormattedHTMLMessage.defaultProps = Object.assign(Object.assign({}, FormattedMessage.defaultProps), {
5633
5810
  tagName: 'span'
5634
5811
  });
5635
5812