@intlify/core-base 9.3.0-beta.1 → 9.3.0-beta.11

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * core-base v9.3.0-beta.1
2
+ * core-base v9.3.0-beta.11
3
3
  * (c) 2022 kazuya kawaguchi
4
4
  * Released under the MIT License.
5
5
  */
@@ -19,8 +19,11 @@ var IntlifyCoreBase = (function (exports) {
19
19
  perf.mark &&
20
20
  perf.measure &&
21
21
  perf.clearMarks &&
22
+ // @ts-ignore browser compat
22
23
  perf.clearMeasures) {
23
- mark = (tag) => perf.mark(tag);
24
+ mark = (tag) => {
25
+ perf.mark(tag);
26
+ };
24
27
  measure = (name, startTag, endTag) => {
25
28
  perf.measure(name, startTag, endTag);
26
29
  perf.clearMarks(startTag);
@@ -79,8 +82,8 @@ var IntlifyCoreBase = (function (exports) {
79
82
  const isFunction = (val) => typeof val === 'function';
80
83
  const isString = (val) => typeof val === 'string';
81
84
  const isBoolean = (val) => typeof val === 'boolean';
82
- const isObject = (val) => // eslint-disable-line
83
- val !== null && typeof val === 'object';
85
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
86
+ const isObject = (val) => val !== null && typeof val === 'object';
84
87
  const objectToString = Object.prototype.toString;
85
88
  const toTypeString = (value) => objectToString.call(value);
86
89
  const isPlainObject = (val) => toTypeString(val) === '[object Object]';
@@ -282,11 +285,11 @@ var IntlifyCoreBase = (function (exports) {
282
285
  const _initLoc = currentPosition();
283
286
  const _initOffset = currentOffset();
284
287
  const _context = {
285
- currentType: 14 /* EOF */,
288
+ currentType: 14 /* TokenTypes.EOF */,
286
289
  offset: _initOffset,
287
290
  startLoc: _initLoc,
288
291
  endLoc: _initLoc,
289
- lastType: 14 /* EOF */,
292
+ lastType: 14 /* TokenTypes.EOF */,
290
293
  lastOffset: _initOffset,
291
294
  lastStartLoc: _initLoc,
292
295
  lastEndLoc: _initLoc,
@@ -321,7 +324,7 @@ var IntlifyCoreBase = (function (exports) {
321
324
  }
322
325
  return token;
323
326
  }
324
- const getEndToken = (context) => getToken(context, 14 /* EOF */);
327
+ const getEndToken = (context) => getToken(context, 14 /* TokenTypes.EOF */);
325
328
  function eat(scnr, ch) {
326
329
  if (scnr.currentChar() === ch) {
327
330
  scnr.next();
@@ -364,7 +367,7 @@ var IntlifyCoreBase = (function (exports) {
364
367
  }
365
368
  function isNamedIdentifierStart(scnr, context) {
366
369
  const { currentType } = context;
367
- if (currentType !== 2 /* BraceLeft */) {
370
+ if (currentType !== 2 /* TokenTypes.BraceLeft */) {
368
371
  return false;
369
372
  }
370
373
  peekSpaces(scnr);
@@ -374,7 +377,7 @@ var IntlifyCoreBase = (function (exports) {
374
377
  }
375
378
  function isListIdentifierStart(scnr, context) {
376
379
  const { currentType } = context;
377
- if (currentType !== 2 /* BraceLeft */) {
380
+ if (currentType !== 2 /* TokenTypes.BraceLeft */) {
378
381
  return false;
379
382
  }
380
383
  peekSpaces(scnr);
@@ -385,7 +388,7 @@ var IntlifyCoreBase = (function (exports) {
385
388
  }
386
389
  function isLiteralStart(scnr, context) {
387
390
  const { currentType } = context;
388
- if (currentType !== 2 /* BraceLeft */) {
391
+ if (currentType !== 2 /* TokenTypes.BraceLeft */) {
389
392
  return false;
390
393
  }
391
394
  peekSpaces(scnr);
@@ -395,17 +398,17 @@ var IntlifyCoreBase = (function (exports) {
395
398
  }
396
399
  function isLinkedDotStart(scnr, context) {
397
400
  const { currentType } = context;
398
- if (currentType !== 8 /* LinkedAlias */) {
401
+ if (currentType !== 8 /* TokenTypes.LinkedAlias */) {
399
402
  return false;
400
403
  }
401
404
  peekSpaces(scnr);
402
- const ret = scnr.currentPeek() === "." /* LinkedDot */;
405
+ const ret = scnr.currentPeek() === "." /* TokenChars.LinkedDot */;
403
406
  scnr.resetPeek();
404
407
  return ret;
405
408
  }
406
409
  function isLinkedModifierStart(scnr, context) {
407
410
  const { currentType } = context;
408
- if (currentType !== 9 /* LinkedDot */) {
411
+ if (currentType !== 9 /* TokenTypes.LinkedDot */) {
409
412
  return false;
410
413
  }
411
414
  peekSpaces(scnr);
@@ -415,30 +418,30 @@ var IntlifyCoreBase = (function (exports) {
415
418
  }
416
419
  function isLinkedDelimiterStart(scnr, context) {
417
420
  const { currentType } = context;
418
- if (!(currentType === 8 /* LinkedAlias */ ||
419
- currentType === 12 /* LinkedModifier */)) {
421
+ if (!(currentType === 8 /* TokenTypes.LinkedAlias */ ||
422
+ currentType === 12 /* TokenTypes.LinkedModifier */)) {
420
423
  return false;
421
424
  }
422
425
  peekSpaces(scnr);
423
- const ret = scnr.currentPeek() === ":" /* LinkedDelimiter */;
426
+ const ret = scnr.currentPeek() === ":" /* TokenChars.LinkedDelimiter */;
424
427
  scnr.resetPeek();
425
428
  return ret;
426
429
  }
427
430
  function isLinkedReferStart(scnr, context) {
428
431
  const { currentType } = context;
429
- if (currentType !== 10 /* LinkedDelimiter */) {
432
+ if (currentType !== 10 /* TokenTypes.LinkedDelimiter */) {
430
433
  return false;
431
434
  }
432
435
  const fn = () => {
433
436
  const ch = scnr.currentPeek();
434
- if (ch === "{" /* BraceLeft */) {
437
+ if (ch === "{" /* TokenChars.BraceLeft */) {
435
438
  return isIdentifierStart(scnr.peek());
436
439
  }
437
- else if (ch === "@" /* LinkedAlias */ ||
438
- ch === "%" /* Modulo */ ||
439
- ch === "|" /* Pipe */ ||
440
- ch === ":" /* LinkedDelimiter */ ||
441
- ch === "." /* LinkedDot */ ||
440
+ else if (ch === "@" /* TokenChars.LinkedAlias */ ||
441
+ ch === "%" /* TokenChars.Modulo */ ||
442
+ ch === "|" /* TokenChars.Pipe */ ||
443
+ ch === ":" /* TokenChars.LinkedDelimiter */ ||
444
+ ch === "." /* TokenChars.LinkedDot */ ||
442
445
  ch === CHAR_SP ||
443
446
  !ch) {
444
447
  return false;
@@ -458,14 +461,14 @@ var IntlifyCoreBase = (function (exports) {
458
461
  }
459
462
  function isPluralStart(scnr) {
460
463
  peekSpaces(scnr);
461
- const ret = scnr.currentPeek() === "|" /* Pipe */;
464
+ const ret = scnr.currentPeek() === "|" /* TokenChars.Pipe */;
462
465
  scnr.resetPeek();
463
466
  return ret;
464
467
  }
465
468
  function detectModuloStart(scnr) {
466
469
  const spaces = peekSpaces(scnr);
467
- const ret = scnr.currentPeek() === "%" /* Modulo */ &&
468
- scnr.peek() === "{" /* BraceLeft */;
470
+ const ret = scnr.currentPeek() === "%" /* TokenChars.Modulo */ &&
471
+ scnr.peek() === "{" /* TokenChars.BraceLeft */;
469
472
  scnr.resetPeek();
470
473
  return {
471
474
  isModulo: ret,
@@ -475,18 +478,18 @@ var IntlifyCoreBase = (function (exports) {
475
478
  function isTextStart(scnr, reset = true) {
476
479
  const fn = (hasSpace = false, prev = '', detectModulo = false) => {
477
480
  const ch = scnr.currentPeek();
478
- if (ch === "{" /* BraceLeft */) {
479
- return prev === "%" /* Modulo */ ? false : hasSpace;
481
+ if (ch === "{" /* TokenChars.BraceLeft */) {
482
+ return prev === "%" /* TokenChars.Modulo */ ? false : hasSpace;
480
483
  }
481
- else if (ch === "@" /* LinkedAlias */ || !ch) {
482
- return prev === "%" /* Modulo */ ? true : hasSpace;
484
+ else if (ch === "@" /* TokenChars.LinkedAlias */ || !ch) {
485
+ return prev === "%" /* TokenChars.Modulo */ ? true : hasSpace;
483
486
  }
484
- else if (ch === "%" /* Modulo */) {
487
+ else if (ch === "%" /* TokenChars.Modulo */) {
485
488
  scnr.peek();
486
- return fn(hasSpace, "%" /* Modulo */, true);
489
+ return fn(hasSpace, "%" /* TokenChars.Modulo */, true);
487
490
  }
488
- else if (ch === "|" /* Pipe */) {
489
- return prev === "%" /* Modulo */ || detectModulo
491
+ else if (ch === "|" /* TokenChars.Pipe */) {
492
+ return prev === "%" /* TokenChars.Modulo */ || detectModulo
490
493
  ? true
491
494
  : !(prev === CHAR_SP || prev === CHAR_LF);
492
495
  }
@@ -556,24 +559,24 @@ var IntlifyCoreBase = (function (exports) {
556
559
  function readModulo(scnr) {
557
560
  skipSpaces(scnr);
558
561
  const ch = scnr.currentChar();
559
- if (ch !== "%" /* Modulo */) {
562
+ if (ch !== "%" /* TokenChars.Modulo */) {
560
563
  emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
561
564
  }
562
565
  scnr.next();
563
- return "%" /* Modulo */;
566
+ return "%" /* TokenChars.Modulo */;
564
567
  }
565
568
  function readText(scnr) {
566
569
  let buf = '';
567
570
  while (true) {
568
571
  const ch = scnr.currentChar();
569
- if (ch === "{" /* BraceLeft */ ||
570
- ch === "}" /* BraceRight */ ||
571
- ch === "@" /* LinkedAlias */ ||
572
- ch === "|" /* Pipe */ ||
572
+ if (ch === "{" /* TokenChars.BraceLeft */ ||
573
+ ch === "}" /* TokenChars.BraceRight */ ||
574
+ ch === "@" /* TokenChars.LinkedAlias */ ||
575
+ ch === "|" /* TokenChars.Pipe */ ||
573
576
  !ch) {
574
577
  break;
575
578
  }
576
- else if (ch === "%" /* Modulo */) {
579
+ else if (ch === "%" /* TokenChars.Modulo */) {
577
580
  if (isTextStart(scnr)) {
578
581
  buf += ch;
579
582
  scnr.next();
@@ -689,8 +692,8 @@ var IntlifyCoreBase = (function (exports) {
689
692
  skipSpaces(scnr);
690
693
  let ch = '';
691
694
  let identifiers = '';
692
- const closure = (ch) => ch !== "{" /* BraceLeft */ &&
693
- ch !== "}" /* BraceRight */ &&
695
+ const closure = (ch) => ch !== "{" /* TokenChars.BraceLeft */ &&
696
+ ch !== "}" /* TokenChars.BraceRight */ &&
694
697
  ch !== CHAR_SP &&
695
698
  ch !== CHAR_LF;
696
699
  while ((ch = takeChar(scnr, closure))) {
@@ -709,10 +712,10 @@ var IntlifyCoreBase = (function (exports) {
709
712
  function readLinkedRefer(scnr) {
710
713
  const fn = (detect = false, buf) => {
711
714
  const ch = scnr.currentChar();
712
- if (ch === "{" /* BraceLeft */ ||
713
- ch === "%" /* Modulo */ ||
714
- ch === "@" /* LinkedAlias */ ||
715
- ch === "|" /* Pipe */ ||
715
+ if (ch === "{" /* TokenChars.BraceLeft */ ||
716
+ ch === "%" /* TokenChars.Modulo */ ||
717
+ ch === "@" /* TokenChars.LinkedAlias */ ||
718
+ ch === "|" /* TokenChars.Pipe */ ||
716
719
  !ch) {
717
720
  return buf;
718
721
  }
@@ -734,7 +737,7 @@ var IntlifyCoreBase = (function (exports) {
734
737
  }
735
738
  function readPlural(scnr) {
736
739
  skipSpaces(scnr);
737
- const plural = eat(scnr, "|" /* Pipe */);
740
+ const plural = eat(scnr, "|" /* TokenChars.Pipe */);
738
741
  skipSpaces(scnr);
739
742
  return plural;
740
743
  }
@@ -743,29 +746,29 @@ var IntlifyCoreBase = (function (exports) {
743
746
  let token = null;
744
747
  const ch = scnr.currentChar();
745
748
  switch (ch) {
746
- case "{" /* BraceLeft */:
749
+ case "{" /* TokenChars.BraceLeft */:
747
750
  if (context.braceNest >= 1) {
748
751
  emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
749
752
  }
750
753
  scnr.next();
751
- token = getToken(context, 2 /* BraceLeft */, "{" /* BraceLeft */);
754
+ token = getToken(context, 2 /* TokenTypes.BraceLeft */, "{" /* TokenChars.BraceLeft */);
752
755
  skipSpaces(scnr);
753
756
  context.braceNest++;
754
757
  return token;
755
- case "}" /* BraceRight */:
758
+ case "}" /* TokenChars.BraceRight */:
756
759
  if (context.braceNest > 0 &&
757
- context.currentType === 2 /* BraceLeft */) {
760
+ context.currentType === 2 /* TokenTypes.BraceLeft */) {
758
761
  emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
759
762
  }
760
763
  scnr.next();
761
- token = getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);
764
+ token = getToken(context, 3 /* TokenTypes.BraceRight */, "}" /* TokenChars.BraceRight */);
762
765
  context.braceNest--;
763
766
  context.braceNest > 0 && skipSpaces(scnr);
764
767
  if (context.inLinked && context.braceNest === 0) {
765
768
  context.inLinked = false;
766
769
  }
767
770
  return token;
768
- case "@" /* LinkedAlias */:
771
+ case "@" /* TokenChars.LinkedAlias */:
769
772
  if (context.braceNest > 0) {
770
773
  emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
771
774
  }
@@ -780,38 +783,38 @@ var IntlifyCoreBase = (function (exports) {
780
783
  if (context.braceNest > 0) {
781
784
  emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
782
785
  }
783
- token = getToken(context, 1 /* Pipe */, readPlural(scnr));
786
+ token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));
784
787
  // reset
785
788
  context.braceNest = 0;
786
789
  context.inLinked = false;
787
790
  return token;
788
791
  }
789
792
  if (context.braceNest > 0 &&
790
- (context.currentType === 5 /* Named */ ||
791
- context.currentType === 6 /* List */ ||
792
- context.currentType === 7 /* Literal */)) {
793
+ (context.currentType === 5 /* TokenTypes.Named */ ||
794
+ context.currentType === 6 /* TokenTypes.List */ ||
795
+ context.currentType === 7 /* TokenTypes.Literal */)) {
793
796
  emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
794
797
  context.braceNest = 0;
795
798
  return readToken(scnr, context);
796
799
  }
797
800
  if ((validNamedIdentifier = isNamedIdentifierStart(scnr, context))) {
798
- token = getToken(context, 5 /* Named */, readNamedIdentifier(scnr));
801
+ token = getToken(context, 5 /* TokenTypes.Named */, readNamedIdentifier(scnr));
799
802
  skipSpaces(scnr);
800
803
  return token;
801
804
  }
802
805
  if ((validListIdentifier = isListIdentifierStart(scnr, context))) {
803
- token = getToken(context, 6 /* List */, readListIdentifier(scnr));
806
+ token = getToken(context, 6 /* TokenTypes.List */, readListIdentifier(scnr));
804
807
  skipSpaces(scnr);
805
808
  return token;
806
809
  }
807
810
  if ((validLiteral = isLiteralStart(scnr, context))) {
808
- token = getToken(context, 7 /* Literal */, readLiteral(scnr));
811
+ token = getToken(context, 7 /* TokenTypes.Literal */, readLiteral(scnr));
809
812
  skipSpaces(scnr);
810
813
  return token;
811
814
  }
812
815
  if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {
813
816
  // TODO: we should be re-designed invalid cases, when we will extend message syntax near the future ...
814
- token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
817
+ token = getToken(context, 13 /* TokenTypes.InvalidPlace */, readInvalidIdentifier(scnr));
815
818
  emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
816
819
  skipSpaces(scnr);
817
820
  return token;
@@ -825,30 +828,30 @@ var IntlifyCoreBase = (function (exports) {
825
828
  const { currentType } = context;
826
829
  let token = null;
827
830
  const ch = scnr.currentChar();
828
- if ((currentType === 8 /* LinkedAlias */ ||
829
- currentType === 9 /* LinkedDot */ ||
830
- currentType === 12 /* LinkedModifier */ ||
831
- currentType === 10 /* LinkedDelimiter */) &&
831
+ if ((currentType === 8 /* TokenTypes.LinkedAlias */ ||
832
+ currentType === 9 /* TokenTypes.LinkedDot */ ||
833
+ currentType === 12 /* TokenTypes.LinkedModifier */ ||
834
+ currentType === 10 /* TokenTypes.LinkedDelimiter */) &&
832
835
  (ch === CHAR_LF || ch === CHAR_SP)) {
833
836
  emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
834
837
  }
835
838
  switch (ch) {
836
- case "@" /* LinkedAlias */:
839
+ case "@" /* TokenChars.LinkedAlias */:
837
840
  scnr.next();
838
- token = getToken(context, 8 /* LinkedAlias */, "@" /* LinkedAlias */);
841
+ token = getToken(context, 8 /* TokenTypes.LinkedAlias */, "@" /* TokenChars.LinkedAlias */);
839
842
  context.inLinked = true;
840
843
  return token;
841
- case "." /* LinkedDot */:
844
+ case "." /* TokenChars.LinkedDot */:
842
845
  skipSpaces(scnr);
843
846
  scnr.next();
844
- return getToken(context, 9 /* LinkedDot */, "." /* LinkedDot */);
845
- case ":" /* LinkedDelimiter */:
847
+ return getToken(context, 9 /* TokenTypes.LinkedDot */, "." /* TokenChars.LinkedDot */);
848
+ case ":" /* TokenChars.LinkedDelimiter */:
846
849
  skipSpaces(scnr);
847
850
  scnr.next();
848
- return getToken(context, 10 /* LinkedDelimiter */, ":" /* LinkedDelimiter */);
851
+ return getToken(context, 10 /* TokenTypes.LinkedDelimiter */, ":" /* TokenChars.LinkedDelimiter */);
849
852
  default:
850
853
  if (isPluralStart(scnr)) {
851
- token = getToken(context, 1 /* Pipe */, readPlural(scnr));
854
+ token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));
852
855
  // reset
853
856
  context.braceNest = 0;
854
857
  context.inLinked = false;
@@ -861,19 +864,19 @@ var IntlifyCoreBase = (function (exports) {
861
864
  }
862
865
  if (isLinkedModifierStart(scnr, context)) {
863
866
  skipSpaces(scnr);
864
- return getToken(context, 12 /* LinkedModifier */, readLinkedModifier(scnr));
867
+ return getToken(context, 12 /* TokenTypes.LinkedModifier */, readLinkedModifier(scnr));
865
868
  }
866
869
  if (isLinkedReferStart(scnr, context)) {
867
870
  skipSpaces(scnr);
868
- if (ch === "{" /* BraceLeft */) {
871
+ if (ch === "{" /* TokenChars.BraceLeft */) {
869
872
  // scan the placeholder
870
873
  return readTokenInPlaceholder(scnr, context) || token;
871
874
  }
872
875
  else {
873
- return getToken(context, 11 /* LinkedKey */, readLinkedRefer(scnr));
876
+ return getToken(context, 11 /* TokenTypes.LinkedKey */, readLinkedRefer(scnr));
874
877
  }
875
878
  }
876
- if (currentType === 8 /* LinkedAlias */) {
879
+ if (currentType === 8 /* TokenTypes.LinkedAlias */) {
877
880
  emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
878
881
  }
879
882
  context.braceNest = 0;
@@ -883,7 +886,7 @@ var IntlifyCoreBase = (function (exports) {
883
886
  }
884
887
  // TODO: We need refactoring of token parsing ...
885
888
  function readToken(scnr, context) {
886
- let token = { type: 14 /* EOF */ };
889
+ let token = { type: 14 /* TokenTypes.EOF */ };
887
890
  if (context.braceNest > 0) {
888
891
  return readTokenInPlaceholder(scnr, context) || getEndToken(context);
889
892
  }
@@ -892,17 +895,17 @@ var IntlifyCoreBase = (function (exports) {
892
895
  }
893
896
  const ch = scnr.currentChar();
894
897
  switch (ch) {
895
- case "{" /* BraceLeft */:
898
+ case "{" /* TokenChars.BraceLeft */:
896
899
  return readTokenInPlaceholder(scnr, context) || getEndToken(context);
897
- case "}" /* BraceRight */:
900
+ case "}" /* TokenChars.BraceRight */:
898
901
  emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
899
902
  scnr.next();
900
- return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);
901
- case "@" /* LinkedAlias */:
903
+ return getToken(context, 3 /* TokenTypes.BraceRight */, "}" /* TokenChars.BraceRight */);
904
+ case "@" /* TokenChars.LinkedAlias */:
902
905
  return readTokenInLinked(scnr, context) || getEndToken(context);
903
906
  default:
904
907
  if (isPluralStart(scnr)) {
905
- token = getToken(context, 1 /* Pipe */, readPlural(scnr));
908
+ token = getToken(context, 1 /* TokenTypes.Pipe */, readPlural(scnr));
906
909
  // reset
907
910
  context.braceNest = 0;
908
911
  context.inLinked = false;
@@ -911,11 +914,11 @@ var IntlifyCoreBase = (function (exports) {
911
914
  const { isModulo, hasSpace } = detectModuloStart(scnr);
912
915
  if (isModulo) {
913
916
  return hasSpace
914
- ? getToken(context, 0 /* Text */, readText(scnr))
915
- : getToken(context, 4 /* Modulo */, readModulo(scnr));
917
+ ? getToken(context, 0 /* TokenTypes.Text */, readText(scnr))
918
+ : getToken(context, 4 /* TokenTypes.Modulo */, readModulo(scnr));
916
919
  }
917
920
  if (isTextStart(scnr)) {
918
- return getToken(context, 0 /* Text */, readText(scnr));
921
+ return getToken(context, 0 /* TokenTypes.Text */, readText(scnr));
919
922
  }
920
923
  break;
921
924
  }
@@ -930,7 +933,7 @@ var IntlifyCoreBase = (function (exports) {
930
933
  _context.offset = currentOffset();
931
934
  _context.startLoc = currentPosition();
932
935
  if (_scnr.currentChar() === EOF) {
933
- return getToken(_context, 14 /* EOF */);
936
+ return getToken(_context, 14 /* TokenTypes.EOF */);
934
937
  }
935
938
  return readToken(_scnr, _context);
936
939
  }
@@ -1000,7 +1003,7 @@ var IntlifyCoreBase = (function (exports) {
1000
1003
  }
1001
1004
  function parseText(tokenizer, value) {
1002
1005
  const context = tokenizer.context();
1003
- const node = startNode(3 /* Text */, context.offset, context.startLoc);
1006
+ const node = startNode(3 /* NodeTypes.Text */, context.offset, context.startLoc);
1004
1007
  node.value = value;
1005
1008
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
1006
1009
  return node;
@@ -1008,7 +1011,7 @@ var IntlifyCoreBase = (function (exports) {
1008
1011
  function parseList(tokenizer, index) {
1009
1012
  const context = tokenizer.context();
1010
1013
  const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc
1011
- const node = startNode(5 /* List */, offset, loc);
1014
+ const node = startNode(5 /* NodeTypes.List */, offset, loc);
1012
1015
  node.index = parseInt(index, 10);
1013
1016
  tokenizer.nextToken(); // skip brach right
1014
1017
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
@@ -1017,7 +1020,7 @@ var IntlifyCoreBase = (function (exports) {
1017
1020
  function parseNamed(tokenizer, key) {
1018
1021
  const context = tokenizer.context();
1019
1022
  const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc
1020
- const node = startNode(4 /* Named */, offset, loc);
1023
+ const node = startNode(4 /* NodeTypes.Named */, offset, loc);
1021
1024
  node.key = key;
1022
1025
  tokenizer.nextToken(); // skip brach right
1023
1026
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
@@ -1026,7 +1029,7 @@ var IntlifyCoreBase = (function (exports) {
1026
1029
  function parseLiteral(tokenizer, value) {
1027
1030
  const context = tokenizer.context();
1028
1031
  const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc
1029
- const node = startNode(9 /* Literal */, offset, loc);
1032
+ const node = startNode(9 /* NodeTypes.Literal */, offset, loc);
1030
1033
  node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence);
1031
1034
  tokenizer.nextToken(); // skip brach right
1032
1035
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
@@ -1036,8 +1039,8 @@ var IntlifyCoreBase = (function (exports) {
1036
1039
  const token = tokenizer.nextToken();
1037
1040
  const context = tokenizer.context();
1038
1041
  const { lastOffset: offset, lastStartLoc: loc } = context; // get linked dot loc
1039
- const node = startNode(8 /* LinkedModifier */, offset, loc);
1040
- if (token.type !== 12 /* LinkedModifier */) {
1042
+ const node = startNode(8 /* NodeTypes.LinkedModifier */, offset, loc);
1043
+ if (token.type !== 12 /* TokenTypes.LinkedModifier */) {
1041
1044
  // empty modifier
1042
1045
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
1043
1046
  node.value = '';
@@ -1059,49 +1062,49 @@ var IntlifyCoreBase = (function (exports) {
1059
1062
  }
1060
1063
  function parseLinkedKey(tokenizer, value) {
1061
1064
  const context = tokenizer.context();
1062
- const node = startNode(7 /* LinkedKey */, context.offset, context.startLoc);
1065
+ const node = startNode(7 /* NodeTypes.LinkedKey */, context.offset, context.startLoc);
1063
1066
  node.value = value;
1064
1067
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
1065
1068
  return node;
1066
1069
  }
1067
1070
  function parseLinked(tokenizer) {
1068
1071
  const context = tokenizer.context();
1069
- const linkedNode = startNode(6 /* Linked */, context.offset, context.startLoc);
1072
+ const linkedNode = startNode(6 /* NodeTypes.Linked */, context.offset, context.startLoc);
1070
1073
  let token = tokenizer.nextToken();
1071
- if (token.type === 9 /* LinkedDot */) {
1074
+ if (token.type === 9 /* TokenTypes.LinkedDot */) {
1072
1075
  const parsed = parseLinkedModifier(tokenizer);
1073
1076
  linkedNode.modifier = parsed.node;
1074
1077
  token = parsed.nextConsumeToken || tokenizer.nextToken();
1075
1078
  }
1076
1079
  // asset check token
1077
- if (token.type !== 10 /* LinkedDelimiter */) {
1080
+ if (token.type !== 10 /* TokenTypes.LinkedDelimiter */) {
1078
1081
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1079
1082
  }
1080
1083
  token = tokenizer.nextToken();
1081
1084
  // skip brace left
1082
- if (token.type === 2 /* BraceLeft */) {
1085
+ if (token.type === 2 /* TokenTypes.BraceLeft */) {
1083
1086
  token = tokenizer.nextToken();
1084
1087
  }
1085
1088
  switch (token.type) {
1086
- case 11 /* LinkedKey */:
1089
+ case 11 /* TokenTypes.LinkedKey */:
1087
1090
  if (token.value == null) {
1088
1091
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1089
1092
  }
1090
1093
  linkedNode.key = parseLinkedKey(tokenizer, token.value || '');
1091
1094
  break;
1092
- case 5 /* Named */:
1095
+ case 5 /* TokenTypes.Named */:
1093
1096
  if (token.value == null) {
1094
1097
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1095
1098
  }
1096
1099
  linkedNode.key = parseNamed(tokenizer, token.value || '');
1097
1100
  break;
1098
- case 6 /* List */:
1101
+ case 6 /* TokenTypes.List */:
1099
1102
  if (token.value == null) {
1100
1103
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1101
1104
  }
1102
1105
  linkedNode.key = parseList(tokenizer, token.value || '');
1103
1106
  break;
1104
- case 7 /* Literal */:
1107
+ case 7 /* TokenTypes.Literal */:
1105
1108
  if (token.value == null) {
1106
1109
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1107
1110
  }
@@ -1111,7 +1114,7 @@ var IntlifyCoreBase = (function (exports) {
1111
1114
  // empty key
1112
1115
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
1113
1116
  const nextContext = tokenizer.context();
1114
- const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);
1117
+ const emptyLinkedKeyNode = startNode(7 /* NodeTypes.LinkedKey */, nextContext.offset, nextContext.startLoc);
1115
1118
  emptyLinkedKeyNode.value = '';
1116
1119
  endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc);
1117
1120
  linkedNode.key = emptyLinkedKeyNode;
@@ -1128,56 +1131,56 @@ var IntlifyCoreBase = (function (exports) {
1128
1131
  }
1129
1132
  function parseMessage(tokenizer) {
1130
1133
  const context = tokenizer.context();
1131
- const startOffset = context.currentType === 1 /* Pipe */
1134
+ const startOffset = context.currentType === 1 /* TokenTypes.Pipe */
1132
1135
  ? tokenizer.currentOffset()
1133
1136
  : context.offset;
1134
- const startLoc = context.currentType === 1 /* Pipe */
1137
+ const startLoc = context.currentType === 1 /* TokenTypes.Pipe */
1135
1138
  ? context.endLoc
1136
1139
  : context.startLoc;
1137
- const node = startNode(2 /* Message */, startOffset, startLoc);
1140
+ const node = startNode(2 /* NodeTypes.Message */, startOffset, startLoc);
1138
1141
  node.items = [];
1139
1142
  let nextToken = null;
1140
1143
  do {
1141
1144
  const token = nextToken || tokenizer.nextToken();
1142
1145
  nextToken = null;
1143
1146
  switch (token.type) {
1144
- case 0 /* Text */:
1147
+ case 0 /* TokenTypes.Text */:
1145
1148
  if (token.value == null) {
1146
1149
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1147
1150
  }
1148
1151
  node.items.push(parseText(tokenizer, token.value || ''));
1149
1152
  break;
1150
- case 6 /* List */:
1153
+ case 6 /* TokenTypes.List */:
1151
1154
  if (token.value == null) {
1152
1155
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1153
1156
  }
1154
1157
  node.items.push(parseList(tokenizer, token.value || ''));
1155
1158
  break;
1156
- case 5 /* Named */:
1159
+ case 5 /* TokenTypes.Named */:
1157
1160
  if (token.value == null) {
1158
1161
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1159
1162
  }
1160
1163
  node.items.push(parseNamed(tokenizer, token.value || ''));
1161
1164
  break;
1162
- case 7 /* Literal */:
1165
+ case 7 /* TokenTypes.Literal */:
1163
1166
  if (token.value == null) {
1164
1167
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
1165
1168
  }
1166
1169
  node.items.push(parseLiteral(tokenizer, token.value || ''));
1167
1170
  break;
1168
- case 8 /* LinkedAlias */:
1171
+ case 8 /* TokenTypes.LinkedAlias */:
1169
1172
  const parsed = parseLinked(tokenizer);
1170
1173
  node.items.push(parsed.node);
1171
1174
  nextToken = parsed.nextConsumeToken || null;
1172
1175
  break;
1173
1176
  }
1174
- } while (context.currentType !== 14 /* EOF */ &&
1175
- context.currentType !== 1 /* Pipe */);
1177
+ } while (context.currentType !== 14 /* TokenTypes.EOF */ &&
1178
+ context.currentType !== 1 /* TokenTypes.Pipe */);
1176
1179
  // adjust message node loc
1177
- const endOffset = context.currentType === 1 /* Pipe */
1180
+ const endOffset = context.currentType === 1 /* TokenTypes.Pipe */
1178
1181
  ? context.lastOffset
1179
1182
  : tokenizer.currentOffset();
1180
- const endLoc = context.currentType === 1 /* Pipe */
1183
+ const endLoc = context.currentType === 1 /* TokenTypes.Pipe */
1181
1184
  ? context.lastEndLoc
1182
1185
  : tokenizer.currentPosition();
1183
1186
  endNode(node, endOffset, endLoc);
@@ -1186,7 +1189,7 @@ var IntlifyCoreBase = (function (exports) {
1186
1189
  function parsePlural(tokenizer, offset, loc, msgNode) {
1187
1190
  const context = tokenizer.context();
1188
1191
  let hasEmptyMessage = msgNode.items.length === 0;
1189
- const node = startNode(1 /* Plural */, offset, loc);
1192
+ const node = startNode(1 /* NodeTypes.Plural */, offset, loc);
1190
1193
  node.cases = [];
1191
1194
  node.cases.push(msgNode);
1192
1195
  do {
@@ -1195,7 +1198,7 @@ var IntlifyCoreBase = (function (exports) {
1195
1198
  hasEmptyMessage = msg.items.length === 0;
1196
1199
  }
1197
1200
  node.cases.push(msg);
1198
- } while (context.currentType !== 14 /* EOF */);
1201
+ } while (context.currentType !== 14 /* TokenTypes.EOF */);
1199
1202
  if (hasEmptyMessage) {
1200
1203
  emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
1201
1204
  }
@@ -1206,7 +1209,7 @@ var IntlifyCoreBase = (function (exports) {
1206
1209
  const context = tokenizer.context();
1207
1210
  const { offset, startLoc } = context;
1208
1211
  const msgNode = parseMessage(tokenizer);
1209
- if (context.currentType === 14 /* EOF */) {
1212
+ if (context.currentType === 14 /* TokenTypes.EOF */) {
1210
1213
  return msgNode;
1211
1214
  }
1212
1215
  else {
@@ -1216,13 +1219,13 @@ var IntlifyCoreBase = (function (exports) {
1216
1219
  function parse(source) {
1217
1220
  const tokenizer = createTokenizer(source, assign({}, options));
1218
1221
  const context = tokenizer.context();
1219
- const node = startNode(0 /* Resource */, context.offset, context.startLoc);
1222
+ const node = startNode(0 /* NodeTypes.Resource */, context.offset, context.startLoc);
1220
1223
  if (location && node.loc) {
1221
1224
  node.loc.source = source;
1222
1225
  }
1223
1226
  node.body = parseResource(tokenizer);
1224
1227
  // assert whether achieved to EOF
1225
- if (context.currentType !== 14 /* EOF */) {
1228
+ if (context.currentType !== 14 /* TokenTypes.EOF */) {
1226
1229
  emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
1227
1230
  }
1228
1231
  endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
@@ -1231,7 +1234,7 @@ var IntlifyCoreBase = (function (exports) {
1231
1234
  return { parse };
1232
1235
  }
1233
1236
  function getTokenCaption(token) {
1234
- if (token.type === 14 /* EOF */) {
1237
+ if (token.type === 14 /* TokenTypes.EOF */) {
1235
1238
  return 'EOF';
1236
1239
  }
1237
1240
  const name = (token.value || '').replace(/\r?\n/gu, '\\n');
@@ -1259,26 +1262,26 @@ var IntlifyCoreBase = (function (exports) {
1259
1262
  function traverseNode(node, transformer) {
1260
1263
  // TODO: if we need pre-hook of transform, should be implemented to here
1261
1264
  switch (node.type) {
1262
- case 1 /* Plural */:
1265
+ case 1 /* NodeTypes.Plural */:
1263
1266
  traverseNodes(node.cases, transformer);
1264
- transformer.helper("plural" /* PLURAL */);
1267
+ transformer.helper("plural" /* HelperNameMap.PLURAL */);
1265
1268
  break;
1266
- case 2 /* Message */:
1269
+ case 2 /* NodeTypes.Message */:
1267
1270
  traverseNodes(node.items, transformer);
1268
1271
  break;
1269
- case 6 /* Linked */:
1272
+ case 6 /* NodeTypes.Linked */:
1270
1273
  const linked = node;
1271
1274
  traverseNode(linked.key, transformer);
1272
- transformer.helper("linked" /* LINKED */);
1273
- transformer.helper("type" /* TYPE */);
1275
+ transformer.helper("linked" /* HelperNameMap.LINKED */);
1276
+ transformer.helper("type" /* HelperNameMap.TYPE */);
1274
1277
  break;
1275
- case 5 /* List */:
1276
- transformer.helper("interpolate" /* INTERPOLATE */);
1277
- transformer.helper("list" /* LIST */);
1278
+ case 5 /* NodeTypes.List */:
1279
+ transformer.helper("interpolate" /* HelperNameMap.INTERPOLATE */);
1280
+ transformer.helper("list" /* HelperNameMap.LIST */);
1278
1281
  break;
1279
- case 4 /* Named */:
1280
- transformer.helper("interpolate" /* INTERPOLATE */);
1281
- transformer.helper("named" /* NAMED */);
1282
+ case 4 /* NodeTypes.Named */:
1283
+ transformer.helper("interpolate" /* HelperNameMap.INTERPOLATE */);
1284
+ transformer.helper("named" /* HelperNameMap.NAMED */);
1282
1285
  break;
1283
1286
  }
1284
1287
  // TODO: if we need post-hook of transform, should be implemented to here
@@ -1287,7 +1290,7 @@ var IntlifyCoreBase = (function (exports) {
1287
1290
  function transform(ast, options = {} // eslint-disable-line
1288
1291
  ) {
1289
1292
  const transformer = createTransformer(ast);
1290
- transformer.helper("normalize" /* NORMALIZE */);
1293
+ transformer.helper("normalize" /* HelperNameMap.NORMALIZE */);
1291
1294
  // traverse
1292
1295
  ast.body && traverseNode(ast.body, transformer);
1293
1296
  // set meta information
@@ -1342,7 +1345,7 @@ var IntlifyCoreBase = (function (exports) {
1342
1345
  }
1343
1346
  function generateLinkedNode(generator, node) {
1344
1347
  const { helper } = generator;
1345
- generator.push(`${helper("linked" /* LINKED */)}(`);
1348
+ generator.push(`${helper("linked" /* HelperNameMap.LINKED */)}(`);
1346
1349
  generateNode(generator, node.key);
1347
1350
  if (node.modifier) {
1348
1351
  generator.push(`, `);
@@ -1356,7 +1359,7 @@ var IntlifyCoreBase = (function (exports) {
1356
1359
  }
1357
1360
  function generateMessageNode(generator, node) {
1358
1361
  const { helper, needIndent } = generator;
1359
- generator.push(`${helper("normalize" /* NORMALIZE */)}([`);
1362
+ generator.push(`${helper("normalize" /* HelperNameMap.NORMALIZE */)}([`);
1360
1363
  generator.indent(needIndent());
1361
1364
  const length = node.items.length;
1362
1365
  for (let i = 0; i < length; i++) {
@@ -1372,7 +1375,7 @@ var IntlifyCoreBase = (function (exports) {
1372
1375
  function generatePluralNode(generator, node) {
1373
1376
  const { helper, needIndent } = generator;
1374
1377
  if (node.cases.length > 1) {
1375
- generator.push(`${helper("plural" /* PLURAL */)}([`);
1378
+ generator.push(`${helper("plural" /* HelperNameMap.PLURAL */)}([`);
1376
1379
  generator.indent(needIndent());
1377
1380
  const length = node.cases.length;
1378
1381
  for (let i = 0; i < length; i++) {
@@ -1397,34 +1400,34 @@ var IntlifyCoreBase = (function (exports) {
1397
1400
  function generateNode(generator, node) {
1398
1401
  const { helper } = generator;
1399
1402
  switch (node.type) {
1400
- case 0 /* Resource */:
1403
+ case 0 /* NodeTypes.Resource */:
1401
1404
  generateResource(generator, node);
1402
1405
  break;
1403
- case 1 /* Plural */:
1406
+ case 1 /* NodeTypes.Plural */:
1404
1407
  generatePluralNode(generator, node);
1405
1408
  break;
1406
- case 2 /* Message */:
1409
+ case 2 /* NodeTypes.Message */:
1407
1410
  generateMessageNode(generator, node);
1408
1411
  break;
1409
- case 6 /* Linked */:
1412
+ case 6 /* NodeTypes.Linked */:
1410
1413
  generateLinkedNode(generator, node);
1411
1414
  break;
1412
- case 8 /* LinkedModifier */:
1415
+ case 8 /* NodeTypes.LinkedModifier */:
1413
1416
  generator.push(JSON.stringify(node.value), node);
1414
1417
  break;
1415
- case 7 /* LinkedKey */:
1418
+ case 7 /* NodeTypes.LinkedKey */:
1416
1419
  generator.push(JSON.stringify(node.value), node);
1417
1420
  break;
1418
- case 5 /* List */:
1419
- generator.push(`${helper("interpolate" /* INTERPOLATE */)}(${helper("list" /* LIST */)}(${node.index}))`, node);
1421
+ case 5 /* NodeTypes.List */:
1422
+ generator.push(`${helper("interpolate" /* HelperNameMap.INTERPOLATE */)}(${helper("list" /* HelperNameMap.LIST */)}(${node.index}))`, node);
1420
1423
  break;
1421
- case 4 /* Named */:
1422
- generator.push(`${helper("interpolate" /* INTERPOLATE */)}(${helper("named" /* NAMED */)}(${JSON.stringify(node.key)}))`, node);
1424
+ case 4 /* NodeTypes.Named */:
1425
+ generator.push(`${helper("interpolate" /* HelperNameMap.INTERPOLATE */)}(${helper("named" /* HelperNameMap.NAMED */)}(${JSON.stringify(node.key)}))`, node);
1423
1426
  break;
1424
- case 9 /* Literal */:
1427
+ case 9 /* NodeTypes.Literal */:
1425
1428
  generator.push(JSON.stringify(node.value), node);
1426
1429
  break;
1427
- case 3 /* Text */:
1430
+ case 3 /* NodeTypes.Text */:
1428
1431
  generator.push(JSON.stringify(node.value), node);
1429
1432
  break;
1430
1433
  default:
@@ -1486,51 +1489,51 @@ var IntlifyCoreBase = (function (exports) {
1486
1489
  }
1487
1490
 
1488
1491
  const pathStateMachine = [];
1489
- pathStateMachine[0 /* BEFORE_PATH */] = {
1490
- ["w" /* WORKSPACE */]: [0 /* BEFORE_PATH */],
1491
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
1492
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
1493
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
1492
+ pathStateMachine[0 /* States.BEFORE_PATH */] = {
1493
+ ["w" /* PathCharTypes.WORKSPACE */]: [0 /* States.BEFORE_PATH */],
1494
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
1495
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
1496
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
1494
1497
  };
1495
- pathStateMachine[1 /* IN_PATH */] = {
1496
- ["w" /* WORKSPACE */]: [1 /* IN_PATH */],
1497
- ["." /* DOT */]: [2 /* BEFORE_IDENT */],
1498
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],
1499
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]
1498
+ pathStateMachine[1 /* States.IN_PATH */] = {
1499
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */],
1500
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */],
1501
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */],
1502
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */]
1500
1503
  };
1501
- pathStateMachine[2 /* BEFORE_IDENT */] = {
1502
- ["w" /* WORKSPACE */]: [2 /* BEFORE_IDENT */],
1503
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
1504
- ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */]
1504
+ pathStateMachine[2 /* States.BEFORE_IDENT */] = {
1505
+ ["w" /* PathCharTypes.WORKSPACE */]: [2 /* States.BEFORE_IDENT */],
1506
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
1507
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */]
1505
1508
  };
1506
- pathStateMachine[3 /* IN_IDENT */] = {
1507
- ["i" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],
1508
- ["0" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */],
1509
- ["w" /* WORKSPACE */]: [1 /* IN_PATH */, 1 /* PUSH */],
1510
- ["." /* DOT */]: [2 /* BEFORE_IDENT */, 1 /* PUSH */],
1511
- ["[" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */, 1 /* PUSH */],
1512
- ["o" /* END_OF_FAIL */]: [7 /* AFTER_PATH */, 1 /* PUSH */]
1509
+ pathStateMachine[3 /* States.IN_IDENT */] = {
1510
+ ["i" /* PathCharTypes.IDENT */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
1511
+ ["0" /* PathCharTypes.ZERO */]: [3 /* States.IN_IDENT */, 0 /* Actions.APPEND */],
1512
+ ["w" /* PathCharTypes.WORKSPACE */]: [1 /* States.IN_PATH */, 1 /* Actions.PUSH */],
1513
+ ["." /* PathCharTypes.DOT */]: [2 /* States.BEFORE_IDENT */, 1 /* Actions.PUSH */],
1514
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [4 /* States.IN_SUB_PATH */, 1 /* Actions.PUSH */],
1515
+ ["o" /* PathCharTypes.END_OF_FAIL */]: [7 /* States.AFTER_PATH */, 1 /* Actions.PUSH */]
1513
1516
  };
1514
- pathStateMachine[4 /* IN_SUB_PATH */] = {
1515
- ["'" /* SINGLE_QUOTE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */],
1516
- ["\"" /* DOUBLE_QUOTE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */],
1517
- ["[" /* LEFT_BRACKET */]: [
1518
- 4 /* IN_SUB_PATH */,
1519
- 2 /* INC_SUB_PATH_DEPTH */
1517
+ pathStateMachine[4 /* States.IN_SUB_PATH */] = {
1518
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */],
1519
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */],
1520
+ ["[" /* PathCharTypes.LEFT_BRACKET */]: [
1521
+ 4 /* States.IN_SUB_PATH */,
1522
+ 2 /* Actions.INC_SUB_PATH_DEPTH */
1520
1523
  ],
1521
- ["]" /* RIGHT_BRACKET */]: [1 /* IN_PATH */, 3 /* PUSH_SUB_PATH */],
1522
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
1523
- ["l" /* ELSE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */]
1524
+ ["]" /* PathCharTypes.RIGHT_BRACKET */]: [1 /* States.IN_PATH */, 3 /* Actions.PUSH_SUB_PATH */],
1525
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
1526
+ ["l" /* PathCharTypes.ELSE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */]
1524
1527
  };
1525
- pathStateMachine[5 /* IN_SINGLE_QUOTE */] = {
1526
- ["'" /* SINGLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
1527
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
1528
- ["l" /* ELSE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */]
1528
+ pathStateMachine[5 /* States.IN_SINGLE_QUOTE */] = {
1529
+ ["'" /* PathCharTypes.SINGLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
1530
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
1531
+ ["l" /* PathCharTypes.ELSE */]: [5 /* States.IN_SINGLE_QUOTE */, 0 /* Actions.APPEND */]
1529
1532
  };
1530
- pathStateMachine[6 /* IN_DOUBLE_QUOTE */] = {
1531
- ["\"" /* DOUBLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],
1532
- ["o" /* END_OF_FAIL */]: 8 /* ERROR */,
1533
- ["l" /* ELSE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */]
1533
+ pathStateMachine[6 /* States.IN_DOUBLE_QUOTE */] = {
1534
+ ["\"" /* PathCharTypes.DOUBLE_QUOTE */]: [4 /* States.IN_SUB_PATH */, 0 /* Actions.APPEND */],
1535
+ ["o" /* PathCharTypes.END_OF_FAIL */]: 8 /* States.ERROR */,
1536
+ ["l" /* PathCharTypes.ELSE */]: [6 /* States.IN_DOUBLE_QUOTE */, 0 /* Actions.APPEND */]
1534
1537
  };
1535
1538
  /**
1536
1539
  * Check if an expression is a literal value.
@@ -1552,7 +1555,7 @@ var IntlifyCoreBase = (function (exports) {
1552
1555
  */
1553
1556
  function getPathCharType(ch) {
1554
1557
  if (ch === undefined || ch === null) {
1555
- return "o" /* END_OF_FAIL */;
1558
+ return "o" /* PathCharTypes.END_OF_FAIL */;
1556
1559
  }
1557
1560
  const code = ch.charCodeAt(0);
1558
1561
  switch (code) {
@@ -1565,7 +1568,7 @@ var IntlifyCoreBase = (function (exports) {
1565
1568
  case 0x5f: // _
1566
1569
  case 0x24: // $
1567
1570
  case 0x2d: // -
1568
- return "i" /* IDENT */;
1571
+ return "i" /* PathCharTypes.IDENT */;
1569
1572
  case 0x09: // Tab (HT)
1570
1573
  case 0x0a: // Newline (LF)
1571
1574
  case 0x0d: // Return (CR)
@@ -1573,9 +1576,9 @@ var IntlifyCoreBase = (function (exports) {
1573
1576
  case 0xfeff: // Byte Order Mark (BOM)
1574
1577
  case 0x2028: // Line Separator (LS)
1575
1578
  case 0x2029: // Paragraph Separator (PS)
1576
- return "w" /* WORKSPACE */;
1579
+ return "w" /* PathCharTypes.WORKSPACE */;
1577
1580
  }
1578
- return "i" /* IDENT */;
1581
+ return "i" /* PathCharTypes.IDENT */;
1579
1582
  }
1580
1583
  /**
1581
1584
  * Format a subPath, return its plain form if it is
@@ -1590,7 +1593,7 @@ var IntlifyCoreBase = (function (exports) {
1590
1593
  }
1591
1594
  return isLiteral(trimmed)
1592
1595
  ? stripQuotes(trimmed)
1593
- : "*" /* ASTARISK */ + trimmed;
1596
+ : "*" /* PathCharTypes.ASTARISK */ + trimmed;
1594
1597
  }
1595
1598
  /**
1596
1599
  * Parse a string path into an array of segments
@@ -1598,7 +1601,7 @@ var IntlifyCoreBase = (function (exports) {
1598
1601
  function parse(path) {
1599
1602
  const keys = [];
1600
1603
  let index = -1;
1601
- let mode = 0 /* BEFORE_PATH */;
1604
+ let mode = 0 /* States.BEFORE_PATH */;
1602
1605
  let subPathDepth = 0;
1603
1606
  let c;
1604
1607
  let key; // eslint-disable-line
@@ -1608,7 +1611,7 @@ var IntlifyCoreBase = (function (exports) {
1608
1611
  let action;
1609
1612
  let typeMap;
1610
1613
  const actions = [];
1611
- actions[0 /* APPEND */] = () => {
1614
+ actions[0 /* Actions.APPEND */] = () => {
1612
1615
  if (key === undefined) {
1613
1616
  key = newChar;
1614
1617
  }
@@ -1616,21 +1619,21 @@ var IntlifyCoreBase = (function (exports) {
1616
1619
  key += newChar;
1617
1620
  }
1618
1621
  };
1619
- actions[1 /* PUSH */] = () => {
1622
+ actions[1 /* Actions.PUSH */] = () => {
1620
1623
  if (key !== undefined) {
1621
1624
  keys.push(key);
1622
1625
  key = undefined;
1623
1626
  }
1624
1627
  };
1625
- actions[2 /* INC_SUB_PATH_DEPTH */] = () => {
1626
- actions[0 /* APPEND */]();
1628
+ actions[2 /* Actions.INC_SUB_PATH_DEPTH */] = () => {
1629
+ actions[0 /* Actions.APPEND */]();
1627
1630
  subPathDepth++;
1628
1631
  };
1629
- actions[3 /* PUSH_SUB_PATH */] = () => {
1632
+ actions[3 /* Actions.PUSH_SUB_PATH */] = () => {
1630
1633
  if (subPathDepth > 0) {
1631
1634
  subPathDepth--;
1632
- mode = 4 /* IN_SUB_PATH */;
1633
- actions[0 /* APPEND */]();
1635
+ mode = 4 /* States.IN_SUB_PATH */;
1636
+ actions[0 /* Actions.APPEND */]();
1634
1637
  }
1635
1638
  else {
1636
1639
  subPathDepth = 0;
@@ -1642,19 +1645,19 @@ var IntlifyCoreBase = (function (exports) {
1642
1645
  return false;
1643
1646
  }
1644
1647
  else {
1645
- actions[1 /* PUSH */]();
1648
+ actions[1 /* Actions.PUSH */]();
1646
1649
  }
1647
1650
  }
1648
1651
  };
1649
1652
  function maybeUnescapeQuote() {
1650
1653
  const nextChar = path[index + 1];
1651
- if ((mode === 5 /* IN_SINGLE_QUOTE */ &&
1652
- nextChar === "'" /* SINGLE_QUOTE */) ||
1653
- (mode === 6 /* IN_DOUBLE_QUOTE */ &&
1654
- nextChar === "\"" /* DOUBLE_QUOTE */)) {
1654
+ if ((mode === 5 /* States.IN_SINGLE_QUOTE */ &&
1655
+ nextChar === "'" /* PathCharTypes.SINGLE_QUOTE */) ||
1656
+ (mode === 6 /* States.IN_DOUBLE_QUOTE */ &&
1657
+ nextChar === "\"" /* PathCharTypes.DOUBLE_QUOTE */)) {
1655
1658
  index++;
1656
1659
  newChar = '\\' + nextChar;
1657
- actions[0 /* APPEND */]();
1660
+ actions[0 /* Actions.APPEND */]();
1658
1661
  return true;
1659
1662
  }
1660
1663
  }
@@ -1666,9 +1669,9 @@ var IntlifyCoreBase = (function (exports) {
1666
1669
  }
1667
1670
  type = getPathCharType(c);
1668
1671
  typeMap = pathStateMachine[mode];
1669
- transition = typeMap[type] || typeMap["l" /* ELSE */] || 8 /* ERROR */;
1672
+ transition = typeMap[type] || typeMap["l" /* PathCharTypes.ELSE */] || 8 /* States.ERROR */;
1670
1673
  // check parse error
1671
- if (transition === 8 /* ERROR */) {
1674
+ if (transition === 8 /* States.ERROR */) {
1672
1675
  return;
1673
1676
  }
1674
1677
  mode = transition[0];
@@ -1682,7 +1685,7 @@ var IntlifyCoreBase = (function (exports) {
1682
1685
  }
1683
1686
  }
1684
1687
  // check parse finish
1685
- if (mode === 7 /* AFTER_PATH */) {
1688
+ if (mode === 7 /* States.AFTER_PATH */) {
1686
1689
  return keys;
1687
1690
  }
1688
1691
  }
@@ -1866,14 +1869,14 @@ var IntlifyCoreBase = (function (exports) {
1866
1869
  return modifier ? _modifier(modifier)(msg, type) : msg;
1867
1870
  };
1868
1871
  const ctx = {
1869
- ["list" /* LIST */]: list,
1870
- ["named" /* NAMED */]: named,
1871
- ["plural" /* PLURAL */]: plural,
1872
- ["linked" /* LINKED */]: linked,
1873
- ["message" /* MESSAGE */]: message,
1874
- ["type" /* TYPE */]: type,
1875
- ["interpolate" /* INTERPOLATE */]: interpolate,
1876
- ["normalize" /* NORMALIZE */]: normalize
1872
+ ["list" /* HelperNameMap.LIST */]: list,
1873
+ ["named" /* HelperNameMap.NAMED */]: named,
1874
+ ["plural" /* HelperNameMap.PLURAL */]: plural,
1875
+ ["linked" /* HelperNameMap.LINKED */]: linked,
1876
+ ["message" /* HelperNameMap.MESSAGE */]: message,
1877
+ ["type" /* HelperNameMap.TYPE */]: type,
1878
+ ["interpolate" /* HelperNameMap.INTERPOLATE */]: interpolate,
1879
+ ["normalize" /* HelperNameMap.NORMALIZE */]: normalize
1877
1880
  };
1878
1881
  return ctx;
1879
1882
  }
@@ -2048,7 +2051,7 @@ var IntlifyCoreBase = (function (exports) {
2048
2051
  * Intlify core-base version
2049
2052
  * @internal
2050
2053
  */
2051
- const VERSION = '9.3.0-beta.1';
2054
+ const VERSION = '9.3.0-beta.11';
2052
2055
  const NOT_REOSLVED = -1;
2053
2056
  const DEFAULT_LOCALE = 'en-US';
2054
2057
  const MISSING_RESOLVE_VALUE = '';
@@ -2108,7 +2111,7 @@ var IntlifyCoreBase = (function (exports) {
2108
2111
  _fallbacker = fallbacker;
2109
2112
  }
2110
2113
  // Additional Meta for Intlify DevTools
2111
- let _additionalMeta = null;
2114
+ let _additionalMeta = null;
2112
2115
  const setAdditionalMeta = (meta) => {
2113
2116
  _additionalMeta = meta;
2114
2117
  };
@@ -2243,7 +2246,7 @@ var IntlifyCoreBase = (function (exports) {
2243
2246
  {
2244
2247
  const emitter = context.__v_emitter;
2245
2248
  if (emitter) {
2246
- emitter.emit("missing" /* MISSING */, {
2249
+ emitter.emit("missing" /* VueDevToolsTimelineEvents.MISSING */, {
2247
2250
  locale,
2248
2251
  key,
2249
2252
  type,
@@ -2476,7 +2479,7 @@ var IntlifyCoreBase = (function (exports) {
2476
2479
  if (locale !== targetLocale) {
2477
2480
  const emitter = context.__v_emitter;
2478
2481
  if (emitter) {
2479
- emitter.emit("fallback" /* FALBACK */, {
2482
+ emitter.emit("fallback" /* VueDevToolsTimelineEvents.FALBACK */, {
2480
2483
  type,
2481
2484
  key,
2482
2485
  from,
@@ -2506,8 +2509,8 @@ var IntlifyCoreBase = (function (exports) {
2506
2509
  const end = window.performance.now();
2507
2510
  const emitter = context.__v_emitter;
2508
2511
  if (emitter && start && format) {
2509
- emitter.emit("message-resolve" /* MESSAGE_RESOLVE */, {
2510
- type: "message-resolve" /* MESSAGE_RESOLVE */,
2512
+ emitter.emit("message-resolve" /* VueDevToolsTimelineEvents.MESSAGE_RESOLVE */, {
2513
+ type: "message-resolve" /* VueDevToolsTimelineEvents.MESSAGE_RESOLVE */,
2511
2514
  key,
2512
2515
  message: format,
2513
2516
  time: end - start,
@@ -2560,8 +2563,8 @@ var IntlifyCoreBase = (function (exports) {
2560
2563
  const end = window.performance.now();
2561
2564
  const emitter = context.__v_emitter;
2562
2565
  if (emitter && start) {
2563
- emitter.emit("message-compilation" /* MESSAGE_COMPILATION */, {
2564
- type: "message-compilation" /* MESSAGE_COMPILATION */,
2566
+ emitter.emit("message-compilation" /* VueDevToolsTimelineEvents.MESSAGE_COMPILATION */, {
2567
+ type: "message-compilation" /* VueDevToolsTimelineEvents.MESSAGE_COMPILATION */,
2565
2568
  message: format,
2566
2569
  time: end - start,
2567
2570
  groupId: `${'translate'}:${key}`
@@ -2594,8 +2597,8 @@ var IntlifyCoreBase = (function (exports) {
2594
2597
  const end = window.performance.now();
2595
2598
  const emitter = context.__v_emitter;
2596
2599
  if (emitter && start) {
2597
- emitter.emit("message-evaluation" /* MESSAGE_EVALUATION */, {
2598
- type: "message-evaluation" /* MESSAGE_EVALUATION */,
2600
+ emitter.emit("message-evaluation" /* VueDevToolsTimelineEvents.MESSAGE_EVALUATION */, {
2601
+ type: "message-evaluation" /* VueDevToolsTimelineEvents.MESSAGE_EVALUATION */,
2599
2602
  value: messaged,
2600
2603
  time: end - start,
2601
2604
  groupId: `${'translate'}:${msg.key}`
@@ -2655,7 +2658,7 @@ var IntlifyCoreBase = (function (exports) {
2655
2658
  generateCodeFrame(source, err.location.start.offset, err.location.end.offset);
2656
2659
  const emitter = context.__v_emitter;
2657
2660
  if (emitter) {
2658
- emitter.emit("compile-error" /* COMPILE_ERROR */, {
2661
+ emitter.emit("compile-error" /* VueDevToolsTimelineEvents.COMPILE_ERROR */, {
2659
2662
  message: source,
2660
2663
  error: err.message,
2661
2664
  start: err.location && err.location.start.offset,
@@ -2765,7 +2768,7 @@ var IntlifyCoreBase = (function (exports) {
2765
2768
  if (locale !== targetLocale) {
2766
2769
  const emitter = context.__v_emitter;
2767
2770
  if (emitter) {
2768
- emitter.emit("fallback" /* FALBACK */, {
2771
+ emitter.emit("fallback" /* VueDevToolsTimelineEvents.FALBACK */, {
2769
2772
  type,
2770
2773
  key,
2771
2774
  from,
@@ -2939,7 +2942,7 @@ var IntlifyCoreBase = (function (exports) {
2939
2942
  if (locale !== targetLocale) {
2940
2943
  const emitter = context.__v_emitter;
2941
2944
  if (emitter) {
2942
- emitter.emit("fallback" /* FALBACK */, {
2945
+ emitter.emit("fallback" /* VueDevToolsTimelineEvents.FALBACK */, {
2943
2946
  type,
2944
2947
  key,
2945
2948
  from,