@itwin/core-i18n 5.0.0-dev.57 → 5.0.0-dev.59

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.
@@ -19,7 +19,7 @@
19
19
  */
20
20
  function cov_ogldeftyv() {
21
21
  var path = "C:\\agent\\_work\\1\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js";
22
- var hash = "a382596dbfbc886d31159a6dca6879dc56dcf2cf";
22
+ var hash = "dc42415b822dd4de30f4e9da695d0e05d9c36eef";
23
23
  var global = new Function("return this")();
24
24
  var gcv = "__coverage__";
25
25
  var coverageData = {
@@ -377,491 +377,431 @@ function cov_ogldeftyv() {
377
377
  },
378
378
  "35": {
379
379
  start: {
380
- line: 126,
381
- column: 22
382
- },
383
- end: {
384
- line: 126,
385
- column: 24
386
- }
387
- },
388
- "36": {
389
- start: {
390
- line: 127,
391
- column: 8
392
- },
393
- end: {
394
- line: 134,
395
- column: 9
396
- }
397
- },
398
- "37": {
399
- start: {
400
- line: 128,
401
- column: 12
402
- },
403
- end: {
404
- line: 128,
405
- column: 44
406
- }
407
- },
408
- "38": {
409
- start: {
410
- line: 131,
411
- column: 12
412
- },
413
- end: {
414
- line: 133,
415
- column: 15
416
- }
417
- },
418
- "39": {
419
- start: {
420
- line: 132,
421
- column: 16
422
- },
423
- end: {
424
- line: 132,
425
- column: 48
426
- }
427
- },
428
- "40": {
429
- start: {
430
- line: 135,
380
+ line: 125,
431
381
  column: 8
432
382
  },
433
383
  end: {
434
- line: 135,
435
- column: 57
436
- }
437
- },
438
- "41": {
439
- start: {
440
- line: 145,
441
- column: 8
442
- },
443
- end: {
444
- line: 147,
384
+ line: 127,
445
385
  column: 9
446
386
  }
447
387
  },
448
- "42": {
388
+ "36": {
449
389
  start: {
450
- line: 146,
390
+ line: 126,
451
391
  column: 12
452
392
  },
453
393
  end: {
454
- line: 146,
394
+ line: 126,
455
395
  column: 116
456
396
  }
457
397
  },
458
- "43": {
398
+ "37": {
459
399
  start: {
460
- line: 148,
400
+ line: 128,
461
401
  column: 8
462
402
  },
463
403
  end: {
464
- line: 151,
404
+ line: 131,
465
405
  column: 10
466
406
  }
467
407
  },
468
- "44": {
408
+ "38": {
469
409
  start: {
470
- line: 152,
410
+ line: 132,
471
411
  column: 19
472
412
  },
473
413
  end: {
474
- line: 152,
414
+ line: 132,
475
415
  column: 58
476
416
  }
477
417
  },
478
- "45": {
418
+ "39": {
479
419
  start: {
480
- line: 153,
420
+ line: 133,
481
421
  column: 20
482
422
  },
483
423
  end: {
484
- line: 153,
424
+ line: 133,
485
425
  column: 36
486
426
  }
487
427
  },
488
- "46": {
428
+ "40": {
489
429
  start: {
490
- line: 154,
430
+ line: 134,
491
431
  column: 8
492
432
  },
493
433
  end: {
494
- line: 155,
434
+ line: 135,
495
435
  column: 60
496
436
  }
497
437
  },
498
- "47": {
438
+ "41": {
499
439
  start: {
500
- line: 155,
440
+ line: 135,
501
441
  column: 12
502
442
  },
503
443
  end: {
504
- line: 155,
444
+ line: 135,
505
445
  column: 60
506
446
  }
507
447
  },
508
- "48": {
448
+ "42": {
509
449
  start: {
510
- line: 156,
450
+ line: 136,
511
451
  column: 8
512
452
  },
513
453
  end: {
514
- line: 156,
454
+ line: 136,
515
455
  column: 19
516
456
  }
517
457
  },
518
- "49": {
458
+ "43": {
519
459
  start: {
520
- line: 163,
460
+ line: 143,
521
461
  column: 8
522
462
  },
523
463
  end: {
524
- line: 163,
464
+ line: 143,
525
465
  column: 42
526
466
  }
527
467
  },
528
- "50": {
468
+ "44": {
529
469
  start: {
530
- line: 167,
470
+ line: 147,
531
471
  column: 8
532
472
  },
533
473
  end: {
534
- line: 167,
474
+ line: 147,
535
475
  column: 38
536
476
  }
537
477
  },
538
- "51": {
478
+ "45": {
539
479
  start: {
540
- line: 171,
480
+ line: 151,
541
481
  column: 8
542
482
  },
543
483
  end: {
544
- line: 171,
484
+ line: 151,
545
485
  column: 53
546
486
  }
547
487
  },
548
- "52": {
488
+ "46": {
549
489
  start: {
550
- line: 182,
490
+ line: 162,
551
491
  column: 25
552
492
  },
553
493
  end: {
554
- line: 182,
494
+ line: 162,
555
495
  column: 51
556
496
  }
557
497
  },
558
- "53": {
498
+ "47": {
559
499
  start: {
560
- line: 183,
500
+ line: 163,
561
501
  column: 8
562
502
  },
563
503
  end: {
564
- line: 184,
504
+ line: 164,
565
505
  column: 28
566
506
  }
567
507
  },
568
- "54": {
508
+ "48": {
569
509
  start: {
570
- line: 184,
510
+ line: 164,
571
511
  column: 12
572
512
  },
573
513
  end: {
574
- line: 184,
514
+ line: 164,
575
515
  column: 28
576
516
  }
577
517
  },
578
- "55": {
518
+ "49": {
579
519
  start: {
580
- line: 185,
520
+ line: 165,
581
521
  column: 31
582
522
  },
583
523
  end: {
584
- line: 210,
524
+ line: 190,
585
525
  column: 10
586
526
  }
587
527
  },
588
- "56": {
528
+ "50": {
589
529
  start: {
590
- line: 187,
530
+ line: 167,
591
531
  column: 12
592
532
  },
593
533
  end: {
594
- line: 209,
534
+ line: 189,
595
535
  column: 15
596
536
  }
597
537
  },
598
- "57": {
538
+ "51": {
599
539
  start: {
600
- line: 188,
540
+ line: 168,
601
541
  column: 16
602
542
  },
603
543
  end: {
604
- line: 189,
544
+ line: 169,
605
545
  column: 37
606
546
  }
607
547
  },
608
- "58": {
548
+ "52": {
609
549
  start: {
610
- line: 189,
550
+ line: 169,
611
551
  column: 20
612
552
  },
613
553
  end: {
614
- line: 189,
554
+ line: 169,
615
555
  column: 37
616
556
  }
617
557
  },
618
- "59": {
558
+ "53": {
619
559
  start: {
620
- line: 195,
560
+ line: 175,
621
561
  column: 30
622
562
  },
623
563
  end: {
624
- line: 195,
564
+ line: 175,
625
565
  column: 91
626
566
  }
627
567
  },
628
- "60": {
568
+ "54": {
629
569
  start: {
630
- line: 195,
570
+ line: 175,
631
571
  column: 73
632
572
  },
633
573
  end: {
634
- line: 195,
574
+ line: 175,
635
575
  column: 90
636
576
  }
637
577
  },
638
- "61": {
578
+ "55": {
639
579
  start: {
640
- line: 196,
580
+ line: 176,
641
581
  column: 16
642
582
  },
643
583
  end: {
644
- line: 204,
584
+ line: 184,
645
585
  column: 17
646
586
  }
647
587
  },
648
- "62": {
588
+ "56": {
649
589
  start: {
650
- line: 197,
590
+ line: 177,
651
591
  column: 20
652
592
  },
653
593
  end: {
654
- line: 200,
594
+ line: 180,
655
595
  column: 21
656
596
  }
657
597
  },
658
- "63": {
598
+ "57": {
659
599
  start: {
660
- line: 198,
600
+ line: 178,
661
601
  column: 24
662
602
  },
663
603
  end: {
664
- line: 199,
604
+ line: 179,
665
605
  column: 102
666
606
  }
667
607
  },
668
- "64": {
608
+ "58": {
669
609
  start: {
670
- line: 199,
610
+ line: 179,
671
611
  column: 28
672
612
  },
673
613
  end: {
674
- line: 199,
614
+ line: 179,
675
615
  column: 102
676
616
  }
677
617
  },
678
- "65": {
618
+ "59": {
679
619
  start: {
680
- line: 199,
620
+ line: 179,
681
621
  column: 69
682
622
  },
683
623
  end: {
684
- line: 199,
624
+ line: 179,
685
625
  column: 100
686
626
  }
687
627
  },
688
- "66": {
628
+ "60": {
689
629
  start: {
690
- line: 203,
630
+ line: 183,
691
631
  column: 20
692
632
  },
693
633
  end: {
694
- line: 203,
634
+ line: 183,
695
635
  column: 33
696
636
  }
697
637
  },
698
- "67": {
638
+ "61": {
699
639
  start: {
700
- line: 206,
640
+ line: 186,
701
641
  column: 16
702
642
  },
703
643
  end: {
704
- line: 207,
644
+ line: 187,
705
645
  column: 113
706
646
  }
707
647
  },
708
- "68": {
648
+ "62": {
709
649
  start: {
710
- line: 207,
650
+ line: 187,
711
651
  column: 20
712
652
  },
713
653
  end: {
714
- line: 207,
654
+ line: 187,
715
655
  column: 113
716
656
  }
717
657
  },
718
- "69": {
658
+ "63": {
719
659
  start: {
720
- line: 208,
660
+ line: 188,
721
661
  column: 16
722
662
  },
723
663
  end: {
724
- line: 208,
664
+ line: 188,
725
665
  column: 26
726
666
  }
727
667
  },
728
- "70": {
668
+ "64": {
729
669
  start: {
730
- line: 211,
670
+ line: 191,
731
671
  column: 8
732
672
  },
733
673
  end: {
734
- line: 211,
674
+ line: 191,
735
675
  column: 51
736
676
  }
737
677
  },
738
- "71": {
678
+ "65": {
739
679
  start: {
740
- line: 212,
680
+ line: 192,
741
681
  column: 8
742
682
  },
743
683
  end: {
744
- line: 212,
684
+ line: 192,
745
685
  column: 30
746
686
  }
747
687
  },
748
- "72": {
688
+ "66": {
749
689
  start: {
750
- line: 216,
690
+ line: 196,
751
691
  column: 8
752
692
  },
753
693
  end: {
754
- line: 216,
694
+ line: 196,
755
695
  column: 38
756
696
  }
757
697
  },
758
- "73": {
698
+ "67": {
759
699
  start: {
760
- line: 219,
700
+ line: 199,
761
701
  column: 0
762
702
  },
763
703
  end: {
764
- line: 219,
704
+ line: 199,
765
705
  column: 46
766
706
  }
767
707
  },
768
- "74": {
708
+ "68": {
769
709
  start: {
770
- line: 221,
710
+ line: 201,
771
711
  column: 18
772
712
  },
773
713
  end: {
774
- line: 221,
714
+ line: 201,
775
715
  column: 26
776
716
  }
777
717
  },
778
- "75": {
718
+ "69": {
779
719
  start: {
780
- line: 222,
720
+ line: 202,
781
721
  column: 16
782
722
  },
783
723
  end: {
784
- line: 222,
724
+ line: 202,
785
725
  column: 83
786
726
  }
787
727
  },
788
- "76": {
728
+ "70": {
789
729
  start: {
790
- line: 223,
730
+ line: 203,
791
731
  column: 17
792
732
  },
793
733
  end: {
794
- line: 223,
734
+ line: 203,
795
735
  column: 87
796
736
  }
797
737
  },
798
- "77": {
738
+ "71": {
799
739
  start: {
800
- line: 224,
740
+ line: 204,
801
741
  column: 18
802
742
  },
803
743
  end: {
804
- line: 224,
744
+ line: 204,
805
745
  column: 86
806
746
  }
807
747
  },
808
- "78": {
748
+ "72": {
809
749
  start: {
810
- line: 226,
750
+ line: 206,
811
751
  column: 22
812
752
  },
813
753
  end: {
814
- line: 226,
754
+ line: 206,
815
755
  column: 29
816
756
  }
817
757
  },
818
- "79": {
758
+ "73": {
819
759
  start: {
820
- line: 227,
760
+ line: 207,
821
761
  column: 8
822
762
  },
823
763
  end: {
824
- line: 230,
764
+ line: 210,
825
765
  column: 9
826
766
  }
827
767
  },
828
- "80": {
768
+ "74": {
829
769
  start: {
830
- line: 227,
770
+ line: 207,
831
771
  column: 21
832
772
  },
833
773
  end: {
834
- line: 227,
774
+ line: 207,
835
775
  column: 22
836
776
  }
837
777
  },
838
- "81": {
778
+ "75": {
839
779
  start: {
840
- line: 228,
780
+ line: 208,
841
781
  column: 12
842
782
  },
843
783
  end: {
844
- line: 229,
784
+ line: 209,
845
785
  column: 44
846
786
  }
847
787
  },
848
- "82": {
788
+ "76": {
849
789
  start: {
850
- line: 229,
790
+ line: 209,
851
791
  column: 16
852
792
  },
853
793
  end: {
854
- line: 229,
794
+ line: 209,
855
795
  column: 44
856
796
  }
857
797
  },
858
- "83": {
798
+ "77": {
859
799
  start: {
860
- line: 231,
800
+ line: 211,
861
801
  column: 8
862
802
  },
863
803
  end: {
864
- line: 231,
804
+ line: 211,
865
805
  column: 23
866
806
  }
867
807
  }
@@ -1015,385 +955,337 @@ function cov_ogldeftyv() {
1015
955
  name: "(anonymous_6)",
1016
956
  decl: {
1017
957
  start: {
1018
- line: 125,
958
+ line: 124,
1019
959
  column: 4
1020
960
  },
1021
961
  end: {
1022
- line: 125,
962
+ line: 124,
1023
963
  column: 5
1024
964
  }
1025
965
  },
1026
966
  loc: {
1027
967
  start: {
1028
- line: 125,
1029
- column: 61
968
+ line: 124,
969
+ column: 46
1030
970
  },
1031
971
  end: {
1032
- line: 136,
972
+ line: 137,
1033
973
  column: 5
1034
974
  }
1035
975
  },
1036
- line: 125
976
+ line: 124
1037
977
  },
1038
978
  "7": {
1039
979
  name: "(anonymous_7)",
1040
980
  decl: {
1041
981
  start: {
1042
- line: 131,
1043
- column: 30
982
+ line: 142,
983
+ column: 4
1044
984
  },
1045
985
  end: {
1046
- line: 131,
1047
- column: 31
986
+ line: 142,
987
+ column: 5
1048
988
  }
1049
989
  },
1050
990
  loc: {
1051
991
  start: {
1052
- line: 131,
1053
- column: 42
992
+ line: 142,
993
+ column: 30
1054
994
  },
1055
995
  end: {
1056
- line: 133,
1057
- column: 13
996
+ line: 144,
997
+ column: 5
1058
998
  }
1059
999
  },
1060
- line: 131
1000
+ line: 142
1061
1001
  },
1062
1002
  "8": {
1063
1003
  name: "(anonymous_8)",
1064
1004
  decl: {
1065
1005
  start: {
1066
- line: 144,
1006
+ line: 146,
1067
1007
  column: 4
1068
1008
  },
1069
1009
  end: {
1070
- line: 144,
1010
+ line: 146,
1071
1011
  column: 5
1072
1012
  }
1073
1013
  },
1074
1014
  loc: {
1075
1015
  start: {
1076
- line: 144,
1077
- column: 46
1016
+ line: 146,
1017
+ column: 22
1078
1018
  },
1079
1019
  end: {
1080
- line: 157,
1020
+ line: 148,
1081
1021
  column: 5
1082
1022
  }
1083
1023
  },
1084
- line: 144
1024
+ line: 146
1085
1025
  },
1086
1026
  "9": {
1087
1027
  name: "(anonymous_9)",
1088
1028
  decl: {
1089
1029
  start: {
1090
- line: 162,
1030
+ line: 150,
1091
1031
  column: 4
1092
1032
  },
1093
1033
  end: {
1094
- line: 162,
1034
+ line: 150,
1095
1035
  column: 5
1096
1036
  }
1097
1037
  },
1098
1038
  loc: {
1099
1039
  start: {
1100
- line: 162,
1101
- column: 30
1040
+ line: 150,
1041
+ column: 35
1102
1042
  },
1103
1043
  end: {
1104
- line: 164,
1044
+ line: 152,
1105
1045
  column: 5
1106
1046
  }
1107
1047
  },
1108
- line: 162
1048
+ line: 150
1109
1049
  },
1110
1050
  "10": {
1111
1051
  name: "(anonymous_10)",
1112
1052
  decl: {
1113
1053
  start: {
1114
- line: 166,
1054
+ line: 161,
1115
1055
  column: 4
1116
1056
  },
1117
1057
  end: {
1118
- line: 166,
1058
+ line: 161,
1119
1059
  column: 5
1120
1060
  }
1121
1061
  },
1122
1062
  loc: {
1123
1063
  start: {
1124
- line: 166,
1125
- column: 22
1064
+ line: 161,
1065
+ column: 34
1126
1066
  },
1127
1067
  end: {
1128
- line: 168,
1068
+ line: 193,
1129
1069
  column: 5
1130
1070
  }
1131
1071
  },
1132
- line: 166
1072
+ line: 161
1133
1073
  },
1134
1074
  "11": {
1135
1075
  name: "(anonymous_11)",
1136
1076
  decl: {
1137
1077
  start: {
1138
- line: 170,
1139
- column: 4
1140
- },
1141
- end: {
1142
- line: 170,
1143
- column: 5
1144
- }
1145
- },
1146
- loc: {
1147
- start: {
1148
- line: 170,
1149
- column: 35
1150
- },
1151
- end: {
1152
- line: 172,
1153
- column: 5
1154
- }
1155
- },
1156
- line: 170
1157
- },
1158
- "12": {
1159
- name: "(anonymous_12)",
1160
- decl: {
1161
- start: {
1162
- line: 181,
1163
- column: 4
1164
- },
1165
- end: {
1166
- line: 181,
1167
- column: 5
1168
- }
1169
- },
1170
- loc: {
1171
- start: {
1172
- line: 181,
1173
- column: 34
1174
- },
1175
- end: {
1176
- line: 213,
1177
- column: 5
1178
- }
1179
- },
1180
- line: 181
1181
- },
1182
- "13": {
1183
- name: "(anonymous_13)",
1184
- decl: {
1185
- start: {
1186
- line: 185,
1078
+ line: 165,
1187
1079
  column: 43
1188
1080
  },
1189
1081
  end: {
1190
- line: 185,
1082
+ line: 165,
1191
1083
  column: 44
1192
1084
  }
1193
1085
  },
1194
1086
  loc: {
1195
1087
  start: {
1196
- line: 185,
1088
+ line: 165,
1197
1089
  column: 56
1198
1090
  },
1199
1091
  end: {
1200
- line: 210,
1092
+ line: 190,
1201
1093
  column: 9
1202
1094
  }
1203
1095
  },
1204
- line: 185
1096
+ line: 165
1205
1097
  },
1206
- "14": {
1207
- name: "(anonymous_14)",
1098
+ "12": {
1099
+ name: "(anonymous_12)",
1208
1100
  decl: {
1209
1101
  start: {
1210
- line: 187,
1102
+ line: 167,
1211
1103
  column: 46
1212
1104
  },
1213
1105
  end: {
1214
- line: 187,
1106
+ line: 167,
1215
1107
  column: 47
1216
1108
  }
1217
1109
  },
1218
1110
  loc: {
1219
1111
  start: {
1220
- line: 187,
1112
+ line: 167,
1221
1113
  column: 55
1222
1114
  },
1223
1115
  end: {
1224
- line: 209,
1116
+ line: 189,
1225
1117
  column: 13
1226
1118
  }
1227
1119
  },
1228
- line: 187
1120
+ line: 167
1229
1121
  },
1230
- "15": {
1231
- name: "(anonymous_15)",
1122
+ "13": {
1123
+ name: "(anonymous_13)",
1232
1124
  decl: {
1233
1125
  start: {
1234
- line: 195,
1126
+ line: 175,
1235
1127
  column: 57
1236
1128
  },
1237
1129
  end: {
1238
- line: 195,
1130
+ line: 175,
1239
1131
  column: 58
1240
1132
  }
1241
1133
  },
1242
1134
  loc: {
1243
1135
  start: {
1244
- line: 195,
1136
+ line: 175,
1245
1137
  column: 73
1246
1138
  },
1247
1139
  end: {
1248
- line: 195,
1140
+ line: 175,
1249
1141
  column: 90
1250
1142
  }
1251
1143
  },
1252
- line: 195
1144
+ line: 175
1253
1145
  },
1254
- "16": {
1255
- name: "(anonymous_16)",
1146
+ "14": {
1147
+ name: "(anonymous_14)",
1256
1148
  decl: {
1257
1149
  start: {
1258
- line: 199,
1150
+ line: 179,
1259
1151
  column: 53
1260
1152
  },
1261
1153
  end: {
1262
- line: 199,
1154
+ line: 179,
1263
1155
  column: 54
1264
1156
  }
1265
1157
  },
1266
1158
  loc: {
1267
1159
  start: {
1268
- line: 199,
1160
+ line: 179,
1269
1161
  column: 69
1270
1162
  },
1271
1163
  end: {
1272
- line: 199,
1164
+ line: 179,
1273
1165
  column: 100
1274
1166
  }
1275
1167
  },
1276
- line: 199
1168
+ line: 179
1277
1169
  },
1278
- "17": {
1279
- name: "(anonymous_17)",
1170
+ "15": {
1171
+ name: "(anonymous_15)",
1280
1172
  decl: {
1281
1173
  start: {
1282
- line: 215,
1174
+ line: 195,
1283
1175
  column: 4
1284
1176
  },
1285
1177
  end: {
1286
- line: 215,
1178
+ line: 195,
1287
1179
  column: 5
1288
1180
  }
1289
1181
  },
1290
1182
  loc: {
1291
1183
  start: {
1292
- line: 215,
1184
+ line: 195,
1293
1185
  column: 30
1294
1186
  },
1295
1187
  end: {
1296
- line: 217,
1188
+ line: 197,
1297
1189
  column: 5
1298
1190
  }
1299
1191
  },
1300
- line: 215
1192
+ line: 195
1301
1193
  },
1302
- "18": {
1303
- name: "(anonymous_18)",
1194
+ "16": {
1195
+ name: "(anonymous_16)",
1304
1196
  decl: {
1305
1197
  start: {
1306
- line: 222,
1198
+ line: 202,
1307
1199
  column: 4
1308
1200
  },
1309
1201
  end: {
1310
- line: 222,
1202
+ line: 202,
1311
1203
  column: 5
1312
1204
  }
1313
1205
  },
1314
1206
  loc: {
1315
1207
  start: {
1316
- line: 222,
1208
+ line: 202,
1317
1209
  column: 14
1318
1210
  },
1319
1211
  end: {
1320
- line: 222,
1212
+ line: 202,
1321
1213
  column: 85
1322
1214
  }
1323
1215
  },
1324
- line: 222
1216
+ line: 202
1325
1217
  },
1326
- "19": {
1327
- name: "(anonymous_19)",
1218
+ "17": {
1219
+ name: "(anonymous_17)",
1328
1220
  decl: {
1329
1221
  start: {
1330
- line: 223,
1222
+ line: 203,
1331
1223
  column: 4
1332
1224
  },
1333
1225
  end: {
1334
- line: 223,
1226
+ line: 203,
1335
1227
  column: 5
1336
1228
  }
1337
1229
  },
1338
1230
  loc: {
1339
1231
  start: {
1340
- line: 223,
1232
+ line: 203,
1341
1233
  column: 15
1342
1234
  },
1343
1235
  end: {
1344
- line: 223,
1236
+ line: 203,
1345
1237
  column: 89
1346
1238
  }
1347
1239
  },
1348
- line: 223
1240
+ line: 203
1349
1241
  },
1350
- "20": {
1351
- name: "(anonymous_20)",
1242
+ "18": {
1243
+ name: "(anonymous_18)",
1352
1244
  decl: {
1353
1245
  start: {
1354
- line: 224,
1246
+ line: 204,
1355
1247
  column: 4
1356
1248
  },
1357
1249
  end: {
1358
- line: 224,
1250
+ line: 204,
1359
1251
  column: 5
1360
1252
  }
1361
1253
  },
1362
1254
  loc: {
1363
1255
  start: {
1364
- line: 224,
1256
+ line: 204,
1365
1257
  column: 16
1366
1258
  },
1367
1259
  end: {
1368
- line: 224,
1260
+ line: 204,
1369
1261
  column: 88
1370
1262
  }
1371
1263
  },
1372
- line: 224
1264
+ line: 204
1373
1265
  },
1374
- "21": {
1375
- name: "(anonymous_21)",
1266
+ "19": {
1267
+ name: "(anonymous_19)",
1376
1268
  decl: {
1377
1269
  start: {
1378
- line: 225,
1270
+ line: 205,
1379
1271
  column: 4
1380
1272
  },
1381
1273
  end: {
1382
- line: 225,
1274
+ line: 205,
1383
1275
  column: 5
1384
1276
  }
1385
1277
  },
1386
1278
  loc: {
1387
1279
  start: {
1388
- line: 225,
1280
+ line: 205,
1389
1281
  column: 27
1390
1282
  },
1391
1283
  end: {
1392
- line: 232,
1284
+ line: 212,
1393
1285
  column: 5
1394
1286
  }
1395
1287
  },
1396
- line: 225
1288
+ line: 205
1397
1289
  }
1398
1290
  },
1399
1291
  branchMap: {
@@ -1838,55 +1730,22 @@ function cov_ogldeftyv() {
1838
1730
  "13": {
1839
1731
  loc: {
1840
1732
  start: {
1841
- line: 127,
1733
+ line: 125,
1842
1734
  column: 8
1843
1735
  },
1844
1736
  end: {
1845
- line: 134,
1846
- column: 9
1847
- }
1848
- },
1849
- type: "if",
1850
- locations: [{
1851
- start: {
1852
1737
  line: 127,
1853
- column: 8
1854
- },
1855
- end: {
1856
- line: 134,
1857
- column: 9
1858
- }
1859
- }, {
1860
- start: {
1861
- line: 130,
1862
- column: 13
1863
- },
1864
- end: {
1865
- line: 134,
1866
- column: 9
1867
- }
1868
- }],
1869
- line: 127
1870
- },
1871
- "14": {
1872
- loc: {
1873
- start: {
1874
- line: 145,
1875
- column: 8
1876
- },
1877
- end: {
1878
- line: 147,
1879
1738
  column: 9
1880
1739
  }
1881
1740
  },
1882
1741
  type: "if",
1883
1742
  locations: [{
1884
1743
  start: {
1885
- line: 145,
1744
+ line: 125,
1886
1745
  column: 8
1887
1746
  },
1888
1747
  end: {
1889
- line: 147,
1748
+ line: 127,
1890
1749
  column: 9
1891
1750
  }
1892
1751
  }, {
@@ -1899,60 +1758,60 @@ function cov_ogldeftyv() {
1899
1758
  column: undefined
1900
1759
  }
1901
1760
  }],
1902
- line: 145
1761
+ line: 125
1903
1762
  },
1904
- "15": {
1763
+ "14": {
1905
1764
  loc: {
1906
1765
  start: {
1907
- line: 145,
1766
+ line: 125,
1908
1767
  column: 12
1909
1768
  },
1910
1769
  end: {
1911
- line: 145,
1770
+ line: 125,
1912
1771
  column: 60
1913
1772
  }
1914
1773
  },
1915
1774
  type: "binary-expr",
1916
1775
  locations: [{
1917
1776
  start: {
1918
- line: 145,
1777
+ line: 125,
1919
1778
  column: 12
1920
1779
  },
1921
1780
  end: {
1922
- line: 145,
1781
+ line: 125,
1923
1782
  column: 34
1924
1783
  }
1925
1784
  }, {
1926
1785
  start: {
1927
- line: 145,
1786
+ line: 125,
1928
1787
  column: 38
1929
1788
  },
1930
1789
  end: {
1931
- line: 145,
1790
+ line: 125,
1932
1791
  column: 60
1933
1792
  }
1934
1793
  }],
1935
- line: 145
1794
+ line: 125
1936
1795
  },
1937
- "16": {
1796
+ "15": {
1938
1797
  loc: {
1939
1798
  start: {
1940
- line: 154,
1799
+ line: 134,
1941
1800
  column: 8
1942
1801
  },
1943
1802
  end: {
1944
- line: 155,
1803
+ line: 135,
1945
1804
  column: 60
1946
1805
  }
1947
1806
  },
1948
1807
  type: "if",
1949
1808
  locations: [{
1950
1809
  start: {
1951
- line: 154,
1810
+ line: 134,
1952
1811
  column: 8
1953
1812
  },
1954
1813
  end: {
1955
- line: 155,
1814
+ line: 135,
1956
1815
  column: 60
1957
1816
  }
1958
1817
  }, {
@@ -1965,27 +1824,27 @@ function cov_ogldeftyv() {
1965
1824
  column: undefined
1966
1825
  }
1967
1826
  }],
1968
- line: 154
1827
+ line: 134
1969
1828
  },
1970
- "17": {
1829
+ "16": {
1971
1830
  loc: {
1972
1831
  start: {
1973
- line: 183,
1832
+ line: 163,
1974
1833
  column: 8
1975
1834
  },
1976
1835
  end: {
1977
- line: 184,
1836
+ line: 164,
1978
1837
  column: 28
1979
1838
  }
1980
1839
  },
1981
1840
  type: "if",
1982
1841
  locations: [{
1983
1842
  start: {
1984
- line: 183,
1843
+ line: 163,
1985
1844
  column: 8
1986
1845
  },
1987
1846
  end: {
1988
- line: 184,
1847
+ line: 164,
1989
1848
  column: 28
1990
1849
  }
1991
1850
  }, {
@@ -1998,27 +1857,27 @@ function cov_ogldeftyv() {
1998
1857
  column: undefined
1999
1858
  }
2000
1859
  }],
2001
- line: 183
1860
+ line: 163
2002
1861
  },
2003
- "18": {
1862
+ "17": {
2004
1863
  loc: {
2005
1864
  start: {
2006
- line: 188,
1865
+ line: 168,
2007
1866
  column: 16
2008
1867
  },
2009
1868
  end: {
2010
- line: 189,
1869
+ line: 169,
2011
1870
  column: 37
2012
1871
  }
2013
1872
  },
2014
1873
  type: "if",
2015
1874
  locations: [{
2016
1875
  start: {
2017
- line: 188,
1876
+ line: 168,
2018
1877
  column: 16
2019
1878
  },
2020
1879
  end: {
2021
- line: 189,
1880
+ line: 169,
2022
1881
  column: 37
2023
1882
  }
2024
1883
  }, {
@@ -2031,27 +1890,27 @@ function cov_ogldeftyv() {
2031
1890
  column: undefined
2032
1891
  }
2033
1892
  }],
2034
- line: 188
1893
+ line: 168
2035
1894
  },
2036
- "19": {
1895
+ "18": {
2037
1896
  loc: {
2038
1897
  start: {
2039
- line: 198,
1898
+ line: 178,
2040
1899
  column: 24
2041
1900
  },
2042
1901
  end: {
2043
- line: 199,
1902
+ line: 179,
2044
1903
  column: 102
2045
1904
  }
2046
1905
  },
2047
1906
  type: "if",
2048
1907
  locations: [{
2049
1908
  start: {
2050
- line: 198,
1909
+ line: 178,
2051
1910
  column: 24
2052
1911
  },
2053
1912
  end: {
2054
- line: 199,
1913
+ line: 179,
2055
1914
  column: 102
2056
1915
  }
2057
1916
  }, {
@@ -2064,27 +1923,27 @@ function cov_ogldeftyv() {
2064
1923
  column: undefined
2065
1924
  }
2066
1925
  }],
2067
- line: 198
1926
+ line: 178
2068
1927
  },
2069
- "20": {
1928
+ "19": {
2070
1929
  loc: {
2071
1930
  start: {
2072
- line: 206,
1931
+ line: 186,
2073
1932
  column: 16
2074
1933
  },
2075
1934
  end: {
2076
- line: 207,
1935
+ line: 187,
2077
1936
  column: 113
2078
1937
  }
2079
1938
  },
2080
1939
  type: "if",
2081
1940
  locations: [{
2082
1941
  start: {
2083
- line: 206,
1942
+ line: 186,
2084
1943
  column: 16
2085
1944
  },
2086
1945
  end: {
2087
- line: 207,
1946
+ line: 187,
2088
1947
  column: 113
2089
1948
  }
2090
1949
  }, {
@@ -2097,27 +1956,27 @@ function cov_ogldeftyv() {
2097
1956
  column: undefined
2098
1957
  }
2099
1958
  }],
2100
- line: 206
1959
+ line: 186
2101
1960
  },
2102
- "21": {
1961
+ "20": {
2103
1962
  loc: {
2104
1963
  start: {
2105
- line: 228,
1964
+ line: 208,
2106
1965
  column: 12
2107
1966
  },
2108
1967
  end: {
2109
- line: 229,
1968
+ line: 209,
2110
1969
  column: 44
2111
1970
  }
2112
1971
  },
2113
1972
  type: "if",
2114
1973
  locations: [{
2115
1974
  start: {
2116
- line: 228,
1975
+ line: 208,
2117
1976
  column: 12
2118
1977
  },
2119
1978
  end: {
2120
- line: 229,
1979
+ line: 209,
2121
1980
  column: 44
2122
1981
  }
2123
1982
  }, {
@@ -2130,7 +1989,7 @@ function cov_ogldeftyv() {
2130
1989
  column: undefined
2131
1990
  }
2132
1991
  }],
2133
- line: 228
1992
+ line: 208
2134
1993
  }
2135
1994
  },
2136
1995
  s: {
@@ -2211,13 +2070,7 @@ function cov_ogldeftyv() {
2211
2070
  "74": 0,
2212
2071
  "75": 0,
2213
2072
  "76": 0,
2214
- "77": 0,
2215
- "78": 0,
2216
- "79": 0,
2217
- "80": 0,
2218
- "81": 0,
2219
- "82": 0,
2220
- "83": 0
2073
+ "77": 0
2221
2074
  },
2222
2075
  f: {
2223
2076
  "0": 0,
@@ -2239,9 +2092,7 @@ function cov_ogldeftyv() {
2239
2092
  "16": 0,
2240
2093
  "17": 0,
2241
2094
  "18": 0,
2242
- "19": 0,
2243
- "20": 0,
2244
- "21": 0
2095
+ "19": 0
2245
2096
  },
2246
2097
  b: {
2247
2098
  "0": [0, 0, 0],
@@ -2264,19 +2115,18 @@ function cov_ogldeftyv() {
2264
2115
  "17": [0, 0],
2265
2116
  "18": [0, 0],
2266
2117
  "19": [0, 0],
2267
- "20": [0, 0],
2268
- "21": [0, 0]
2118
+ "20": [0, 0]
2269
2119
  },
2270
2120
  inputSourceMap: {
2271
2121
  version: 3,
2272
2122
  file: "ITwinLocalization.js",
2273
2123
  sources: ["C:\\agent\\_work\\1\\s\\core\\i18n\\src\\ITwinLocalization.ts"],
2274
2124
  names: [],
2275
- mappings: ";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;AAEH,sDAA2E;AAC3E,wGAAmG;AACnG,gFAA+D;AAC/D,sDAA6C;AAG7C,MAAM,mBAAmB,GAAW,CAAC,CAAC,CAAC,8GAA8G;AAcrJ;;;GAGG;AACH,MAAa,iBAAiB;IACrB,OAAO,CAAO;IACJ,YAAY,CAAc;IAC1B,eAAe,CAAiB;IAChC,iBAAiB,CAAkB;IACnC,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEhE,YAAmB,OAA6B;QAC9C,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC,cAAc,EAAE,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG;YACrB,QAAQ,EAAE,OAAO,EAAE,WAAW,IAAI,6BAA6B;YAC/D,WAAW,EAAE,IAAI;YACjB,GAAG,OAAO,EAAE,kBAAkB;SAC/B,CAAC;QAEF,IAAI,CAAC,iBAAiB,GAAG;YACvB,KAAK,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC;YAC9C,iBAAiB,EAAE,KAAK;YACxB,MAAM,EAAE,EAAE;YACV,GAAG,OAAO,EAAE,eAAe;SAC5B,CAAC;QAEF,IAA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AC,CAAC,CAAC,CAAC;IAC5E,IAAI,CAAC,IAAc,IAAI,qBAAM,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,KAAK,CAAC,IAAc,IAAI,qBAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9E,gBAAgB,CAAC,IAAc;QACrC,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACrC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAC7B,OAAO,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC",
2276
- sourcesContent: ["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Localization\n */\n\nimport i18next, { i18n, InitOptions, Module, TOptionsBase } from \"i18next\";\nimport i18nextBrowserLanguageDetector, { DetectorOptions } from \"i18next-browser-languagedetector\";\nimport Backend, { BackendOptions } from \"i18next-http-backend\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\n\nconst DEFAULT_MAX_RETRIES: number = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error\n\n/** Options for ITwinLocalization\n * @public\n */\nexport interface LocalizationOptions {\n urlTemplate?: string;\n backendPlugin?: Module;\n detectorPlugin?: Module;\n initOptions?: InitOptions;\n backendHttpOptions?: BackendOptions;\n detectorOptions?: DetectorOptions;\n}\n\n/** Supplies localizations for iTwin.js\n * @note this class uses the [i18next](https://www.i18next.com/) package.\n * @public\n */\nexport class ITwinLocalization implements Localization {\n public i18next: i18n;\n private readonly _initOptions: InitOptions;\n private readonly _backendOptions: BackendOptions;\n private readonly _detectionOptions: DetectorOptions;\n private readonly _namespaces = new Map<string, Promise<void>>();\n\n public constructor(options?: LocalizationOptions) {\n this.i18next = i18next.createInstance();\n\n this._backendOptions = {\n loadPath: options?.urlTemplate ?? \"locales/{{lng}}/{{ns}}.json\",\n crossDomain: true,\n ...options?.backendHttpOptions,\n };\n\n this._detectionOptions = {\n order: [\"querystring\", \"navigator\", \"htmlTag\"],\n lookupQuerystring: \"lng\",\n caches: [],\n ...options?.detectorOptions,\n };\n\n this._initOptions = {\n interpolation: { escapeValue: true },\n fallbackLng: \"en\",\n maxRetries: DEFAULT_MAX_RETRIES,\n backend: this._backendOptions,\n detection: this._detectionOptions,\n ...options?.initOptions,\n };\n\n this.i18next\n .use(options?.detectorPlugin ?? i18nextBrowserLanguageDetector)\n .use(options?.backendPlugin ?? Backend)\n .use(TranslationLogger);\n }\n\n public async initialize(namespaces: string[]): Promise<void> {\n\n // Also consider namespaces passed into constructor\n const initNamespaces: string[] = [this._initOptions.ns || []].flat();\n const combinedNamespaces: Set<string> = new Set([...namespaces, ...initNamespaces]); // without duplicates\n\n const defaultNamespace: string | false | readonly string[] = this._initOptions.defaultNS ?? namespaces[0];\n if (defaultNamespace)\n combinedNamespaces.add(defaultNamespace as string); // Make sure default namespace is in namespaces list\n\n const initOptions: InitOptions = {\n ...this._initOptions,\n defaultNS: defaultNamespace,\n ns: [...combinedNamespaces],\n };\n\n // if in a development environment, set debugging\n if (process.env.NODE_ENV === \"development\")\n initOptions.debug = true;\n\n const initPromise = this.i18next.init(initOptions) as unknown as Promise<void>;\n\n for (const ns of namespaces)\n this._namespaces.set(ns, initPromise);\n\n return initPromise;\n }\n\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\n * For example:\n * ``` ts\n * \"MyKeys\": {\n * \"Key1\": \"First value\",\n * \"Key2\": \"Second value\"\n * }\n * ```\n *\n * ``` ts\n * i18.translateKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\n * ```\n * @param line The input line, potentially containing %{keys}.\n * @returns The line with all %{keys} translated\n * @public\n */\n public getLocalizedKeys(line: string): string {\n return line.replace(/\\%\\{(.+?)\\}/g, (_match, tag) => this.getLocalizedString(tag));\n }\n\n /** Return the translated value of a key.\n * @param key - the key that matches a property in the JSON localization file.\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\n * followed by a colon, followed by the property in the JSON file.\n * For example:\n * ``` ts\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\n * ```\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n * @public\n */\n public getLocalizedString(key: string | string[], options?: TOptionsBase): string {\n if (options?.returnDetails || options?.returnObjects) {\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\n }\n\n const value = this.i18next.t(key, options);\n\n if (typeof value !== \"string\") {\n throw new Error(\"Translation key(s) string not found\");\n }\n\n return value;\n }\n\n /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need\n * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\n * @param key - the key that matches a property in the JSON localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n * @internal\n */\n public getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TOptionsBase): string {\n let fullKey: string | string[] = \"\";\n\n if (typeof key === \"string\") {\n fullKey = `${namespace}:${key}`;\n } else {\n fullKey = key.map((subKey: string) => {\n return `${namespace}:${subKey}`;\n });\n }\n\n return this.getLocalizedString(fullKey, options);\n }\n\n /** Gets the English translation.\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\n * @param key - the key that matches a property in the JSON localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n * @internal\n */\n public getEnglishString(namespace: string, key: string | string[], options?: TOptionsBase): string {\n if (options?.returnDetails || options?.returnObjects) {\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\n }\n\n options = {\n ...options,\n ns: namespace, // ensure namespace argument is used\n };\n\n const en = this.i18next.getFixedT(\"en\", namespace);\n const str = en(key, options);\n if (typeof str !== \"string\")\n throw new Error(\"Translation key(s) not found\");\n\n return str;\n }\n\n /** Get the promise for an already registered Namespace.\n * @param name - the name of the namespace\n * @public\n */\n public getNamespacePromise(name: string): Promise<void> | undefined {\n return this._namespaces.get(name);\n }\n\n /** @internal */\n public getLanguageList(): readonly string[] {\n return this.i18next.languages;\n }\n\n /** override the language detected in the browser */\n public async changeLanguage(language: string) {\n return this.i18next.changeLanguage(language) as unknown as Promise<void>;\n }\n\n /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.\n * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\n * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\n * @public\n */\n public async registerNamespace(name: string): Promise<void> {\n const existing = this._namespaces.get(name);\n if (existing !== undefined)\n return existing;\n\n const theReadPromise = new Promise<void>((resolve) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.i18next.loadNamespaces(name, (err) => {\n if (!err)\n return resolve();\n\n // Here we got a non-null err object.\n // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.\n // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.\n // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.\n // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.\n let locales = this.getLanguageList().map((thisLocale: any) => `/${thisLocale}/`);\n\n try {\n for (const thisError of err) {\n if (typeof thisError === \"string\")\n locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));\n }\n } catch {\n locales = [];\n }\n // if we removed every locale from the array, it wasn't loaded.\n if (locales.length === 0)\n Logger.logError(\"i18n\", `No resources for namespace ${name} could be loaded`);\n\n resolve();\n });\n });\n this._namespaces.set(name, theReadPromise);\n return theReadPromise;\n }\n\n /** @internal */\n public unregisterNamespace(name: string): void {\n this._namespaces.delete(name);\n }\n}\n\nclass TranslationLogger {\n public static readonly type = \"logger\";\n public log(args: string[]) { Logger.logInfo(\"i18n\", this.createLogMessage(args)); }\n public warn(args: string[]) { Logger.logWarning(\"i18n\", this.createLogMessage(args)); }\n public error(args: string[]) { Logger.logError(\"i18n\", this.createLogMessage(args)); }\n private createLogMessage(args: string[]) {\n let message = args[0];\n for (let i = 1; i < args.length; ++i) {\n if (typeof args[i] === \"string\")\n message += `\\n ${args[i]}`;\n }\n return message;\n }\n}\n"]
2125
+ mappings: ";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;;;AAEH,sDAA2E;AAC3E,wGAAmG;AACnG,gFAA+D;AAC/D,sDAA6C;AAG7C,MAAM,mBAAmB,GAAW,CAAC,CAAC,CAAC,8GAA8G;AAcrJ;;;GAGG;AACH,MAAa,iBAAiB;IACrB,OAAO,CAAO;IACJ,YAAY,CAAc;IAC1B,eAAe,CAAiB;IAChC,iBAAiB,CAAkB;IACnC,WAAW,GAAG,IAAI,GAAG,EAAyB,CAAC;IAEhE,YAAmB,OAA6B;QAC9C,IAAI,CAAC,OAAO,GAAG,iBAAO,CAAC,cAAc,EAAE,CAAC;QAExC,IAAI,CAAC,eAAe,GAAG;YACrB,QAAQ,EAAE,OAAO,EAAE,WAAW,IAAI,6BAA6B;YAC/D,WAAW,EAAE,IAAI;YACjB,GAAG,OAAO,EAAE,kBAAkB;SAC/B,CAAC;QAEF,IAAI,CA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AC9E,gBAAgB,CAAC,IAAc;QACrC,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;YACrC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ;gBAC7B,OAAO,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC",
2126
+ sourcesContent: ["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Localization\n */\n\nimport i18next, { i18n, InitOptions, Module, TOptionsBase } from \"i18next\";\nimport i18nextBrowserLanguageDetector, { DetectorOptions } from \"i18next-browser-languagedetector\";\nimport Backend, { BackendOptions } from \"i18next-http-backend\";\nimport { Logger } from \"@itwin/core-bentley\";\nimport type { Localization } from \"@itwin/core-common\";\n\nconst DEFAULT_MAX_RETRIES: number = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error\n\n/** Options for ITwinLocalization\n * @public\n */\nexport interface LocalizationOptions {\n urlTemplate?: string;\n backendPlugin?: Module;\n detectorPlugin?: Module;\n initOptions?: InitOptions;\n backendHttpOptions?: BackendOptions;\n detectorOptions?: DetectorOptions;\n}\n\n/** Supplies localizations for iTwin.js\n * @note this class uses the [i18next](https://www.i18next.com/) package.\n * @public\n */\nexport class ITwinLocalization implements Localization {\n public i18next: i18n;\n private readonly _initOptions: InitOptions;\n private readonly _backendOptions: BackendOptions;\n private readonly _detectionOptions: DetectorOptions;\n private readonly _namespaces = new Map<string, Promise<void>>();\n\n public constructor(options?: LocalizationOptions) {\n this.i18next = i18next.createInstance();\n\n this._backendOptions = {\n loadPath: options?.urlTemplate ?? \"locales/{{lng}}/{{ns}}.json\",\n crossDomain: true,\n ...options?.backendHttpOptions,\n };\n\n this._detectionOptions = {\n order: [\"querystring\", \"navigator\", \"htmlTag\"],\n lookupQuerystring: \"lng\",\n caches: [],\n ...options?.detectorOptions,\n };\n\n this._initOptions = {\n interpolation: { escapeValue: true },\n fallbackLng: \"en\",\n maxRetries: DEFAULT_MAX_RETRIES,\n backend: this._backendOptions,\n detection: this._detectionOptions,\n ...options?.initOptions,\n };\n\n this.i18next\n .use(options?.detectorPlugin ?? i18nextBrowserLanguageDetector)\n .use(options?.backendPlugin ?? Backend)\n .use(TranslationLogger);\n }\n\n public async initialize(namespaces: string[]): Promise<void> {\n\n // Also consider namespaces passed into constructor\n const initNamespaces: string[] = [this._initOptions.ns || []].flat();\n const combinedNamespaces: Set<string> = new Set([...namespaces, ...initNamespaces]); // without duplicates\n\n const defaultNamespace: string | false | readonly string[] = this._initOptions.defaultNS ?? namespaces[0];\n if (defaultNamespace)\n combinedNamespaces.add(defaultNamespace as string); // Make sure default namespace is in namespaces list\n\n const initOptions: InitOptions = {\n ...this._initOptions,\n defaultNS: defaultNamespace,\n ns: [...combinedNamespaces],\n };\n\n // if in a development environment, set debugging\n if (process.env.NODE_ENV === \"development\")\n initOptions.debug = true;\n\n const initPromise = this.i18next.init(initOptions) as unknown as Promise<void>;\n\n for (const ns of namespaces)\n this._namespaces.set(ns, initPromise);\n\n return initPromise;\n }\n\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\n * For example:\n * ``` ts\n * \"MyKeys\": {\n * \"Key1\": \"First value\",\n * \"Key2\": \"Second value\"\n * }\n * ```\n *\n * ``` ts\n * i18.translateKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\n * ```\n * @param line The input line, potentially containing %{keys}.\n * @returns The line with all %{keys} translated\n * @public\n */\n public getLocalizedKeys(line: string): string {\n return line.replace(/\\%\\{(.+?)\\}/g, (_match, tag) => this.getLocalizedString(tag));\n }\n\n /** Return the translated value of a key.\n * @param key - the key that matches a property in the JSON localization file.\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\n * followed by a colon, followed by the property in the JSON file.\n * For example:\n * ``` ts\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\n * ```\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n * @public\n */\n public getLocalizedString(key: string | string[], options?: TOptionsBase): string {\n if (options?.returnDetails || options?.returnObjects) {\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\n }\n\n const value = this.i18next.t(key, options);\n\n if (typeof value !== \"string\") {\n throw new Error(\"Translation key(s) string not found\");\n }\n\n return value;\n }\n\n /** Gets the English translation.\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\n * @param key - the key that matches a property in the JSON localization file.\n * @returns The string corresponding to the first key that resolves.\n * @throws Error if no keys resolve to a string.\n * @internal\n */\n public getEnglishString(namespace: string, key: string | string[], options?: TOptionsBase): string {\n if (options?.returnDetails || options?.returnObjects) {\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\n }\n\n options = {\n ...options,\n ns: namespace, // ensure namespace argument is used\n };\n\n const en = this.i18next.getFixedT(\"en\", namespace);\n const str = en(key, options);\n if (typeof str !== \"string\")\n throw new Error(\"Translation key(s) not found\");\n\n return str;\n }\n\n /** Get the promise for an already registered Namespace.\n * @param name - the name of the namespace\n * @public\n */\n public getNamespacePromise(name: string): Promise<void> | undefined {\n return this._namespaces.get(name);\n }\n\n /** @internal */\n public getLanguageList(): readonly string[] {\n return this.i18next.languages;\n }\n\n /** override the language detected in the browser */\n public async changeLanguage(language: string) {\n return this.i18next.changeLanguage(language) as unknown as Promise<void>;\n }\n\n /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.\n * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\n * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\n * @public\n */\n public async registerNamespace(name: string): Promise<void> {\n const existing = this._namespaces.get(name);\n if (existing !== undefined)\n return existing;\n\n const theReadPromise = new Promise<void>((resolve) => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.i18next.loadNamespaces(name, (err) => {\n if (!err)\n return resolve();\n\n // Here we got a non-null err object.\n // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.\n // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.\n // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.\n // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.\n let locales = this.getLanguageList().map((thisLocale: any) => `/${thisLocale}/`);\n\n try {\n for (const thisError of err) {\n if (typeof thisError === \"string\")\n locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));\n }\n } catch {\n locales = [];\n }\n // if we removed every locale from the array, it wasn't loaded.\n if (locales.length === 0)\n Logger.logError(\"i18n\", `No resources for namespace ${name} could be loaded`);\n\n resolve();\n });\n });\n this._namespaces.set(name, theReadPromise);\n return theReadPromise;\n }\n\n /** @internal */\n public unregisterNamespace(name: string): void {\n this._namespaces.delete(name);\n }\n}\n\nclass TranslationLogger {\n public static readonly type = \"logger\";\n public log(args: string[]) { Logger.logInfo(\"i18n\", this.createLogMessage(args)); }\n public warn(args: string[]) { Logger.logWarning(\"i18n\", this.createLogMessage(args)); }\n public error(args: string[]) { Logger.logError(\"i18n\", this.createLogMessage(args)); }\n private createLogMessage(args: string[]) {\n let message = args[0];\n for (let i = 1; i < args.length; ++i) {\n if (typeof args[i] === \"string\")\n message += `\\n ${args[i]}`;\n }\n return message;\n }\n}\n"]
2277
2127
  },
2278
2128
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
2279
- hash: "a382596dbfbc886d31159a6dca6879dc56dcf2cf"
2129
+ hash: "dc42415b822dd4de30f4e9da695d0e05d9c36eef"
2280
2130
  };
2281
2131
  var coverage = global[gcv] || (global[gcv] = {});
2282
2132
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -2444,34 +2294,6 @@ class ITwinLocalization {
2444
2294
  cov_ogldeftyv().s[34]++;
2445
2295
  return value;
2446
2296
  }
2447
- /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need
2448
- * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.
2449
- * @param namespace - the namespace that identifies the particular localization file that contains the property.
2450
- * @param key - the key that matches a property in the JSON localization file.
2451
- * @returns The string corresponding to the first key that resolves.
2452
- * @throws Error if no keys resolve to a string.
2453
- * @internal
2454
- */
2455
- getLocalizedStringWithNamespace(namespace, key, options) {
2456
- cov_ogldeftyv().f[6]++;
2457
- let fullKey = (cov_ogldeftyv().s[35]++, "");
2458
- cov_ogldeftyv().s[36]++;
2459
- if (typeof key === "string") {
2460
- cov_ogldeftyv().b[13][0]++;
2461
- cov_ogldeftyv().s[37]++;
2462
- fullKey = `${namespace}:${key}`;
2463
- } else {
2464
- cov_ogldeftyv().b[13][1]++;
2465
- cov_ogldeftyv().s[38]++;
2466
- fullKey = key.map(subKey => {
2467
- cov_ogldeftyv().f[7]++;
2468
- cov_ogldeftyv().s[39]++;
2469
- return `${namespace}:${subKey}`;
2470
- });
2471
- }
2472
- cov_ogldeftyv().s[40]++;
2473
- return this.getLocalizedString(fullKey, options);
2474
- }
2475
2297
  /** Gets the English translation.
2476
2298
  * @param namespace - the namespace that identifies the particular localization file that contains the property.
2477
2299
  * @param key - the key that matches a property in the JSON localization file.
@@ -2480,31 +2302,31 @@ class ITwinLocalization {
2480
2302
  * @internal
2481
2303
  */
2482
2304
  getEnglishString(namespace, key, options) {
2483
- cov_ogldeftyv().f[8]++;
2484
- cov_ogldeftyv().s[41]++;
2485
- if ((cov_ogldeftyv().b[15][0]++, options?.returnDetails) || (cov_ogldeftyv().b[15][1]++, options?.returnObjects)) {
2486
- cov_ogldeftyv().b[14][0]++;
2487
- cov_ogldeftyv().s[42]++;
2305
+ cov_ogldeftyv().f[6]++;
2306
+ cov_ogldeftyv().s[35]++;
2307
+ if ((cov_ogldeftyv().b[14][0]++, options?.returnDetails) || (cov_ogldeftyv().b[14][1]++, options?.returnObjects)) {
2308
+ cov_ogldeftyv().b[13][0]++;
2309
+ cov_ogldeftyv().s[36]++;
2488
2310
  throw new Error("Translation key must map to a string, but the given options will result in an object");
2489
2311
  } else {
2490
- cov_ogldeftyv().b[14][1]++;
2312
+ cov_ogldeftyv().b[13][1]++;
2491
2313
  }
2492
- cov_ogldeftyv().s[43]++;
2314
+ cov_ogldeftyv().s[37]++;
2493
2315
  options = {
2494
2316
  ...options,
2495
2317
  ns: namespace // ensure namespace argument is used
2496
2318
  };
2497
- const en = (cov_ogldeftyv().s[44]++, this.i18next.getFixedT("en", namespace));
2498
- const str = (cov_ogldeftyv().s[45]++, en(key, options));
2499
- cov_ogldeftyv().s[46]++;
2319
+ const en = (cov_ogldeftyv().s[38]++, this.i18next.getFixedT("en", namespace));
2320
+ const str = (cov_ogldeftyv().s[39]++, en(key, options));
2321
+ cov_ogldeftyv().s[40]++;
2500
2322
  if (typeof str !== "string") {
2501
- cov_ogldeftyv().b[16][0]++;
2502
- cov_ogldeftyv().s[47]++;
2323
+ cov_ogldeftyv().b[15][0]++;
2324
+ cov_ogldeftyv().s[41]++;
2503
2325
  throw new Error("Translation key(s) not found");
2504
2326
  } else {
2505
- cov_ogldeftyv().b[16][1]++;
2327
+ cov_ogldeftyv().b[15][1]++;
2506
2328
  }
2507
- cov_ogldeftyv().s[48]++;
2329
+ cov_ogldeftyv().s[42]++;
2508
2330
  return str;
2509
2331
  }
2510
2332
  /** Get the promise for an already registered Namespace.
@@ -2512,20 +2334,20 @@ class ITwinLocalization {
2512
2334
  * @public
2513
2335
  */
2514
2336
  getNamespacePromise(name) {
2515
- cov_ogldeftyv().f[9]++;
2516
- cov_ogldeftyv().s[49]++;
2337
+ cov_ogldeftyv().f[7]++;
2338
+ cov_ogldeftyv().s[43]++;
2517
2339
  return this._namespaces.get(name);
2518
2340
  }
2519
2341
  /** @internal */
2520
2342
  getLanguageList() {
2521
- cov_ogldeftyv().f[10]++;
2522
- cov_ogldeftyv().s[50]++;
2343
+ cov_ogldeftyv().f[8]++;
2344
+ cov_ogldeftyv().s[44]++;
2523
2345
  return this.i18next.languages;
2524
2346
  }
2525
2347
  /** override the language detected in the browser */
2526
2348
  async changeLanguage(language) {
2527
- cov_ogldeftyv().f[11]++;
2528
- cov_ogldeftyv().s[51]++;
2349
+ cov_ogldeftyv().f[9]++;
2350
+ cov_ogldeftyv().s[45]++;
2529
2351
  return this.i18next.changeLanguage(language);
2530
2352
  }
2531
2353
  /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.
@@ -2537,120 +2359,120 @@ class ITwinLocalization {
2537
2359
  * @public
2538
2360
  */
2539
2361
  async registerNamespace(name) {
2540
- cov_ogldeftyv().f[12]++;
2541
- const existing = (cov_ogldeftyv().s[52]++, this._namespaces.get(name));
2542
- cov_ogldeftyv().s[53]++;
2362
+ cov_ogldeftyv().f[10]++;
2363
+ const existing = (cov_ogldeftyv().s[46]++, this._namespaces.get(name));
2364
+ cov_ogldeftyv().s[47]++;
2543
2365
  if (existing !== undefined) {
2544
- cov_ogldeftyv().b[17][0]++;
2545
- cov_ogldeftyv().s[54]++;
2366
+ cov_ogldeftyv().b[16][0]++;
2367
+ cov_ogldeftyv().s[48]++;
2546
2368
  return existing;
2547
2369
  } else {
2548
- cov_ogldeftyv().b[17][1]++;
2370
+ cov_ogldeftyv().b[16][1]++;
2549
2371
  }
2550
- const theReadPromise = (cov_ogldeftyv().s[55]++, new Promise(resolve => {
2551
- cov_ogldeftyv().f[13]++;
2552
- cov_ogldeftyv().s[56]++;
2372
+ const theReadPromise = (cov_ogldeftyv().s[49]++, new Promise(resolve => {
2373
+ cov_ogldeftyv().f[11]++;
2374
+ cov_ogldeftyv().s[50]++;
2553
2375
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
2554
2376
  this.i18next.loadNamespaces(name, err => {
2555
- cov_ogldeftyv().f[14]++;
2556
- cov_ogldeftyv().s[57]++;
2377
+ cov_ogldeftyv().f[12]++;
2378
+ cov_ogldeftyv().s[51]++;
2557
2379
  if (!err) {
2558
- cov_ogldeftyv().b[18][0]++;
2559
- cov_ogldeftyv().s[58]++;
2380
+ cov_ogldeftyv().b[17][0]++;
2381
+ cov_ogldeftyv().s[52]++;
2560
2382
  return resolve();
2561
2383
  } else {
2562
- cov_ogldeftyv().b[18][1]++;
2384
+ cov_ogldeftyv().b[17][1]++;
2563
2385
  }
2564
2386
  // Here we got a non-null err object.
2565
2387
  // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
2566
2388
  // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
2567
2389
  // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
2568
2390
  // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
2569
- let locales = (cov_ogldeftyv().s[59]++, this.getLanguageList().map(thisLocale => {
2570
- cov_ogldeftyv().f[15]++;
2571
- cov_ogldeftyv().s[60]++;
2391
+ let locales = (cov_ogldeftyv().s[53]++, this.getLanguageList().map(thisLocale => {
2392
+ cov_ogldeftyv().f[13]++;
2393
+ cov_ogldeftyv().s[54]++;
2572
2394
  return `/${thisLocale}/`;
2573
2395
  }));
2574
- cov_ogldeftyv().s[61]++;
2396
+ cov_ogldeftyv().s[55]++;
2575
2397
  try {
2576
- cov_ogldeftyv().s[62]++;
2398
+ cov_ogldeftyv().s[56]++;
2577
2399
  for (const thisError of err) {
2578
- cov_ogldeftyv().s[63]++;
2400
+ cov_ogldeftyv().s[57]++;
2579
2401
  if (typeof thisError === "string") {
2580
- cov_ogldeftyv().b[19][0]++;
2581
- cov_ogldeftyv().s[64]++;
2402
+ cov_ogldeftyv().b[18][0]++;
2403
+ cov_ogldeftyv().s[58]++;
2582
2404
  locales = locales.filter(thisLocale => {
2583
- cov_ogldeftyv().f[16]++;
2584
- cov_ogldeftyv().s[65]++;
2405
+ cov_ogldeftyv().f[14]++;
2406
+ cov_ogldeftyv().s[59]++;
2585
2407
  return !thisError.includes(thisLocale);
2586
2408
  });
2587
2409
  } else {
2588
- cov_ogldeftyv().b[19][1]++;
2410
+ cov_ogldeftyv().b[18][1]++;
2589
2411
  }
2590
2412
  }
2591
2413
  } catch {
2592
- cov_ogldeftyv().s[66]++;
2414
+ cov_ogldeftyv().s[60]++;
2593
2415
  locales = [];
2594
2416
  }
2595
2417
  // if we removed every locale from the array, it wasn't loaded.
2596
- cov_ogldeftyv().s[67]++;
2418
+ cov_ogldeftyv().s[61]++;
2597
2419
  if (locales.length === 0) {
2598
- cov_ogldeftyv().b[20][0]++;
2599
- cov_ogldeftyv().s[68]++;
2420
+ cov_ogldeftyv().b[19][0]++;
2421
+ cov_ogldeftyv().s[62]++;
2600
2422
  core_bentley_1.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
2601
2423
  } else {
2602
- cov_ogldeftyv().b[20][1]++;
2424
+ cov_ogldeftyv().b[19][1]++;
2603
2425
  }
2604
- cov_ogldeftyv().s[69]++;
2426
+ cov_ogldeftyv().s[63]++;
2605
2427
  resolve();
2606
2428
  });
2607
2429
  }));
2608
- cov_ogldeftyv().s[70]++;
2430
+ cov_ogldeftyv().s[64]++;
2609
2431
  this._namespaces.set(name, theReadPromise);
2610
- cov_ogldeftyv().s[71]++;
2432
+ cov_ogldeftyv().s[65]++;
2611
2433
  return theReadPromise;
2612
2434
  }
2613
2435
  /** @internal */
2614
2436
  unregisterNamespace(name) {
2615
- cov_ogldeftyv().f[17]++;
2616
- cov_ogldeftyv().s[72]++;
2437
+ cov_ogldeftyv().f[15]++;
2438
+ cov_ogldeftyv().s[66]++;
2617
2439
  this._namespaces.delete(name);
2618
2440
  }
2619
2441
  }
2620
- cov_ogldeftyv().s[73]++;
2442
+ cov_ogldeftyv().s[67]++;
2621
2443
  exports.ITwinLocalization = ITwinLocalization;
2622
2444
  class TranslationLogger {
2623
- static type = (cov_ogldeftyv().s[74]++, "logger");
2445
+ static type = (cov_ogldeftyv().s[68]++, "logger");
2624
2446
  log(args) {
2625
- cov_ogldeftyv().f[18]++;
2626
- cov_ogldeftyv().s[75]++;
2447
+ cov_ogldeftyv().f[16]++;
2448
+ cov_ogldeftyv().s[69]++;
2627
2449
  core_bentley_1.Logger.logInfo("i18n", this.createLogMessage(args));
2628
2450
  }
2629
2451
  warn(args) {
2630
- cov_ogldeftyv().f[19]++;
2631
- cov_ogldeftyv().s[76]++;
2452
+ cov_ogldeftyv().f[17]++;
2453
+ cov_ogldeftyv().s[70]++;
2632
2454
  core_bentley_1.Logger.logWarning("i18n", this.createLogMessage(args));
2633
2455
  }
2634
2456
  error(args) {
2635
- cov_ogldeftyv().f[20]++;
2636
- cov_ogldeftyv().s[77]++;
2457
+ cov_ogldeftyv().f[18]++;
2458
+ cov_ogldeftyv().s[71]++;
2637
2459
  core_bentley_1.Logger.logError("i18n", this.createLogMessage(args));
2638
2460
  }
2639
2461
  createLogMessage(args) {
2640
- cov_ogldeftyv().f[21]++;
2641
- let message = (cov_ogldeftyv().s[78]++, args[0]);
2642
- cov_ogldeftyv().s[79]++;
2643
- for (let i = (cov_ogldeftyv().s[80]++, 1); i < args.length; ++i) {
2644
- cov_ogldeftyv().s[81]++;
2462
+ cov_ogldeftyv().f[19]++;
2463
+ let message = (cov_ogldeftyv().s[72]++, args[0]);
2464
+ cov_ogldeftyv().s[73]++;
2465
+ for (let i = (cov_ogldeftyv().s[74]++, 1); i < args.length; ++i) {
2466
+ cov_ogldeftyv().s[75]++;
2645
2467
  if (typeof args[i] === "string") {
2646
- cov_ogldeftyv().b[21][0]++;
2647
- cov_ogldeftyv().s[82]++;
2468
+ cov_ogldeftyv().b[20][0]++;
2469
+ cov_ogldeftyv().s[76]++;
2648
2470
  message += `\n ${args[i]}`;
2649
2471
  } else {
2650
- cov_ogldeftyv().b[21][1]++;
2472
+ cov_ogldeftyv().b[20][1]++;
2651
2473
  }
2652
2474
  }
2653
- cov_ogldeftyv().s[83]++;
2475
+ cov_ogldeftyv().s[77]++;
2654
2476
  return message;
2655
2477
  }
2656
2478
  }